Make inventory file writable
Looks like ansible_runner.utils.dump_artifact() makes it
read-only and redeploy fails with permission error.
Closes-Bug: #1950767
Change-Id: I32acdb51ac12be08c94efa5c198ea83549a8f034
(cherry picked from commit 6b2892508a)
This commit is contained in:
@@ -371,11 +371,12 @@ def run_ansible_playbook(playbook, inventory, workdir, playbook_dir=None,
|
|||||||
inventory,
|
inventory,
|
||||||
default_flow_style=False
|
default_flow_style=False
|
||||||
)
|
)
|
||||||
return ansible_runner.utils.dump_artifact(
|
inv_file = ansible_runner.utils.dump_artifact(
|
||||||
inventory,
|
inventory,
|
||||||
workdir,
|
workdir,
|
||||||
constants.ANSIBLE_HOSTS_FILENAME
|
constants.ANSIBLE_HOSTS_FILENAME)
|
||||||
)
|
os.chmod(inv_file, 0o600)
|
||||||
|
return inv_file
|
||||||
|
|
||||||
def _running_ansible_msg(playbook, timeout=None):
|
def _running_ansible_msg(playbook, timeout=None):
|
||||||
if timeout and timeout > 0:
|
if timeout and timeout > 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user