-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathfix_aws_dns.yml
More file actions
42 lines (37 loc) · 1.38 KB
/
fix_aws_dns.yml
File metadata and controls
42 lines (37 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
# AWS specific initialization starts here
- name: "Fix AWS DNS (needed on cold start)"
hosts: build_control
remote_user: localhost
connection: local
become: false
vars_files:
- 'vars/aws_vars.yml'
- '~/agof_vault.yml'
tasks:
- name: "AWS inventory and DHCP option setting"
block:
- name: Include check code to setup variables
ansible.builtin.include_role:
name: roles/aws_check_setup
when: ec2_vpc_id is not defined
- name: Include setup code to populate VPC and other vars if not defined
ansible.builtin.include_role:
name: roles/manage_ec2_infra
when: ec2_vpc_id is not defined
- name: Check for state vars
ansible.builtin.stat:
path: '{{ pattern_state_rootdir }}/{{ ec2_name_prefix }}/aws_state_vars.yml'
register: statevars
- name: Include state vars if set
when: statevars.stat.exists
block:
- name: Include vars if set
ansible.builtin.include_vars:
file: '{{ pattern_state_rootdir }}/{{ ec2_name_prefix }}/aws_state_vars.yml'
- name: Set ami_id
ansible.builtin.set_fact:
ami_id: imagebuilder_ami
- name: Include setup code for VMs and DNS
ansible.builtin.include_role:
name: roles/manage_ec2_instances