Hello, i am running ansible 1.9.1 on a Ubuntu server 14.04.2, my remote machine is a windows 7 sp1.
i have the following files and error message, i don't understand where the issue is..
/etc/ansible/group_vars/windows.yml
ansible_ssh_user: AnsibleUser
ansible_ssh_pass: ansiblepass
ansible_ssh_port: 5986
ansible_connection: winrm
/etc/ansible/winplaybook.yml
/etc/ansible/hosts
WIN-F6531IBP8HG
i have python 2.7.6 and i have the following error message:
ansible-playbook /etc/ansible/winplaybook.yml -i WIN-F6531IBP8HG,
PLAY [WIN-F6531IBP8HG] ********************************************************
GATHERING FACTS ***************************************************************
fatal: [WIN-F6531IBP8HG] => SSH Error: Permission denied (publickey,password,keyboard-interactive).
while connecting to 192.168.79.133:22
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.
TASK: [unarchive] *************************************************************
FATAL: no hosts matched or all hosts have already failed -- aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/home/guillaume/winplaybook.retry
WIN-F6531IBP8HG : ok=0 changed=0 unreachable=1 failed=0
if i try to ping windows:
ansible WIN-F6531IBP8HG -m win_ping
WIN-F6531IBP8HG | FAILED => SSH Error: Permission denied (publickey,password,keyboard-interactive).
while connecting to 192.168.79.133:22
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.
thanks for your help!!
/etc/ansible/group_vars/windows/windows.yml
ansible_ssh_user: AnsibleUser
ansible_ssh_pass: ansiblepass
ansible_ssh_port: 5986
ansible_connection: winrm
/etc/ansible/hosts
[windows]
WIN-F6531IBP8NG
the ping is working but sometimes it fails with this message:
WIN-F6531IBP8HG | FAILED >> {
"failed": true,
"msg": "\nProcess is terminated due to StackOverflowException.\n",
"parsed": false
}
or this one:
WIN-F6531IBP8HG | FAILED >> {
"failed": true,
"msg": "",
"parsed": false
}
but when i run the playbook, it still tries to connect via ssh and not winrm so it doesn't seem to see my windows.yml file but i don't know how to deal with this issue....
[windows]
WIN-F5631IBP8HG ansible_connection=winrm ansible_ssh_user=AnsibleUser ansible_ssh_pass=ansiblepass ansible_ssh_port=5986
etc/ansible/winplaybook.yml
- name: Run powershell script
hosts: windows
gather_facts: false
connection: winrm
tasks:
- name: Run powershell script
script: C:/Users/AnsibleUser/Desktop/helloworld.ps1
the ping is working perfectly (thanks to powershell 4) and i have the following message:
ansible-playbook /etc/ansible/winplaybook.yml -i windows, -vvvv
PLAY [Run powershell script] **************************************************
TASK: [Run powershell script] *************************************************
<windows> ESTABLISH WINRM CONNECTION FOR USER: guillaume on PORT 5986 TO windows
<windows> WINRM CONNECT: transport=plaintext endpoint=https://windows:5986/wsman
<windows> WINRM CONNECTION ERROR: 500 WinRMTransport. [Errno 111] Connection refused
fatal: [windows] => 500 WinRMTransport. [Errno 111] Connection refused
FATAL: all hosts have already failed -- aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/home/guillaume/winplaybook.retry
windows : ok=0 changed=0 unreachable=1 failed=0