Bug 1970252 - Migrate the role-addition playbook to a proper Ansible Role for creating new Validation
Summary: Migrate the role-addition playbook to a proper Ansible Role for creating new ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-validations
Version: 17.0 (Wallaby)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Alpha
: 17.0
Assignee: Gaël Chamoulaud
QA Contact: David Rosenfeld
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-10 07:39 UTC by Gaël Chamoulaud
Modified: 2022-09-21 12:16 UTC (History)
6 users (show)

Fixed In Version: openstack-tripleo-validations-14.1.2-0.20210619001812.70028b6.el8ost
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-09-21 12:15:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 791977 0 None MERGED Introduce new Ansible validation_init role. 2021-06-10 07:39:58 UTC
OpenStack gerrit 795098 0 None MERGED Introduce new Ansible validation_init role. 2021-06-18 10:11:47 UTC
Red Hat Issue Tracker OSP-4507 0 None None None 2022-01-04 10:21:25 UTC
Red Hat Issue Tracker VALFRWK-499 0 None None None 2022-01-04 10:21:21 UTC
Red Hat Issue Tracker VALFRWK-550 0 None None None 2022-01-04 10:21:24 UTC
Red Hat Product Errata RHEA-2022:6543 0 None None None 2022-09-21 12:16:42 UTC

Description Gaël Chamoulaud 2021-06-10 07:39:58 UTC
Until now, the creation of a new validation was done with a standalone Ansible playbook:

$ cd tripleo-validations
$ export NEWROLENAME=my_new_validation
$ ansible-playbook -i localhost, role-addition.yml -e role_name=${NEWROLENAME}

The role-addition.yml playbook should be migrated to an Ansible role called validation_init, including the following features:
1- One or multiple Molecule scenario(s) to validate the functioning of the latter
2- Being able to create a new validation for development purpose (with sphinx documentation and CI molecule job configuration)
3- Being able to create a new validation without the sphinx documentation and CI parts to allow operators/customers to create their own custom validations through the CLI in a near future.

To create a new validation (point 2 above), the process will be the following:

$ git clone https://opendev.org/openstack/tripleo-validations
$ cd tripleo-validations
$ export ANSIBLE_ROLES_PATH="${PWD}/roles"
$ export NEWROLENAME=my_new_val
$ ansible-playbook -i localhost, role-addition.yml -e validation_init_role_name=my_new_val

By default, the new role will be created in tripleo-validations/roles/tripleo_my_new_val directory from a skeleton and one playbook will be added in tripleo-validations/playbooks/tripleo-my-new-val.yaml.

It will also add a new job entry into the zuul.d/molecule.yaml:

- job:
    files:
      - ^roles/tripleo_my_new_val/.*
      - ^tests/prepare-test-host.yml
      - ^ci/playbooks/pre.yml
      - ^ci/playbooks/run.yml
      - ^molecule-requirements.txt
    name: tripleo-validations-centos-8-molecule-tripleo_my_new_val
    parent: tripleo-validations-centos-8-base
    vars:
      tripleo_validations_role_name: tripleo_my_new_val

And the job name will be added into the check and gate section at the top of the molecule.yaml file.

- project:
    check:
      jobs:
        - tripleo-validations-centos-8-molecule-tripleo_my_new_val
    gate:
      jobs:
        - tripleo-validations-centos-8-molecule-tripleo_my_new_val

Finally it will add a role documentation file at doc/source/roles/role-tripleo_my_new_val.rst

To create a new validation (point 3 above), the process will be the following:

$ git clone https://opendev.org/openstack/tripleo-validations
$ cd tripleo-validations
$ export ANSIBLE_ROLES_PATH="${PWD}/roles"
$ export NEWROLENAME=my_new_val
$ ansible-playbook -i localhost, role-addition.yml -e validation_init_role_name=my_new_val -e validation_init_enabling_ci=false

Only the new role and the new playbook will be created:
- tripleo-validations/roles/tripleo_my_new_val
- tripleo-validations/playbooks/tripleo-my-new-val.yaml

No modification in zuul.d/molecule.yaml will be done and no doc/source/roles/role-tripleo_my_new_val.rst file will be created.

Comment 8 errata-xmlrpc 2022-09-21 12:15:48 UTC
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


Note You need to log in before you can comment on or make changes to this bug.