How do you provide the become (sudo) password?
BeginnerConceptVault, Privilege Escalation and Error Handling
Answer
ansible-playbook site.yml --ask-become-pass # or -K
[web:vars]
ansible_become_password={{ vault_sudo_password }}
The preferred production setup avoids passwords entirely: a dedicated automation user with key-based SSH and a NOPASSWD sudoers entry limited to what automation needs, or the cloud's default ec2-user/ubuntu that already has passwordless sudo.
More on Vault, Privilege Escalation and Error Handling
What is Ansible Vault?BeginnerWhich `ansible-vault` commands do you use day to day?BeginnerHow do you supply the vault password when running a playbook?BeginnerWhat is `encrypt_string` and when is it better than encrypting a whole file?IntermediateWhat are vault IDs and why use them?AdvancedHow is Vault data encrypted and what does the file look like?Advanced