summaryrefslogtreecommitdiffstats
path: root/roles/openshift_aws/tasks/launch_config_create.yml
blob: f7f0f09538535c8a1c6856043be3c7f2e0656c1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
---
- name: fetch the security groups for launch config
  ec2_group_facts:
    filters:
      group-name: "{{ l_launch_config_security_groups[launch_config_item.key] }}"
      vpc-id: "{{ vpcout.vpcs[0].id }}"
    region: "{{ openshift_aws_region }}"
  register: ec2sgs

# Create the scale group config
- name: Create the node scale group launch config
  ec2_lc:
    name: "{{ openshift_aws_launch_config_basename }}-{{ launch_config_item.key }}{{'-' ~ openshift_aws_new_version if openshift_aws_new_version != '' else '' }}"
    region: "{{ openshift_aws_region }}"
    image_id: "{{ l_aws_ami_map[launch_config_item.key] | default(openshift_aws_ami) }}"
    instance_type: "{{ launch_config_item.value.instance_type }}"
    security_groups: "{{ openshift_aws_launch_config_security_group_id  | default(ec2sgs.security_groups | map(attribute='group_id')| list) }}"
    instance_profile_name: "{{ launch_config_item.value.iam_role if launch_config_item.value.iam_role is defined and
                                                                    launch_config_item.value.iam_role != '' and
                                                                    openshift_aws_create_iam_role
                                                                 else omit }}"
    user_data: "{{ lookup('template', 'user_data.j2') }}"
    key_name: "{{ openshift_aws_ssh_key_name }}"
    ebs_optimized: False
    volumes: "{{ launch_config_item.value.volumes }}"
    assign_public_ip: True