Change generate_ansible_inventory() arguments

Mistral context.security auth attributes are not same as the
keystone auth plugins. Use the attributes directly in
generate_ansible_inventory() function.

This will help us to move to using ansible module.

Change-Id: I83856119ea53e39d1891c3f7d94a4d5645da0046
This commit is contained in:
Rabi Mishra 2020-05-18 10:02:28 +05:30
parent 4349f209b9
commit d0c60a280f
3 changed files with 11 additions and 6 deletions

View File

@ -533,7 +533,9 @@ class AnsibleGenerateInventoryAction(base.TripleOAction):
heat=self.get_orchestration_client(context),
work_dir=self.work_dir,
plan=self.plan_name,
auth=context.security,
auth_url=context.security.auth_uri,
username=context.security.user_name,
project_name=context.security.project_name,
ansible_ssh_user=self.ansible_ssh_user,
undercloud_key_file=self.undercloud_key_file,
ansible_python_interpreter=self.ansible_python_interpreter,

View File

@ -382,7 +382,9 @@ class TripleoInventory(object):
yaml.dump(inventory, inventory_file, TemplateDumper)
def generate_tripleo_ansible_inventory(heat, auth,
def generate_tripleo_ansible_inventory(heat, auth_url,
username,
project_name,
cacert=None,
plan='overcloud',
work_dir=None,
@ -397,10 +399,10 @@ def generate_tripleo_ansible_inventory(heat, auth,
work_dir, 'tripleo-ansible-inventory.yaml')
inv = TripleoInventory(
hclient=heat,
auth_url=auth.auth_uri,
auth_url=auth_url,
username=username,
project_name=project_name,
cacert=cacert,
project_name=auth.project_name,
username=auth.user_name,
ansible_ssh_user=ansible_ssh_user,
undercloud_key_file=undercloud_key_file,
undercloud_connection=UNDERCLOUD_CONNECTION_SSH,

View File

@ -166,13 +166,14 @@ def deploy_stack(swift, heat, container, skip_deploy_identifier=False,
stack_is_new = stack is None
# update StackAction, DeployIdentifier and UpdateIdentifier
# update StackAction, DeployIdentifier
parameters = dict()
if not skip_deploy_identifier:
parameters['DeployIdentifier'] = int(time.time())
else:
parameters['DeployIdentifier'] = ''
parameters['StackAction'] = 'CREATE' if stack_is_new else 'UPDATE'
try: