From d1051c8e556a060910bfde67dc9e61385b702e5b Mon Sep 17 00:00:00 2001 From: ToprHarley Date: Mon, 18 Feb 2019 19:02:03 +0100 Subject: [PATCH] Convert interface names to underscores Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1540881 Signed-off-by: Tomas Petr (cherry picked from commit 573adce7dd4f306c384b3308c8049ae49ef59716) --- roles/ceph-validate/tasks/check_eth_mon.yml | 6 +++--- roles/ceph-validate/tasks/check_eth_rgw.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/ceph-validate/tasks/check_eth_mon.yml b/roles/ceph-validate/tasks/check_eth_mon.yml index cb800c290..ce42be48b 100644 --- a/roles/ceph-validate/tasks/check_eth_mon.yml +++ b/roles/ceph-validate/tasks/check_eth_mon.yml @@ -9,18 +9,18 @@ fail: msg: "{{ monitor_interface }} is not active on {{ inventory_hostname }}" when: - - not hostvars[inventory_hostname]['ansible_' + monitor_interface]['active'] + - not hostvars[inventory_hostname]['ansible_' + (monitor_interface | replace('-', '_'))]['active'] - name: "fail if {{ monitor_interface }} does not have any ip v4 address on {{ inventory_hostname }}" fail: msg: "{{ monitor_interface }} does not have any IPv4 address on {{ inventory_hostname }}" when: - ip_version == "ipv4" - - hostvars[inventory_hostname]['ansible_' + monitor_interface]['ipv4'] is not defined + - hostvars[inventory_hostname]['ansible_' + (monitor_interface | replace('-', '_'))]['ipv4'] is not defined - name: "fail if {{ monitor_interface }} does not have any ip v6 address on {{ inventory_hostname }}" fail: msg: "{{ monitor_interface }} does not have any IPv6 address on {{ inventory_hostname }}" when: - ip_version == "ipv6" - - hostvars[inventory_hostname]['ansible_' + monitor_interface]['ipv6'] is not defined \ No newline at end of file + - hostvars[inventory_hostname]['ansible_' + (monitor_interface | replace('-', '_'))]['ipv6'] is not defined diff --git a/roles/ceph-validate/tasks/check_eth_rgw.yml b/roles/ceph-validate/tasks/check_eth_rgw.yml index 987eb8ebe..d9fff4860 100644 --- a/roles/ceph-validate/tasks/check_eth_rgw.yml +++ b/roles/ceph-validate/tasks/check_eth_rgw.yml @@ -9,18 +9,18 @@ fail: msg: "{{ radosgw_interface }} is not active on {{ inventory_hostname }}" when: - - hostvars[inventory_hostname]['ansible_' + radosgw_interface]['active'] == "false" + - hostvars[inventory_hostname]['ansible_' + (radosgw_interface | replace('-', '_'))]['active'] == "false" - name: "fail if {{ radosgw_interface }} does not have any ip v4 address on {{ inventory_hostname }}" fail: msg: "{{ radosgw_interface }} does not have any IPv4 address on {{ inventory_hostname }}" when: - ip_version == "ipv4" - - hostvars[inventory_hostname]['ansible_' + radosgw_interface]['ipv4'] is not defined + - hostvars[inventory_hostname]['ansible_' + (radosgw_interface | replace('-', '_'))]['ipv4'] is not defined - name: "fail if {{ radosgw_interface }} does not have any ip v6 address on {{ inventory_hostname }}" fail: msg: "{{ radosgw_interface }} does not have any IPv6 address on {{ inventory_hostname }}" when: - ip_version == "ipv6" - - hostvars[inventory_hostname]['ansible_' + radosgw_interface]['ipv6'] is not defined \ No newline at end of file + - hostvars[inventory_hostname]['ansible_' + (radosgw_interface | replace('-', '_'))]['ipv6'] is not defined -- 2.39.5