summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Kucia <m.kucia@partner.samsung.com>2018-12-19 15:39:35 +0100
committerMaciej Kucia <maciej@kucia.net>2019-02-18 17:28:15 +0000
commit4a127d4bd92769843c3593c7f1653c3395e61bcf (patch)
tree9324d68f527369530d655da4665f5c57e02d80ef
parent23c439db0a0e25aa1e3348ba0ccd299efeee7f7a (diff)
designate: Correctly match hostnamesHEADmaster
'in' expresion matches substrings, therefore it is possible that following expression will fail: inventory_hostname in groups['groupname'][0] for example when: inventory_hostname = 'my-host-a' groups['groupname'][0] = 'my-host-a1' The result is running task on multiple hosts rather than single one. Such action might result in playbook failure Change-Id: Ibe2d5ca2f9502a8140a895ab3ac7abc5076ce2ff Signed-off-by: Maciej Kucia <m.kucia@partner.samsung.com>
Notes
Notes (review): Code-Review+2: Surya Prakash (spsurya) <singh.surya64mnnit@gmail.com> Code-Review+2: Eduardo Gonzalez <dabarren@gmail.com> Code-Review+1: weizj <wzj334965317@outlook.com> Workflow+1: Eduardo Gonzalez <dabarren@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Tue, 19 Feb 2019 10:23:25 +0000 Reviewed-on: https://review.openstack.org/635527 Project: openstack/kolla-ansible Branch: refs/heads/master
-rw-r--r--ansible/roles/designate/tasks/deploy.yml2
-rw-r--r--ansible/roles/designate/tasks/update_pools.yml2
2 files changed, 2 insertions, 2 deletions
diff --git a/ansible/roles/designate/tasks/deploy.yml b/ansible/roles/designate/tasks/deploy.yml
index 373af0e..bf212d9 100644
--- a/ansible/roles/designate/tasks/deploy.yml
+++ b/ansible/roles/designate/tasks/deploy.yml
@@ -21,4 +21,4 @@
21 meta: flush_handlers 21 meta: flush_handlers
22 22
23- include_tasks: update_pools.yml 23- include_tasks: update_pools.yml
24 when: inventory_hostname in groups['designate-worker'][0] 24 when: inventory_hostname == groups['designate-worker'][0]
diff --git a/ansible/roles/designate/tasks/update_pools.yml b/ansible/roles/designate/tasks/update_pools.yml
index dc9692a..c0602d7 100644
--- a/ansible/roles/designate/tasks/update_pools.yml
+++ b/ansible/roles/designate/tasks/update_pools.yml
@@ -1,4 +1,4 @@
1--- 1---
2- name: Update DNS pools 2- name: Update DNS pools
3 command: docker exec -t designate_worker designate-manage pool update --file /etc/designate/pools.yaml 3 command: docker exec -t designate_worker designate-manage pool update --file /etc/designate/pools.yaml
4 when: inventory_hostname in groups['designate-worker'][0] 4 when: inventory_hostname == groups['designate-worker'][0]