# Ansible module "win\_domain\_membership" not working as expected from last 2 months. I am using Ansible version 2.9.27

**URL:** <https://forum.ansible.com/t/ansible-module-win-domain-membership-not-working-as-expected-from-last-2-months-i-am-using-ansible-version-2-9-27/8070>\
**Category:** Get Help\
**Tags:** azure, ansible, awx\
**Created:** [August 23, 2024, 8:13am UTC](https://forum.ansible.com/t/ansible-module-win-domain-membership-not-working-as-expected-from-last-2-months-i-am-using-ansible-version-2-9-27/8070 "2024-08-23T08:13:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kandisridhar](https://avatars.discourse-cdn.com/v4/letter/k/f1d935/32.png) [@kandisridhar](https://forum.ansible.com/u/kandisridhar)\
**Post date:** [August 23, 2024, 8:13am UTC](https://forum.ansible.com/t/ansible-module-win-domain-membership-not-working-as-expected-from-last-2-months-i-am-using-ansible-version-2-9-27/8070/1 "2024-08-23T08:13:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kandisridhar](https://avatars.discourse-cdn.com/v4/letter/k/f1d935/32.png) [@kandisridhar](https://forum.ansible.com/u/kandisridhar)\
**Post date:** [August 26, 2024, 7:26am UTC](https://forum.ansible.com/t/ansible-module-win-domain-membership-not-working-as-expected-from-last-2-months-i-am-using-ansible-version-2-9-27/8070/2 "2024-08-26T07:26:27Z")

</div>

Hi Team,

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

Thanks in advance for your help.

Regards  
K Sridhar

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [August 26, 2024, 8:10am UTC](https://forum.ansible.com/t/ansible-module-win-domain-membership-not-working-as-expected-from-last-2-months-i-am-using-ansible-version-2-9-27/8070/3 "2024-08-26T08:10:41Z")

</div>

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)?

---

<div class="post-metadata">

**Author:** ![kandisridhar](https://avatars.discourse-cdn.com/v4/letter/k/f1d935/32.png) [@kandisridhar](https://forum.ansible.com/u/kandisridhar)\
**Post date:** [August 26, 2024, 12:01pm UTC](https://forum.ansible.com/t/ansible-module-win-domain-membership-not-working-as-expected-from-last-2-months-i-am-using-ansible-version-2-9-27/8070/4 "2024-08-26T12:01:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [August 26, 2024, 5:52pm UTC](https://forum.ansible.com/t/ansible-module-win-domain-membership-not-working-as-expected-from-last-2-months-i-am-using-ansible-version-2-9-27/8070/5 "2024-08-26T17:52:40Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [August 26, 2024, 6:49pm UTC](https://forum.ansible.com/t/ansible-module-win-domain-membership-not-working-as-expected-from-last-2-months-i-am-using-ansible-version-2-9-27/8070/6 "2024-08-26T18:49:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kandisridhar](https://avatars.discourse-cdn.com/v4/letter/k/f1d935/32.png) [@kandisridhar](https://forum.ansible.com/u/kandisridhar)\
**Post date:** [August 27, 2024, 12:58pm UTC](https://forum.ansible.com/t/ansible-module-win-domain-membership-not-working-as-expected-from-last-2-months-i-am-using-ansible-version-2-9-27/8070/7 "2024-08-27T12:58:36Z")

</div>

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.
