From 03790c7e9862d881f9fa477b890fdd7e618d4582 Mon Sep 17 00:00:00 2001 From: SquirrelDevelopper Date: Tue, 15 Oct 2024 09:51:27 +0200 Subject: [PATCH] Append --vault-id to ansible runner command Add --vault-id ssm@ssm-ansible-vault-password-client.py to the command line arguments if 'cmdline' exists in runner_args. This ensures the vault ID is always passed for secure password management. --- server/src/ansible/ssm-ansible-run.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/src/ansible/ssm-ansible-run.py b/server/src/ansible/ssm-ansible-run.py index 49ceba9c..c2043b99 100644 --- a/server/src/ansible/ssm-ansible-run.py +++ b/server/src/ansible/ssm-ansible-run.py @@ -103,6 +103,8 @@ def execute(): runner_args['cmdline'] += ' --diff' else: runner_args['cmdline'] = '--diff' + if 'cmdline' in runner_args: + runner_args['cmdline'] += ' --vault-id ssm@ssm-ansible-vault-password-client.py' thread_obj, runner_obj = ansible_runner.run_async(**runner_args) sys.stdout.write(runner_obj.config.ident)