summaryrefslogtreecommitdiffstats
path: root/roles/openshift_cfme/tasks/storage/create_nfs_pvs.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/storage/create_nfs_pvs.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/storage/create_nfs_pvs.yml')
-rw-r--r--roles/openshift_cfme/tasks/storage/create_nfs_pvs.yml69
1 files changed, 69 insertions, 0 deletions
diff --git a/roles/openshift_cfme/tasks/storage/create_nfs_pvs.yml b/roles/openshift_cfme/tasks/storage/create_nfs_pvs.yml
new file mode 100644
index 000000000..d5252464e
--- /dev/null
+++ b/roles/openshift_cfme/tasks/storage/create_nfs_pvs.yml
@@ -0,0 +1,69 @@
+---
+# Create the required PVs for the App and the DB
+- name: Note the App PV Size from Template Parameters
+ set_fact:
+ openshift_cfme_app_pv_size: "{{ openshift_cfme_template_parameters.APPLICATION_VOLUME_CAPACITY }}"
+ when:
+ - openshift_cfme_template_parameters.APPLICATION_VOLUME_CAPACITY is defined
+
+- name: Note the App PV Size from defaults
+ set_fact:
+ openshift_cfme_app_pv_size: "{{ __openshift_cfme_app_pv_size }}"
+ when:
+ - openshift_cfme_template_parameters.APPLICATION_VOLUME_CAPACITY is not defined
+
+- when: openshift_cfme_app_template in ['miq-template', 'cfme-template']
+ block:
+ - name: Note the DB PV Size from Template Parameters
+ set_fact:
+ openshift_cfme_db_pv_size: "{{ openshift_cfme_template_parameters.DATABASE_VOLUME_CAPACITY }}"
+ when:
+ - openshift_cfme_template_parameters.DATABASE_VOLUME_CAPACITY is defined
+
+ - name: Note the DB PV Size from defaults
+ set_fact:
+ openshift_cfme_db_pv_size: "{{ __openshift_cfme_db_pv_size }}"
+ when:
+ - openshift_cfme_template_parameters.DATABASE_VOLUME_CAPACITY is not defined
+
+- name: Check if the CFME App PV has been created
+ oc_obj:
+ namespace: "{{ openshift_cfme_project }}"
+ state: list
+ kind: pv
+ name: "{{ openshift_cfme_flavor_short }}-app"
+ register: miq_app_pv_check
+
+- name: Check if the CFME DB PV has been created
+ oc_obj:
+ namespace: "{{ openshift_cfme_project }}"
+ state: list
+ kind: pv
+ name: "{{ openshift_cfme_flavor_short }}-db"
+ register: miq_db_pv_check
+ when:
+ - openshift_cfme_app_template in ['miq-template', 'cfme-template']
+
+- name: Ensure the CFME App PV is created
+ oc_process:
+ namespace: "{{ openshift_cfme_project }}"
+ template_name: "{{ openshift_cfme_flavor }}-app-pv"
+ create: True
+ params:
+ PV_SIZE: "{{ openshift_cfme_app_pv_size }}"
+ BASE_PATH: "{{ openshift_cfme_storage_nfs_base_dir }}"
+ NFS_HOST: "{{ openshift_cfme_nfs_server }}"
+ when: miq_app_pv_check.results.results == [{}]
+
+- name: Ensure the CFME DB PV is created
+ oc_process:
+ namespace: "{{ openshift_cfme_project }}"
+ template_name: "{{ openshift_cfme_flavor }}-db-pv"
+ create: True
+ params:
+ PV_SIZE: "{{ openshift_cfme_db_pv_size }}"
+ BASE_PATH: "{{ openshift_cfme_storage_nfs_base_dir }}"
+ NFS_HOST: "{{ openshift_cfme_nfs_server }}"
+ when:
+ - openshift_cfme_app_template in ['miq-template', 'cfme-template']
+ - miq_db_pv_check.results.results == [{}]