WINRM

20 views
Skip to first unread message

Manish Kumar

unread,
Aug 21, 2019, 5:16:07 AM8/21/19
to Ansible Project
Hi,

I am working on automation using ansible where in I need to connect to remote window server and install NT service . Please help me for the correct playbook as I have installed Winrm on window and connectivity is working from Linux -Ansible control server to window.

ansible]$ ansible all -i inventory.yml -m win_ping
172.31.82.137 | SUCCESS => {
    "changed": false,
    "ping": "pong"
}


I need playbook for window service install.

Thanks,
Manish

Manish Kumar

unread,
Aug 21, 2019, 5:41:45 AM8/21/19
to Ansible Project
I have tried below playbook but getting error :

ansible-playbook window.yml -i inventory.yml
ERROR! the field 'hosts' is required but was not set


Playbook  contents:

- name: test raw module
  hosts: windows----------------> I think here is the problem . I tried with ip but same error as i don't have domain name available in my personal account .
  tasks:
    - name: run ipconfig
      win_command: ipconfig
      register: ipconfig
    - debug: var=ipconfig

Dick Visser

unread,
Aug 21, 2019, 6:20:41 AM8/21/19
to ansible...@googlegroups.com
Playbook looks ok, maybe something with spacing?
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/0f9c5455-7489-44a7-8467-1f5ae031b79a%40googlegroups.com.



--
Dick Visser
Trust & Identity Service Operations Manager
GÉANT
Reply all
Reply to author
Forward
0 new messages