diff options
author | heqnx <root@heqnx.com> | 2025-07-12 13:15:48 +0300 |
---|---|---|
committer | heqnx <root@heqnx.com> | 2025-07-12 13:15:48 +0300 |
commit | 5c07039ceb41ad6867213827440876a74f586aad (patch) | |
tree | bce1eaf4d7b8a47696272b91938def0981c93b75 /ansible/main.yaml | |
parent | 5a0f9c70eb028fc6bf04b9cdf39904fe5391612b (diff) | |
download | ansible-active-directory-range-5c07039ceb41ad6867213827440876a74f586aad.tar.gz ansible-active-directory-range-5c07039ceb41ad6867213827440876a74f586aad.zip |
working setup now with dynamic inventory
Diffstat (limited to 'ansible/main.yaml')
-rw-r--r-- | ansible/main.yaml | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/ansible/main.yaml b/ansible/main.yaml index 777db8f..3c0effe 100644 --- a/ansible/main.yaml +++ b/ansible/main.yaml @@ -31,13 +31,6 @@ ansible_winrm_server_cert_validation: ignore changed_when: false - - name: configure windows domain controller - include_role: - name: dc01 - vars: - hostname: "{{ main_dc01_hostname }}" - domain_name: "{{ main_domain_name }}" - - name: deploy linux domain vm on proxmox include_role: name: proxmox_vm @@ -50,8 +43,7 @@ vmid: "{{ main_linux_srv01_vmid }}" ip: "{{ main_linux_srv01_ip_address }}" gateway: "{{ network_gateway }}" - #dns: "{{ main_dc01_ip_address }}" - dns: "8.8.8.8" + dns: "{{ main_dc01_ip_address }}" hostname: "{{ main_linux_srv01_hostname }}" domain: "{{ main_domain_name }}" fqdn: "{{ main_linux_srv01_hostname }}.{{ main_domain_name }}" @@ -67,9 +59,17 @@ ansible_host_key_checking: false changed_when: false - - name: configure linux domain vm +- name: configure everything + hosts: all + gather_facts: no + tasks: + - name: configure windows dc + include_role: + name: dc01 + when: inventory_hostname == main_dc01_hostname + '.' + main_domain_name + + - name: configure linux server include_role: name: srv01 - vars: - hostname: "{{ main_linux_srv01_hostname }}" - domain_name: "{{ main_domain_name }}" + when: inventory_hostname == main_linux_srv01_hostname + '.' + main_domain_name + |