Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolves #15 #16

Merged
merged 1 commit into from
Oct 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Resolves #15
  • Loading branch information
mrlesmithjr committed Oct 1, 2017
commit 01dc22c42c7a37ee1100e0ed7739391906d265b6
9 changes: 9 additions & 0 deletions Vagrant/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
name: NET-Framework-Core
state: present

- name: Install Windows RSAT Tools
win_feature:
name: "{{ item }}"
state: present
with_items:
- RSAT-AD-PowerShell
- RSAT-AD-AdminCenter
- RSAT-DNS-Server

- name: Rebooting Server
win_reboot:
shutdown_timeout: 3600
Expand Down
10 changes: 5 additions & 5 deletions inventory/group_vars/vsphere_ddi_vms/powerdns-recursor.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
# Defines if specific forward zones should be defined
pdns_recursor_enable_fwd_zones: true
pdns_recursor_enable_fwd_zones: false

# Define forward lookup zone(s) along with DNS servers to use
pdns_recursor_fwd_zones:
- name: "{{ vsphere_ad_dns_domain_name }}"
servers:
- 10.0.102.30
# pdns_recursor_fwd_zones:
# - name: "{{ vsphere_ad_dns_domain_name }}"
# servers:
# - 10.0.102.30
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ config_network_interfaces: true

# Defines all dns servers to configure
dns_nameservers:
- 127.0.0.1
# - 127.0.0.1
- "{{ vsphere_dns_servers[0] }}"
- "{{ vsphere_dns_servers[1] }}"
# - "{{ vsphere_dns_servers[2] }}"
Expand Down
42 changes: 41 additions & 1 deletion tasks/bootstrap_vms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
ip: "{{ item['ip']|default(omit) }}"
gateway: "{{ item['gateway']|default(omit) }}"
memory_mb: "{{ item['memory_mb'] }}"
netmask: "{{ item['netmask']|default(omit) }}"
netmask_cidr: "{{ item['netmask_cidr']|default(omit) }}"
network_name: "{{ item['network_name'] }}"
vapp_source_path: "{{ item['vapp_source_path'] }}"
Expand Down Expand Up @@ -72,7 +73,46 @@
delay: 2
failed_when: false
with_items: "{{ vsphere_bootstrap_vms }}"
when: item['deploy']
when: >
item['deploy'] and
item['ip'] is not defined

- name: bootstrap_vms | Waiting For All IP Addresses To Be Captured
vmware_guest_facts:
hostname: "{{ hostvars[vsphere_bootstrap_host]['ansible_host'] }}"
username: "{{ vsphere_user_info['username'] }}"
password: "{{ vsphere_user_info['password'] }}"
datacenter: ha-datacenter
validate_certs: false
name: "{{ item['vm_name'] }}"
folder: /ha-datacenter/vm
delegate_to: localhost
register: _vsphere_bootstrap_vm_facts
until: >
(_vsphere_bootstrap_vm_facts['instance']['ipv4'] == item['ip'])
retries: 30
delay: 2
failed_when: false
with_items: "{{ vsphere_bootstrap_vms }}"
when: >
item['deploy'] and
item['ip'] is defined

- name: bootstrap_vms | Creating Initial VM Snapshot
vmware_guest_snapshot:
hostname: "{{ hostvars[vsphere_bootstrap_host]['ansible_host'] }}"
username: "{{ vsphere_user_info['username'] }}"
password: "{{ vsphere_user_info['password'] }}"
datacenter: ha-datacenter
validate_certs: false
name: "{{ item['instance']['hw_name'] }}"
folder: /ha-datacenter/vm
snapshot_name: post_deploy
state: present
uuid: "{{ item['instance']['hw_product_uuid'] }}"
delegate_to: localhost
with_items: "{{ _vsphere_bootstrap_vm_facts['results'] }}"
when: item['instance']['snapshots'] == []

- name: bootstrap_vms | Creating Dynamic Inventory For vsphere_bootstrap_vms
add_host:
Expand Down
27 changes: 25 additions & 2 deletions tasks/ddi_vms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
win_shell: $Password=ConvertTo-SecureString -String "{{ vsphere_bootstrap_user_info['password'] }}" -AsPlainText -Force | ConvertFrom-SecureString | Out-File {{ vsphere_bootstrap_vms_secure_password_file }}
no_log: true

