summaryrefslogtreecommitdiffstats
path: root/roles/openshift_cfme/tasks/main.yml
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2017-10-05 09:42:09 -0700
committerGitHub <noreply@github.com>2017-10-05 09:42:09 -0700
commit6f06b5ed6ada0bf22051b7af79bd474ae2398ee9 (patch)
tree2d54f3580de1580c14c956cbd9532338c1193d18 /roles/openshift_cfme/tasks/main.yml
parent8e2019c9c3840a64425c34c23ace9e9cbd6b7eb0 (diff)
parentd4c1a0443e7c38343752f880d6ae3c2c2c33ab54 (diff)
downloadopenshift-6f06b5ed6ada0bf22051b7af79bd474ae2398ee9.tar.gz
openshift-6f06b5ed6ada0bf22051b7af79bd474ae2398ee9.tar.bz2
openshift-6f06b5ed6ada0bf22051b7af79bd474ae2398ee9.tar.xz
openshift-6f06b5ed6ada0bf22051b7af79bd474ae2398ee9.zip
Merge pull request #5336 from tbielawa/cfme_4.6
Automatic merge from submit-queue. Cfme 4.6 # Description * Implements support for **CFME 4.6** in OCP 3.7 * **Replaces** the Tech Preview CFME 4.5 release included in OCP 3.6 * Does not support graceful migrations from the CFME 4.5 tech preview release # References * [Trello - (5) Integrate CFME 4.6 into OCP Installation](https://trello.com/c/Rzfn5Qa8/380-5-integrate-cfme-46-into-ocp-installation) Ensure the following RFE/Errors do not happen again - [x] #4555 - Error creating the CFME user - [x] #4556 - Error in PV template evaluation - [x] #4822 - Changing `maxImagesBulkImportedPerRepository` parameter - [x] #4568 - Add NFS directory support # Features Ensure the following features are configurable in the role - [x] POC deployments can easily default to NFS storage - [ ] Production/Cloud deployments can use automatic storage providers - [ ] Able to select between podified vs. external PostgreSQL database (podified uses configured storage mechanism) - [x] Template resource requests can be overridden for POC deployments
Diffstat (limited to 'roles/openshift_cfme/tasks/main.yml')
-rw-r--r--roles/openshift_cfme/tasks/main.yml150
1 files changed, 56 insertions, 94 deletions
diff --git a/roles/openshift_cfme/tasks/main.yml b/roles/openshift_cfme/tasks/main.yml
index 74ae16d91..78a6710b3 100644
--- a/roles/openshift_cfme/tasks/main.yml
+++ b/roles/openshift_cfme/tasks/main.yml
@@ -1,117 +1,79 @@
---
-######################################################################
+######################################################################)
# Users, projects, and privileges
-- name: Ensure the CFME user exists
- oc_user:
- state: present
- username: "{{ openshift_cfme_user }}"
+- name: Run pre-install CFME validation checks
+ include: validate.yml
-- name: Ensure the CFME namespace exists with CFME user as admin
+- name: "Ensure the CFME '{{ openshift_cfme_project }}' namespace exists"
oc_project:
state: present
name: "{{ openshift_cfme_project }}"
display_name: "{{ openshift_cfme_project_description }}"
- admin: "{{ openshift_cfme_user }}"
-
-- name: Ensure the CFME namespace service account is privileged
- oc_adm_policy_user:
- namespace: "{{ openshift_cfme_project }}"
- user: "{{ openshift_cfme_service_account }}"
- resource_kind: scc
- resource_name: privileged
- state: present
-
-######################################################################
-# NFS
-# In the case that we are not running on a cloud provider, volumes must be statically provisioned
-- include: nfs.yml
- when: not (openshift_cloudprovider_kind is defined and (openshift_cloudprovider_kind == 'aws' or openshift_cloudprovider_kind == 'gce'))
+- name: Create and Authorize CFME Accounts
+ include: accounts.yml
######################################################################
-# CFME App Template
-#
-# Note, this is different from the create_pvs.yml tasks in that the
-# application template does not require any jinja2 evaluation.
-#
-# TODO: Handle the case where the server template is updated in
-# openshift-ansible and the change needs to be landed on the managed
-# cluster.
-
-- name: Check if the CFME Server template has been created already
- oc_obj:
- namespace: "{{ openshift_cfme_project }}"
- state: list
- kind: template
- name: manageiq
- register: miq_server_check
+# STORAGE - Initialize basic storage class
+#---------------------------------------------------------------------
+# * nfs - set up NFS shares on the first master for a proof of concept
+- name: Create required NFS exports for CFME app storage
+ include: storage/nfs.yml
+ when: openshift_cfme_storage_class == 'nfs'
+
+#---------------------------------------------------------------------
+# * external - NFS again, but pointing to a pre-configured NFS server
+- name: Note Storage Type - External NFS
+ debug:
+ msg: "Setting up external NFS storage, openshift_cfme_storage_class is {{ openshift_cfme_storage_class }}"
+ when: openshift_cfme_storage_class == 'nfs_external'
-- name: Copy over CFME Server template
- copy:
- src: miq-template.yaml
- dest: "{{ template_dir }}/miq-template.yaml"
+#---------------------------------------------------------------------
+# * cloudprovider - use an existing cloudprovider based storage
+- name: Note Storage Type - Cloud Provider
+ debug:
+ msg: Validating cloud provider storage type, openshift_cfme_storage_class is 'cloudprovider'
+ when: openshift_cfme_storage_class == 'cloudprovider'
-- name: Ensure the server template was read from disk
+#---------------------------------------------------------------------
+# * preconfigured - don't do anything, assume it's all there ready to go
+- name: Note Storage Type - Preconfigured
debug:
- var=r_openshift_cfme_miq_template_content
+ msg: Skipping storage configuration, openshift_cfme_storage_class is 'preconfigured'
+ when: openshift_cfme_storage_class == 'preconfigured'
-- name: Ensure CFME Server Template exists
- oc_obj:
- namespace: "{{ openshift_cfme_project }}"
- kind: template
- name: "manageiq"
- state: present
- content: "{{ r_openshift_cfme_miq_template_content }}"
+######################################################################
+# APPLICATION TEMPLATE
+- name: Install the CFME app and PV templates
+ include: template.yml
######################################################################
-# Let's do this
+# APP & DB Storage
-- name: Ensure the CFME Server is created
- oc_process:
- namespace: "{{ openshift_cfme_project }}"
- template_name: manageiq
- create: True
- params:
- APPLICATION_IMG_NAME: "{{ openshift_cfme_application_img_name }}"
- POSTGRESQL_IMG_NAME: "{{ openshift_cfme_postgresql_img_name }}"
- MEMCACHED_IMG_NAME: "{{ openshift_cfme_memcached_img_name }}"
- APPLICATION_IMG_TAG: "{{ openshift_cfme_application_img_tag }}"
- POSTGRESQL_IMG_TAG: "{{ openshift_cfme_postgresql_img_tag }}"
- MEMCACHED_IMG_TAG: "{{ openshift_cfme_memcached_img_tag }}"
- register: cfme_new_app_process
- run_once: True
+# For local/external NFS backed installations
+- name: "Create the required App and DB PVs using {{ openshift_cfme_storage_class }}"
+ include: storage/create_nfs_pvs.yml
when:
- # User said to install CFME in their inventory
- - openshift_cfme_install_app | bool
- # # The server app doesn't exist already
- # - not miq_server_check.results.results.0
-
-- debug:
- var: cfme_new_app_process
+ - openshift_cfme_storage_class in ['nfs', 'nfs_external']
######################################################################
-# Various cleanup steps
-
-# TODO: Not sure what to do about this right now. Might be able to
-# just delete it? This currently warns about "Unable to find
-# '<TEMP_DIR>' in expected paths."
-- name: Ensure the temporary PV/App templates are erased
- file:
- path: "{{ item }}"
- state: absent
- with_fileglob:
- - "{{ template_dir }}/*.yaml"
-
-- name: Ensure the temporary PV/app template directory is erased
- file:
- path: "{{ template_dir }}"
- state: absent
+# CREATE APP
+- name: Note the correct ext-db template name
+ set_fact:
+ openshift_cfme_template_name: "{{ openshift_cfme_flavor }}-ext-db"
+ when:
+ - openshift_cfme_app_template in ['miq-template-ext-db', 'cfme-template-ext-db']
-######################################################################
+- name: Note the correct podified db template name
+ set_fact:
+ openshift_cfme_template_name: "{{ openshift_cfme_flavor }}"
+ when:
+ - openshift_cfme_app_template in ['miq-template', 'cfme-template']
-- name: Status update
- debug:
- msg: >
- CFME has been deployed. Note that there will be a delay before
- it is fully initialized.
+- name: Ensure the CFME App is created
+ oc_process:
+ namespace: "{{ openshift_cfme_project }}"
+ template_name: "{{ openshift_cfme_template_name }}"
+ create: True
+ params: "{{ openshift_cfme_template_parameters }}"