Fix authentication issue in Swift ring rebalance playbook

Not all OS_* environment variables are set when running from within
Mistral, especially not OS_PASSWORD. However, tripleo-ansible-inventory
sets the storage_url and token for the undercloud Swift instance, and
thus using this directly speeds up the whole process (no re-auth
required) and works both when used from within Mistral as well as
directly using ansible-playbook.

Change-Id: Idd1a65af504e8e9bcafd5e5cee8b245ed0c27e86
This commit is contained in:
Christian Schwede 2017-12-21 19:59:29 +00:00
parent eb2389c354
commit a34c13b438
1 changed files with 2 additions and 7 deletions

View File

@ -9,13 +9,8 @@
base_directory: "/var/lib/config-data/puppet-generated/swift/"
rebalance_is_safe: False
environment:
# TODO (cschwede): Remove v3 suffix once
# https://review.openstack.org/#/c/473740/ is included in image
OS_AUTH_URL: "{{ lookup('env','OS_AUTH_URL') }}v3"
OS_USERNAME: "{{ lookup('env','OS_USERNAME') }}"
OS_PROJECT_NAME: "{{ lookup('env','OS_PROJECT_NAME') }}"
OS_PASSWORD: "{{ lookup('env','OS_PASSWORD') }}"
OS_IDENTITY_API_VERSION: "{{ lookup('env','OS_IDENTITY_API_VERSION') }}"
OS_STORAGE_URL: "{{ hostvars.localhost.undercloud_swift_url }}"
OS_AUTH_TOKEN: "{{ hostvars.localhost.os_auth_token }}"
tasks:
- name: Get reference ring checksum
run_once: true