-
Notifications
You must be signed in to change notification settings - Fork 2
/
cert-installer.yaml
66 lines (60 loc) · 2.46 KB
/
cert-installer.yaml
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
- hosts: master
become: yes
tasks:
- name: Prepairing Prometheus Certificates
become_user: ubuntu
replace:
path: ~/certificates/prometheus.yaml
regexp: "{{ item.regexp }}"
replace: "{{ item.var }}"
with_items:
- { regexp: 'prometheus_certificate', var: "{{ prometheus_certificate }}" }
- { regexp: 'prometheus.url', var: "{{ prometheus_address_http }}" }
- name: Prepairing Alertmanager Certificates
become_user: ubuntu
replace:
path: ~/certificates/alertmanager.yaml
regexp: "{{ item.regexp }}"
replace: "{{ item.var }}"
with_items:
- { regexp: 'alertmanager_certificate', var: "{{ alertmanager_certificate }}" }
- { regexp: 'alertmanager.url', var: "{{ alertmanager_address_http }}" }
- name: Prepairing Alertmanager Certificates
become_user: ubuntu
replace:
path: ~/certificates/grafana.yaml
regexp: "{{ item.regexp }}"
replace: "{{ item.var }}"
with_items:
- { regexp: 'grafana_certificate', var: "{{ grafana_certificate }}" }
- { regexp: 'grafana.url', var: "{{ grafana_address_http }}" }
- name: Prepairing Pushgateway Certificates
become_user: ubuntu
replace:
path: ~/certificates/pushgateway.yaml
regexp: "{{ item.regexp }}"
replace: "{{ item.var }}"
with_items:
- { regexp: 'pushgateway_certificate', var: "{{ pushgateway_certificate }}" }
- { regexp: 'pushgateway.url', var: "{{ pushgateway_address_http }}" }
- name: Prepairing Registry Certificates
become_user: ubuntu
replace:
path: ~/certificates/registry.yaml
regexp: "{{ item.regexp }}"
replace: "{{ item.var }}"
with_items:
- { regexp: 'registry_certificate', var: "{{ registry_certificate }}" }
- { regexp: 'registry.url', var: "{{ registry_address_http }}" }
- name: Creating necessary Certificates
become_user: ubuntu
shell: kubectl create -f {{ item.yaml }} >> certificate_{{ item.file }}_created.info
with_items:
- { yaml: '~/certificates/prometheus.yaml', file: 'prometheus' }
- { yaml: '~/certificates/alertmanager.yaml', file: 'alertmanager' }
- { yaml: '~/certificates/pushgateway.yaml', file: 'pushgateway' }
- { yaml: '~/certificates/grafana.yaml', file: 'grafana' }
- { yaml: '~/certificates/registry.yaml', file: 'registry' }
args:
chdir: $HOME
creates: certificate_{{ item.file }}_created.info