From 02a6d993509ac395165c504dba7b92c4f2eb907c Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Fri, 16 Oct 2015 11:28:42 -0400 Subject: Fix etcd cert generation when etcd_interface is defined - Refactor certificate generation to properly accept overrides of etcd_interface per host and set the certificate SANS and peer URLs properly. - Add sanity checking to user-set values of etcd_interface to provide a better error message --- roles/etcd_common/tasks/main.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 roles/etcd_common/tasks/main.yml (limited to 'roles/etcd_common/tasks/main.yml') diff --git a/roles/etcd_common/tasks/main.yml b/roles/etcd_common/tasks/main.yml new file mode 100644 index 000000000..cd108495d --- /dev/null +++ b/roles/etcd_common/tasks/main.yml @@ -0,0 +1,13 @@ +--- +- set_fact: + etcd_host_int_map: "{{ lookup('template', '../templates/host_int_map.j2') | from_yaml }}" + +- fail: + msg: "Interface {{ item.value.etcd_interface }} not found on host {{ item.key }}" + when: "'etcd_interface' in item.value and 'interface' not in item.value" + with_dict: etcd_host_int_map + +- fail: + msg: IPv4 address not found for {{ item.value.interface.device }} on host {{ item.key }} + when: "'ipv4' not in item.value.interface or 'address' not in item.value.interface.ipv4" + with_dict: etcd_host_int_map -- cgit v1.2.3