install_provisioners.yaml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ---
  2. - name: Check that EFS File System ID is set
  3. fail: msg='the openshift_provisioners_efs_fsid variable is required'
  4. when: (openshift_provisioners_efs | bool) and openshift_provisioners_efs_fsid is not defined
  5. - name: Check that EFS region is set
  6. fail: msg='the openshift_provisioners_efs_region variable is required'
  7. when: (openshift_provisioners_efs | bool) and openshift_provisioners_efs_region is not defined
  8. - name: Check that EFS AWS access key id is set
  9. fail: msg='the openshift_provisioners_efs_aws_access_key_id variable is required'
  10. when: (openshift_provisioners_efs | bool) and openshift_provisioners_efs_aws_access_key_id is not defined
  11. - name: Check that EFS AWS secret access key is set
  12. fail: msg='the openshift_provisioners_efs_aws_secret_access_key variable is required'
  13. when: (openshift_provisioners_efs | bool) and openshift_provisioners_efs_aws_secret_access_key is not defined
  14. - name: Ensure that Provisioners has nodes to run on
  15. import_role:
  16. name: openshift_control_plane
  17. tasks_from: ensure_nodes_matching_selector.yml
  18. vars:
  19. openshift_master_ensure_nodes_selector: "{{ openshift_provisioners_efs_nodeselector | map_to_pairs }}"
  20. openshift_master_ensure_nodes_service: Provisioners
  21. - name: Install support
  22. include_tasks: install_support.yaml
  23. - name: Install EFS
  24. include_tasks: install_efs.yaml
  25. when: openshift_provisioners_efs | bool
  26. - find: paths={{ mktemp.stdout }}/templates patterns=*.yaml
  27. register: object_def_files
  28. changed_when: no
  29. - slurp: src={{item}}
  30. register: object_defs
  31. with_items: "{{object_def_files.files | map(attribute='path') | list | sort}}"
  32. changed_when: no
  33. - name: Create objects
  34. include_tasks: oc_apply.yaml
  35. vars:
  36. - kubeconfig: "{{ mktemp.stdout }}/admin.kubeconfig"
  37. - namespace: "{{ openshift_provisioners_project }}"
  38. - file_name: "{{ file.source }}"
  39. - file_content: "{{ file.content | b64decode | from_yaml }}"
  40. with_items: "{{ object_defs.results }}"
  41. loop_control:
  42. loop_var: file
  43. when: not ansible_check_mode
  44. - name: Printing out objects to create
  45. debug: msg={{file.content | b64decode }}
  46. with_items: "{{ object_defs.results }}"
  47. loop_control:
  48. loop_var: file
  49. when: ansible_check_mode
  50. - name: Scaling up cluster
  51. include_tasks: start_cluster.yaml
  52. when: start_cluster | default(true) | bool