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
/
deploy_opa.yml
74 lines (63 loc) · 2.15 KB
/
deploy_opa.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
---
# #####################################################################
# Deploy OPA
# #####################################################################
# #####################################################################
# Query some private ips
# #####################################################################
- hosts: tag_role_jumphost:&tag_user_{{ user }}
tasks:
- name: Get ipaddr of Jumphost
set_fact:
remote_ip: "{{ inventory_hostname | ipaddr}}"
- name: Get ipaddr of Jumphost
set_fact:
remote_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
when: not remote_ip
- name: Store external ip address of Jumphost
add_host:
name: "{{ remote_ip }}"
groups: "moadsd_ng_jumphost_instance_public"
- hosts: localhost
gather_facts: false
tasks:
- name: Include vars
include: site_vars.yml
- name: Listing Jumphost Environment
debug:
msg:
- "Jumphost : {{ jumphost_ip }}"
when: site_deploy_jumphost == True
- name: Listing Kubernetes Environment
debug:
msg:
- "Kubernetes Master : {{ k8smaster_ip }}"
- "Kubernetes Worker 1 : {{ k8sworker1_ip }}"
when: site_deploy_kubernetes == True
- name: Listing OpenShift Environment
debug:
msg:
- "OpenShift Master : {{ openshift_ip }}"
when: site_deploy_openshift == True
- name: Listing Deep Security Environment
debug:
msg:
- "Deep Security : {{ dsm_ip }}"
- "PostgreSQL : {{ dsmdb_ip }}"
when:
- site_deploy_deepsecurity == True
- deepsecurity_variant == 'dsm'
# #####################################################################
# Deploy OPA
# #####################################################################
- name: Deploy OPA
hosts: tag_role_k8smaster:&tag_user_{{ user }}
become: true
tasks:
- name: Include vars
include: site_vars.yml
- name: Deploy OPA
include_role:
name: opa
vars:
operation: deploy