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 27, 2020 in Ansible by akhtar
• 38,180 points
631 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 27, 2020 by MD
• 95,220 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
2,469 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 23, 2020 in Ansible by smy
153 views
0 votes
1 answer
+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 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
1,135 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,220 points
960 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,220 points
679 views