forked from openshift/openshift-ansible
-
Notifications
You must be signed in to change notification settings - Fork 1
/
redeploy-certificates.yml
125 lines (115 loc) · 3.18 KB
/
redeploy-certificates.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
123
124
125
---
- name: Update monitoring certificates
hosts: oo_first_master
vars:
roles:
- lib_openshift
- openshift_facts
tasks:
- name: Remove TLS secret
oc_obj:
name: "{{ item }}"
kind: secret
state: absent
namespace: openshift-monitoring
with_items:
- alertmanager-main-tls
- grafana-tls
- kube-state-metrics-tls
- node-exporter-tls
- prometheus-k8s-tls
- name: Remove Prometheus pods
oc_obj:
selector: "app=prometheus"
kind: pod
state: absent
namespace: openshift-monitoring
- name: Verify that the Prometheus is running
oc_obj:
namespace: openshift-monitoring
kind: statefulset
state: list
name: prometheus-k8s
register: prometheus_ss
until:
- prometheus_ss.results.results[0].status.readyReplicas is defined
- prometheus_ss.results.results[0].status.readyReplicas > 0
retries: 60
delay: 10
changed_when: false
- name: Remove Alertmanager pods
oc_obj:
selector: "app=alertmanager"
kind: pod
state: absent
namespace: openshift-monitoring
- name: Verify that the Alertmanager is running
oc_obj:
namespace: openshift-monitoring
kind: statefulset
state: list
name: alertmanager-main
register: alertmanager_ss
until:
- alertmanager_ss.results.results[0].status.readyReplicas is defined
- alertmanager_ss.results.results[0].status.readyReplicas > 0
retries: 60
delay: 10
changed_when: false
- name: Remove kube-state-metrics pods
oc_obj:
selector: "app=kube-state-metrics"
kind: pod
state: absent
namespace: openshift-monitoring
- name: Verify that the Kube State Metrics is running
oc_obj:
namespace: openshift-monitoring
kind: deployment
state: list
name: kube-state-metrics
register: kube_state_metrics_deployment
until:
- kube_state_metrics_deployment.results.results[0].status.readyReplicas is defined
- kube_state_metrics_deployment.results.results[0].status.readyReplicas > 0
retries: 60
delay: 10
changed_when: false
- name: Remove grafana pods
oc_obj:
selector: "app=grafana"
kind: pod
state: absent
namespace: openshift-monitoring
- name: Verify that the Grafana is running
oc_obj:
namespace: openshift-monitoring
kind: deployment
state: list
name: grafana
register: grafana_deployment
until:
- grafana_deployment.results.results[0].status.readyReplicas is defined
- grafana_deployment.results.results[0].status.readyReplicas > 0
retries: 60
delay: 10
changed_when: false
- name: Remove node-exporter pods
oc_obj:
selector: "app=node-exporter"
kind: pod
state: absent
namespace: openshift-monitoring
- name: Verify that the node-exporter is running
oc_obj:
namespace: openshift-monitoring
kind: daemonset
state: list
name: node-exporter
register: node_exporter_ds
until:
- node_exporter_ds.results.results[0].status.numberReady is defined
- node_exporter_ds.results.results[0].status.numberReady > 0
retries: 60
delay: 10
changed_when: false