Get the undercloud.conf file from where it actually is

Since the deprecation of Mistral in THT, we can't get the path of this
file by using hiera anymore. This patch will get it directly in its
original place ($HOME/undercloud.conf) by using *ansible_env.HOME* fact.

Impacted Validations:
 playbooks/ceilometerdb-size.yaml
 playbooks/check-network-gateway.yaml
 playbooks/check-undercloud-conf.yaml
 playbooks/container-status.yaml
 playbooks/ctlplane-ip-range.yaml
 playbooks/dhcp-provisioning.yaml
 playbooks/neutron-sanity-check.yaml
 playbooks/tls-everywhere-pre-deployment.yaml
 playbooks/tls-everywhere-prep.yaml
 playbooks/undercloud-heat-purge-deleted.yaml
 playbooks/undercloud-process-count.yaml
 playbooks/undercloud-tokenflush.yaml

This patch also fixes every molecule tests accordingly.

NB: check_network_gateway molecule test is now voting in the CI.

Closes-Bug: 1907553

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Change-Id: Iafc38c6cd99edee89ae0305f09fe7080df148331
(cherry picked from commit bc31f762c2)
(cherry picked from commit f4ea045e42)
(cherry picked from commit a3eafbd6a2)
This commit is contained in:
Gael Chamoulaud (Strider) 2020-12-09 16:02:10 +01:00
parent 1a737336c5
commit 18325474cb
No known key found for this signature in database
GPG Key ID: 4119D0305C651D66
20 changed files with 134 additions and 184 deletions

View File

@ -5,14 +5,17 @@
Panko has been deprecated since the Train Release. Panko has been deprecated since the Train Release.
The 'ceilometerdb-size' validation is now considered as deprecated too. The 'ceilometerdb-size' validation is now considered as deprecated too.
- name: Get the path of tripleo undercloud config file - name: Ensure we get needed facts
become: true setup:
hiera: gather_subset:
name: "tripleo_undercloud_conf_file" - '!all'
- '!any'
- '!min'
- env
- name: Check if telemetry services are enabled - name: Check if telemetry services are enabled
validations_read_ini: validations_read_ini:
path: "{{ tripleo_undercloud_conf_file }}" path: "{{ ansible_env.HOME }}/undercloud.conf"
section: DEFAULT section: DEFAULT
key: enable_telemetry key: enable_telemetry
register: enable_telemetry register: enable_telemetry

View File

@ -18,7 +18,6 @@
- name: Converge - name: Converge
hosts: all hosts: all
gather_facts: false gather_facts: false
tasks: tasks:
- name: successful check with ctlplane-subnet - name: successful check with ctlplane-subnet
include_role: include_role:
@ -26,12 +25,12 @@
- name: override undercloud.conf - name: override undercloud.conf
copy: copy:
dest: /undercloud.conf dest: "{{ ansible_env.HOME }}/undercloud.conf"
content: | content: |
[DEFAULT] [DEFAULT]
local_subnet = 192.168.254.0/24 local_subnet = 192.168.254.0/24
[192.168.254.0/24] [192.168.254.0/24]
gateway = 8.8.8.8 gateway = 0.0.0.0
- name: successful check with local_ip - name: successful check with local_ip
include_role: include_role:
@ -41,7 +40,7 @@
block: block:
- name: override undercloud.conf - name: override undercloud.conf
copy: copy:
dest: /undercloud.conf dest: "{{ ansible_env.HOME }}/undercloud.conf"
content: | content: |
[ctlplane-subnet] [ctlplane-subnet]
gateway = 192.168.254.254 gateway = 192.168.254.254

View File

@ -20,35 +20,17 @@
gather_facts: false gather_facts: false
tasks: tasks:
- name: install hiera - name: Ensure we get needed facts
package: setup:
name: hiera gather_subset:
- '!all'
- name: create hiera tree - '!any'
file: - '!min'
path: /etc/puppet - env
state: directory
- name: populate hiera.yaml
copy:
dest: /etc/puppet/hiera.yaml
content: |
:backends:
- yaml
:yaml:
:datadir: "/etc/puppet/"
:hierarchy:
- "common"
- name: populate hiera content
copy:
dest: /etc/puppet/common.yaml
content: |
tripleo_undercloud_conf_file: /undercloud.conf
- name: populate undercloud.conf - name: populate undercloud.conf
copy: copy:
dest: /undercloud.conf dest: "{{ ansible_env.HOME }}/undercloud.conf"
content: | content: |
[ctlplane-subnet] [ctlplane-subnet]
gateway = 8.8.8.8 gateway = 0.0.0.0

