launch_config_create.yml 1.5 KB

1234567891011121314151617181920212223242526
  1. ---
  2. - name: fetch the security groups for launch config
  3. ec2_group_facts:
  4. filters:
  5. group-name: "{{ l_launch_config_security_groups[launch_config_item.key] }}"
  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_launch_config_basename }}-{{ launch_config_item.key }}{{'-' ~ openshift_aws_new_version if openshift_aws_new_version != '' else '' }}"
  13. region: "{{ openshift_aws_region }}"
  14. image_id: "{{ l_aws_ami_map[launch_config_item.key] | default(openshift_aws_ami) }}"
  15. instance_type: "{{ launch_config_item.value.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: "{{ launch_config_item.value.iam_role if launch_config_item.value.iam_role is defined and
  18. launch_config_item.value.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: "{{ launch_config_item.value.volumes }}"
  25. assign_public_ip: True