Write ansible-playbook-command.sh to workdir not playbook_dir

The reproducer command, ansible-playbook-command.sh, should not be
written to playbook_dir, as that directory may not always be writeable.
It is in fact commonly set to /usr/share/ansible/tripleo-playbooks,
which is not writeable by a non-privileged user.

Instead, write the command to workdir, which is either the
config-download directory, or the directory setup for use by ansible
runner.

Change-Id: I4ac0c2aaf8b6a8f4a9b5e5f40fa68929be32ee38
Signed-off-by: James Slagle <jslagle@redhat.com>
This commit is contained in:
James Slagle 2021-01-27 17:39:10 -05:00
parent 39cfed499a
commit 8b3fa1bfd7
1 changed files with 1 additions and 1 deletions

View File

@ -666,7 +666,7 @@ def run_ansible_playbook(playbook, inventory, workdir, playbook_dir=None,
if reproduce_command:
command_path = os.path.join(
playbook_dir,
workdir,
"ansible-playbook-command.sh"
)
with open(command_path, 'w') as f: