Ansible module "win_domain_membership" not working as expected from last 2 months. I am using Ansible version 2.9.27

Hello Team,

I am using AWX tower to run Ansible playbooks to create Azure VM. Everything works fine up to April 2024 but last 2 months pipeline failed to create VM with domain join. As searched in logs “win_domain_membership” module not working as expected.
Below is the code and logs of playbook
#Join server in domain

  • name: Join server in domain
    win_domain_membership:
    dns_domain_name: “{{ Windows_domain_join }}”
    domain_admin_user: “{{ Windows_username }}”
    domain_admin_password: “{{ Windows_password }}”
    domain_ou_path: “OU=Servers,DC=xyzls,DC=abc”
    state: domain
    register: domain_state
    when: Domain == “YES”

#Reboot server

  • name: Reboot server
    win_reboot:
    when: Domain == “YES”

ESTABLISH WINRM CONNECTION FOR USER: Adminuser on PORT 5985 TO
ESTABLISH WINRM CONNECTION FOR USER: Adminuser on PORT 5985 TO
fatal: [Temp_Host]: FAILED! => {
“changed”: false,
“elapsed”: 605,
“msg”: “Timed out waiting for last boot time check (timeout=600)”,
“rebooted”: true
}

Please help me to troubleshoot this issue.

Hi Team,

Please help me to solve this issue, last 2 months I am facing.

Thanks in advance for your help.

Regards
K Sridhar

Ansible 2.9 is End of Life and hasn’t received any updates for over two years. Have you tried this with a newer version of Ansible, and/or a newer version of the ansible.windows collection (of which win_domain_membership is a part since 2.10)?

Hi @felixfontein
Thanks for sharing details but my project using Ansible 2.9 only, we have to fix this issue. Shall I use “microsoft.ad.membership” module instead of old module “win_domain_membership”.

Thanks

Maybe just using the new win_domain_membership from ansible.windows instead of the built-in module in 2.9 will already help. On the other hand, latest ansible.windows no longer supports 2.9 (it requires ansible-core 2.15+), so maybe it won’t work. Maybe microsoft.ad.membership also works; I’ve never used any of these modules (since I don’t work with Windows).

None of the Windows collections were certified with 2.9 so your mileage may vary. Unfortunately as felix has mentioned 2.9 is EOL so even if this was a bug we wouldn’t be fixing it.

You should look at the hosts to see if they are coming back online or whether the reboot is just now taking longer to run. If so you can increase the timeout to wait.

Hello @felixfontein @jborean
Thank you for sharing details on modules and collections. However, we are struck with Ansible 2.9 and need to fix this module issue. After changing module “win_domain_membership” to “microsoft.ad.membership” I got below error
ERROR! couldn’t resolve module/action ‘microsoft.ad.membership’. This often indicates a misspelling, missing collection, or incorrect module path.

‘microsoft.ad.membership’ module default module in Ansible 2.9 or not. If need to download means what is the command to install it.

Please help me to resolve it.