scale_group.yml 2.2 KB

123456789101112131415161718192021222324252627282930
  1. ---
  2. - name: set node group name
  3. set_fact:
  4. l_node_group_name: "{{ openshift_aws_node_group.name }} {{ l_deployment_serial }}"
  5. - name: Create the scale group
  6. ec2_asg:
  7. name: "{{ l_node_group_name }}"
  8. launch_config_name: "{{ openshift_aws_node_group.name }}-{{ openshift_aws_ami_map[openshift_aws_node_group.group] | default(openshift_aws_ami) }}-{{ l_epoch_time }}"
  9. health_check_period: "{{ l_node_group_config[openshift_aws_node_group.group].health_check.period }}"
  10. health_check_type: "{{ l_node_group_config[openshift_aws_node_group.group].health_check.type }}"
  11. min_size: "{{ l_node_group_config[openshift_aws_node_group.group].min_size }}"
  12. max_size: "{{ l_node_group_config[openshift_aws_node_group.group].max_size }}"
  13. desired_capacity: "{{ l_node_group_config[openshift_aws_node_group.group].desired_size }}"
  14. region: "{{ openshift_aws_region }}"
  15. termination_policies: "{{ l_node_group_config[openshift_aws_node_group.group].termination_policy if 'termination_policy' in l_node_group_config[openshift_aws_node_group.group] else omit }}"
  16. load_balancers: "{{ l_node_group_config[openshift_aws_node_group.group].elbs if 'elbs' in l_node_group_config[openshift_aws_node_group.group] else omit }}"
  17. wait_for_instances: "{{ l_node_group_config[openshift_aws_node_group.group].wait_for_instances | default(False)}}"
  18. vpc_zone_identifier: "{{ subnetout.subnets[0].id }}"
  19. replace_instances: "{{ openshift_aws_node_group_replace_instances if openshift_aws_node_group_replace_instances != [] else omit }}"
  20. replace_all_instances: "{{ omit if openshift_aws_node_group_replace_instances != []
  21. else (l_node_group_config[openshift_aws_node_group.group].replace_all_instances | default(omit)) }}"
  22. tags:
  23. - "{{ openshift_aws_node_group_config_tags
  24. | combine(openshift_aws_node_group.tags)
  25. | combine({'deployment_serial': l_deployment_serial, 'ami': openshift_aws_ami_map[openshift_aws_node_group.group] | default(openshift_aws_ami)}) }}"
  26. - name: append the asg name to the openshift_aws_created_asgs fact
  27. set_fact:
  28. openshift_aws_created_asgs: "{{ [l_node_group_name] | union(openshift_aws_created_asgs) | list }}"