-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.yaml
63 lines (57 loc) · 1.13 KB
/
main.yaml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
- name: Create VMs
hosts: localhost
vars_prompt:
- name: network
prompt: Network?
private: false
tasks:
# Include this role to gather information about instances before assigning Floating IP>
# Needed for tags hosts and keys
- include_role:
name: instances
tags:
- hosts
- keys
when: "'hosts' in ansible_run_tags or 'keys' in ansible_run_tags"
# Add a floating IP to the instances to reconfigure them.
# Needed for tags hosts and keys
- include_role:
name: floatingip
tags:
- hosts
- keys
when: "'hosts' in ansible_run_tags or 'keys' in ansible_run_tags"
- include_role:
name: instances
tags:
- ssh_config
- hosts
- keys
- name: Configure VMs
hosts: all
gather_facts: false
become: true
tasks:
- include_role:
name: configuration
tags:
- hosts
- keys
- name: Cleanup
hosts: localhost
gather_facts: false
tasks:
- include_role:
name: cleanup
tags:
- hosts
- keys
- name: Update SSH config
hosts: localhost
gather_facts: true
tasks:
- include_role:
name: ssh
tags:
- ssh_config