我在become: yes
文件中使用了.yml
条件。然而,我收到以下错误:
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "module_stderr": "sudo: a password is required\n", "module_stdout": "", "msg": "MODULE FAILURE"}
这是我的Ansible剧本供参考:
- 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
我在哪里出错?
答案 0 :(得分:2)
sudo
来运行ec2
模块。