Always write ansible-playbook-command.sh

This command is used for debugging and reproducability, we should always
create it. Also, it's not presently possible to toggle the creation, so
for now just default to always creating it.

Change-Id: If45b1820f9840a50b26afce82a1780124c684a4e
Signed-off-by: James Slagle <jslagle@redhat.com>
This commit is contained in:
James Slagle 2021-01-27 18:13:33 -05:00
parent ee1990ef65
commit 817c8e3348
3 changed files with 7 additions and 2 deletions

View File

@ -220,6 +220,9 @@ class FakeRunnerConfig(object):
env = dict() # noqa
artifact_dir = ''
def __init__(self):
self.command = []
def prepare(self):
pass

View File

@ -205,10 +205,12 @@ class TestRunAnsiblePlaybook(TestCase):
extra_vars=arglist
)
@mock.patch('os.chmod')
@mock.patch('six.moves.builtins.open')
@mock.patch('tripleoclient.utils.makedirs')
@mock.patch('os.path.exists', side_effect=(False, True, True))
def test_run_with_timeout(self, mock_exists, mock_mkdir, mock_open):
def test_run_with_timeout(self, mock_exists, mock_mkdir, mock_open,
mock_chmod):
ansible_runner.ArtifactLoader = mock.MagicMock()
ansible_runner.Runner.run = mock.MagicMock(return_value=('', 0))
ansible_runner.runner_config = mock.MagicMock()

View File

@ -253,7 +253,7 @@ def run_ansible_playbook(playbook, inventory, workdir, playbook_dir=None,
parallel_run=False,
callback_whitelist=constants.ANSIBLE_CWL,
ansible_cfg=None, ansible_timeout=30,
reproduce_command=False,
reproduce_command=True,
timeout=None, forks=None):
"""Simple wrapper for ansible-playbook.