main.yml 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. ---
  2. - name: Copy openshift examples
  3. copy:
  4. src: examples
  5. dest: /usr/share/openshift
  6. # RHEL and Centos image streams are mutually exclusive
  7. - name: Import RHEL streams
  8. command: >
  9. {{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ rhel_image_streams }}
  10. when: openshift_examples_load_rhel
  11. register: oex_import_rhel_streams
  12. failed_when: "'already exists' not in oex_import_rhel_streams.stderr and oex_import_rhel_streams.rc != 0"
  13. changed_when: false
  14. - name: Import Centos Image streams
  15. command: >
  16. {{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ centos_image_streams }}
  17. when: openshift_examples_load_centos | bool
  18. register: oex_import_centos_streams
  19. failed_when: "'already exists' not in oex_import_centos_streams.stderr and oex_import_centos_streams.rc != 0"
  20. changed_when: false
  21. - name: Import db templates
  22. command: >
  23. {{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ db_templates_base }}
  24. when: openshift_examples_load_db_templates | bool
  25. register: oex_import_db_templates
  26. failed_when: "'already exists' not in oex_import_db_templates.stderr and oex_import_db_templates.rc != 0"
  27. changed_when: false
  28. - name: Import quickstart-templates
  29. command: >
  30. {{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ quickstarts_base }}
  31. when: openshift_examples_load_quickstarts | bool
  32. register: oex_import_quickstarts
  33. failed_when: "'already exists' not in oex_import_quickstarts.stderr and oex_import_quickstarts.rc != 0"
  34. changed_when: false
  35. - name: Import origin infrastructure-templates
  36. command: >
  37. {{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ infrastructure_origin_base }}
  38. when: openshift_examples_load_centos | bool
  39. register: oex_import_infrastructure
  40. failed_when: "'already exists' not in oex_import_infrastructure.stderr and oex_import_infrastructure.rc != 0"
  41. changed_when: false
  42. - name: Import enterprise infrastructure-templates
  43. command: >
  44. {{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ infrastructure_enterprise_base }}
  45. when: openshift_examples_load_rhel | bool
  46. register: oex_import_infrastructure
  47. failed_when: "'already exists' not in oex_import_infrastructure.stderr and oex_import_infrastructure.rc != 0"
  48. changed_when: false
  49. - name: Import xPaas image streams
  50. command: >
  51. {{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ xpaas_image_streams }}
  52. when: openshift_examples_load_xpaas | bool
  53. register: oex_import_xpaas_streams
  54. failed_when: "'already exists' not in oex_import_xpaas_streams.stderr and oex_import_xpaas_streams.rc != 0"
  55. changed_when: false
  56. - name: Import xPaas templates
  57. command: >
  58. {{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ xpaas_templates_base }}
  59. when: openshift_examples_load_xpaas | bool
  60. register: oex_import_xpaas_templates
  61. failed_when: "'already exists' not in oex_import_xpaas_templates.stderr and oex_import_xpaas_templates.rc != 0"
  62. changed_when: false