Add env var for custom ssh user

W/o an env var, a dynamic inventory can't be invoked for a custom
user. Ansible uses the same ANSIBLE_SSH_USER so the value will
be aligned to both.

Related-bug: #1734298

Change-Id: Ieddbb4c87d88888f78d494ff670db907bce4fd78
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
This commit is contained in:
Bogdan Dobrelya 2017-11-24 17:56:40 +01:00
parent 7e9d8e538a
commit fde797ca14
2 changed files with 4 additions and 1 deletions

View File

@ -3,3 +3,5 @@ fixes:
- The ansible_ssh_user in the generated inventory by
tripleo-ansible-inventory is now configurable instead
of hardcoded to heat-admin. The default is still heat-admin.
Use the `--ansible_ssh_user` param or the `ANSIBLE_SSH_USER`
env var to define a custom value.

View File

@ -47,7 +47,8 @@ opts = [
'OS_PROJECT_NAME', os.environ.get('OS_TENANT_NAME'))),
cfg.StrOpt('cacert', default=os.environ.get('OS_CACERT')),
cfg.StrOpt('plan', default=os.environ.get('TRIPLEO_PLAN_NAME')),
cfg.StrOpt('ansible_ssh_user', default='heat-admin'),
cfg.StrOpt('ansible_ssh_user', default=os.environ.get('ANSIBLE_SSH_USER',
'heat-admin')),
]