A Jenkins job hangs forever at the start of `ansible-playbook`
BeginnerTroubleshootingVariables, Facts and Precedence Problems
Answer
Likely causes → The play uses vars_prompt, or the run passes --ask-become-pass or --ask-vault-pass, and there is no terminal to answer the prompt.
Diagnose → Run the same command locally and see whether it prompts. grep -rn vars_prompt playbooks/.
Fix → Supply the values without prompting. A vars_prompt variable is skipped if it is passed with -e. Use --vault-password-file or a script, and put the become password in a vaulted ansible_become_password.
Prevent → Make playbooks non-interactive by default, and add a CI timeout so a hang fails quickly.
More on Variables, Facts and Precedence Problems
Variables in `group_vars/webservers.yml` are silently ignoredBeginnerYou set `nginx_port: 8443` in inventory `group_vars`, but the role still uses `80`Intermediate`set_fact: release_tag=v2` runs, but later tasks still see `v1`Intermediate`'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_default_ipv4'` when templating `hostvars['db01']`Intermediate`'ansible_eth0' is undefined` on new cloud instancesBeginnerFacts like `ansible_hostname` became undefined after someone changed `ansible.cfg`Intermediate