# win\_domain\_controller "controller for the domain could not be contacted"

**URL:** <https://forum.ansible.com/t/win-domain-controller-controller-for-the-domain-could-not-be-contacted/31224>\
**Category:** Ansible Project\
**Created:** [September 8, 2019, 3:01am UTC](https://forum.ansible.com/t/win-domain-controller-controller-for-the-domain-could-not-be-contacted/31224 "2019-09-08T03:01:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixel\_fairy](https://avatars.discourse-cdn.com/v4/letter/p/6f9a4e/32.png) [@pixel\_fairy](https://forum.ansible.com/u/pixel_fairy)\
**Post date:** [September 8, 2019, 3:01am UTC](https://forum.ansible.com/t/win-domain-controller-controller-for-the-domain-could-not-be-contacted/31224/1 "2019-09-08T03:01:14Z")

</div>

After making a new domain, and adding a server to it, cant promote that server to domain controller.

heres how im trying,

`

- hosts: domaincontrollers[1:]  
tasks:
- name: set dns for other domain controllers  
win\_dns\_client:  
adapter\_names: ‘\*’  
ipv4\_addresses:  
#- “{{ hostvars[item][‘ansible\_facts’][‘ip\_addresses’][2] }}”
- 10.6.5.10
- 1.1.1.1

# loop: “{{ groups[‘domaincontrollers’] }}”

- name: join the domain  
win\_domain\_membership:  
dns\_domain\_name: foo.local  
hostname: “{{inventory\_hostname}}”  
domain\_admin\_user: foo\dom  
domain\_admin\_password: A1!vagrant  
state: domain  
register: dmout

- win\_reboot:  
when: dmout.reboot\_required

- name: make domain controllers  
win\_domain\_controller:  
dns\_domain\_name: foo.local  
domain\_admin\_user: foo\dom  
domain\_admin\_password: A1!vagrant  
safe\_mode\_password: A1!vagrant  
state: domain\_controller  
register: newdc

- name: reboot for new settings  
win\_reboot:  
test\_command: ‘exit (Get-Service -Name Netlogon).Status -ne “Running”’  
post\_reboot\_delay: 600  
when: newdc.reboot\_required

`

and heres the error,  
`

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [domain1]

TASK [set dns for other domain controllers] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [domain1]

TASK [join the domain] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [domain1]

TASK [win\_reboot] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
skipping: [domain1]

TASK [make domain controllers] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: at , : line 214  
fatal: [domain1]: FAILED! =\> {“changed”: false, “msg”: “Unhandled exception while executing module: Verification of user credential permissions failed. An Active Directory domain controller for the domain "foo.local" could not be contacted.\r\n\r\nEnsure that you supplied the correct DNS domain name.\r\n\r\n\r\n”}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
domain0 : ok=3 changed=1 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0  
domain1 : ok=3 changed=0 unreachable=0 failed=1 skipped=1 rescued=0 ignored=0

`

the one change on domain0 is making the new domain admin, which is always redone (setting its password)

domain1 is on the domain, can log in “dom”, and can ping domain0.foo.local

---

<div class="post-metadata">

**Author:** ![pixel\_fairy](https://avatars.discourse-cdn.com/v4/letter/p/6f9a4e/32.png) [@pixel\_fairy](https://forum.ansible.com/u/pixel_fairy)\
**Post date:** [September 8, 2019, 3:13am UTC](https://forum.ansible.com/t/win-domain-controller-controller-for-the-domain-could-not-be-contacted/31224/2 "2019-09-08T03:13:21Z")

</div>

somehow, waiting like 1/2hr and it works. any ideas?
