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 in Ansible by akhtar
• 29,320 points
40 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 by MD
• 67,840 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
1,906 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 in Ansible by smy
22 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
740 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 in Ansible by MD
• 67,840 points
136 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 in Ansible by MD
• 67,840 points
95 views