launch_config.yml 1.6 KB

1234567891011121314151617181920212223242526
  1. ---
  2. - name: fetch the security groups for launch config
  3. ec2_group_facts:
  4. filters:
  5. group-name: "{{ openshift_aws_launch_config_security_groups[openshift_aws_node_group.group] }}"
  6. vpc-id: "{{ vpcout.vpcs[0].id }}"
  7. region: "{{ openshift_aws_region }}"
  8. register: ec2sgs
  9. # Create the scale group config
  10. - name: Create the node scale group launch config
  11. ec2_lc:
  12. name: "{{ openshift_aws_node_group.name }}-{{ openshift_aws_ami_map[openshift_aws_node_group.group] | default(openshift_aws_ami) }}-{{ l_epoch_time }}"
  13. region: "{{ openshift_aws_region }}"
  14. image_id: "{{ openshift_aws_ami_map[openshift_aws_node_group.group] | default(openshift_aws_ami) }}"
  15. instance_type: "{{ l_node_group_config[openshift_aws_node_group.group].instance_type }}"
  16. security_groups: "{{ openshift_aws_launch_config_security_group_id | default(ec2sgs.security_groups | map(attribute='group_id')| list) }}"
  17. instance_profile_name: "{{ l_node_group_config[openshift_aws_node_group.group].iam_role if l_node_group_config[openshift_aws_node_group.group].iam_role is defined and
  18. l_node_group_config[openshift_aws_node_group.group].iam_role != '' and
  19. openshift_aws_create_iam_role
  20. else omit }}"
  21. user_data: "{{ lookup('template', 'user_data.j2') }}"
  22. key_name: "{{ openshift_aws_ssh_key_name }}"
  23. ebs_optimized: False
  24. volumes: "{{ l_node_group_config[openshift_aws_node_group.group].volumes }}"
  25. assign_public_ip: True