Don't modify case of role names in inventory

When doing --limit <role> for ansible-playbook, it's quite unintuitive
as you need to know to change the case, I would prefer if we made
these groups match exactly with what is in the roles_data.yaml and
output by the heat RoleData outputs.

Change-Id: I2bba5f66e653d9ec4e26f74887261c8541054800
This commit is contained in:
Steven Hardy 2017-07-21 14:02:47 +01:00
parent e6ebdd37bd
commit 25a20b672c
12 changed files with 18 additions and 18 deletions

View File

@ -149,8 +149,8 @@ class TripleoInventory(object):
if hostnames: if hostnames:
names = hostnames.get(HOST_NETWORK) or [] names = hostnames.get(HOST_NETWORK) or []
shortnames = [n.split(".%s." % HOST_NETWORK)[0] for n in names] shortnames = [n.split(".%s." % HOST_NETWORK)[0] for n in names]
children.append(role.lower()) children.append(role)
ret[role.lower()] = { ret[role] = {
'children': sorted(shortnames), 'children': sorted(shortnames),
'vars': { 'vars': {
'ansible_ssh_user': 'heat-admin', 'ansible_ssh_user': 'heat-admin',
@ -177,8 +177,8 @@ class TripleoInventory(object):
roles_by_service = self.get_roles_by_service( roles_by_service = self.get_roles_by_service(
self.stack_outputs.get('EnabledServices', {})) self.stack_outputs.get('EnabledServices', {}))
for service, roles in roles_by_service.items(): for service, roles in roles_by_service.items():
service_children = [role.lower() for role in roles service_children = [role for role in roles
if ret.get(role.lower()) is not None] if ret.get(role) is not None]
if service_children: if service_children:
ret[service.lower()] = { ret[service.lower()] = {
'children': service_children, 'children': service_children,

View File

@ -166,12 +166,12 @@ class TestInventory(base.TestCase):
'vars': {'deploy_server_id': 'b'}}, 'vars': {'deploy_server_id': 'b'}},
'c-2': {'hosts': ['x.x.x.3'], 'c-2': {'hosts': ['x.x.x.3'],
'vars': {'deploy_server_id': 'c'}}, 'vars': {'deploy_server_id': 'c'}},
'compute': { 'Compute': {
'children': ['cp-0'], 'children': ['cp-0'],
'vars': {'ansible_ssh_user': 'heat-admin', 'vars': {'ansible_ssh_user': 'heat-admin',
'bootstrap_server_id': 'a', 'bootstrap_server_id': 'a',
'role_name': 'Compute'}}, 'role_name': 'Compute'}},
'controller': { 'Controller': {
'children': ['c-0', 'c-1', 'c-2'], 'children': ['c-0', 'c-1', 'c-2'],
'vars': {'ansible_ssh_user': 'heat-admin', 'vars': {'ansible_ssh_user': 'heat-admin',
'bootstrap_server_id': 'a', 'bootstrap_server_id': 'a',
@ -180,13 +180,13 @@ class TestInventory(base.TestCase):
'vars': {'deploy_server_id': 'd'}}, 'vars': {'deploy_server_id': 'd'}},
'cs-0': {'hosts': ['z.z.z.1'], 'cs-0': {'hosts': ['z.z.z.1'],
'vars': {'deploy_server_id': 'e'}}, 'vars': {'deploy_server_id': 'e'}},
'customrole': { 'CustomRole': {
'children': ['cs-0'], 'children': ['cs-0'],
'vars': {'ansible_ssh_user': 'heat-admin', 'vars': {'ansible_ssh_user': 'heat-admin',
'bootstrap_server_id': 'a', 'bootstrap_server_id': 'a',
'role_name': 'CustomRole'}}, 'role_name': 'CustomRole'}},
'overcloud': { 'overcloud': {
'children': ['compute', 'controller', 'customrole']}, 'children': ['Compute', 'Controller', 'CustomRole']},
'undercloud': { 'undercloud': {
'hosts': ['localhost'], 'hosts': ['localhost'],
'vars': {'ansible_connection': 'local', 'vars': {'ansible_connection': 'local',

View File

@ -1,5 +1,5 @@
--- ---
- hosts: controller - hosts: Controller
vars: vars:
metadata: metadata:
name: Check the status of the ceph cluster name: Check the status of the ceph cluster

View File

@ -1,5 +1,5 @@
--- ---
- hosts: undercloud, controller - hosts: undercloud, Controller
vars: vars:
metadata: metadata:
Name: Verify that keystone admin token is disabled. Name: Verify that keystone admin token is disabled.

View File

@ -1,5 +1,5 @@
--- ---
- hosts: controller - hosts: Controller
vars: vars:
metadata: metadata:
name: Check controller ulimits name: Check controller ulimits

View File

@ -1,5 +1,5 @@
--- ---
- hosts: controller - hosts: Controller
vars: vars:
metadata: metadata:
name: HAProxy configuration name: HAProxy configuration

View File

@ -1,5 +1,5 @@
--- ---
- hosts: controller - hosts: Controller
vars: vars:
metadata: metadata:
name: MySQL Open Files Limit name: MySQL Open Files Limit

View File

@ -1,5 +1,5 @@
--- ---
- hosts: controller - hosts: Controller
vars: vars:
metadata: metadata:
name: Neutron Sanity Check name: Neutron Sanity Check

View File

@ -1,5 +1,5 @@
--- ---
- hosts: compute - hosts: Compute
vars: vars:
metadata: metadata:
name: Verify NoOpFirewallDriver is set in Nova name: Verify NoOpFirewallDriver is set in Nova

View File

@ -1,5 +1,5 @@
--- ---
- hosts: controller - hosts: Controller
vars: vars:
metadata: metadata:
name: Check the status of the pacemaker cluster name: Check the status of the pacemaker cluster

View File

@ -1,5 +1,5 @@
--- ---
- hosts: controller - hosts: Controller
vars: vars:
metadata: metadata:
name: Rabbitmq limits name: Rabbitmq limits

View File

@ -1,6 +1,6 @@
--- ---
- name: Validate stonith devices - name: Validate stonith devices
hosts: controller hosts: Controller
vars: vars:
metadata: metadata:
name: stonith-exists name: stonith-exists