Joining to the Domain using Ansible

Posted: November 20, 2018 in ansible, Windows Server

File structure is same as in this post.

Playbook for Joining Machine to AD Domain:

name: install second domain controller
 hosts: dc2
 - group_vars/windows/vault_win.yml
 gather_facts: yes
 - name: Configure Primary DNS Server
     adapter_names: 'Ethernet 2'
 - name: Join to the domain
     dns_domain_name: '{{ dns_name }}'
     domain_admin_user: '{{ domain_admin_user }}'
     domain_admin_password: '{{ vault_ad_admin_pass }}'
     state: domain
 register: domain_state
 - name: Reboot after joining
     msg: "Joining Domain.Rebooting..."
     pre_reboot_delay: 15
   when: domain_state.reboot_required</pre> 
  1. Justin Smith says:

    Im running ansible natively on my mac… does the win_domain_membership require a “windows bridge computer” to run these specific commands? Wen i run these with my local host it says powershell isnt installed, because it isnt.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s