【发布时间】:2018-02-04 08:45:57
【问题描述】:
发件人:Best way to launch aws ec2 instances with ansible
- name: Add the newly created EC2 instance(s) to the local host group (located inside the directory)
local_action: lineinfile
dest="/etc/ansibles/aws/hosts"
regexp={{ item.private_ip }}
insertafter="[webserver]" line={{ item.private_ip }}
with_items: "{{ ec2.instances }}"
产生这个错误:
致命:[本地主机]:失败! => { “失败”:真的, "msg": "字段 'args' 的值无效,似乎包含一个未定义的变量。错误是:'ansible.vars.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'private_ip'\n\n
我已经定义了变量 private_ip: 在 vars 下,有一个值
【问题讨论】:
标签: amazon-web-services amazon-ec2 ansible boto