From e811711a49398726c7bc8159e334f1a4c0d43efc Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Thu, 27 Aug 2020 10:55:47 -0400 Subject: [PATCH] Put project playbook in runner project folder --- awx/main/tasks.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 3e70f93c19..ec685539b9 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -2169,7 +2169,7 @@ class RunProjectUpdate(BaseTask): self._write_extra_vars_file(private_data_dir, extra_vars) def build_cwd(self, project_update, private_data_dir): - return self.get_path_to('..', 'playbooks') + return os.path.join(private_data_dir, 'project') def build_playbook_path_relative_to_cwd(self, project_update, private_data_dir): return os.path.join('project_update.yml') @@ -2310,6 +2310,12 @@ class RunProjectUpdate(BaseTask): shutil.rmtree(stage_path) os.makedirs(stage_path) # presence of empty cache indicates lack of roles or collections + # the project update playbook is not in a git repo, but uses a vendoring directory + # to be consistent with the ansible-runner model, + # that is moved into the runner projecct folder here + awx_playbooks = self.get_path_to('..', 'playbooks') + copy_tree(awx_playbooks, os.path.join(private_data_dir, 'project')) + @staticmethod def clear_project_cache(cache_dir, keep_value): if os.path.isdir(cache_dir):