main.yml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. ---
  2. ######################################################################)
  3. # Users, projects, and privileges
  4. - name: Run pre-install Management validation checks
  5. include_tasks: validate.yml
  6. # This creates a service account allowing Container Provider
  7. # integration (managing OCP/Origin via MIQ/Management)
  8. - name: Enable Container Provider Integration
  9. import_role:
  10. role: openshift_manageiq
  11. - name: "Ensure the Management '{{ openshift_management_project }}' namespace exists"
  12. oc_project:
  13. state: present
  14. name: "{{ openshift_management_project }}"
  15. display_name: "{{ openshift_management_project_description }}"
  16. - name: Create and Authorize Management Accounts
  17. include_tasks: accounts.yml
  18. ######################################################################
  19. # STORAGE - Initialize basic storage class
  20. - name: Determine the correct NFS host if required
  21. include_tasks: storage/nfs_server.yml
  22. when: openshift_management_storage_class in ['nfs', 'nfs_external']
  23. #---------------------------------------------------------------------
  24. # * nfs - set up NFS shares on the first master for a proof of concept
  25. - name: Create required NFS exports for Management app storage
  26. include_tasks: storage/nfs.yml
  27. when: openshift_management_storage_class == 'nfs'
  28. #---------------------------------------------------------------------
  29. # * external - NFS again, but pointing to a pre-configured NFS server
  30. - name: Note Storage Type - External NFS
  31. debug:
  32. msg: "Setting up external NFS storage, openshift_management_storage_class is {{ openshift_management_storage_class }}"
  33. when: openshift_management_storage_class == 'nfs_external'
  34. #---------------------------------------------------------------------
  35. # * cloudprovider - use an existing cloudprovider based storage
  36. - name: Note Storage Type - Cloud Provider
  37. debug:
  38. msg: Validating cloud provider storage type, openshift_management_storage_class is 'cloudprovider'
  39. when: openshift_management_storage_class == 'cloudprovider'
  40. #---------------------------------------------------------------------
  41. # * preconfigured - don't do anything, assume it's all there ready to go
  42. - name: Note Storage Type - Preconfigured
  43. debug:
  44. msg: Skipping storage configuration, openshift_management_storage_class is 'preconfigured'
  45. when: openshift_management_storage_class == 'preconfigured'
  46. ######################################################################
  47. # APPLICATION TEMPLATE
  48. - name: Install the Management app and PV templates
  49. include_tasks: template.yml
  50. ######################################################################
  51. # APP & DB Storage
  52. # For local/external NFS backed installations
  53. - name: "Create the required App and DB PVs using {{ openshift_management_storage_class }}"
  54. include_tasks: storage/create_nfs_pvs.yml
  55. when:
  56. - openshift_management_storage_class in ['nfs', 'nfs_external']
  57. ######################################################################
  58. # CREATE APP
  59. - name: Note the correct ext-db template name
  60. set_fact:
  61. openshift_management_template_name: "{{ openshift_management_flavor }}-ext-db"
  62. when:
  63. - openshift_management_app_template in ['miq-template-ext-db', 'cfme-template-ext-db']
  64. - name: Note the correct podified db template name
  65. set_fact:
  66. openshift_management_template_name: "{{ openshift_management_flavor }}"
  67. when:
  68. - openshift_management_app_template in ['miq-template', 'cfme-template']
  69. - name: Ensure the Management App is created
  70. oc_process:
  71. namespace: "{{ openshift_management_project }}"
  72. template_name: "{{ openshift_management_template_name }}"
  73. create: True
  74. params: "{{ openshift_management_template_parameters }}"
  75. - name: Wait for the app to come up. May take several minutes, 30s check intervals, {{ openshift_management_pod_rollout_retries }} retries
  76. command: "oc logs {{ openshift_management_flavor }}-0 -n {{ openshift_management_project }}"
  77. register: app_seeding_logs
  78. until: app_seeding_logs.stdout.find('Server starting complete') != -1
  79. delay: 30
  80. retries: "{{ openshift_management_pod_rollout_retries }}"