Browse Source

Use tripleo custom stdout plugins in utils

Iff8eec43bd73bc6486f56e741e740869d1b8acbb adjusted ansible config for
custom 'tripleo_dense' and 'tripleo_profile_tasks' plugins.

That was not sufficient because of bug/1881254.

Align settings provided by run_ansible_playbook utility with that
Iff8eec43bd73bc6486f56e741e740869d1b8acbb provides for tripleo_common
shared ansible configuration module. That is to have:
- better coverage in CI jobs
- users experience as well.

Callbacks whitelist defaults switches to
tripleo_dense,tripleo_profile_tasks. And default output callback
becomes tripleo_dense.

Change-Id: I5e8bc9ac5cbf4a042b5cd7e27578092062839726
Related-Bug: #1881254
(cherry picked from commit ed470de991)
tags/13.4.0
Bogdan Dobrelya 2 months ago
committed by Emilien Macchi
parent
commit
f3ebd58f38
2 changed files with 10 additions and 11 deletions
  1. +1
    -0
      tripleoclient/constants.py
  2. +9
    -11
      tripleoclient/utils.py

+ 1
- 0
tripleoclient/constants.py View File

@@ -43,6 +43,7 @@ OVERCLOUD_NETWORKS_FILE = "network_data.yaml"
STANDALONE_NETWORKS_FILE = "/dev/null"
UNDERCLOUD_NETWORKS_FILE = "network_data_undercloud.yaml"
ANSIBLE_HOSTS_FILENAME = "hosts.yaml"
ANSIBLE_CWL = "tripleo_dense,tripleo_profile_tasks"

# The name of the file which holds the plan environment contents
PLAN_ENVIRONMENT = 'plan-environment.yaml'


+ 9
- 11
tripleoclient/utils.py View File

@@ -242,13 +242,14 @@ def playbook_verbosity(self):


def run_ansible_playbook(playbook, inventory, workdir, playbook_dir=None,
connection='smart', output_callback='yaml',
connection='smart', output_callback='tripleo_dense',
ssh_user='root', key=None, module_path=None,
limit_hosts=None, tags=None, skip_tags=None,
verbosity=0, quiet=False, extra_vars=None,
extra_vars_file=None, plan='overcloud',
gathering_policy='smart', extra_env_variables=None,
parallel_run=False, callback_whitelist=None,
parallel_run=False,
callback_whitelist=constants.ANSIBLE_CWL,
ansible_cfg=None, ansible_timeout=30,
reproduce_command=False, fail_on_rc=True,
timeout=None):
@@ -270,13 +271,14 @@ def run_ansible_playbook(playbook, inventory, workdir, playbook_dir=None,
:param connection: Connection type (local, smart, etc).
:type connection: String

:param output_callback: Callback for output format. Defaults to "json".
:param output_callback: Callback for output format. Defaults to
"tripleo_dense".
:type output_callback: String

:param callback_whitelist: Comma separated list of callback plugins.
Defaults to the value of `output_callback`.
When the verbosity is > 0 "profile_tasks"
will also be whitelisted.
Defaults to
"tripleo_dense,tripleo_profile_tasks".
Custom output_callback is also whitelisted.
:type callback_whitelist: String

:param ssh_user: User for the ssh connection.
@@ -454,12 +456,8 @@ def run_ansible_playbook(playbook, inventory, workdir, playbook_dir=None,
)
makedirs(ansible_fact_path)

if callback_whitelist:
if output_callback not in callback_whitelist.split(','):
callback_whitelist = ','.join([callback_whitelist, output_callback])
else:
callback_whitelist = output_callback

callback_whitelist = ','.join([callback_whitelist, 'profile_tasks'])

env = dict()
env['ANSIBLE_SSH_ARGS'] = (


Loading…
Cancel
Save