【发布时间】:2016-10-18 00:12:30
【问题描述】:
我的厨师食谱中有这样定义的 aws 机器:
machine "my-server" do
action :converge
end
aws_eip_address "server_ip_1" do
machine "my-server"
associate_to_vpc true
end
当这个配方第一次运行时,它会创建机器,并正确关联 ip。但是,每当此配方再次运行时,它都会引发以下错误:
aws_eip_address[server_ip_1] (xx.xx.xx.xx) 操作创建
================================================ ======================
在资源上执行操作
create时出错 'aws_eip_address[server_ip_1] (xx.xx.xx.xx)'================================================ =======================
AWS::EC2::Errors::Resource::AlreadyAssociated
resource eipalloc-xxx 已经与 associate-id eipassoc-xxx 关联
如何让这个食谱能够一遍又一遍地运行?我可以测试 eip 是否已经关联?我可以围绕资源声明做一个 try/catch 吗?
这非常令人沮丧,因为文档非常糟糕。到目前为止我找到的文档包括:
【问题讨论】:
-
我对厨师供应问题的通常免责声明:请注意,我们不建议新用户使用厨师供应,因为它不再处于重大开发阶段。请参阅coderanger.net/provisioning 了解更多信息。
标签: amazon-web-services chef-infra