summaryrefslogtreecommitdiffstats
path: root/playbooks/common
diff options
context:
space:
mode:
authorAndrew Butcher <abutcher@redhat.com>2015-11-08 12:34:23 -0500
committerAndrew Butcher <abutcher@redhat.com>2015-11-08 12:34:23 -0500
commit53988dfe57a2c061f111cdb3bfe464796a49dba0 (patch)
treedd78a3a492d6d81e2df4c0468ddceeb681cb9f54 /playbooks/common
parent334c20584080abaaee9551b25a0efed1526e5e72 (diff)
downloadopenshift-53988dfe57a2c061f111cdb3bfe464796a49dba0.tar.gz
openshift-53988dfe57a2c061f111cdb3bfe464796a49dba0.tar.bz2
openshift-53988dfe57a2c061f111cdb3bfe464796a49dba0.tar.xz
openshift-53988dfe57a2c061f111cdb3bfe464796a49dba0.zip
Conditionals for flannel etcd client certs.
Diffstat (limited to 'playbooks/common')
-rw-r--r--playbooks/common/openshift-node/config.yml11
1 files changed, 8 insertions, 3 deletions
diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml
index ba96b4a78..8da9e231f 100644
--- a/playbooks/common/openshift-node/config.yml
+++ b/playbooks/common/openshift-node/config.yml
@@ -45,6 +45,7 @@
- node.etcd-client.crt
- node.etcd-ca.crt
register: g_external_etcd_flannel_cert_stat_result
+ when: groups.oo_etcd_to_config is defined and groups.oo_etcd_to_config and (openshift.common.use_flannel | bool)
- set_fact:
etcd_client_flannel_certs_missing: "{{ g_external_etcd_flannel_cert_stat_result.results
| map(attribute='stat.exists')
@@ -69,11 +70,13 @@
hosts: oo_first_etcd
vars:
etcd_generated_certs_dir: /etc/etcd/generated_certs
- etcd_needing_client_certs: "{{ hostvars
- | oo_select_keys(groups['oo_nodes_to_config'])
- | oo_filter_list(filter_attr='etcd_client_flannel_certs_missing') }}"
sync_tmpdir: "{{ hostvars.localhost.mktemp.stdout }}"
pre_tasks:
+ - set_fact:
+ etcd_needing_client_certs: "{{ hostvars
+ | oo_select_keys(groups['oo_nodes_to_config'])
+ | oo_filter_list(filter_attr='etcd_client_flannel_certs_missing') | default([]) }}"
+ when: etcd_client_flannel_certs_missing is defined and etcd_client_flannel_certs_missing
roles:
- role: etcd_certificates
post_tasks:
@@ -84,6 +87,7 @@
args:
creates: "{{ etcd_generated_certs_dir }}/{{ item.etcd_cert_subdir }}.tgz"
with_items: etcd_needing_client_certs
+ when: etcd_client_flannel_certs_missing is defined and etcd_client_flannel_certs_missing
- name: Retrieve the etcd cert tarballs
fetch:
src: "{{ etcd_generated_certs_dir }}/{{ item.etcd_cert_subdir }}.tgz"
@@ -92,6 +96,7 @@
fail_on_missing: yes
validate_checksum: yes
with_items: etcd_needing_client_certs
+ when: etcd_client_flannel_certs_missing is defined and etcd_client_flannel_certs_missing
- name: Copy the external etcd flannel certs to the nodes
hosts: oo_nodes_to_config