With this update, the Validation Framework provides a configuration file in which you can set parameters for particular use. You can find an example of this file at the root of the code source or in the default location:
`/etc/validation.cfg`.
+
You can use the default file in `/etc/` or use your own file and provide it to the CLI with the argument `--config`.
+
When you use a configuration file there is an order for the variables precedence. The following order is the order of variable precedence:
+
* User's CLI arguments
* Configuration file
* Default interval values
Description of problem:
Since the VF has a proper CLI included in validations-libs, it make sense to implement a validation.cfg config file in order to provide severals parameters through it.
For a 1st iteration the goals will be:
* the used of ConfigParser python builtin to avoid too much dependencies and links with other Openstack projects.
* a minimal set of sections: default / ansible_runner / ansible_environment
The default will be the settings for the CLI parameters.
Ansible Runner, a way to override the ansible runner options
Ansible Environment will expose all the Ansible env variables available in Ansible so the user can edit, update, configure them without export each time those values.
* The precedence of the parameters will be as Ansible CLI does:
* User CLI parameters take precedence on all the other values
* The config is loaded on each run if found, and will override the default parameters
example:
config file:
[default]
validation_dir = /home/foo
$ validation run --validation foo --validation-dir /foo/bar
-> validation_dir is /foo/bar
$ validation run --validation foo
-> validation_dir is /home/foo
Config file not found:
$ validation run --validation foo
-> validation_dir is /usr/share/ansible/validation-playbooks
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Release of components for Red Hat OpenStack Platform 17.0 (Wallaby)), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHEA-2022:6543
Description of problem: Since the VF has a proper CLI included in validations-libs, it make sense to implement a validation.cfg config file in order to provide severals parameters through it. For a 1st iteration the goals will be: * the used of ConfigParser python builtin to avoid too much dependencies and links with other Openstack projects. * a minimal set of sections: default / ansible_runner / ansible_environment The default will be the settings for the CLI parameters. Ansible Runner, a way to override the ansible runner options Ansible Environment will expose all the Ansible env variables available in Ansible so the user can edit, update, configure them without export each time those values. * The precedence of the parameters will be as Ansible CLI does: * User CLI parameters take precedence on all the other values * The config is loaded on each run if found, and will override the default parameters example: config file: [default] validation_dir = /home/foo $ validation run --validation foo --validation-dir /foo/bar -> validation_dir is /foo/bar $ validation run --validation foo -> validation_dir is /home/foo Config file not found: $ validation run --validation foo -> validation_dir is /usr/share/ansible/validation-playbooks