From 49f8aad6c526445b80664130bb539140284ed3b9 Mon Sep 17 00:00:00 2001 From: Gael Chamoulaud Date: Fri, 7 Jun 2019 13:51:20 +0200 Subject: [PATCH] Sync 'validations/check-network-gateway.yaml' with the new role To be able to maintain stable branches, the validations in the 'validations' directory have to be synchronized with the new role created with the validation framework. This patch synchronizes the check-network-gateway validation. Signed-off-by: Gael Chamoulaud (cherry picked from commit c025666cee8b94f14fd795d51c1113803fb42848) (cherry picked from commit I7bb40a1f0b42cbbf5b38a3939db9140b602e5c52) Change-Id: I7bb40a1f0b42cbbf5b38a3939db9140b602e5c52 --- validations/check-network-gateway.yaml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/validations/check-network-gateway.yaml b/validations/check-network-gateway.yaml index f7271ad7d..8da4e048b 100644 --- a/validations/check-network-gateway.yaml +++ b/validations/check-network-gateway.yaml @@ -11,13 +11,23 @@ tasks: - name: Get the path of tripleo undercloud config file become: true - hiera: name="tripleo_undercloud_conf_file" + hiera: + name: "tripleo_undercloud_conf_file" + + - name: Get the local_subnet name from the undercloud_conf file + become: True + ini: + path: "{{ tripleo_undercloud_conf_file }}" + section: DEFAULT + key: local_subnet + ignore_missing_file: True + register: local_subnet - name: Get gateway value from the undercloud.conf file become: true ini: path: "{{ tripleo_undercloud_conf_file }}" - section: ctlplane-subnet + section: "{% if local_subnet.value %}{{ local_subnet.value }}{% else %}ctlplane-subnet{% endif %}" key: gateway ignore_missing_file: True register: gateway @@ -32,8 +42,9 @@ register: local_ip - name: Test network_gateway if different from local_ip - icmp_ping: host="{{ gateway.value | default('0.0.0.0') }}" + icmp_ping: + host: "{{ gateway.value | default('0.0.0.0', true) }}" when: > - "local_ip.value | default('0.0.0.0') | ipaddr('address')" + "local_ip.value | default('0.0.0.0', true) | ipaddr('address')" != - "gateway.value | default('0.0.0.0') | ipaddr('address')" + "gateway.value | default('0.0.0.0', true) | ipaddr('address')"