2015-06-20 29 views
0

我試圖部署ec2實例與ansible。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 /任務/ 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 

我在兩臺主機主機文件。

[hornet] 
awo-p01-hm02 privip=`UniqueIP` ectags="{purpose:hornetMQ}" 
awo-p01-hm03 privip=`UniqueIP` ectags="{purpose:hornetMQ}" 
+0

請顯示您的hosts文件 – tedder42

回答

2

我懷疑你實際上是想要state: presentstate: running用於啓動現有實例(通過instance_ids: [ ... ]傳遞)。

我知道可怕的混亂和記錄不完整。 ec2模塊試圖做太多事情。 :(

+0

更改狀態爲「present」,它將我轉移到下一個錯誤,謝謝 –

+0

接受答案,然後?;) – nitzmahone