From 55d8fb783bf6dfbf13baea9fae23f1a1a79fc90d Mon Sep 17 00:00:00 2001 From: Chris Long Date: Sun, 14 Mar 2021 12:22:55 -0700 Subject: [PATCH] More Azure ansible fixes --- Azure/Ansible/roles/exchange/tasks/main.yml | 25 ++++++++++----------- ESXi/ansible/roles/exchange/tasks/main.yml | 3 --- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/Azure/Ansible/roles/exchange/tasks/main.yml b/Azure/Ansible/roles/exchange/tasks/main.yml index 634d73cfc..60cb418c1 100644 --- a/Azure/Ansible/roles/exchange/tasks/main.yml +++ b/Azure/Ansible/roles/exchange/tasks/main.yml @@ -9,11 +9,13 @@ win_reboot: when: res.reboot_required -- name: Set HostOnly IP Address - win_shell: "If (-not(get-netipaddress | where {$_.IPAddress -eq '192.168.38.106'})) {$adapter = (get-netadapter | where {$_.MacAddress -eq '00-50-56-A1-B4-C5'}).Name; New-NetIPAddress –InterfaceAlias $adapter –AddressFamily IPv4 -IPAddress 192.168.38.106 –PrefixLength 24 -DefaultGateway 192.168.38.1 } Else { Write-Host 'IP Address Already Created.' }" - - name: Set HostOnly DNS Address - win_shell: "$adapter = (get-netadapter | where {$_.MacAddress -eq '00-50-56-A1-B4-C5'}).Name; Set-DnsClientServerAddress -InterfaceAlias $adapter -ServerAddresses 192.168.38.102,8.8.8.8" + win_dns_client: + adapter_names: '*' + ipv4_addresses: + - 192.168.38.102 + - 8.8.8.8 + log_path: C:\dns_log.txt - name: Install git win_chocolatey: @@ -72,7 +74,7 @@ - name: Prepare Schema win_package: - path: E:\Setup.exe + path: F:\Setup.exe arguments: >- /IAcceptExchangeServerLicenseTerms /PrepareSchema @@ -80,14 +82,13 @@ vars: ansible_become: yes ansible_become_method: runas - ansible_become_user: WINDOMAIN.local\Administrator + ansible_become_user: WINDOMAIN\vagrant ansible_become_password: vagrant register: prepare_schema - changed_when: "prepare_schema.rc == 0" - name: Prepare AD win_package: - path: E:\Setup.exe + path: F:\Setup.exe arguments: >- /IAcceptExchangeServerLicenseTerms /PrepareAD @@ -96,14 +97,13 @@ vars: ansible_become: yes ansible_become_method: runas - ansible_become_user: WINDOMAIN.local\Administrator + ansible_become_user: WINDOMAIN\vagrant ansible_become_password: vagrant register: prepare_ad - changed_when: "prepare_ad.rc == 0" - name: Install Exchange win_package: - path: E:\Setup.exe + path: F:\Setup.exe arguments: >- /IAcceptExchangeServerLicenseTerms /Mode:Install @@ -112,10 +112,9 @@ vars: ansible_become: yes ansible_become_method: runas - ansible_become_user: WINDOMAIN.local\Administrator + ansible_become_user: WINDOMAIN\vagrant ansible_become_password: vagrant register: install_exchange - changed_when: "install_exchange.rc == 0" - name: Reboot after Exchange Installation win_reboot: diff --git a/ESXi/ansible/roles/exchange/tasks/main.yml b/ESXi/ansible/roles/exchange/tasks/main.yml index 634d73cfc..965d4af71 100644 --- a/ESXi/ansible/roles/exchange/tasks/main.yml +++ b/ESXi/ansible/roles/exchange/tasks/main.yml @@ -83,7 +83,6 @@ ansible_become_user: WINDOMAIN.local\Administrator ansible_become_password: vagrant register: prepare_schema - changed_when: "prepare_schema.rc == 0" - name: Prepare AD win_package: @@ -99,7 +98,6 @@ ansible_become_user: WINDOMAIN.local\Administrator ansible_become_password: vagrant register: prepare_ad - changed_when: "prepare_ad.rc == 0" - name: Install Exchange win_package: @@ -115,7 +113,6 @@ ansible_become_user: WINDOMAIN.local\Administrator ansible_become_password: vagrant register: install_exchange - changed_when: "install_exchange.rc == 0" - name: Reboot after Exchange Installation win_reboot: