Generating an Ansible inventory using tripleo.ansible-generate-inventory fails when used during deployment/update. It does work properly when used in Mistral and the the workflow is triggered on the CLI, but when used either in Mistral or directly in TripleO it fails with an authentication error due to usage of a scoped token.
This is somewhat unfortunate, because one needs to manually generate an inventory for Ansible and can't use the builtin tripleo-ansible-inventory which sets some other useful host variables.
stderr: u'Error creating inventory: You are not authorized to perform the requested action: Using trust-scoped token to create another token. Create a new trust-scoped token instead. (HTTP 403) (Request-ID: req-9fd6679c-3009-4ee5-b4d8-edb008306ab1)\n' execute /usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py:443
2018-01-08 10:37:42.373 18337 ERROR mistral.executors.default_executor [req-ece5ecd1-5e5d-441d-8782-3b5b1c889ce3 f6137b2272494b2abf615e078a2a77be 989bade5dea74a13921dde733d574a94 - default default] Failed to run action [action_ex_id=a3da64ad-2537-4621-9996-4a256b5422ed, action_cls='<class 'mistral.actions.action_factory.AnsibleGenerateInventoryAction'>', attributes='{}', params='{}']
Unexpected error while running command.
Stderr: u'Error creating inventory: You are not authorized to perform the requested action: Using trust-scoped token to create another token. Create a new trust-scoped token instead. (HTTP 403) (Request-ID: req-9fd6679c-3009-4ee5-b4d8-edb008306ab1)\n': ProcessExecutionError: Unexpected error while running command.
Stderr: u'Error creating inventory: You are not authorized to perform the requested action: Using trust-scoped token to create another token. Create a new trust-scoped token instead. (HTTP 403) (Request-ID: req-9fd6679c-3009-4ee5-b4d8-edb008306ab1)\n'
2018-01-08 10:37:42.373 18337 ERROR mistral.executors.default_executor Traceback (most recent call last):
2018-01-08 10:37:42.373 18337 ERROR mistral.executors.default_executor File "/usr/lib/python2.7/site-packages/mistral/executors/default_executor.py", line 110, in run_action
2018-01-08 10:37:42.373 18337 ERROR mistral.executors.default_executor result = action.run(action_ctx)
2018-01-08 10:37:42.373 18337 ERROR mistral.executors.default_executor File "/usr/lib/python2.7/site-packages/tripleo_common/actions/ansible.py", line 551, in run
2018-01-08 10:37:42.373 18337 ERROR mistral.executors.default_executor log_errors=processutils.LogErrors.ALL)
2018-01-08 10:37:42.373 18337 ERROR mistral.executors.default_executor File "/usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py", line 419, in execute
2018-01-08 10:37:42.373 18337 ERROR mistral.executors.default_executor cmd=sanitized_cmd)
2018-01-08 10:37:42.373 18337 ERROR mistral.executors.default_executor ProcessExecutionError: Unexpected error while running command.
2018-01-08 10:37:42.373 18337 ERROR mistral.executors.default_executor Command: /usr/bin/tripleo-ansible-inventory --static-inventory /tmp/ansible-mistral-actionDeqUz6/tripleo-ansible-inventory --ansible_ssh_user tripleo-admin
2018-01-08 10:37:42.373 18337 ERROR mistral.executors.default_executor Exit code: 1
2018-01-08 10:37:42.373 18337 ERROR mistral.executors.default_executor Stdout: u''
2018-01-08 10:37:42.373 18337 ERROR mistral.executors.default_executor Stderr: u'Error creating inventory: You are not authorized to perform the requested action: Using trust-scoped token to create another token. Create a new trust-scoped token instead. (HTTP 403) (Request-ID: req-9fd6679c-3009-4ee5-b4d8-edb008306ab1)\n'
Related fix proposed to branch: master /review. openstack. org/533233
Review: https:/