summaryrefslogtreecommitdiffstats
path: root/lib/ansible/playbooks/post_deploy_undercloud.yml
diff options
context:
space:
mode:
authorFeng Pan <fpan@redhat.com>2018-03-13 14:05:39 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-03-13 14:05:39 +0000
commitb83b80ebb8b1419d8fa39554fedbddfc92039b3c (patch)
treeb3bcdc1a398fc60bc799dd9f7e3b9fe182a23bf5 /lib/ansible/playbooks/post_deploy_undercloud.yml
parent67e7b3c76402445d7e62d5953d661794ec1f7c6d (diff)
parent560883c38365028abb082c35d335e00fb7adfa97 (diff)
Merge "Adds OS_REGION_NAME into overcloudrc files"
Diffstat (limited to 'lib/ansible/playbooks/post_deploy_undercloud.yml')
-rw-r--r--lib/ansible/playbooks/post_deploy_undercloud.yml15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/ansible/playbooks/post_deploy_undercloud.yml b/lib/ansible/playbooks/post_deploy_undercloud.yml
index 2e1bf0f3..a8f1cd55 100644
--- a/lib/ansible/playbooks/post_deploy_undercloud.yml
+++ b/lib/ansible/playbooks/post_deploy_undercloud.yml
@@ -77,6 +77,21 @@
with_items:
- overcloudrc
- overcloudrc.v3
+ - name: Register OS Region
+ shell: "{{ overcloudrc }} && openstack endpoint list -c Region -f json"
+ register: region
+ become: yes
+ become_user: stack
+ - name: Write Region into overcloudrc
+ lineinfile:
+ line: "export OS_REGION_NAME={{(region.stdout|from_json)[1]['Region']}}"
+ regexp: 'OS_REGION_NAME'
+ path: "/home/stack/{{ item }}"
+ become: yes
+ become_user: stack
+ with_items:
+ - overcloudrc
+ - overcloudrc.v3
- name: Undercloud NAT - MASQUERADE interface
iptables:
table: nat