Target AIO swift vars at specific containers

The variables defined in etc/openstack_deploy/conf.d/swift.yml are
added as hostvars by the dynamic inventory script. Currently the vars
are being added to hosts that do not require them.

There is a variable called limit_container_types that is used by the
dynamic inventory to filter the hosts to which variables are assigned.
This script makes use of that variable so that only swift hosts have
these variables set.

The dynamic inventory script checks to see if the limit_container_types
string is in the container name as the method of filtering. This means
that the AIO host, aio1, does not get swift_vars assigned to it. This
commit alters the filter so that the component is checked instead of the
container name.

Change-Id: I945594a55ce058d822b941d08eb0ad9c5614db15
Closes-bug: #1472261
This commit is contained in:
git-harry 2015-07-14 16:47:17 +01:00
parent 36640a8f43
commit 1ef256a308
2 changed files with 3 additions and 1 deletions

View File

@ -19,6 +19,7 @@ swift-proxy_hosts:
ip: 172.29.236.100
container_vars:
swift_proxy_vars:
limit_container_types: swift_proxy
read_affinity: "r1=100"
write_affinity: "r1"
write_affinity_node_count: "1 * replicas"
@ -27,5 +28,6 @@ swift_hosts:
ip: 172.29.236.100
container_vars:
swift_vars:
limit_container_types: swift
zone: 0
region: 1

View File

@ -272,7 +272,7 @@ def _append_to_host_groups(inventory, container_type, assignment, host_type,
'limit_container_types', None
)
if limit is None or limit in container:
if limit is None or (component and limit in component):
hdata[_keys] = options