Skip to content

Commit

Permalink
fix another issue with unset credentials (fix #84)
Browse files Browse the repository at this point in the history
  • Loading branch information
superstes committed Jan 21, 2025
1 parent 4e9a550 commit ff9bf01
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/ansibleguy-webui/aw/execute/play_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,20 @@ def get_credentials_to_use(job: Job, execution: JobExecution) -> (BaseJobCredent
def get_runner_credential_args(creds: BaseJobCredentials) -> dict:
args = {}

if is_set(creds.ssh_key):
args['ssh_key'] = creds.ssh_key
if is_set(creds):
if is_set(creds.ssh_key):
args['ssh_key'] = creds.ssh_key

if is_set(creds.connect_pass) or is_set(creds.become_pass) or is_set(creds.vault_pass):
args['passwords'] = {}
if is_set(creds.connect_pass) or is_set(creds.become_pass) or is_set(creds.vault_pass):
args['passwords'] = {}

if is_set(creds.connect_pass):
args['passwords'][r'^SSH\s[pP]assword:\s*$'] = creds.connect_pass
if is_set(creds.connect_pass):
args['passwords'][r'^SSH\s[pP]assword:\s*$'] = creds.connect_pass

if is_set(creds.become_pass):
args['passwords'][r'^BECOME\s[pP]assword:\s*$'] = creds.become_pass
if is_set(creds.become_pass):
args['passwords'][r'^BECOME\s[pP]assword:\s*$'] = creds.become_pass

if is_set(creds.vault_pass):
args['passwords'][r'^Vault\s[pP]assword:\s*$'] = creds.vault_pass
if is_set(creds.vault_pass):
args['passwords'][r'^Vault\s[pP]assword:\s*$'] = creds.vault_pass

return args

0 comments on commit ff9bf01

Please sign in to comment.