This section creates the clouds.yaml file from

undercloud/overcloud credentials .
This is for use by pythonsdk api for OSP
connection and querrying.
This will allow us to run the same rally/sts tests on
the OSP deployment whether it was deployed by
Infrared or Quickstart.

Change-Id: I82e3fd04282506f706f91bfd399795f92612cf36
This commit is contained in:
pkomarov 2018-02-26 13:18:51 +02:00
parent f41bd7f805
commit ed71ae7e7c
1 changed files with 52 additions and 1 deletions

View File

@ -24,8 +24,59 @@
# - include_role:
# name: instance-ha
#This executes all from the undercloud itself:
#This creates the clouds.yaml file from undercloud/overcloud credentials
#for use in pythonsdk api for osp connection and querrying:
- name: create clouds.yaml for pythonsdk api
hosts: undercloud
tasks:
- name: get undercloud variables
shell: |
for key in $( set | awk '{FS="="} /^OS_/ {print $1}' ); do unset $key ; done
source /home/stack/stackrc
echo -n "undercloud: {'auth': { 'auth-url': '$OS_AUTH_URL', 'username': '$OS_USERNAME', 'password': '$OS_PASSWORD', 'project-name': '${OS_PROJECT_NAME:-$OS_TENANT_NAME}' }}"
register: cloud_details
- name: create clouds.yaml if doesn't exist
blockinfile:
content: 'clouds:'
dest: " /home/stack/clouds.yaml"
marker: "#{mark} HEADER"
create: yes
- name: insert undercloud parameters
blockinfile:
dest: " /home/stack/clouds.yaml"
block: |5
{{ cloud_details.stdout|from_yaml|to_nice_yaml(indent=4) }}
insertbefore: "#END undercloud SECTION"
marker: "#{mark} undercloud PARAMETERS"
- name: get overcloud variables
shell: |
for key in $( set | awk '{FS="="} /^OS_/ {print $1}' ); do unset $key ; done
source /home/stack/overcloudrc
echo -n "overcloud: {'auth': { 'auth-url': '$OS_AUTH_URL', 'username': '$OS_USERNAME', 'password': '$OS_PASSWORD', 'project-name': '${OS_PROJECT_NAME:-$OS_TENANT_NAME}' }}"
register: cloud_details
- name: create clouds.yaml if doesn't exist
blockinfile:
content: 'clouds:'
dest: " /home/stack/clouds.yaml"
marker: "#{mark} HEADER"
create: yes
- name: insert overcloud parameters
blockinfile:
dest: " /home/stack/clouds.yaml"
block: |5
{{ cloud_details.stdout|from_yaml|to_nice_yaml(indent=4) }}
insertbefore: "#END overcloud SECTION"
marker: "#{mark} overcloud PARAMETERS"
#This executes all from the undercloud itself:
- name: Configure Instance HA
hosts: undercloud