-
Notifications
You must be signed in to change notification settings - Fork 967
Open
Description
Description
The ansible.windows.win_domain
in ansible/roles/domain_controller/tasks/main.yml
has been replaced with ansible.windows.win_domain
along with a few more.
I tried replacing the file as such:
# DNSCHANGE
# - name: "disable interface {{nat_adapter}} before join domain"
# win_shell: netsh interface set interface "{{nat_adapter}}" disable
- name: "disable the registration of the {{nat_adapter}} interface (NAT address) in DNS"
ansible.windows.win_shell:
Get-NetAdapter {{nat_adapter}} | Set-DNSClient -RegisterThisConnectionsAddress $False
when: two_adapters
- name: Ensure that domain exists
microsoft.ad.domain:
domain_netbios_name: "{{netbios_name}}"
dns_domain_name: "{{domain}}"
safe_mode_password: "{{domain_password}}"
register: check_domain
- name: Reboot to complete domain creation
win_reboot:
reboot_timeout: 900
post_reboot_delay: 300
when: check_domain.changed
- name: Ensure the server is a domain controller
microsoft.ad.domain_controller:
dns_domain_name: "{{domain}}"
domain_admin_user: "{{domain_username}}"
domain_admin_password: "{{domain_password}}"
safe_mode_password: "{{domain_password}}"
state: domain_controller
register: check_domain_controller
- name: Reboot to complete domain controller setup
win_reboot:
reboot_timeout: 900
post_reboot_delay: 100
when: check_domain_controller.changed
# DNSCHANGE
# - name: "enable interface {{nat_adapter}} after domain joined"
# win_shell: netsh interface set interface "{{nat_adapter}}" enable
# register: enable_interface_dc
# until: "enable_interface_dc is not failed"
# retries: 3
# delay: 120
- name: Be sure DNS feature is installed
win_feature:
name: DNS
state: present
- name: Check for xDnsServer Powershell module
win_psmodule:
name: xDnsServer
state: present
- name: enable only the {{domain_adapter}} interface (local) for DNS client requests
ansible.windows.win_shell: dnscmd . /resetlistenaddresses {{ hostvars[dict_key].ansible_host }}
when: two_adapters
- name: Configure DNS Forwarders
win_dsc:
resource_name: xDnsServerForwarder
IsSingleInstance: "yes"
UseRootHint: false
IPAddresses:
- "{{dns_server_forwarder}}"
#- name: install nuget
# win_shell: install-packageprovider -name nuget -force
- name: "Install XactiveDirectory"
win_psmodule:
name: ActiveDirectoryDSC
state: present
- name: Ensure Administrator is part of Enterprise Admins
microsoft.ad.group:
name: "Enterprise Admins"
members:
- Administrator
state: present
- name: Ensure Administrator is part of Domain Admins
microsoft.ad.group:
name: "Domain Admins"
members:
- Administrator
state: present
But this leads to the following error:
TASK [domain_controller : Ensure Administrator is part of Enterprise Admins] **********************************************************************************
fatal: [dc03]: FAILED! => {"changed": false, "msg": "argument for members is of type System.Object[] and we were unable to convert to dict: System.Object[] cannot be converted to a dict"}
fatal: [dc01]: FAILED! => {"changed": false, "msg": "argument for members is of type System.Object[] and we were unable to convert to dict: System.Object[] cannot be converted to a dict"}
PLAY RECAP
**********************************************************************************
dc01 : ok=15 changed=2 unreachable=0 failed=1 skipped=3 rescued=0 ignored=0
dc02 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
dc03 : ok=10 changed=2 unreachable=0 failed=1 skipped=2 rescued=0 ignored=0
srv02 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
srv03 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
[-] 3 fails abort.
[-] Something wrong during the provisioning task : ad-parent_domain.yml
Here is my current config:
[+] Current Settings :
[*] Current Lab : GOAD
[*] Current Provider : virtualbox
[*] Current Provisioner : local
[*] Current IP range : 192.168.57.X
[*] Extension(s) :
Metadata
Metadata
Assignees
Labels
No labels