如何在 ansible 中为elb_target_group配置慢启动持续时间?



如何配置慢启动持续时间,就像在ansible中的负载均衡器目标组的 AWS 控制台中所做的那样?

我目前正在使用ansible 的 elb 目标组模块: https://docs.ansible.com/ansible/latest/modules/elb_target_group_module.html

我想设置慢启动,如下所述: https://docs.aws.amazon.com/en_en/elasticloadbalancing/latest/application/load-balancer-target-groups.html#slow-start-mode

例如:

# Create a target group with instance targets
- elb_target_group:
name: mytargetgroup
protocol: http
port: 81
vpc_id: vpc-01234567
slow_start_duration: 30
health_check_path: /
successful_response_codes: "200,250-260"
targets:
- Id: i-01234567
Port: 80
- Id: i-98765432
Port: 80
state: present
wait_timeout: 200
wait: True

进入目标组的描述选项卡,向下滚动:编辑属性。在那里,您将有缓慢的启动持续时间

将持续时间值作为剧本中的变量传递,并在执行剧本时使用它。

最新更新