简体   繁体   English

如何使用Ansible从GCE负载平衡器添加/删除实例?

[英]How can I add/remove instances from GCE load balancers with Ansible?

I see that there is a gce_lb Ansible module, but it is unclear to me whether or not I can actually use this to change the instances assigned to that LB or whether the module just creates and destroys LBs. 我看到有一个gce_lb Ansible模块,但是我不清楚我是否可以实际使用它来更改分配给该LB的实例,或者该模块是否只是创建并销毁了LB。

In contrast, EC2 clearly has one module just for creating and destroying ELBs, and another module explicitly for [de]registering instances to/from an existing ELB. 相反,EC2显然具有一个仅用于创建和销毁ELB的模块 ,而另一个模块明确地用于向现有ELB [注销]实例或从现有ELB注销实例。

Currently, the gce_lb module is only for creating/destroying the LB. 当前,gce_lb模块仅用于创建/销毁LB。 It does not support adding/removing instances. 它不支持添加/删除实例。

The GCE modules in Ansible are built on top of the python libcloud library which does have support for add/remove. Ansible中的GCE模块建立在python libcloud库的顶部,该库确实支持添加/删除。 I think a similar approach taken by the EC2 modules would be a good solution here also. 我认为EC2模块采用的类似方法也是一种不错的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM