- name: deploy active directory range on proxmox hosts: localhost gather_facts: no tasks: - name: "deploy {{ main_dc01_hostname }}.{{ main_domain_name }} vm on {{ proxmox_hostname }}" include_role: name: proxmox_vm vars: os_type: "windows" template: "{{ windows_server_template_name }}" id: "{{ windows_server_template_id }}" vm: "{{ main_dc01_hostname }}.{{ main_domain_name }}" newid: "{{ main_dc01_vmid }}" vmid: "{{ main_dc01_vmid }}" ip: "{{ main_dc01_ip_address }}" gateway: "{{ network_gateway }}" dns: "8.8.8.8" hostname: "{{ main_dc01_hostname }}" domain: "{{ main_domain_name }}" fqdn: "{{ main_dc01_hostname }}.{{ main_domain_name }}" - name: "add {{ main_dc01_hostname }}.{{ main_domain_name }} to in-memory inventory" add_host: name: "{{ main_dc01_hostname }}.{{ main_domain_name }}" ansible_host: "{{ main_dc01_ip_address }}" ansible_connection: "{{ win_connector }}" ansible_user: "{{ default_win_username }}" ansible_password: "{{ default_win_password }}" ansible_port: "{{ win_port }}" ansible_winrm_transport: basic ansible_winrm_server_cert_validation: ignore changed_when: false - name: "deploy {{ main_linux_srv01_hostname }}.{{ main_domain_name }} vm on {{ proxmox_hostname }}" include_role: name: proxmox_vm vars: os_type: "linux" template: "{{ linux_server_template_name }}" id: "{{ linux_server_template_id }}" vm: "{{ main_linux_srv01_hostname }}.{{ main_domain_name }}" newid: "{{ main_linux_srv01_vmid }}" vmid: "{{ main_linux_srv01_vmid }}" ip: "{{ main_linux_srv01_ip_address }}" gateway: "{{ network_gateway }}" dns: "{{ main_dc01_ip_address }}" hostname: "{{ main_linux_srv01_hostname }}" domain: "{{ main_domain_name }}" fqdn: "{{ main_linux_srv01_hostname }}.{{ main_domain_name }}" - name: "add {{ main_linux_srv01_hostname }}.{{ main_domain_name }} to in-memory inventory" add_host: name: "{{ main_linux_srv01_hostname }}.{{ main_domain_name }}" ansible_host: "{{ main_linux_srv01_ip_address }}" ansible_connection: "{{ linux_connector }}" ansible_user: "{{ default_linux_username }}" ansible_password: "{{ default_linux_password }}" ansible_port: "{{ linux_port }}" ansible_host_key_checking: false changed_when: false - name: configure hosts hosts: all gather_facts: no tasks: - name: "configure {{ main_dc01_hostname }}.{{ main_domain_name }}" include_role: name: dc01 when: inventory_hostname == main_dc01_hostname + '.' + main_domain_name - name: "configure {{ main_linux_srv01_hostname }}.{{ main_domain_name }}" include_role: name: srv01 when: inventory_hostname == main_linux_srv01_hostname + '.' + main_domain_name