Bug 2150298

Summary: oslo_config_validator fails with Error: The task includes an option with an undefined variable
Product: Red Hat OpenStack Reporter: Jiri Podivin <jpodivin>
Component: openstack-tripleo-validationsAssignee: Jiri Podivin <jpodivin>
Status: CLOSED CURRENTRELEASE QA Contact: nlevinki <nlevinki>
Severity: medium Docs Contact:
Priority: medium    
Version: 17.0 (Wallaby)CC: jjoyce, jschluet, mciecier, slinaber, tvignaud
Target Milestone: z2Keywords: Bugfix, Triaged
Target Release: 17.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-tripleo-validations-14.2.2-0.20230206150303.37bfae3.el9osttrunk Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-02-22 14:16:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2127966    
Bug Blocks:    

Description Jiri Podivin 2022-12-02 12:26:18 UTC
Description of problem:
Validation can fail on controller with a syntax error.

Issue is possibly caused by accessing attribute without appropriate prior check.

Trace:
------
                        "controller-0": {
                            "_ansible_no_log": false,
                            "action": "set_fact",
                            "failed": true,
                            "msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'os_vif_ovs'\n\nThe error appears to be in '/usr/share/ansible/roles/oslo_config_validator/tasks/opt_data_format.yml': line 39, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Building list of replaceable data\n  ^ here\n"
                        }
                    },


Version-Release number of selected component (if applicable):


How reproducible:
Consistently

Steps to Reproduce:
1. Execute `validation run --validation oslo-config-validator` with appropriate inventory
2.
3.

Actual results:
Validation fails ungracefully.

Expected results:
Validation should succeed or gracefully fail.

Additional info:
Can only manifest if the validation execution gets this far.