Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1970252

Summary: Migrate the role-addition playbook to a proper Ansible Role for creating new Validation
Product: Red Hat OpenStack Reporter: Gaël Chamoulaud <gchamoul>
Component: openstack-tripleo-validationsAssignee: Gaël Chamoulaud <gchamoul>
Status: CLOSED ERRATA QA Contact: David Rosenfeld <drosenfe>
Severity: medium Docs Contact:
Priority: medium    
Version: 17.0 (Wallaby)CC: jjoyce, jpodivin, jschluet, scohen, slinaber, tvignaud
Target Milestone: AlphaKeywords: Triaged
Target Release: 17.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-tripleo-validations-14.1.2-0.20210619001812.70028b6.el8ost Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-09-21 12:15:48 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:

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