This repository has been archived by the owner on Aug 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
site_vars.yml
122 lines (109 loc) · 4.44 KB
/
site_vars.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
- name: Include site credentials
include_vars: vars/site_secrets.yml
- name: Include vars for GCP
include_vars: "{{ item }}"
with_items:
- vars/environment_gcp_secrets.yml
- vars/environment_gcp_vars.yml
when: type == 'gcp'
- name: Include vars for AWS
include_vars: "{{ item }}"
with_items:
- vars/environment_aws_secrets.yml
- vars/environment_aws_vars.yml
when: type == 'aws'
- name: Include vars for ESX
include_vars: "{{ item }}"
with_items:
- vars/environment_esx_secrets.yml
- vars/environment_esx_vars.yml
when: type == 'esx'
- name: Report
uri:
url: "{{ report_url }}"
method: POST
headers:
x-api-key: "{{ report_key | b64decode }}"
validate_certs: yes
body_format: json
body: |
{
"TableName": "moadsd-ng-reporter",
"Item": {
"datetime": {"S": "{{ lookup('pipe','date +%Y-%m-%d-%H-%M-%S') }}" },
"admin_email": {"S": "{{ admin_email | hash('sha256') }}" },
"type": {"S": "{{ type }}" },
"action": {"S": "{{ run_pb }}" },
"site_deploy_kubernetes": {"S": "{{ site_deploy_kubernetes }}" },
"site_deploy_openshift": {"S": "{{ site_deploy_openshift }}" },
"site_deploy_deepsecurity": {"S": "{{ site_deploy_deepsecurity }}" },
"site_deploy_smartcheck": {"S": "{{ site_deploy_smartcheck }}" },
"site_deploy_jenkins": {"S": "{{ site_deploy_jenkins }}" },
"site_deploy_gitlab": {"S": "{{ site_deploy_gitlab }}" },
"site_deploy_endpoints": {"S": "{{ site_deploy_endpoints }}" },
"site_deploy_linkerd": {"S": "{{ site_deploy_linkerd }}" },
"site_deploy_prometheus": {"S": "{{ site_deploy_prometheus }}" },
"site_deploy_grafana": {"S": "{{ site_deploy_grafana }}" },
"site_deploy_opa": {"S": "{{ site_deploy_opa }}" },
"site_deploy_jumphost": {"S": "{{ site_deploy_jumphost }}" }
}
}
status_code: 200
delegate_to: localhost
# - name: Debug
# debug:
# msg: "{{ hostvars[inventory_hostname] }}"
- name: Get Jumphost IP
set_fact:
jumphost_ip: "{{ hostvars[inventory_hostname]['groups']['tag_Name_' + moadsd_ng_prefix | regex_replace('-', '_') + '_jumphost_instance'][0] | default('0.0.0.0') }}"
when:
- site_deploy_jumphost == True
- type == 'aws'
- name: Get Jumphost IP
set_fact:
jumphost_ip: "{{ hostvars[inventory_hostname]['groups']['tag_role_jumphost'][0] }}"
when:
- site_deploy_jumphost == True
- type == 'gcp'
- name: Get Kubernetes IPs
set_fact:
k8smaster_ip: "{{ hostvars[inventory_hostname]['groups']['tag_Name_' + moadsd_ng_prefix | regex_replace('-', '_') + '_k8smaster_instance'][0] | default('0.0.0.0') }}"
k8sworker1_ip: "{{ hostvars[inventory_hostname]['groups']['tag_Name_' + moadsd_ng_prefix | regex_replace('-', '_') + '_k8sworker1_instance'][0] | default('0.0.0.0') }}"
when:
- site_deploy_kubernetes == True
- type == 'aws'
- name: Get Kubernetes IPs
set_fact:
k8smaster_ip: "{{ hostvars[inventory_hostname]['groups']['tag_role_k8smaster'][0] }}"
k8sworker1_ip: "{{ hostvars[inventory_hostname]['groups']['tag_role_k8sworker'][0] }}"
when:
- site_deploy_kubernetes == True
- type == 'gcp'
- name: Get Openshift IP
set_fact:
openshift_ip: "{{ hostvars[inventory_hostname]['groups']['tag_Name_' + moadsd_ng_prefix | regex_replace('-', '_') + '_openshift_instance'][0] | default('0.0.0.0') }}"
when:
- site_deploy_openshift == True
- type == 'aws'
- name: Get Openshift IP
set_fact:
openshift_ip: "{{ hostvars[inventory_hostname]['groups']['tag_role_openshift'][0] }}"
when:
- site_deploy_openshift == True
- type == 'gcp'
- name: Get Deep Security Manager IPs
set_fact:
dsm_ip: "{{ hostvars[inventory_hostname]['groups']['tag_Name_' + moadsd_ng_prefix | regex_replace('-', '_') + '_dsm_instance'][0] | default('0.0.0.0') }}"
dsmdb_ip: "{{ hostvars[inventory_hostname]['groups']['tag_Name_' + moadsd_ng_prefix | regex_replace('-', '_') + '_dsmdb_instance'][0] | default('0.0.0.0') }}"
when:
- site_deploy_deepsecurity == True
- deepsecurity_variant == 'dsm'
- type == 'aws'
- name: Get Deep Security Manager IPs
set_fact:
dsm_ip: "{{ hostvars[inventory_hostname]['groups']['tag_role_dsm'][0] }}"
dsmdb_ip: "{{ hostvars[inventory_hostname]['groups']['tag_role_dsmdb'][0] }}"
when:
- site_deploy_deepsecurity == True
- deepsecurity_variant == 'dsm'
- type == 'gcp'