Ansible Playbook Issue

Hi Folks,
I am new to Ansible. I am trying to create user in 2 Remote Systems. But i am getting the error.
Can you please help me out...

My Playbook Code

You may want to add the --ask-become-pass option to your command line. This will cause ansible to prompt you for a password before running your playbook. The password needs to be the one your ansible_ssh_user would type on the remote systems when running a command with sudo. Obviously, the same ansible_ssh_user needs to have permission to run sudo on all remote systems.

Quoting from Getting started with Ansible — Ansible Documentation

When speaking with remote machines, Ansible by default assumes you are using SSH keys. SSH keys are encouraged but password authentication can also be used where needed by supplying the option --ask-pass. If using sudo features and when sudo requires a password, also supply --ask-become-pass (previously --ask-sudo-pass which has been deprecated).

As the above quote suggests, there are better ways to do this.

For future reference, please note:

  1. Do not attach screenshots of error messages or log output, especially since it's much easier to just copy and paste the text directly. But mostly, because screenshots are unsearchable. Your future self will thank you when you are stumped by the same error again and will find your own post with google.
  2. When you copy and paste error messages or text files such as yaml, please format them properly before posting.

'sudo password is required' seems to be the fault.
-K, --ask-become-pass
ask for privilege escalation password

See: https://docs.ansible.com/ansible/latest/cli/ansible-playbook.html
for options calling ansible-playbook

Take a run through https://training.plone.org/5/deployment/playbook-use.html#smoke-test for a tutorial.

Hi All,

Thanks for your valuable suggestions. My problem was solved. It was privilege issue & i fixed it as per your advice.