View File

@ -1,13 +1,16 @@
--- ---
- name: Get the path of tripleo undercloud config file - name: Ensure we get needed facts
become: true setup:
hiera: gather_subset:
name: "tripleo_undercloud_conf_file" - '!all'
- '!any'
- '!min'
- env
- name: Get the local_subnet name from the undercloud_conf file - name: Get the local_subnet name from the undercloud_conf file
become: true become: true
validations_read_ini: validations_read_ini:
path: "{{ tripleo_undercloud_conf_file }}" path: "{{ ansible_env.HOME }}/undercloud.conf"
section: DEFAULT section: DEFAULT
key: local_subnet key: local_subnet
ignore_missing_file: true ignore_missing_file: true
@ -16,7 +19,7 @@
- name: Get gateway value from the undercloud.conf file - name: Get gateway value from the undercloud.conf file
become: true become: true
validations_read_ini: validations_read_ini:
path: "{{ tripleo_undercloud_conf_file }}" path: "{{ ansible_env.HOME }}/undercloud.conf"
section: "{% if local_subnet.value %}{{ local_subnet.value }}{% else %}ctlplane-subnet{% endif %}" section: "{% if local_subnet.value %}{{ local_subnet.value }}{% else %}ctlplane-subnet{% endif %}"
key: gateway key: gateway
ignore_missing_file: true ignore_missing_file: true
@ -25,7 +28,7 @@
- name: Get local_ip value from the undercloud.conf file - name: Get local_ip value from the undercloud.conf file
become: true become: true
validations_read_ini: validations_read_ini:
path: "{{ tripleo_undercloud_conf_file }}" path: "{{ ansible_env.HOME }}/undercloud.conf"
section: DEFAULT section: DEFAULT
key: local_ip key: local_ip
ignore_missing_file: true ignore_missing_file: true

View File

@ -10,14 +10,17 @@
block: block:
- name: Set container_cli fact from undercloud.conf - name: Set container_cli fact from undercloud.conf
block: block:
- name: Get the path of tripleo undercloud config file - name: Ensure we get needed facts
become: true setup:
hiera: gather_subset:
name: "tripleo_undercloud_conf_file" - '!all'
- '!any'
- '!min'
- env
- name: Get container client from undercloud.conf - name: Get container client from undercloud.conf
validations_read_ini: validations_read_ini:
path: "{{ tripleo_undercloud_conf_file }}" path: "{{ ansible_env.HOME }}/undercloud.conf"
section: DEFAULT section: DEFAULT
key: container_cli key: container_cli
ignore_missing_file: true ignore_missing_file: true

View File

@ -18,36 +18,20 @@
- name: Converge - name: Converge
hosts: all hosts: all
gather_facts: false gather_facts: false
tasks: tasks:
- name: prepare directory tree for hiera - name: Ensure we get needed facts
file: setup:
path: /etc/puppet gather_subset:
state: directory - '!all'
- '!any'
- name: populate a hiera config - '!min'
copy: - env
dest: /etc/puppet/hiera.yaml
content: |
:backends:
- yaml
- json
:yaml:
:datadir: "/etc/puppet/"
:hierarchy:
- "common"
- name: populate hiera content
copy:
dest: /etc/puppet/common.yaml
content: |
tripleo_undercloud_conf_file: /undercloud.conf
- name: Test good values - name: Test good values
block: block:
- name: populate undercloud.conf with right range length - name: populate undercloud.conf with right range length
copy: copy:
dest: /undercloud.conf dest: "{{ ansible_env.HOME }}/undercloud.conf"
content: | content: |
[ctlplane-subnet] [ctlplane-subnet]
dhcp_start = 192.168.12.10 dhcp_start = 192.168.12.10
@ -59,7 +43,7 @@
block: block:
- name: populate undercloud.conf with wrong range length - name: populate undercloud.conf with wrong range length
copy: copy:
dest: /undercloud.conf dest: "{{ ansible_env.HOME }}/undercloud.conf"
content: | content: |
[ctlplane-subnet] [ctlplane-subnet]
dhcp_start = 192.168.12.10 dhcp_start = 192.168.12.10

