module

Krikri::Passwords

Resolution of the two password values (-k/--ask-pass/-K/--ask-become-pass and the *-password-file flags all land them as inventory host vars) from the vars hash a dispatch site already holds. Shared by PluginManager (become), SSHManager's registration path (connection), TaskExecutor's batch/async builders and the synchronize action plugin, so every consumer agrees on the key names and the "empty string is not a password" rule.

Key lists mirror ansible-core's own: the ssh connection plugin's password option vars (ansible_password/ansible_ssh_pass/ ansible_ssh_password) and the sudo become plugin's become_pass vars (ansible_become_password/ansible_become_pass/ansible_sudo_pass).

Constants

BECOME_KEYS = ["ansible_become_password", "ansible_become_pass", "ansible_sudo_pass"]
CONNECTION_KEYS = ["ansible_password", "ansible_ssh_pass", "ansible_ssh_password"]

Class methods

become(vars : Hash(String, JSON::Any) | Nil, host : Host | Nil = nil) : String | Nil
Source
connection(vars : Hash(String, JSON::Any) | Nil, host : Host | Nil = nil) : String | Nil

Task-level vars first (Ansible's task-var precedence over inventory), then the host's own inventory vars - dispatch sites pass the full vars_context, but a couple (batch daemon routing, the async launch builder) only hold the Host, so both sources are consulted.

Source