main.yml 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. ---
  2. ######################################################################)
  3. # Users, projects, and privileges
  4. - name: Run pre-install Management validation checks
  5. include: 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. include_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: accounts.yml
  18. ######################################################################
  19. # STORAGE - Initialize basic storage class
  20. #---------------------------------------------------------------------
  21. # * nfs - set up NFS shares on the first master for a proof of concept
  22. - name: Create required NFS exports for Management app storage
  23. include: storage/nfs.yml
  24. when: openshift_management_storage_class == 'nfs'
  25. #---------------------------------------------------------------------
  26. # * external - NFS again, but pointing to a pre-configured NFS server
  27. - name: Note Storage Type - External NFS
  28. debug:
  29. msg: "Setting up external NFS storage, openshift_management_storage_class is {{ openshift_management_storage_class }}"
  30. when: openshift_management_storage_class == 'nfs_external'
  31. #---------------------------------------------------------------------
  32. # * cloudprovider - use an existing cloudprovider based storage
  33. - name: Note Storage Type - Cloud Provider
  34. debug:
  35. msg: Validating cloud provider storage type, openshift_management_storage_class is 'cloudprovider'
  36. when: openshift_management_storage_class == 'cloudprovider'
  37. #---------------------------------------------------------------------
  38. # * preconfigured - don't do anything, assume it's all there ready to go
  39. - name: Note Storage Type - Preconfigured
  40. debug:
  41. msg: Skipping storage configuration, openshift_management_storage_class is 'preconfigured'
  42. when: openshift_management_storage_class == 'preconfigured'
  43. ######################################################################
  44. # APPLICATION TEMPLATE
  45. - name: Install the Management app and PV templates
  46. include: template.yml
  47. ######################################################################
  48. # APP & DB Storage
  49. # For local/external NFS backed installations
  50. - name: "Create the required App and DB PVs using {{ openshift_management_storage_class }}"
  51. include: storage/create_nfs_pvs.yml
  52. when:
  53. - openshift_management_storage_class in ['nfs', 'nfs_external']
  54. ######################################################################
  55. # CREATE APP
  56. - name: Note the correct ext-db template name
  57. set_fact:
  58. openshift_management_template_name: "{{ openshift_management_flavor }}-ext-db"
  59. when:
  60. - openshift_management_app_template in ['miq-template-ext-db', 'cfme-template-ext-db']
  61. - name: Note the correct podified db template name
  62. set_fact:
  63. openshift_management_template_name: "{{ openshift_management_flavor }}"
  64. when:
  65. - openshift_management_app_template in ['miq-template', 'cfme-template']
  66. - name: Ensure the Management App is created
  67. oc_process:
  68. namespace: "{{ openshift_management_project }}"
  69. template_name: "{{ openshift_management_template_name }}"
  70. create: True
  71. params: "{{ openshift_management_template_parameters }}"
  72. - name: Wait for the app to come up. May take several minutes, 30s check intervals, 10m max
  73. command: "oc logs {{ openshift_management_flavor }}-0 -n {{ openshift_management_project }}"
  74. register: app_seeding_logs
  75. until: app_seeding_logs.stdout.find('Server starting complete') != -1
  76. delay: 30
  77. retries: 20