Specify sudo password for Ansible

The docs strongly recommend against setting the sudo password in plaintext:

As a reminder passwords should never be stored in plain text. For information on encrypting your passwords and other secrets with Ansible Vault, see Encrypting content with Ansible Vault.

Instead you should be using --ask-become-pass on the command line when running ansible-playbook

Previous versions of Ansible have used --ask-sudo-pass and sudo instead of become.

Leave a Comment