build_ami.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ---
  2. - hosts: localhost
  3. connection: local
  4. gather_facts: no
  5. tasks:
  6. - name: Require openshift_aws_base_ami
  7. fail:
  8. msg: "A base AMI is required for AMI building. Please ensure `openshift_aws_base_ami` is defined."
  9. when: openshift_aws_base_ami is undefined
  10. - name: "Alert user to variables needed and their values - {{ item.name }}"
  11. debug:
  12. msg: "{{ item.msg }}"
  13. with_items:
  14. - name: openshift_aws_clusterid
  15. msg: "openshift_aws_clusterid={{ openshift_aws_clusterid | default('default') }}"
  16. - name: openshift_aws_region
  17. msg: "openshift_aws_region={{ openshift_aws_region | default('us-east-1') }}"
  18. - include: provision_vpc.yml
  19. - include: provision_ssh_keypair.yml
  20. - include: provision_sec_group.yml
  21. vars:
  22. openshift_aws_node_group_type: compute
  23. - include: provision_instance.yml
  24. vars:
  25. openshift_aws_node_group_type: compute
  26. - hosts: nodes
  27. gather_facts: False
  28. tasks:
  29. - name: set the user to perform installation
  30. set_fact:
  31. ansible_ssh_user: "{{ openshift_aws_build_ami_ssh_user | default('root') }}"
  32. # This is the part that installs all of the software and configs for the instance
  33. # to become a node.
  34. - include: ../../common/openshift-node/image_prep.yml
  35. - include: seal_ami.yml
  36. vars:
  37. openshift_aws_ami_name: "openshift-gi-{{ lookup('pipe', 'date +%Y%m%d%H%M')}}"