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, 2019 in Ansible by Bob
5,324 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, 2019 by Akash

Related Questions In Ansible

0 votes
1 answer
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, 2019 in Ansible by Bobin
14,363 views
+15 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,989 views
+2 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP