I'm trying to use Ansible on my first Windows node, using winrm on HTTP (I will use https as a second step) and ntlm authentication.
I configured group_vars and the basic connection to the Windows host works:
me@ansible:~/ansible$ ansible -i staging.ini windows -m setup
windows-server.my.domain.name | SUCCESS => {
"ansible_facts": {
"ansible_architecture": "64-bit",
"ansible_bios_date": "04/01/2014",
"ansible_bios_version": "rel-1.11.1-0-g0551a4be2c-prebuilt.qemu-project.org",
"ansible_date_time": {
[...]
},
"ansible_distribution": "Microsoft Windows Server 2016 Standard",
"ansible_distribution_major_version": "10",
"ansible_distribution_version": "10.0.14393.0",
"ansible_domain": "my.domain.name",
[...]
"ansible_windows_domain": "my.domain.name,
"ansible_windows_domain_member": true,
"ansible_windows_domain_role": "Member server",
"gather_subset": [
"all"
],
"module_setup": true
},
"changed": false
}
Now I'm trying to instal a MSI package (Icinga 2) with a basic playbook:
---
- hosts: all
tasks:
- name: Install Icinga 2
win_package:
path: "https://packages.icinga.com/windows/Icinga2-v2.10.5-x86_64.msi"
product_id: "712727BA-156F-466A-9C25-7A6246602664"
arguments: /install /passive /norestart
But when I run it it remains endlessly hanged with no output:
me@ansible:~/ansible$ ansible-playbook plays/win-test.yml -i staging.ini --limit windows
PLAY [all] *****************************************************************************************************************
TASK [Gathering Facts] *************************************************************************************************************************
ok: [windows-server.my.domain.name]
TASK [Install Icinga 2] ************************************************************************************************************************
(no output after 10 minutes)
I've already tried to debug using -vvvv
but it does not output any useful info:
me@ansible:~/ansible$ ansible-playbook plays/win-test.yml -i staging.ini --limit windows -vvvv
TASK [Install Icinga 2] *******************************************************************************************************************
task path: /home/me/ansible/plays/win-test.yml:5
Using module file /home/me/.local/lib/python2.7/site-packages/ansible/modules/windows/win_package.ps1
<windows-server.my.domain.name> ESTABLISH WINRM CONNECTION FOR USER: DOMAIN\me on PORT 5985 TO windows-server.my.domain.name
checking if winrm_host windows-server.my.domain.name is an IPv6 address
EXEC (via pipeline wrapper)
(no output after 10 minutes)
How I can debug it?
I solved my problem, I was using wrong arguments for the Icinga 2 MSI file.
Correct arguments are:
Now the package installs correctly: