Skip to content

Commit

Permalink
dont use meta for dependencies so we have full control over the role.
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-p committed Apr 14, 2020
1 parent 1b36aa1 commit 8ff56c4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
2 changes: 2 additions & 0 deletions files/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- src: justin_p.wincom
version: v0.0.2
10 changes: 1 addition & 9 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,4 @@ galaxy_info:
- 2012R2
- 2016
- 2019
galaxy_tags: ["activedirectory", "ad", "domaincontroller", "pdc"]
dependencies:
- role: justin_p.wincom
version: v0.0.2
vars:
wincom_required_psmodule: "{{ pdc_required_psmodules }}"
wincom_service_delayed: "{{ pdc_delayed_services }}"
wincom_dns_nics: "{{ pdc_dns_nics }}"
wincom_dns_servers: "{{ pdc_dns_servers }}"
galaxy_tags: ["activedirectory", "ad", "domaincontroller", "pdc"]
28 changes: 22 additions & 6 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,35 @@
- pdc_required_psmodules
- pdc_required_features

- name: Ensure role requirements from Ansible Galaxy are installed
delegate_to: 127.0.0.1
command: ansible-galaxy install -r {{ role_path }}/files/requirements.yml
register: ansible_galaxy_requirements
changed_when: "not ansible_galaxy_requirements.stdout.find('is already installed, skipping.')"

- name: Ensure PowerShell 5 and common settings are setup as we need them to be
include_role:
name: justin_p.wincom
vars:
wincom_required_psmodule: "{{ pdc_required_psmodules }}"
wincom_service_delayed: "{{ pdc_delayed_services }}"
wincom_dns_nics: "{{ pdc_dns_nics }}"
wincom_dns_servers: "{{ pdc_dns_servers }}"
when: not ansible_windows_domain_member

- name: Ensure the local user {{ pdc_administrator_username }} has the password specified for {{ pdc_netbios }}\{{ pdc_administrator_username }}
win_user:
name: "{{ pdc_administrator_username }}"
password: "{{ pdc_administrator_password }}"
groups: administrators
when: not ansible_windows_domain_member

- name: Ensure required Windows Features are installed
win_feature:
name: '{{ item }}'
include_management_tools: yes
with_items: "{{ pdc_required_features }}"

- name: Ensure there is a Active Directory domain and forest on {{ ansible_hostname }}
win_domain:
dns_domain_name: "{{ pdc_domain }}"
Expand Down Expand Up @@ -76,9 +98,3 @@
domain_username: "{{ pdc_netbios }}\\{{ pdc_administrator_username }}"
domain_password: "{{ pdc_administrator_password }}"
update_password: on_create

- name: Ensure required Windows Features are installed
win_feature:
name: '{{ item }}'
include_management_tools: yes
with_items: "{{ pdc_required_features }}"

0 comments on commit 8ff56c4

Please sign in to comment.