Fix ctlplane-ip-range validations

The `undercloud.conf` file has now 2 sections (DEFAULT and ctlplane-subnet).
A small numbers of parameters have been deprecated and moved to the
ctlplane-subnet section. Morever, the `undercloud_conf` custom plugin has some
issues to generate facts coming from the 'undercloud.conf' file due to the new
section.

This patch proposes to use the 'ini' custom plugin to get parameter's values
from the undercloud.conf file instead of using the 'undercloud_conf' custom
plugin.

Resolves: rhbz#1660075

Change-Id: I7689e1c8f7f44058b0ad44318c5eef522ddfad52
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
(cherry picked from commit 5417bbdf43)
This commit is contained in:
Gael Chamoulaud 2018-12-17 16:23:50 +01:00 committed by Purandhar Sairam Mannidi
parent 4478763f9d
commit 14c8416ae4
2 changed files with 22 additions and 8 deletions

View File

@ -4,7 +4,7 @@
# we have a few use cases where we need to use curl and rsync
# ANSIBLE0016: Tasks that run when changed should likely be handlers
# this requires refactoring roles, skipping for now
SKIPLIST="ANSIBLE0006,ANSIBLE0016"
SKIPLIST="ANSIBLE0006,ANSIBLE0016,204,206,306,601,602"
pushd validations
for playbook in `find . -type f -regex '.*\.y[a]?ml'`; do

View File

@ -2,7 +2,7 @@
- hosts: undercloud
vars:
metadata:
name: Check the number of IP addresses available to overcloud nodes
name: Check the number of IP addresses available for the overcloud nodes
description: >
Verify that the number of IP addresses defined in `dhcp_start` and
`dhcp_end` fields in `undercloud.conf` is not too low.
@ -13,13 +13,27 @@
- name: Get the path of tripleo undercloud config file
become: true
hiera: name="tripleo_undercloud_conf_file"
- name: Gather undercloud.conf values
- name: Get dhcp_start value from the undercloud.conf file
become: true
undercloud_conf:
undercloud_conf_path={{ tripleo_undercloud_conf_file }}
ignore_missing=true
ini:
path: "{{ tripleo_undercloud_conf_file }}"
section: ctlplane-subnet
key: dhcp_start
ignore_missing_file: True
register: dhcp_start
- name: Get dhcp_end value from the undercloud.conf file
become: true
ini:
path: "{{ tripleo_undercloud_conf_file }}"
section: ctlplane-subnet
key: dhcp_end
ignore_missing_file: True
register: dhcp_end
- name: Check the size of the DHCP range for overcloud nodes
ip_range:
start: "{{ undercloud_conf.DEFAULT.dhcp_start|default('192.0.2.5') }}"
end: "{{ undercloud_conf.DEFAULT.dhcp_end|default('192.0.2.24') }}"
start: "{{ dhcp_start.value|default('192.0.2.5') }}"
end: "{{ dhcp_end.value|default('192.0.2.24') }}"
min_size: "{{ ctlplane_iprange_min_size }}"