-
Notifications
You must be signed in to change notification settings - Fork 3
/
shaman.yml
executable file
·58 lines (52 loc) · 1.72 KB
/
shaman.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
#!/usr/local/bin/ansible-playbook
- name: ' Konductor UPI '
hosts: konductor
vars_files:
- '../cluster-vars.yml'
- 'vars/global.yml'
- 'vars/{{ target_environment }}.yml'
# - 'vars/git.yml'
vars:
module: "build"
state_provider: "local"
tf_module_path: "{{ dir_terraform }}/shaman"
vars_module_path: "{{ dir_terraform }}"
ansible_name_module: " Konductor | UPI | {{ module }}"
tasks:
####### Terraform Apply
- name: '{{ ansible_name_module }} | terraform | apply'
terraform:
project_path: "{{ item }}"
variables_file: "{{ vars_module_path }}/global.tfvars"
state: present
loop:
- "{{ tf_module_path }}/elb"
- "{{ tf_module_path }}/control-plane"
- "{{ tf_module_path }}/route53"
register: tf_output
- name: Waiting for default ingress to be defined...
k8s_info:
api_version: v1
kind: Service
name: router-default
namespace: openshift-ingress
register: ingress_status_out
until:
- ingress_status_out is defined
- ingress_status_out.resources[0] is defined
- ingress_status_out.resources[0].status.loadBalancer.ingress[0].hostname is defined
retries: 120
delay: 10
- name: Set ingress_hostname fact
set_fact:
ingress_hostname: "{{ ingress_status_out.resources[0].status.loadBalancer.ingress[0].hostname }}"
- name: Create Route 53 entry
route53:
state: present
zone: "{{ cluster_domain }}"
record: "*.apps.{{ cluster_domain }}"
type: CNAME
value: "{{ ingress_hostname }}"
private_zone: true
aws_access_key: "{{ aws_access_key_id }}"
aws_secret_key: "{{ aws_secret_access_key }}"