|
@@ -13,21 +13,6 @@
|
|
|
hostnames: hawkular-cassandra
|
|
|
changed_when: no
|
|
|
|
|
|
-- slurp: src={{ mktemp.stdout }}/hawkular-metrics-truststore.pwd
|
|
|
- register: hawkular_truststore_password
|
|
|
-
|
|
|
-- stat: path="{{mktemp.stdout}}/{{item}}"
|
|
|
- register: pwd_file_stat
|
|
|
- with_items:
|
|
|
- - hawkular-metrics.pwd
|
|
|
- - hawkular-metrics.htpasswd
|
|
|
- changed_when: no
|
|
|
-
|
|
|
-- set_fact:
|
|
|
- pwd_files: "{{pwd_files | default({}) | combine ({item.item: item.stat}) }}"
|
|
|
- with_items: "{{pwd_file_stat.results}}"
|
|
|
- changed_when: no
|
|
|
-
|
|
|
- name: generate password for hawkular metrics
|
|
|
local_action: copy dest="{{ local_tmp.stdout}}/{{ item }}.pwd" content="{{ 15 | oo_random_word }}"
|
|
|
with_items:
|
|
@@ -47,8 +32,6 @@
|
|
|
- hawkular-metrics.pwd
|
|
|
- hawkular-metrics.htpasswd
|
|
|
|
|
|
-- include: import_jks_certs.yaml
|
|
|
-
|
|
|
- name: read files for the hawkular-metrics secret
|
|
|
shell: >
|
|
|
printf '%s: ' '{{ item }}'
|
|
@@ -56,13 +39,11 @@
|
|
|
register: hawkular_secrets
|
|
|
with_items:
|
|
|
- ca.crt
|
|
|
- - hawkular-metrics.crt
|
|
|
- - hawkular-metrics.keystore
|
|
|
- - hawkular-metrics-keystore.pwd
|
|
|
- - hawkular-metrics.truststore
|
|
|
- - hawkular-metrics-truststore.pwd
|
|
|
- hawkular-metrics.pwd
|
|
|
- hawkular-metrics.htpasswd
|
|
|
+ - hawkular-metrics.crt
|
|
|
+ - hawkular-metrics.key
|
|
|
+ - hawkular-metrics.pem
|
|
|
- hawkular-cassandra.crt
|
|
|
- hawkular-cassandra.key
|
|
|
- hawkular-cassandra.pem
|
|
@@ -73,42 +54,23 @@
|
|
|
{{ hawkular_secrets.results|map(attribute='stdout')|join('
|
|
|
')|from_yaml }}
|
|
|
|
|
|
-- name: generate hawkular-metrics-secrets secret template
|
|
|
- template:
|
|
|
- src: secret.j2
|
|
|
- dest: "{{ mktemp.stdout }}/templates/hawkular_metrics_secrets.yaml"
|
|
|
- vars:
|
|
|
- name: hawkular-metrics-secrets
|
|
|
- labels:
|
|
|
- metrics-infra: hawkular-metrics
|
|
|
- data:
|
|
|
- hawkular-metrics.keystore: >
|
|
|
- {{ hawkular_secrets['hawkular-metrics.keystore'] }}
|
|
|
- hawkular-metrics.keystore.password: >
|
|
|
- {{ hawkular_secrets['hawkular-metrics-keystore.pwd'] }}
|
|
|
- hawkular-metrics.truststore: >
|
|
|
- {{ hawkular_secrets['hawkular-metrics.truststore'] }}
|
|
|
- hawkular-metrics.truststore.password: >
|
|
|
- {{ hawkular_secrets['hawkular-metrics-truststore.pwd'] }}
|
|
|
- hawkular-metrics.keystore.alias: "{{ 'hawkular-metrics'|b64encode }}"
|
|
|
- hawkular-metrics.htpasswd.file: >
|
|
|
- {{ hawkular_secrets['hawkular-metrics.htpasswd'] }}
|
|
|
- when: name not in metrics_secrets.stdout_lines
|
|
|
- changed_when: no
|
|
|
-
|
|
|
-- name: generate hawkular-metrics-certificate secret template
|
|
|
+- name: generate hawkular-metrics-certs secret template
|
|
|
template:
|
|
|
src: secret.j2
|
|
|
- dest: "{{ mktemp.stdout }}/templates/hawkular_metrics_certificate.yaml"
|
|
|
+ dest: "{{ mktemp.stdout }}/templates/hawkular-metrics-certs.yaml"
|
|
|
vars:
|
|
|
- name: hawkular-metrics-certificate
|
|
|
+ name: hawkular-metrics-certs
|
|
|
labels:
|
|
|
- metrics-infra: hawkular-metrics
|
|
|
+ metrics-infra: hawkular-metrics-certs
|
|
|
+ annotations:
|
|
|
+ service.alpha.openshift.io/originating-service-name: hawkular-metrics
|
|
|
data:
|
|
|
- hawkular-metrics.certificate: >
|
|
|
+ tls.crt: >
|
|
|
{{ hawkular_secrets['hawkular-metrics.crt'] }}
|
|
|
- hawkular-metrics-ca.certificate: >
|
|
|
- {{ hawkular_secrets['ca.crt'] }}
|
|
|
+ tls.key: >
|
|
|
+ {{ hawkular_secrets['hawkular-metrics.key'] }}
|
|
|
+ tls.truststore.crt: >
|
|
|
+ {{ hawkular_secrets['hawkular-cassandra.crt'] }}
|
|
|
when: name not in metrics_secrets.stdout_lines
|
|
|
changed_when: no
|
|
|
|
|
@@ -122,6 +84,7 @@
|
|
|
metrics-infra: hawkular-metrics
|
|
|
data:
|
|
|
hawkular-metrics.username: "{{ 'hawkular'|b64encode }}"
|
|
|
+ hawkular-metrics.htpasswd: "{{ hawkular_secrets['hawkular-metrics.htpasswd'] }}"
|
|
|
hawkular-metrics.password: >
|
|
|
{{ hawkular_secrets['hawkular-metrics.pwd'] }}
|
|
|
when: name not in metrics_secrets.stdout_lines
|