provision_ec2.yml 1.3 KB

123456789101112131415161718192021222324252627282930
  1. ---
  2. - name: create instance(s)
  3. ec2:
  4. assign_public_ip: yes
  5. count_tag:
  6. host-type: "master"
  7. ebs_optimized: True
  8. exact_count: "{{ l_subnetout_results[l_loop] }}"
  9. group_id: "{{ ec2sgs.security_groups | map(attribute='group_id') | list }}"
  10. instance_tags: "{{ l_instance_tags }}"
  11. instance_type: "{{ openshift_aws_master_instance_config.instance_type }}"
  12. image: "{{ l_image }}"
  13. key_name: "{{ openshift_aws_ssh_key_name }}"
  14. monitoring: False
  15. region: "{{ openshift_aws_region }}"
  16. termination_protection: False
  17. user_data: "{{ lookup('template', 'user_data.j2') }}"
  18. volumes: "{{ openshift_aws_master_instance_config.volumes }}"
  19. vpc_subnet_id: "{{ l_loop }}"
  20. wait: yes
  21. instance_profile_name: "{{ l_profilename.iam_roles[0].role_name if openshift_aws_create_iam_role and
  22. openshift_aws_master_instance_config.iam_role is defined and
  23. openshift_aws_master_instance_config.iam_role != ''
  24. else omit }}"
  25. loop: "{{ l_subnetout_results | list }}"
  26. loop_control:
  27. loop_var: l_loop
  28. retries: 3
  29. delay: 3
  30. register: ec2s