Skip to content

Commit

Permalink
Fixed encrypted playbook not running issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jaisejose1123 committed Jun 13, 2024
1 parent 7b4ad93 commit 18fb898
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/ansible/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ def run_via_cli(hosts, credentials, env_vars, extra_vars, tags: nil, ansible_run
end

res = response(base_dir, ansible_runner_method, result, debug)
if !cred_env_vars.empty?
command_line = res.instance_variable_get(:@command_line)
new_command = "export #{cred_env_vars['ANSIBLE_VAULT_PASSWORD_FILE']} ; #{command_line}"
res.instance_variable_set(:@command_line, new_command)
end
res
ensure
# Clean up the tmp dir for the sync method, for async we will clean it up after the job is finished and we've
# read the output, that will be written into this directory.
Expand Down

0 comments on commit 18fb898

Please sign in to comment.