Amazon ec2 ansible ec2 running list需要是实例列表
我正在尝试使用ansible部署ec2实例 我一直收到一个错误,上面写着:Amazon ec2 ansible ec2 running list需要是实例列表,amazon-ec2,ansible,ansible-playbook,Amazon Ec2,Ansible,Ansible Playbook,我正在尝试使用ansible部署ec2实例 我一直收到一个错误,上面写着: FAILED! => {"msg": "running list needs to be a list of instances to run: None", site.yml --- - hosts: hornet user: root sudo: false gather_facts: False serial: 1 roles: - role: ec2 角色/ec2/task
FAILED! => {"msg": "running list needs to be a list of instances to run: None",
site.yml
---
- hosts: hornet
user: root
sudo: false
gather_facts: False
serial: 1
roles:
- role: ec2
角色/ec2/tasks/main.yml
---
- include_vars: "env.yml"
- name: create an EC2 instance
local_action:
module: ec2
key_name: "{{ key_name }}"
region: "{{ region }}"
instance_type: "{{ instance_type }}"
image: "{{ image }}"
group_id: "{{ security_group }}"
wait: yes
private_ip: "{{ privip }}"
assign_public_ip: True
state: running
instance_tags: { "{{ ectags }}","name: {{ inventory_hostname }}"}
count: 1
register: basic_ec2
我在hosts文件中有两个主机
[hornet]
awo-p01-hm02 privip=`UniqueIP` ectags="{purpose:hornetMQ}"
awo-p01-hm03 privip=`UniqueIP` ectags="{purpose:hornetMQ}"
我怀疑你真的想要
状态:present
<代码>状态:运行用于启动现有实例(使用实例ID:[…]
传递)
我知道,非常混乱,记录也很差。ec2模块尝试执行太多操作:(请显示您的主机文件。将状态更改为“当前”,这使我转到下一个错误,谢谢。然后接受答案?;)