Fix a template issue related to IPv6 validation

This commit resolves a template issue due to a flawed IPv6
addressing condition check. Tasks related to DNS server ping
test are also removed as many DNS servers may not respond to
ICMP messages especially when they are behind the firewall.

Closes-Bug: 1830113
Change-Id: Ie62c102ba0a6965ff675209f9d98004038007899
Signed-off-by: Tee Ngo <tee.ngo@windriver.com>
This commit is contained in:
Tee Ngo 2019-05-22 18:04:10 -04:00
parent 95b946469a
commit 62ef323246
3 changed files with 7 additions and 37 deletions

View File

@ -227,4 +227,4 @@
path: /etc/resolv.conf
regex: "nameserver ::1"
state: absent
when: not ipv6_addressing
when: ipv6_addressing == False

View File

@ -66,11 +66,11 @@
# DNS servers config validation
- block:
# Looping over a block of tasks is not yet supported. For now, move the
# DNS validation to a seprate tasks file.
- include: validate_dns.yml dns_server={{ item }}
with_items: "{{ dns_servers }}"
- name: Check format of DNS server IP(s)
debug:
msg: "DNS Server: {{ item }}"
failed_when: item | ipaddr == False
with_items: "{{ dns_servers }}"
# Networks config validation
@ -135,7 +135,7 @@
set_fact:
localhost_name_ip_mapping: "::1\tlocalhost\tlocalhost.localdomain localhost6 localhost6.localdomain6"
when: ipv6_addressing
when: ipv6_addressing != False
- name: Fail if address allocation is misconfigured
fail:

View File

@ -1,30 +0,0 @@
---
#
# Copyright (c) 2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# SUB-TASKS DESCRIPTION:
# Validate DNS IP format and reachability
#
- block:
- name: Check format of DNS Server IP
debug:
msg: "DNS Server: {{ dns_server }}"
failed_when: dns_server | ipaddr == False
- name: Perform ping test
command: ping -w 1 {{ dns_server }}
register: ping_result
failed_when: false
- name: Fail if DNS Server is unreachable
fail:
msg: "The provided DNS Server {{ dns_server }} is unreachable."
when: ping_result.rc !=0
when: dns_server != default_dns_server
vars:
default_dns_server: 192.168.204.2