This repository has been archived by the owner on Aug 19, 2021. It is now read-only.
/
deploy_prometheus.yml
85 lines (73 loc) · 2.44 KB
/
deploy_prometheus.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
---
# #####################################################################
# Deploy Prometheus
# #####################################################################
# #####################################################################
# 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 Prometheus
# #####################################################################
- name: Deploy Prometheus
hosts: tag_role_k8smaster:&tag_user_{{ user }}
become: true
tasks:
- name: Include vars
include: site_vars.yml
- name: Delete prometheus.*
become: true
become_user: ubuntu
file:
state: absent
path: "{{ item }}"
loop:
- ~/prometheus.txt
- ~/prometheus.log
- name: Deploy Prometheus
include_role:
name: prometheus
vars:
operation: deploy
# when: site_deploy_prometheus == True