View File

@ -24,31 +24,3 @@
package: package:
name: python*-netaddr name: python*-netaddr
state: installed state: installed
- name: install hiera
package:
name: hiera
state: installed
- name: prepare directory tree for hiera
file:
path: /etc/puppet
state: directory
- name: populate a hiera config
copy:
dest: /etc/puppet/hiera.yaml
content: |
:backends:
- yaml
- json
:yaml:
:datadir: "/etc/puppet/"
:hierarchy:
- "common"
- name: populate hiera content
copy:
dest: /etc/puppet/common.yaml
content: |
tripleo_undercloud_conf_file: /undercloud.conf

View File

@ -1,13 +1,16 @@
--- ---
- name: Get the path of tripleo undercloud config file - name: Ensure we get needed facts
become: true setup:
hiera: gather_subset:
name: "tripleo_undercloud_conf_file" - '!all'
- '!any'
- '!min'
- env
- name: Get dhcp_start value from the undercloud.conf file - name: Get dhcp_start value from the undercloud.conf file
become: true become: true
validations_read_ini: validations_read_ini:
path: "{{ tripleo_undercloud_conf_file }}" path: "{{ ansible_env.HOME }}/undercloud.conf"
section: ctlplane-subnet section: ctlplane-subnet
key: dhcp_start key: dhcp_start
ignore_missing_file: true ignore_missing_file: true
@ -17,7 +20,7 @@
- name: Get dhcp_end value from the undercloud.conf file - name: Get dhcp_end value from the undercloud.conf file
become: true become: true
validations_read_ini: validations_read_ini:
path: "{{ tripleo_undercloud_conf_file }}" path: "{{ ansible_env.HOME }}/undercloud.conf"
section: ctlplane-subnet section: ctlplane-subnet
key: dhcp_end key: dhcp_end
ignore_missing_file: true ignore_missing_file: true

View File

@ -1,10 +1,15 @@
--- ---
- name: Get the path of tripleo undercloud config file - name: Ensure we get needed facts
hiera: name="tripleo_undercloud_conf_file" setup:
gather_subset:
- '!all'
- '!any'
- '!min'
- env
- name: Gather undercloud.conf values - name: Gather undercloud.conf values
validations_read_ini: validations_read_ini:
path: "{{ tripleo_undercloud_conf_file }}" path: "{{ ansible_env.HOME }}/undercloud.conf"
section: DEFAULT section: DEFAULT
key: local_interface key: local_interface
ignore_missing_file: true ignore_missing_file: true

View File

@ -7,15 +7,18 @@
- when: "'Undercloud' in group_names" - when: "'Undercloud' in group_names"
block: block:
- name: Get the path of tripleo undercloud config file - name: Ensure we get needed facts
become: true setup:
hiera: gather_subset:
name: "tripleo_undercloud_conf_file" - '!all'
- '!any'
- '!min'
- env
- name: Get the Container CLI from the undercloud.conf file - name: Get the Container CLI from the undercloud.conf file
become: true become: true
validations_read_ini: validations_read_ini:
path: "{{ tripleo_undercloud_conf_file }}" path: "{{ ansible_env.HOME }}/undercloud.conf"
section: DEFAULT section: DEFAULT
key: container_cli key: container_cli
ignore_missing_file: true ignore_missing_file: true

View File

