-
Notifications
You must be signed in to change notification settings - Fork 2
/
bastion_setup.yaml
49 lines (45 loc) · 1.47 KB
/
bastion_setup.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
#!/usr/bin/env ansible-playbook
---
- name: "OPENTLC: Bastion Setup"
hosts: localhost
connection: local
gather_facts: True
vars_files:
- configuration.yaml
- credentials.yaml
vars:
cloudforms_api_url: "{{ opentlc_api_url }}"
pre_tasks:
- name: "Parameter: username"
fail: msg="username is not defined or is empty"
when: username is not defined or username is none
tags: [ always ]
- name: "Parameter: password"
fail: msg="password is not defined or is empty"
when: password is not defined or password is none
tags: [ always ]
roles:
- role: cloudforms_login
- role: cloudforms_check_existing_service
- role: cloudforms_fetch_custom_attributes_opentlc
- role: bastion_init
# - name: Updating .ssh/config to easy access
# hosts: personal_hosts,localhost
# gather_facts: True
# roles:
# - role: bastion_ssh_config
- name: Setting up bastion
hosts: openshift_bastion
gather_facts: False
become: True
vars:
aws_key: "{{ hostvars['localhost']['aws_key'] }}"
aws_secret: "{{ hostvars['localhost']['aws_secret'] }}"
top_level_domain: "{{ hostvars['localhost']['top_level_domain'] }}"
guid: "{{ hostvars['localhost']['gui'] }}"
pre_tasks:
- name: Inserting public key into /root/.ssh/authorized_keys
copy: dest=/root/.ssh/authorized_keys content={{ hostvars['localhost']['public_key'] }}
roles:
- install_docker_ce
- install_git2