From 44f7556ad6873ba01908b6ba22323f88f9379326 Mon Sep 17 00:00:00 2001 From: n0mad1k Date: Thu, 30 Apr 2026 22:55:28 -0400 Subject: [PATCH] =?UTF-8?q?Fix=20node=5Fchunks=5Ffile=20path=20=E2=80=94?= =?UTF-8?q?=20Ansible=20file=20lookup=20requires=20absolute=20paths?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/webrunner/deploy_webrunner.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/webrunner/deploy_webrunner.py b/modules/webrunner/deploy_webrunner.py index f58ac9b..f05de98 100644 --- a/modules/webrunner/deploy_webrunner.py +++ b/modules/webrunner/deploy_webrunner.py @@ -385,15 +385,17 @@ def execute_webrunner_deployment(config: dict): print(f"\n{COLORS['YELLOW']}Deployment cancelled.{COLORS['RESET']}") return - # Write node chunks file - os.makedirs('logs', exist_ok=True) - chunks_file = f"logs/node_chunks_{config['deployment_id']}.json" + # Write node chunks file — absolute paths so Ansible lookup('file',...) works + # regardless of playbook-relative CWD + logs_dir = os.path.abspath(os.path.join(_base, 'logs')) + os.makedirs(logs_dir, exist_ok=True) + chunks_file = os.path.join(logs_dir, f"node_chunks_{config['deployment_id']}.json") with open(chunks_file, 'w') as f: json.dump(node_chunks, f) config['node_chunks_file'] = chunks_file - config['scanner_ip_log'] = f"logs/scanner_ips_{config['webrunner_name']}.txt" - config['results_dir'] = f"logs/webrunner_{config['deployment_id']}" + config['scanner_ip_log'] = os.path.join(logs_dir, f"scanner_ips_{config['webrunner_name']}.txt") + config['results_dir'] = os.path.join(logs_dir, f"webrunner_{config['deployment_id']}") for provider in config['providers']: set_provider_environment({**config, 'provider': provider})