Files
tripleo-validations/roles/check_network_gateway/tasks/main.yml
Cédric Jeanneret ceb0f75182 Replace all references to the old role name
This change replaces all of the roles references in our various files with the
new role name. This is being done because Ansible no longer allows hyphens in
role names.

TODO: (gchamoul) Remove healthcheck-service-status once this patch is
merged. Tripleo Jobs are RED due to THT trying to execute this
validation as inflight one but it has been renamed healthcheck_service_status.

Co-Authored-by: Gael Chamoulaud <gchamoul@redhat.com>
Change-Id: I19bb587ece403f86ddd0bbe174c282326500cfd3
2020-01-23 17:25:43 +01:00

41 lines
1.2 KiB
YAML

---
- name: Get the path of tripleo undercloud config file
become: true
hiera:
name: "tripleo_undercloud_conf_file"
- name: Get the local_subnet name from the undercloud_conf file
become: true
validations_read_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
validations_read_ini:
path: "{{ tripleo_undercloud_conf_file }}"
section: "{% if local_subnet.value %}{{ local_subnet.value }}{% else %}ctlplane-subnet{% endif %}"
key: gateway
ignore_missing_file: true
register: gateway
- name: Get local_ip value from the undercloud.conf file
become: true
validations_read_ini:
path: "{{ tripleo_undercloud_conf_file }}"
section: DEFAULT
key: local_ip
ignore_missing_file: true
register: local_ip
- name: Test network_gateway if different from local_ip
icmp_ping:
host: "{{ gateway.value | default('0.0.0.0', true) }}"
when: >
"local_ip.value | default('0.0.0.0', true) | ipaddr('address')"
!=
"gateway.value | default('0.0.0.0', true) | ipaddr('address')"