diff --git a/roles/tripleo_validator_list/README.md b/roles/tripleo_validator_list/README.md new file mode 100644 index 0000000..140b67f --- /dev/null +++ b/roles/tripleo_validator_list/README.md @@ -0,0 +1,43 @@ +tripleo_validator_list +===================== + +A role to list tripleo validations + +Requirements +------------ + +None. + +Role Variables +-------------- + +* `tripleo_validator_list_debug`: (Boolean) Flag to print out the delete command. Default: False + +Output Variables +---------------- + +* `tripleo_validator_list_result`: Ansible shell execution results + +Dependencies +------------ + +None. + +Example Playbook +---------------- + +Example validator list playbook + +```yaml +- hosts: undercloud + gather_facts: true + tasks: + - name: List validations + import_role: + name: tripleo_validator_list +``` + +License +------- + +Apache-2.0 diff --git a/roles/tripleo_validator_list/defaults/main.yml b/roles/tripleo_validator_list/defaults/main.yml new file mode 100644 index 0000000..f8b3a8a --- /dev/null +++ b/roles/tripleo_validator_list/defaults/main.yml @@ -0,0 +1,2 @@ +--- +tripleo_validator_list_debug: false diff --git a/roles/tripleo_validator_list/meta/main.yml b/roles/tripleo_validator_list/meta/main.yml new file mode 100644 index 0000000..1487e9d --- /dev/null +++ b/roles/tripleo_validator_list/meta/main.yml @@ -0,0 +1,42 @@ +--- +# Copyright 2020 Red Hat, Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +galaxy_info: + author: OpenStack + description: TripleO Operator Role -- tripleo_validator_list + company: Red Hat + license: Apache-2.0 + min_ansible_version: 2.8 + # + # Provide a list of supported platforms, and for each platform a list of versions. + # If you don't wish to enumerate all versions for a particular platform, use 'all'. + # To view available platforms and versions (or releases), visit: + # https://galaxy.ansible.com/api/v1/platforms/ + # + platforms: + - name: CentOS + versions: + - 7 + - 8 + + galaxy_tags: + - tripleo + + +# List your role dependencies here, one per line. Be sure to remove the '[]' above, +# if you add dependencies to this list. +dependencies: [] diff --git a/roles/tripleo_validator_list/molecule/default/converge.yml b/roles/tripleo_validator_list/molecule/default/converge.yml new file mode 100644 index 0000000..ef7c7e3 --- /dev/null +++ b/roles/tripleo_validator_list/molecule/default/converge.yml @@ -0,0 +1,20 @@ +--- +- name: Converge + hosts: all + collections: + - tripleo.operator + vars: + openstack_bin: echo + tripleo_os_cloud: undercloud + tripleo_validator_run_debug: true + tasks: + + - name: Check parameter "tripleo_validator_list" as a list + include_role: + name: "tripleo_validator_list" + + - name: Assert "tripleo_validator_list" + assert: + that: + - tripleo_validator_list_result.stdout == + "tripleo validator list" diff --git a/roles/tripleo_validator_list/molecule/default/molecule.yml b/roles/tripleo_validator_list/molecule/default/molecule.yml new file mode 100644 index 0000000..2841806 --- /dev/null +++ b/roles/tripleo_validator_list/molecule/default/molecule.yml @@ -0,0 +1,19 @@ +--- +driver: + name: delegated + options: + managed: false + ansible_connection_options: + ansible_connection: local +log: true +platforms: + - name: instance +provisioner: + name: ansible +scenario: + name: default + test_sequence: + - prepare + - syntax + - converge + - verify diff --git a/roles/tripleo_validator_list/molecule/default/prepare.yml b/roles/tripleo_validator_list/molecule/default/prepare.yml new file mode 100644 index 0000000..63bb6ab --- /dev/null +++ b/roles/tripleo_validator_list/molecule/default/prepare.yml @@ -0,0 +1,8 @@ +--- +- name: Prepare + hosts: all + tasks: + + - name: Include molecule prep + include_role: + name: test_molecule_prep diff --git a/roles/tripleo_validator_list/tasks/main.yml b/roles/tripleo_validator_list/tasks/main.yml new file mode 100644 index 0000000..e54dc47 --- /dev/null +++ b/roles/tripleo_validator_list/tasks/main.yml @@ -0,0 +1,18 @@ +--- +- name: Setup validator list facts + set_fact: + _validator_list_cmd: >- + {{ openstack_bin }} tripleo validator list + +- name: Show debug information + when: + tripleo_validator_list_debug|bool + block: + - name: Show validator list command + debug: + var: _validator_list_cmd + +- name: List validation(s) + shell: "{{ _validator_list_cmd }}" + register: tripleo_validator_list_result + changed_when: true diff --git a/zuul.d/molecule.yaml b/zuul.d/molecule.yaml index 2f63dfe..1050850 100644 --- a/zuul.d/molecule.yaml +++ b/zuul.d/molecule.yaml @@ -62,6 +62,7 @@ - tripleo-operator-molecule-tripleo_undercloud_minion_install - tripleo-operator-molecule-tripleo_undercloud_minion_upgrade - tripleo-operator-molecule-tripleo_undercloud_upgrade + - tripleo-operator-molecule-tripleo_validator_list - tripleo-operator-molecule-tripleo_validator_run gate: @@ -126,6 +127,7 @@ - tripleo-operator-molecule-tripleo_undercloud_minion_install - tripleo-operator-molecule-tripleo_undercloud_minion_upgrade - tripleo-operator-molecule-tripleo_undercloud_upgrade + - tripleo-operator-molecule-tripleo_validator_list - tripleo-operator-molecule-tripleo_validator_run - job: @@ -1005,6 +1007,21 @@ - job: files: + - ^roles/tripleo_validator_list/.* + - ^bindep.txt + - ^galaxy.yml + - ^requirements.txt + - ^setup.cfg + - ^test-requirements.txt + - ^tox.ini + name: tripleo-operator-molecule-tripleo_validator_list + parent: tripleo-operator-molecule-base + vars: + tox_extra_args: tripleo_validator_list + +- job: + files: + - ^roles/tripleo_validator_run/.* - ^bindep.txt - ^galaxy.yml - ^molecule-requirements.txt