Ansible模块:ec2_elb无法找到ELB(当ELB计数> 400?)

时间:2015-10-29 16:06:11

标签: ansible boto ansible-playbook amazon-elb

我有需要添加到ELB的EC2实例。从ansible尝试这个时,得到以下错误。我可以使用AWS CLI添加相同的内容。使用ansible中的模块 ec2_elb 找到了这个未解决的问题:https://github.com/ansible/ansible-modules-core/issues/2115

这有什么工作吗?或者任何其他版本的boto / python,它按预期工作。我在我正在使用的配置文件中有> 400 ELB。

  

msg:ELB MyTestELB不存在。

1 个答案:

答案 0 :(得分:0)

这对我有用。使用来自ansible的AWS CLI命令来解决boto / ansible无法识别ELB的上述问题。

- name: Add EC2 instance to ELB {{ elb_result.elb.name }} using AWS - CLI from within ansible play
    command: "sudo -E aws elb register-instances-with-load-balancer --load-balancer-name {{ elb_result.elb.name }} --instances i-456r3546 --profile <<MyProfileHereIfNeeded>>"
    environment:
      http_proxy: http://{{ proxyUserId }}:{{ proxyPwd }}@proxy.com:port
      https_proxy: http://{{ proxyUserId }}:{{ proxyPwd }}@proxy.com:port