- I have two GCE instances (say node1, node2).
- I have installed ansible in node1 and is running a script to start a service in node2.
- SSH as root is disabled in GCE instances, so I created a separate user (devops) in node1 and ran the script as devops user.
- There is no root password set in both instances, So I am able to become the root user and execute the whoami command successfully.
- But when i try same after creating a separate user it asks for "sudo: a password is required" but there is no root user password set.
My sample ansible playbook that i tried
https://gist.github.com/pavananms/a7a99a8b1f50ea3ab70e8dddbf4cb56c
I am running the above script as
ansible-playbook test.yml