我想创建一个新的负载均衡器,并使用ansible在aws中分配ec2实例。所以,我创建了new_elb.yml文件来创建新的elb,下面是我的ELB代码:
---
#tasks:
- name: creating load balancer
#local_action:
ec2_elb_lb:
name: "apache-balancer"
state: present
zones:
- us-west-2a
- us-west-2b
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 443
~
我收到的错误如下:
ERROR! 'ec2_elb_lb' is not a valid attribute for a Play
The error appears to have been in '/etc/ansible/playbooks/final_elb.yml': line 3, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
#tasks:
- name: creating load balancer
^ here
任何人都可以告诉我们使用ansible声明ELB和注册ec2实例的正确方法是什么?