forked from sheeshkebab/etg-contoso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
instance_bac.yml
79 lines (71 loc) · 1.87 KB
/
instance_bac.yml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
# - name: Create an AAP credential for AWS Open Environment
# hosts: localhost
# gather_facts: false
# roles:
# - aap_aws_credential
- name: Build a jumphost - prepare with dependancies of students participating in a workshop
hosts: localhost
gather_facts: false
vars:
- ec2_wait: true
- teardown: false
- instance_count: 1
- ec2_name_prefix: "{{ tower_user_name }}_bac_{{ instance_tag }}"
#- ec2_name_prefix: "{{ tower_user_name }}_{{ instance_tag }}"
roles:
- workshop_jumphost
tasks:
- name: Ensure tags are present for jumphost
ec2_tag:
region: "{{ ec2_region }}"
resource: "{{ item.1.id }}"
state: present
tags:
aap: bac
with_indexed_items:
- "{{ ec2.instances }}"
- name: wait for all nodes to have SSH reachability
hosts: "jumphost"
become: true
gather_facts: false
roles:
- connectivity_test
- name: Add local accounts for students participating in a workshop
hosts: "jumphost"
gather_facts: false
become: true
vars:
# - student_total: "10"
# - student_prefix: "student"
roles:
- user_accounts
- name: Customise and add software dependancies
hosts: "jumphost"
become: true
gather_facts: true
vars:
#- towerinstall: true
roles:
- common
- control_node
# - name: Install coder service + NGINX frontend
# hosts: "jumphost"
# become: true
# gather_facts: true
# roles:
# - vscode
- name: Install and enable Cockpit & bash-completion & OC Client & etc.
hosts: "jumphost"
become: true
gather_facts: true
roles:
- vulgar
tasks:
- name: show all host IP matching group pattern, i.e. all in the group jumphost
debug:
msg: "{{ hostvars[item]['ansible_host'] }}"
#msg: "{{ item }} {{ hostvars[item]['ansible_' + }}"
#ansible_host: "{{ item.public_ip_address }}"
with_inventory_hostnames:
- jumphost