-
Notifications
You must be signed in to change notification settings - Fork 13
/
create-bastion.yml
65 lines (57 loc) · 1.6 KB
/
create-bastion.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
---
- name: Provision and configure a bastion admin node
hosts: localhost
connection: local
gather_facts: False
vars_files:
- "{{ VARS_FILE }}"
tasks:
- name: Launch Bastion Node
local_action:
module: ec2
image: "{{ BASTION_IMAGE }}"
instance_type: "{{ BASTION_INSTANCE_TYPE }}"
keypair: "{{ KEYPAIR }}"
region: "{{ EC2_REGION }}"
group_id: "{{ BASTION_SG }}"
vpc_subnet_id: "{{ BASTION_SN }}"
assign_public_ip: yes
instance_tags:
Name: "Lightbend Admin Bastion"
Role: Bastion Node
count: 1
volumes:
- device_name: /dev/sda1
device_type: "{{ BASTION_VOL_TYPE }}"
volume_size: "{{ BASTION_VOL_SIZE }}"
delete_on_termination: true
wait: yes
register: ec2
- name: Add to bastion_public
add_host:
groupname: "bastion_public"
hostname: "{{ ec2.instances[0].public_ip }}"
- name: Wait for SSH to come up
wait_for:
host: "{{ groups.bastion_public[0] }}"
port: 22
delay: 60
timeout: 320
state: started
- name: Setup Bastion
hosts: bastion_public
user: "ubuntu"
gather_facts: False
sudo: True
vars:
REMOTE_USER: "ubuntu"
vars_files:
- "{{ VARS_FILE }}"
tasks:
- include: python/tasks/main.yml
- include: ntp/tasks/main.yml
- include: ansible/tasks/setup-ansible.yml
- include: conductr/tasks/install-cli-pip.yml
- include: java/tasks/openjdk.yml
- include: docker/tasks/main.yml
- include: system/tasks/update-ubuntu.yml