validations-libs
A collection of python libraries for the Validation Framework
The validations will help detect issues early in the deployment process and prevent field engineers from wasting time on misconfiguration or hardware issues in their environments.
Free software: Apache_license
Documentation: https://docs.openstack.org/validations-libs/latest/
Bugs - Upstream: https://bugs.launchpad.net/tripleo/+bugs?field.tag=validations
Bugs - Downstream: https://bugzilla.redhat.com/buglist.cgi?component=validations-libs&product=Red%20Hat%20OpenStack
Development Environment Setup
Vagrantfiles for CentOS and Ubuntu have been provided for convenience; simply copy one into your desired location and rename to Vagrantfile, then run:
vagrant up
Once complete you will have a clean development environment ready to go for working with Validation Framework.
podman Quickstart
A Dockerfile is provided at the root of the Validations Library project in order to quickly set and hack the Validation Framework, on a equivalent of a single machine. Build the container from the Dockerfile by running:
podman build -t "vf:dockerfile" .
From the validations-libs repo directory.
Since the podman build uses code sourced from the buildah project to build container images. It is also possible to build an image using:
buildah bud -t "vf:dockerfile" .
Then you can run the container and start to run some builtin Validations:
podman run -ti vf:dockerfile /bin/bash
Then run validations:
validation.py run --validation check-ftype,512e --inventory /etc/ansible/hosts
Skip list
You can provide a file with a list of Validations to skip via the run command:
validation.py run --validation check-ftype,512e --inventory /etc/ansible/hosts --skiplist my-skip-list.yaml
This file should be formed as:
validation-name: hosts: targeted_hostname reason: reason to ignore the file lp: bug number
The framework will skip the validation against the hosts key. In order to skip the validation on every hosts, you can set all value such as:
hosts: all
If no hosts key is provided for a given validation, it will be considered as hosts: all.
Community Validations
Community Validations enable a sysadmin to create and execute validations unique to their environment through the validation CLI.
The Community Validations will be created and stored in an unique, standardized and known place, called 'community-validations/', in the home directory of the non-root user which is running the CLI.
The first level of the mandatory structure will be the following (assuming the operator uses the pennywise user):
/home/pennywise/community-validations
├── library
├── lookup_plugins
├── playbooks
└── roles
How To Create A New Community Validation
[pennywise@localhost]$ validation init my-new-validation
Validation config file found: /etc/validation.cfg
New role created successfully in /home/pennywise/community-validations/roles/my_new_validation
New playbook created successfully in /home/pennywise/community-validations/playbooks/my-new-validation.yaml
The community-validations/ directory should have been created in the home directory of the pennywise user.
[pennywise@localhost ~]$ cd && tree community-validations/
community-validations/
├── library
├── lookup_plugins
├── playbooks
│ └── my-new-validation.yaml
└── roles
└── my_new_validation
├── defaults
│ └── main.yml
├── files
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── README.md
├── tasks
│ └── main.yml
├── templates
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
13 directories, 9 files
Your new community validation should also be available when listing all the validations available on your system.
[pennywise@localhost ~]$ validation list
Validation config file found: /etc/validation.cfg
+-------------------------------+--------------------------------+--------------------------------+-----------------------------------+---------------+
| ID | Name | Groups | Categories | Products |
+-------------------------------+--------------------------------+--------------------------------+-----------------------------------+---------------+
| 512e | Advanced Format 512e Support | ['prep', 'pre-deployment'] | ['storage', 'disk', 'system'] | ['common'] |
| check-cpu | Verify if the server fits the | ['prep', 'backup-and-restore', | ['system', 'cpu', 'core', 'os'] | ['common'] |
| | CPU core requirements | 'pre-introspection'] | | |
| check-disk-space-pre-upgrade | Verify server fits the disk | ['pre-upgrade'] | ['system', 'disk', 'upgrade'] | ['common'] |
| | space requirements to perform | | | |
| | an upgrade | | | |
| check-disk-space | Verify server fits the disk | ['prep', 'pre-introspection'] | ['system', 'disk', 'upgrade'] | ['common'] |
| | space requirements | | | |
| check-ftype | XFS ftype check | ['pre-upgrade'] | ['storage', 'xfs', 'disk'] | ['common'] |
| check-latest-packages-version | Check if latest version of | ['pre-upgrade'] | ['packages', 'rpm', 'upgrade'] | ['common'] |
| | packages is installed | | | |
| check-ram | Verify the server fits the RAM | ['prep', 'pre-introspection', | ['system', 'ram', 'memory', 'os'] | ['common'] |
| | requirements | 'pre-upgrade'] | | |
| check-selinux-mode | SELinux Enforcing Mode Check | ['prep', 'pre-introspection'] | ['security', 'selinux'] | ['common'] |
| dns | Verify DNS | ['pre-deployment'] | ['networking', 'dns'] | ['common'] |
| no-op | NO-OP validation | ['no-op'] | ['noop', 'dummy', 'test'] | ['common'] |
| ntp | Verify all deployed servers | ['post-deployment'] | ['networking', 'time', 'os'] | ['common'] |
| | have their clock synchronised | | | |
| service-status | Ensure services state | ['prep', 'backup-and-restore', | ['systemd', 'container', | ['common'] |
| | | 'pre-deployment', 'pre- | 'docker', 'podman'] | |
| | | upgrade', 'post-deployment', | | |
| | | 'post-upgrade'] | | |
| validate-selinux | validate-selinux | ['backup-and-restore', 'pre- | ['security', 'selinux', 'audit'] | ['common'] |
| | | deployment', 'post- | | |
| | | deployment', 'pre-upgrade', | | |
| | | 'post-upgrade'] | | |
| my-new-validation | Brief and general description | ['prep', 'pre-deployment'] | ['networking', 'security', 'os', | ['community'] |
| | of the validation | | 'system'] | |
+-------------------------------+--------------------------------+--------------------------------+-----------------------------------+---------------+
To get only the list of your community validations, you can filter by products:
[pennywise@localhost]$ validation list --product community
Validation config file found: /etc/validation.cfg
+-------------------+------------------------------------------+----------------------------+------------------------------------------+---------------+
| ID | Name | Groups | Categories | Products |
+-------------------+------------------------------------------+----------------------------+------------------------------------------+---------------+
| my-new-validation | Brief and general description of the | ['prep', 'pre-deployment'] | ['networking', 'security', 'os', | ['community'] |
| | validation | | 'system'] | |
+-------------------+------------------------------------------+----------------------------+------------------------------------------+---------------+
How To Develop Your New Community Validation
As you can see above, the validation init CLI sub command has generated a new Ansible role by using ansible-galaxy and a new Ansible playbook in the community-validations/ directory.
You are now able to implement your own validation by editing the generated playbook and adding your ansible tasks in the associated role.
For people not familiar with how to write a validation, get started with this documentation.
Metadata
Release files for validations-libs 1.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| validations-libs-1.9.0.tar.gz | 118.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| validations_libs-1.9.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 263.4 kB
Release files / validations-libs-1.9.0.tar.gz
| Download URL | validations-libs-1.9.0.tar.gz |
|---|---|
| Size | 118.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b776868e83c1e0ed5fc126e7a22e5ab92cee1981e1385e6d5ce84cdb48dc9914
|
|
BLAKE2b-256 checksum How to use checksums |
3d3daa9e9fe6b41fdfe91e34eac48e17aec20c4436a2c50432c68a51ef2640aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Release files / validations_libs-1.9.0-py3-none-any.whl
| Download URL | validations_libs-1.9.0-py3-none-any.whl |
|---|---|
| Size | 144.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
48003a08bfe598d2e11dacc88b0599d07a30b796c31effe9bf9098ef523a0a66
|
|
BLAKE2b-256 checksum How to use checksums |
5d173a2234e8cd647810ef28f4d5a6b721f840d353ce512c5ecdbb6ce6acc5e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Security for validations-libs 1.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.