@ -1,17 +1,20 @@
--- ---
- name: Ensure we get needed facts
setup:
gather_subset:
- '!all'
- '!any'
- '!min'
- env
- name: Set facts for undercloud handlers to clean up - name: Set facts for undercloud handlers to clean up
set_fact: set_fact:
novajoin_temp_krb_caches: [] novajoin_temp_krb_caches: []
- name: Get the path of tripleo undercloud config file
become: true
hiera: name="tripleo_undercloud_conf_file"
check_mode: false
- name: Get the Container CLI from the undercloud.conf file (stein+) - name: Get the Container CLI from the undercloud.conf file (stein+)
become: true become: true
validations_read_ini: validations_read_ini:
path: "{{ tripleo_undercloud_conf_file }}" path: "{{ ansible_env.HOME }}/undercloud.conf"
section: DEFAULT section: DEFAULT
key: container_cli key: container_cli
register: container_cli register: container_cli

View File

@ -1,14 +1,16 @@
--- ---
- name: Get the path of tripleo undercloud config file - name: Ensure we get needed facts
become: true setup:
hiera: gather_subset:
name: "tripleo_undercloud_conf_file" - '!all'
check_mode: false - '!any'
- '!min'
- env
- name: Verify that nameservers are set in undercloud.conf - name: Verify that nameservers are set in undercloud.conf
become: true become: true
validations_read_ini: validations_read_ini:
path: "{{ tripleo_undercloud_conf_file }}" path: "{{ ansible_env.HOME }}/undercloud.conf"
section: DEFAULT section: DEFAULT
key: undercloud_nameservers key: undercloud_nameservers
ignore_missing_file: false ignore_missing_file: false
@ -57,7 +59,7 @@
- name: Get domain as set in undercloud.conf - name: Get domain as set in undercloud.conf
become: true become: true
validations_read_ini: validations_read_ini:
path: "{{ tripleo_undercloud_conf_file }}" path: "{{ ansible_env.HOME }}/undercloud.conf"
section: DEFAULT section: DEFAULT
key: overcloud_domain_name key: overcloud_domain_name
ignore_missing_file: false ignore_missing_file: false
@ -93,7 +95,7 @@
- name: Get enable_novajoin flag from undercloud.conf - name: Get enable_novajoin flag from undercloud.conf
become: true become: true
validations_read_ini: validations_read_ini:
path: "{{ tripleo_undercloud_conf_file }}" path: "{{ ansible_env.HOME }}/undercloud.conf"
section: DEFAULT section: DEFAULT
key: enable_novajoin key: enable_novajoin
ignore_missing_file: false ignore_missing_file: false

View File

@ -18,7 +18,6 @@
- name: Converge - name: Converge
hosts: all hosts: all
gather_facts: false gather_facts: false
tasks: tasks:
- name: working detection - name: working detection
include_role: include_role:
@ -28,7 +27,7 @@
block: block:
- name: Override container_cli - name: Override container_cli
copy: copy:
dest: /undercloud.conf dest: "{{ ansible_env.HOME }}/undercloud.conf"
content: | content: |
[DEFAULT] [DEFAULT]
container_cli = docker container_cli = docker

View File

@ -18,37 +18,18 @@
- name: Prepare - name: Prepare
hosts: all hosts: all
gather_facts: false gather_facts: false
tasks: tasks:
- name: install hiera - name: Ensure we get needed facts
package: setup:
name: hiera gather_subset:
- '!all'
- name: create hiera tree - '!any'
file: - '!min'
path: /etc/puppet - env
state: directory
- name: populate hiera.yaml
copy:
dest: /etc/puppet/hiera.yaml
content: |
:backends:
- yaml
:yaml:
:datadir: "/etc/puppet/"
:hierarchy:
- "common"
- name: populate hiera content
copy:
dest: /etc/puppet/common.yaml
content: |
tripleo_undercloud_conf_file: /undercloud.conf
- name: populate undercloud.conf - name: populate undercloud.conf
copy: copy:
dest: /undercloud.conf dest: "{{ ansible_env.HOME }}/undercloud.conf"
content: | content: |
[DEFAULT] [DEFAULT]
container_cli = podman container_cli = podman

View File

@ -1,12 +1,16 @@
--- ---
- name: Get the path of tripleo undercloud config file - name: Ensure we get needed facts
become: true setup:
hiera: name="tripleo_undercloud_conf_file" gather_subset:
- '!all'
- '!any'
- '!min'
- env
- name: Get the Container CLI from the undercloud.conf file - name: Get the Container CLI from the undercloud.conf file
become: true become: true
validations_read_ini: validations_read_ini:
path: "{{ tripleo_undercloud_conf_file }}" path: "{{ ansible_env.HOME }}/undercloud.conf"
section: DEFAULT section: DEFAULT
key: container_cli key: container_cli
ignore_missing_file: true ignore_missing_file: true

