From bebb1b1bf66a9c63a2e00365938be68e00cb452f Mon Sep 17 00:00:00 2001 From: Yifei Xue Date: Tue, 30 Aug 2016 19:30:11 +0800 Subject: Bug fix for tacker installation JIRA: COMPASS-430 Change-Id: I622b092dac3d77d4094cc470b8eeb9b0628d83e9 Signed-off-by: Yifei Xue --- .../roles/tacker/tasks/tacker_controller.yml | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'deploy') 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] -- cgit 1.2.3-korg