From 1ef256a3082759213e41ffb136596001e88de4d2 Mon Sep 17 00:00:00 2001 From: git-harry Date: Tue, 14 Jul 2015 16:47:17 +0100 Subject: [PATCH] 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 --- etc/openstack_deploy/conf.d/swift.yml.aio | 2 ++ playbooks/inventory/dynamic_inventory.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/etc/openstack_deploy/conf.d/swift.yml.aio b/etc/openstack_deploy/conf.d/swift.yml.aio index dae9fbcceb..a4595ac3a9 100644 --- a/etc/openstack_deploy/conf.d/swift.yml.aio +++ b/etc/openstack_deploy/conf.d/swift.yml.aio @@ -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 diff --git a/playbooks/inventory/dynamic_inventory.py b/playbooks/inventory/dynamic_inventory.py index f1209ce2a4..417c5e534a 100755 --- a/playbooks/inventory/dynamic_inventory.py +++ b/playbooks/inventory/dynamic_inventory.py @@ -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