View File

@ -1,13 +1,16 @@
--- ---
- name: Get the path of tripleo undercloud config file - name: Ensure we get needed facts
become: true setup:
hiera: gather_subset:
name: "tripleo_undercloud_conf_file" - '!all'
- '!any'
- '!min'
- env
- name: Get the Container CLI from the undercloud.conf file - name: Get the Container CLI from the undercloud.conf file
become: true become: true
validations_read_ini: validations_read_ini:
path: "{{ tripleo_undercloud_conf_file }}" path: "{{ ansible_env.HOME }}/undercloud.conf"
section: DEFAULT section: DEFAULT
key: container_cli key: container_cli
ignore_missing_file: true ignore_missing_file: true

View File

@ -18,7 +18,6 @@
- name: Converge - name: Converge
hosts: all hosts: all
gather_facts: false gather_facts: false
tasks: tasks:
- name: working detection - name: working detection
include_role: include_role:
@ -28,7 +27,7 @@
block: block:
- name: Override container_cli - name: Override container_cli
copy: copy:
dest: /undercloud.conf dest: "{{ ansible_env.HOME }}/undercloud.conf"
content: | content: |
[DEFAULT] [DEFAULT]
container_cli = docker container_cli = docker

View File

@ -18,8 +18,15 @@
- name: Prepare - name: Prepare
hosts: all hosts: all
gather_facts: false gather_facts: false
tasks: tasks:
- name: Ensure we get needed facts
setup:
gather_subset:
- '!all'
- '!any'
- '!min'
- env
- name: install hiera - name: install hiera
package: package:
name: hiera name: hiera
@ -38,15 +45,8 @@
:yaml: :yaml:
:datadir: "/etc/puppet/" :datadir: "/etc/puppet/"
:hierarchy: :hierarchy:
- "common"
- "service_configs" - "service_configs"
- name: populate hiera content
copy:
dest: /etc/puppet/common.yaml
content: |
tripleo_undercloud_conf_file: /undercloud.conf
- name: populate service config content - name: populate service config content
copy: copy:
dest: /etc/puppet/service_configs.yaml dest: /etc/puppet/service_configs.yaml
@ -55,7 +55,7 @@
- name: populate undercloud.conf - name: populate undercloud.conf
copy: copy:
dest: /undercloud.conf dest: "{{ ansible_env.HOME }}/undercloud.conf"
content: | content: |
[DEFAULT] [DEFAULT]
container_cli = podman container_cli = podman

View File

@ -9,15 +9,18 @@
- ansible_facts['keystone::token_provider'] != 'fernet' - ansible_facts['keystone::token_provider'] != 'fernet'
- ansible_facts['keystone::token_provider'] != 'jws' - ansible_facts['keystone::token_provider'] != 'jws'
block: block:
- name: Ensure we get needed facts
- name: Get the path of tripleo undercloud config file setup:
become: true gather_subset:
hiera: name="tripleo_undercloud_conf_file" - '!all'
- '!any'
- '!min'
- env
- name: Get the Container CLI from the undercloud.conf file - name: Get the Container CLI from the undercloud.conf file
become: true become: true
validations_read_ini: validations_read_ini:
path: "{{ tripleo_undercloud_conf_file }}" path: "{{ ansible_env.HOME }}/undercloud.conf"
section: DEFAULT section: DEFAULT
key: container_cli key: container_cli
ignore_missing_file: true ignore_missing_file: true

View File

@ -257,7 +257,6 @@
parent: tripleo-validations-centos-8-base parent: tripleo-validations-centos-8-base
vars: vars:
tripleo_validations_role_name: check_network_gateway tripleo_validations_role_name: check_network_gateway
voting: false
- job: - job:
files: files:
- ^roles/undercloud_heat_purge_deleted/.* - ^roles/undercloud_heat_purge_deleted/.*