Reputation: 11061
I have used the become: yes
condition in my .yml
file. Yet, I'm getting the following error:
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "module_stderr": "sudo: a password is required\n", "module_stdout": "", "msg": "MODULE FAILURE"}
This is my Ansible playbook for reference:
- hosts: localhost
connection: local
remote_user: test
become: yes
gather_facts: no
vars_files:
- files/awscreds.yml
- files/info.yml
tasks:
- name: Basic provisioning of EC2 instances
ec2:
aws_access_key: "{{ aws_id }}"
aws_secret_key: "{{ aws_key }}"
region: "{{ aws_region }}"
image: "{{ standard_ami }}"
instance_type: "{{ free_instance }}"
key_name: "{{ ssh_keyname }}"
count: 1
state: present
group_id: "{{ secgroup_id }}"
wait: no
instance_tags:
Name: Dawny33_template
register: e2info
- name: Print the results
debug: var=ec2info
Where did I go wrong here?
Upvotes: 0
Views: 640
Reputation: 68229
sudo
to run ec2
module. Upvotes: 2