install_provisioners.yaml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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: Install support
  15. include_tasks: install_support.yaml
  16. - name: Install EFS
  17. include_tasks: install_efs.yaml
  18. when: openshift_provisioners_efs | bool
  19. - find: paths={{ mktemp.stdout }}/templates patterns=*.yaml
  20. register: object_def_files
  21. changed_when: no
  22. - slurp: src={{item}}
  23. register: object_defs
  24. with_items: "{{object_def_files.files | map(attribute='path') | list | sort}}"
  25. changed_when: no
  26. - name: Create objects
  27. include_tasks: oc_apply.yaml
  28. vars:
  29. - kubeconfig: "{{ mktemp.stdout }}/admin.kubeconfig"
  30. - namespace: "{{ openshift_provisioners_project }}"
  31. - file_name: "{{ file.source }}"
  32. - file_content: "{{ file.content | b64decode | from_yaml }}"
  33. with_items: "{{ object_defs.results }}"
  34. loop_control:
  35. loop_var: file
  36. when: not ansible_check_mode
  37. - name: Printing out objects to create
  38. debug: msg={{file.content | b64decode }}
  39. with_items: "{{ object_defs.results }}"
  40. loop_control:
  41. loop_var: file
  42. when: ansible_check_mode
  43. - name: Scaling up cluster
  44. include_tasks: start_cluster.yaml
  45. when: start_cluster | default(true) | bool