2017-07-17 70 views
0

是否有任何模块或属性,这将有助于启用修改自动分配公共子网在Ansible的公共子网。 我负责的版本是2.3.1.0。Ansible | AWS |修改子网属性自动分配公共IP

+0

不要以为这可能与ec2_vpc_subnet,但你可以发射awscli作为shell命令:http://docs.aws.amazon.com/cli/latest/reference/ec2/modify-subnet-attribute.html –

+0

是的,有相同的使用目前使用的cli。 –

回答

0

去年我提交了PR添加了2个AWS模块:boto3boto3_wait

这两个模块允许您使用boto3与AWS API进行交互。

举例来说,你可以通过调用modify_subnet_attribute方法的EC2服务使公共IP自动分配:

- name: Enable auto-assign public ip 
    boto3: 
    service: ec2 
    region: us-east-1 
    operation: modify_subnet_attribute 
    parameters: 
     SubnetId: subnet-xxxxxxxx 
     AssignIpv6AddressOnCreation: 
     Value: True 

随意给PR竖起大拇指,如果你喜欢它! ;)

+0

感谢您的工作,只是想知道更多这是否boto3也支持应用程序负载平衡器是否有任何相同的例子,如何使用它与ansible。 –

+0

是的,您可以使用[ElasticLoadBalancingv2客户端](https://boto3.readthedocs.io/en/latest/reference/services/elbv2.html)管理ALB。 –