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
27 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.