作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
为什么这个任务(来自 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="./hosts"
regexp={{ item.public_ip }}
insertafter="[webserver]" line={{ item.public_ip }}
with_items: ec2.instances
TASK [Add the newly created EC2 instance(s) to the local host group (located inside the directory)] ********************************************************************
fatal: [localhost]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'ansible.vars.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'public_ip'\n\nThe error appears to have been in '/Users/snowcrash/ansible-ec2/ec2_launch.yml': line 55, column 9, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Add the newly created EC2 instance(s) to the local host group (located inside the directory)\n ^ here\n"}
最佳答案
问题在这里
with_items: ec2.instances
with_items: '{{ ec2.instances }}'
关于amazon-web-services - ansible.vars.unsafe_proxy.AnsibleUnsafeText 对象'没有属性 'public_ip',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45259207/
我无法正确地将使用 terraform 创建的第一个 azure 公共(public) IP 引用到使用相同 terraform 脚本创建的网络安全组中。 我尝试了各种方法以使该行正常: source
为什么这个任务(来自 Best way to launch aws ec2 instances with ansible ): - name: Add the newly created EC2
我是在 AWS 上部署 Web 应用程序的初学者,我相信我遇到了与 AWS forward port 8000 from elb to port 8000 of EC2 类似的问题我有一个 react
我是一名优秀的程序员,十分优秀!