[validation_init] add new metadata keys in the playbook template

This patch adds two new metadata keys to the playbook creation step when
initializing a new Validation:
- categories: A list of technical tags or domains
- products: A list of targeted products (here mainly TripleO)

This patch is also part of the Validation Metadata Evolution for the
Validations Framework.

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Change-Id: Ia41a0e05b1074d72bfcc23b43d61f65a43758fe7
(cherry picked from commit d691f30633)
This commit is contained in:
Gael Chamoulaud (Strider) 2021-06-16 16:16:10 +02:00 committed by Gael Chamoulaud
parent 033e70c575
commit 4156b6154e
2 changed files with 86 additions and 1 deletions

View File

@ -93,6 +93,65 @@ groups. Here is, for example, how to have a validation be part of the
- pre-deployment
- hardware
The validations can be categorized by technical domain and can belong to one or
multiple categories. The categorization is depending on what the validation is
checking on the hosts. For example, if a validation checks some networking
related configuration and needs to get configuration items from the
undercloud.conf file, you will have to put `networking` and `undercloud-config` in
the ``categories`` metadata key:
.. code-block:: yaml
metadata:
groups:
- pre-deployment
- hardware
categories:
- networking
- undercloud-config
.. note::
The ``categories`` are not restricted to a list as for the ``groups``
present in the ``groups.yaml`` file, but it could be for example:
* ``networking``
* ``compute``
* ``baremetal``
* ``provisioning``
* ``database``
* ``os``
* ``system``
* ``packaging``
* ``kernel``
* ``security``
* ``tls-everywhere``
* ``dns``
* ``dhcp``
* ``dnsmasq``
* ``webserver``
* ``storage``
* ``ha``
* ``clustering``
* ``undercloud-config``
* etc ...
The validations should be linked to a product. Every validations hosted in
``tripleo-validations`` should get at least ``tripleo`` in the ``products``
metadata key:
.. code-block:: yaml
metadata:
groups:
- pre-deployment
- hardware
categories:
- networking
- undercloud-config
products:
- tripleo
``roles`` include the Ansible role, which contains all the tasks to run,
associated to this validation. Each task is a YAML dictionary that must at
minimum contain a name and a module to use. Module can be any module that ships
@ -282,6 +341,12 @@ in there:
groups:
- prep
- pre-introspection
categories:
- os
- system
- ram
products:
- tripleo
The ``hosts`` key will tell which server should the validation run on. The
@ -299,7 +364,7 @@ the same indentation as ``hosts`` and ``vars``:
.. code-block:: yaml
roles:
- undercloud-ram
- undercloud-ram
Now let's create the ``undercloud-ram`` Ansible role which will contain the
necessary task(s) for checking if the Undercloud has the mininum amount of RAM
@ -417,6 +482,8 @@ the ``vars`` section:
name: ...
description: ...
groups: ...
categories: ...
products: ...
minimum_ram_gb: 16
Make sure it's on the same indentation level as ``metadata``.

View File

@ -105,6 +105,24 @@
- pre-update-run
- pre-update-converge
- post-update
categories:
- networking
- compute
- baremetal
- provisioning
- database
- os
- system
- packaging
- kernel
- security
- webserver
- storage
- ha
- clustering
- undercloud-config
products:
- tripleo
{{ validation_init_prefix }}_{{ _role_name }}_debug: false
roles:
- {{ validation_init_prefix }}_{{ _role_name }}