- name: bootstrap_vms | Generating ddi_vms.ps1 Powershell Script
- name: ddi_vms | Generating ddi_vms.ps1 Powershell Script
win_template:
src: ddi_vms.ps1.j2
dest: c:\tmp\ddi_vms.ps1
Expand Down Expand Up @@ -73,7 +73,30 @@
delay: 2
failed_when: false
with_items: "{{ vsphere_ddi_vms }}"
when: item['deploy']
when: >
item['deploy'] and
item['ip'] is not defined

- name: ddi_vms | Waiting For All IP Addresses To Be Captured
vmware_guest_facts:
hostname: "{{ hostvars[vsphere_bootstrap_host]['ansible_host'] }}"
username: "{{ vsphere_user_info['username'] }}"
password: "{{ vsphere_user_info['password'] }}"
datacenter: ha-datacenter
validate_certs: false
name: "{{ item['vm_name'] }}"
folder: /ha-datacenter/vm
delegate_to: localhost
register: _vsphere_ddi_vm_facts
until: >
(_vsphere_ddi_vm_facts['instance']['ipv4'] == item['ip'])
retries: 30
delay: 2
failed_when: false
with_items: "{{ vsphere_ddi_vms }}"
when: >
item['deploy'] and
item['ip'] is defined

- name: ddi_vms | Creating Initial VM Snapshot
vmware_guest_snapshot:
Expand Down
27 changes: 25 additions & 2 deletions tasks/dnsdist_vms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
win_shell: $Password=ConvertTo-SecureString -String "{{ vsphere_bootstrap_user_info['password'] }}" -AsPlainText -Force | ConvertFrom-SecureString | Out-File {{ vsphere_bootstrap_vms_secure_password_file }}
no_log: true

- name: bootstrap_vms | Generating dnsdist_vms.ps1 Powershell Script
- name: dnsdist_vms | Generating dnsdist_vms.ps1 Powershell Script
win_template:
src: dnsdist_vms.ps1.j2
dest: c:\tmp\dnsdist_vms.ps1
Expand Down Expand Up @@ -73,7 +73,30 @@
delay: 2
failed_when: false
with_items: "{{ vsphere_dnsdist_vms }}"
when: item['deploy']
when: >
item['deploy'] and
item['ip'] is not defined

- name: dnsdist_vms | Waiting For All IP Addresses To Be Captured
vmware_guest_facts:
hostname: "{{ hostvars[vsphere_bootstrap_host]['ansible_host'] }}"
username: "{{ vsphere_user_info['username'] }}"
password: "{{ vsphere_user_info['password'] }}"
datacenter: ha-datacenter
validate_certs: false
name: "{{ item['vm_name'] }}"
folder: /ha-datacenter/vm
delegate_to: localhost
register: _vsphere_dnsdist_vm_facts
until: >
(_vsphere_dnsdist_vm_facts['instance']['ipv4'] == item['ip'])
retries: 30
delay: 2
failed_when: false
with_items: "{{ vsphere_dnsdist_vms }}"
when: >
item['deploy'] and
item['ip'] is defined

- name: dnsdist_vms | Creating Initial VM Snapshot
vmware_guest_snapshot:
Expand Down
25 changes: 24 additions & 1 deletion tasks/lb_vms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,30 @@
delay: 2
failed_when: false
with_items: "{{ vsphere_lb_vms }}"
when: item['deploy']
when: >
item['deploy'] and
item['ip'] is not defined

- name: lb_vms | Waiting For All IP Addresses To Be Captured
vmware_guest_facts:
hostname: "{{ hostvars[vsphere_bootstrap_host]['ansible_host'] }}"
username: "{{ vsphere_user_info['username'] }}"
password: "{{ vsphere_user_info['password'] }}"
datacenter: ha-datacenter
validate_certs: false
name: "{{ item['vm_name'] }}"
folder: /ha-datacenter/vm
delegate_to: localhost
register: _vsphere_lb_vm_facts
until: >
(_vsphere_lb_vm_facts['instance']['ipv4'] == item['ip'])
retries: 30
delay: 2
failed_when: false
with_items: "{{ vsphere_lb_vms }}"
when: >
item['deploy'] and
item['ip'] is defined

- name: lb_vms | Creating Initial VM Snapshot
vmware_guest_snapshot:
Expand Down