1

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?

Mat
  • 1,873
  • 7
  • 25
  • 41
  • You can debug the `ansible-playbook` with the [--verbose](https://docs.ansible.com/ansible/latest/cli/ansible-playbook.html#cmdoption-ansible-playbook-v) parameter – Henrik Pingel Jul 02 '19 at 16:56
  • Thanks Henrik. I've already tried to debug with --verbose but I had not useful information. Sorry, I am about to add this info to my question. – Mat Jul 02 '19 at 16:57
  • You can increase the verbosity with `-vvv` and `-vvvv`. Ansible should print the error message returned `win_package`. – Henrik Pingel Jul 02 '19 at 17:00
  • Yes, I've already tried that. No debug info. Only "EXEC (via pipeline wrapper)" and nothing after. – Mat Jul 02 '19 at 17:03
  • Ah OK, never mind than. – Henrik Pingel Jul 02 '19 at 17:08

1 Answers1

1

I solved my problem, I was using wrong arguments for the Icinga 2 MSI file.

Correct arguments are:

---
- 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: /qn /norestart

Now the package installs correctly:

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] **************************************************************************************************
changed: [windows-server.my.domain.name]

PLAY RECAP ***************************************************************************************************************
windows-server.my.domain.name   : ok=2    changed=1    unreachable=0    failed=0   
Mat
  • 1,873
  • 7
  • 25
  • 41