I have a simple ansible playbook that copies a script and executes a script on an EC2 instance.
- name: Playbook Deploy jar
hosts: all
remote_user: ubuntu
tasks:
- name: Copy Provisioning Script
copy:
src: ./prod-setup.sh
dest: .
mode: '0755'
- name: Execute the Provisioning script
command: sh ./prod-setup.sh
The .pem file used to connect to the host is specified in the 'Hosts' file. There is no become user but everytime I run it, I am interactively queried for a become password.
$superuser: ansible-playbook -i hosts -K playbook.yml
BECOME Password:
No Become password is set because there is no become user so literally pressing 'Enter' is sufficient to continue execution but this means I can't deploy this playbook as part of a script.
I checked ansible.cfg and none of the settings have been overridden. There are no other config files. What else could be causing this? Is there a way to circumvent this?