How to specify sudo password for Ansible

0 votes

Hi Guys,

I have one Ansible Playbook. I want to pass the Sudo password to this playbook. How can I do that?

Sep 28, 2020 in Ansible by akhtar
• 38,260 points
5,760 views

1 answer to this question.

0 votes

Hi@akhtar,

You can pass variable on the command line via --extra-vars "name=value". You need to use the Sudo password variable named ansible_sudo_pass as shown below.

$ ansible-playbook playbook.yml --user=username --extra-vars "ansible_sudo_pass=yourPassword"
answered Sep 28, 2020 by MD
• 95,460 points

Related Questions In Ansible

0 votes
1 answer

How to set vault password on ansible tower?

On Ansible Tower, go to Settings > ...READ MORE

answered Jan 29, 2019 in Ansible by Yesha
6,173 views
0 votes
0 answers
0 votes
1 answer

How to write ansible script for installing jenkins on aws RHEL?

Check this out. https://github.com/geerlingguy/ansible-role-jenkins H ...READ MORE

answered Sep 24, 2020 in Ansible by smy
1,201 views
0 votes
1 answer

How to write ansible playbook for storage health checking? Any references?

Why ansible in particular? You can use ...READ MORE

answered Oct 29, 2020 in Ansible by Lohith
1,717 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
4,040 views
+2 votes
1 answer
0 votes
1 answer

How to change vault password in Ansible?

Hi@akhtar, You can use rekey keyword in your ...READ MORE

answered Aug 11, 2020 in Ansible by MD
• 95,460 points
12,941 views
0 votes
1 answer

How to set dynamic host inventory file for docker in Ansible?

Hi@akhtar, In a configuration especially a container setup such ...READ MORE

answered Sep 20, 2020 in Ansible by MD
• 95,460 points
2,004 views
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