-
-
Save gravcat/09a2ba7bc8250a2ea98f937bcb528f4a to your computer and use it in GitHub Desktop.
--- | |
- hosts: windows | |
tasks: | |
- name: ping | |
win_ping: |
Hey @TridevGuha! Welcome to Ansible, it's a wonderful tool.
https://docs.ansible.com/ansible/latest/user_guide/intro_getting_started.html#action-create-a-basic-inventory
https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#basics
As for the basics to get this rolling in a clean way you'll need
- a host inventory (
hosts
) - a group_vars file (
group_vars/windows.yml
) - a playbook (
main.yml
)
It looks like you are putting your playbook as group_vars by mistake, and ansible is trying to read it and failing. Move windows1.yml
to ../main.yml
In group_vars/windows.yml
, place:
ansible_user: username
ansible_password: super_secret_password
ansible_port: 5986
ansible_connection: winrm
ansible_winrm_server_cert_validation: ignore
At this point, it should work :)
unrelated, here's an example of a simple playbook. Doesn't include group_vars
like this one would, but shows how your main.yml
playbook entrypoint should be!
@gravcat I have made the changes and It is working now! Thanks for the response!
@Gravecat In which file you are passing these?
ansible_user: username
ansible_password: super_secret_password
ansible_port: 5986
ansible_connection: winrm
ansible_winrm_server_cert_validation: ignore
Is this needed to add in the ping_windows_hosts.yml you are using or elsewhere? Please take a look