Merge "Fix to check the result of undercloud_debug validation"

This commit is contained in:
Zuul 2022-08-08 11:27:54 +00:00 committed by Gerrit Code Review
commit 30a94616f9
2 changed files with 11 additions and 3 deletions

View File

@ -35,12 +35,14 @@
include_role:
name: undercloud_debug
vars:
debug_check: false
debug_check: true
- name: Should fail due to bad value
block:
- include_role:
name: undercloud_debug
vars:
debug_check: false
rescue:
- name: Clear host errors

View File

@ -1,5 +1,5 @@
---
- name: Check the services for debug flag
- name: Get the services for debug flag
become: true
validations_read_ini:
path: "{{ item }}"
@ -8,4 +8,10 @@
ignore_missing_file: true
register: config_result
with_items: "{{ services_conf_files }}"
failed_when: "debug_check|bool == config_result.value|bool"
- name: Check the services for debug flag
fail:
msg: >
debug_check is set to {{ debug_check }} and the result of
validation is {{ config_result.results[0].value }}
failed_when: "debug_check|bool != config_result.results[0].value|bool"