build_node_group.yml 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. ---
  2. # When openshift_aws_use_custom_ami is '' then
  3. # we retrieve the latest build AMI.
  4. # Then set openshift_aws_ami to the ami.
  5. - when: openshift_aws_ami == ''
  6. block:
  7. - name: fetch recently created AMI
  8. ec2_ami_find:
  9. region: "{{ openshift_aws_region }}"
  10. sort: creationDate
  11. sort_order: descending
  12. name: "{{ openshift_aws_ami_name }}*"
  13. ami_tags: "{{ openshift_aws_ami_tags }}"
  14. no_result_action: fail
  15. register: amiout
  16. - name: Set the openshift_aws_ami
  17. set_fact:
  18. openshift_aws_ami: "{{ amiout.results[0].ami_id }}"
  19. when:
  20. - "'results' in amiout"
  21. - amiout.results|length > 0
  22. - when: openshift_aws_create_security_groups
  23. name: "Create {{ openshift_aws_node_group_type }} security groups"
  24. include: security_group.yml
  25. - when: openshift_aws_create_launch_config
  26. name: "Create {{ openshift_aws_node_group_type }} launch config"
  27. include: launch_config.yml
  28. - when: openshift_aws_create_scale_group
  29. name: "Create {{ openshift_aws_node_group_type }} node group"
  30. include: scale_group.yml