|
@@ -13,22 +13,26 @@
|
|
|
hostnames: hawkular-cassandra
|
|
|
changed_when: no
|
|
|
|
|
|
+- slurp: src={{ openshift_metrics_certs_dir|quote }}/hawkular-cassandra-truststore.pwd
|
|
|
+ register: cassandra_truststore_password
|
|
|
+
|
|
|
- name: check existing aliases on the hawkular-cassandra truststore
|
|
|
shell: >
|
|
|
keytool -noprompt -list
|
|
|
-keystore {{ openshift_metrics_certs_dir|quote }}/hawkular-cassandra.truststore
|
|
|
- -storepass "$(<
|
|
|
- '{{ openshift_metrics_certs_dir|quote }}/hawkular-cassandra-truststore.pwd')"
|
|
|
+ -storepass {{cassandra_truststore_password.content | b64decode }}
|
|
|
| sed -n '7~2s/,.*$//p'
|
|
|
register: hawkular_cassandra_truststore_aliases
|
|
|
changed_when: false
|
|
|
|
|
|
+- slurp: src={{ openshift_metrics_certs_dir|quote }}/hawkular-metrics-truststore.pwd
|
|
|
+ register: hawkular_truststore_password
|
|
|
+
|
|
|
- name: check existing aliases on the hawkular-metrics truststore
|
|
|
shell: >
|
|
|
keytool -noprompt -list
|
|
|
-keystore {{ openshift_metrics_certs_dir|quote }}/hawkular-metrics.truststore
|
|
|
- -storepass "$(<
|
|
|
- '{{ openshift_metrics_certs_dir|quote }}/hawkular-metrics-truststore.pwd')"
|
|
|
+ -storepass {{ hawkular_truststore_password.content | b64decode }}
|
|
|
| sed -n '7~2s/,.*$//p'
|
|
|
register: hawkular_metrics_truststore_aliases
|
|
|
changed_when: false
|
|
@@ -39,8 +43,7 @@
|
|
|
-alias hawkular-metrics
|
|
|
-file '{{ openshift_metrics_certs_dir }}/hawkular-metrics.crt'
|
|
|
-keystore '{{ openshift_metrics_certs_dir }}/hawkular-cassandra.truststore'
|
|
|
- -storepass "$(<
|
|
|
- '{{ openshift_metrics_certs_dir }}/hawkular-cassandra-truststore.pwd')"
|
|
|
+ -storepass {{cassandra_truststore_password.content | b64decode }}
|
|
|
when: >
|
|
|
'hawkular-metrics' not in
|
|
|
hawkular_cassandra_truststore_aliases.stdout_lines
|
|
@@ -51,8 +54,7 @@
|
|
|
-alias hawkular-cassandra
|
|
|
-file '{{ openshift_metrics_certs_dir }}/hawkular-cassandra.crt'
|
|
|
-keystore '{{ openshift_metrics_certs_dir }}/hawkular-metrics.truststore'
|
|
|
- -storepass "$(<
|
|
|
- '{{ openshift_metrics_certs_dir }}/hawkular-metrics-truststore.pwd')"
|
|
|
+ -storepass {{ hawkular_truststore_password.content | b64decode }}
|
|
|
when: >
|
|
|
'hawkular-cassandra' not in
|
|
|
hawkular_metrics_truststore_aliases.stdout_lines
|
|
@@ -63,8 +65,7 @@
|
|
|
-alias hawkular-cassandra
|
|
|
-file '{{ openshift_metrics_certs_dir }}/hawkular-cassandra.crt'
|
|
|
-keystore '{{ openshift_metrics_certs_dir }}/hawkular-cassandra.truststore'
|
|
|
- -storepass "$(<
|
|
|
- '{{ openshift_metrics_certs_dir }}/hawkular-cassandra-truststore.pwd')"
|
|
|
+ -storepass {{cassandra_truststore_password.content | b64decode }}
|
|
|
when: >
|
|
|
'hawkular-cassandra' not in
|
|
|
hawkular_cassandra_truststore_aliases.stdout_lines
|
|
@@ -75,8 +76,7 @@
|
|
|
-alias '{{ item }}'
|
|
|
-file '{{ openshift_metrics_certs_dir }}/ca.crt'
|
|
|
-keystore '{{ openshift_metrics_certs_dir }}/hawkular-cassandra.truststore'
|
|
|
- -storepass "$(<
|
|
|
- '{{ openshift_metrics_certs_dir }}/hawkular-cassandra-truststore.pwd')"
|
|
|
+ -storepass {{cassandra_truststore_password.content | b64decode }}
|
|
|
with_items:
|
|
|
- ca
|
|
|
- metricca
|
|
@@ -89,8 +89,7 @@
|
|
|
-alias '{{ item }}'
|
|
|
-file '{{ openshift_metrics_certs_dir }}/ca.crt'
|
|
|
-keystore '{{ openshift_metrics_certs_dir }}/hawkular-metrics.truststore'
|
|
|
- -storepass "$(<
|
|
|
- '{{ openshift_metrics_certs_dir }}/hawkular-metrics-truststore.pwd')"
|
|
|
+ -storepass {{ hawkular_truststore_password.content | b64decode }}
|
|
|
with_items:
|
|
|
- ca
|
|
|
- metricca
|