Pass sudo password while executing Ansible playbook

0 votes
I am trying to pass a sudo password while executing my playbook. How do I do that?
Jul 22 in Ansible by Bob
41 views

1 answer to this question.

0 votes

Hey @Bob, try something like this:

ansible-playbook playbook.yml -i inventory.ini --user=username \
                              --extra-vars "ansible_sudo_pass=yourPassword"

Here, you're passing your inventory file as well as an extra variable which holds your sudo password.

answered Jul 22 by Akash

Related Questions In Ansible

0 votes
1 answer
+1 vote
4 answers

Pass variable to ansible playbook through command line

ansible-playbook test.yml --extra-vars "arg1=${var1} arg2=${var2}" Use is like ...READ MORE

answered May 7 in Ansible by Bobin
3,849 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
186 views
0 votes
1 answer