aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshuai chen <chenshuai@huawei.com>2016-09-08 02:24:08 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-09-08 02:24:08 +0000
commit18c5212df117296dbd43e36a75d51485f5ae5cde (patch)
tree11838c89202cb20a867681a4bf25f227ee9db734
parentaf5806f65e1cd6db7d8933417ab43f4f94b9b3f4 (diff)
parentbebb1b1bf66a9c63a2e00365938be68e00cb452f (diff)
Merge "Bug fix for tacker installation"
-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]