aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYifei Xue <xueyifei@huawei.com>2016-08-30 19:30:11 +0800
committerYifei Xue <xueyifei@huawei.com>2016-08-30 23:22:09 +0800
commitbebb1b1bf66a9c63a2e00365938be68e00cb452f (patch)
treea3064a95f77f17fcb3a875f5455f5e33e2295989
parent0e622c06737e9da4a97ca86452b9ebc23e8a330b (diff)
Bug fix for tacker installation
JIRA: COMPASS-430 Change-Id: I622b092dac3d77d4094cc470b8eeb9b0628d83e9 Signed-off-by: Yifei Xue <xueyifei@huawei.com>
-rwxr-xr-xdeploy/adapters/ansible/roles/tacker/tasks/tacker_controller.yml29
1 files changed, 29 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/roles/tacker/tasks/tacker_controller.yml b/deploy/adapters/ansible/roles/tacker/tasks/tacker_controller.yml
index 564b5506..4e92557d 100755
--- a/deploy/adapters/ansible/roles/tacker/tasks/tacker_controller.yml
+++ b/deploy/adapters/ansible/roles/tacker/tasks/tacker_controller.yml
@@ -46,8 +46,13 @@
src: "haproxy-tacker-cfg.j2"
dest: "/tmp/haproxy-tacker.cfg"
+- name: get the current haproxy configuration
+ shell: cat /etc/haproxy/haproxy.cfg
+ register: ha_cfg
+
- name: "combination of the haproxy configuration"
shell: "cat /tmp/haproxy-tacker.cfg >> /etc/haproxy/haproxy.cfg"
+ when: ha_cfg.stdout.find('8888') == -1
- name: "delete temporary configuration file"
file:
@@ -65,6 +70,30 @@
mysql -e "grant all on tacker.* to 'tacker'@'%' identified by 'TACKER_DBPASS';";
when: inventory_hostname == haproxy_hosts.keys()[0]
+- name: get the openstack user info
+ shell: . /opt/admin-openrc.sh; openstack user list
+ register: user_info
+
+- name: get the openstack service info
+ shell: . /opt/admin-openrc.sh; openstack service list
+ register: service_info
+
+- name: get the openstack endpoint info
+ shell: . /opt/admin-openrc.sh; openstack endpoint list
+ register: endpoint_info
+
+- name: delete the existed tacker endpoint
+ shell: . /opt/admin-openrc.sh; openstack endpoint delete $(openstack endpoint list | grep tacker | awk '{print $2}')
+ when: endpoint_info.stdout.find('tacker') != -1 and inventory_hostname == haproxy_hosts.keys()[0]
+
+- name: delete the existed tacker service
+ shell: . /opt/admin-openrc.sh; openstack service delete tacker
+ when: service_info.stdout.find('tacker') != -1 and inventory_hostname == haproxy_hosts.keys()[0]
+
+- name: delete the existed tacker user
+ shell: . /opt/admin-openrc.sh; openstack user delete tacker
+ when: user_info.stdout.find('tacker') != -1 and inventory_hostname == haproxy_hosts.keys()[0]
+
- name: create tacker user with admin privileges
shell: . /opt/admin-openrc.sh; openstack user create --password console tacker; openstack role add --project service --user tacker admin;
when: inventory_hostname == haproxy_hosts.keys()[0]