Error saying "ERROR: sudo_pass is not a legal parameter at this level in an Ansible Playbook"

0 votes

I'm trying to run an ansible playbook and I end up with this error:

ERROR: sudo_pass is not a legal parameter at this level in an Ansible Playbook

My playbook:

---
- name: Server
  hosts: node1
  sudo_pass: ubuntu
  roles:
    - dbserver
Jan 28 in Ansible by Neel
29 views

1 answer to this question.

0 votes

Here sudo_pass is where you're going wrong. Ansible does not understand sudo_pass. Use sudo: yes instead of sudo_pass. This line will give a message saying sudo password is required to run the playbook and the password will be asked on the command line when you execute the playbook. Execute the playbook with -k flag, like this:

ansible-playbook -i hosts site.yml -K​
answered Jan 28 by Hatim

Related Questions In Ansible

0 votes
1 answer
+1 vote
1 answer
0 votes
1 answer
+13 votes
2 answers
0 votes
1 answer
0 votes
2 answers
0 votes
1 answer