Allows to use custom role name for validations

The tripleo-ansible-inventory script uses the role names in order to
group the different hosts.

Since we can use custom roles, the fixed "Controller" and others aren't
relevant in such cases.

Ansible allows to use parameter for the "hosts" value in playbooks,
allowing us to call the validations using this command:

openstack tripleo validator run --validation haproxy \
  --extra-vars '{"controller_rolename": "MyCustomController"}'

(or use the --extra-vars-file in order to avoid in-line JSON)

This patch also correct a non-existent group call, Database. The closest
we have is the "mysql" group in the inventory - let's reflect it in
order to avoid useless warning(s).

Change-Id: I3bec039283fe5df56771d84fff5bd5940fd149d8
(cherry picked from commit ec0465e481)
This commit is contained in:
Cédric Jeanneret 2020-08-12 07:54:30 +02:00 committed by Cédric Jeanneret (Tengu)
parent b7d679d936
commit 088c4a1301
10 changed files with 14 additions and 10 deletions

View File

@ -1,5 +1,7 @@
---
- hosts: undercloud, Controller
- hosts:
- undercloud
- "{{ controller_rolename | default('Controller') }}"
vars:
metadata:
name: Verify that keystone admin token is disabled

View File

@ -1,5 +1,5 @@
---
- hosts: Controller
- hosts: "{{ controller_rolename | default('Controller') }}"
vars:
metadata:
name: Check controller ulimits

View File

@ -1,5 +1,5 @@
---
- hosts: Controller
- hosts: "{{ controller_rolename | default('Controller') }}"
vars:
metadata:
name: HAProxy configuration

View File

@ -1,5 +1,7 @@
---
- hosts: Controller, Database
- hosts:
- "{{ controller_rolename | default('Controller') }}"
- mysql
vars:
metadata:
name: MySQL Open Files Limit

View File

@ -1,5 +1,5 @@
---
- hosts: Controller
- hosts: "{{ controller_rolename | default('Controller') }}"
gather_facts: false
vars:
metadata:

View File

@ -1,5 +1,5 @@
---
- hosts: Controller
- hosts: "{{ controller_rolename | default('Controller') }}"
vars:
metadata:
name: Nova Event Callback Configuration Check

View File

@ -1,5 +1,5 @@
---
- hosts: ComputeOvsDpdk
- hosts: "{{ compute_ovsdpdk_rolename | default('ComputeOvsDpdk') }}"
vars:
metadata:
name: Validates OVS DPDK PMD cores from all NUMA nodes.

View File

@ -1,5 +1,5 @@
---
- hosts: Controller
- hosts: "{{ controller_rolename | default('Controller') }}"
vars:
metadata:
name: Check the status of the pacemaker cluster

View File

@ -1,5 +1,5 @@
---
- hosts: Controller
- hosts: "{{ controller_rolename | default('Controller') }}"
vars:
metadata:
name: Rabbitmq limits

View File

@ -1,5 +1,5 @@
---
- hosts: Controller
- hosts: "{{ controller_rolename | default('Controller') }}"
vars:
metadata:
name: Validate stonith devices