From 42d330a1cf2990fee39dab36250524ebfb303428 Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Wed, 6 Sep 2017 15:11:55 -0400 Subject: CFME 4.6 work begins. CFME 4.5 references added to the release-3.6 branch --- roles/openshift_cfme/defaults/main.yml | 188 +++++++++++++++++++++++++++------ 1 file changed, 156 insertions(+), 32 deletions(-) (limited to 'roles/openshift_cfme/defaults') diff --git a/roles/openshift_cfme/defaults/main.yml b/roles/openshift_cfme/defaults/main.yml index b82c2e602..9a36f902d 100644 --- a/roles/openshift_cfme/defaults/main.yml +++ b/roles/openshift_cfme/defaults/main.yml @@ -1,32 +1,154 @@ --- -# Namespace for the CFME project (Note: changed post-3.6 to use -# reserved 'openshift-' namespace prefix) +# Namespace for the CFME project openshift_cfme_project: openshift-cfme # Namespace/project description -openshift_cfme_project_description: ManageIQ - CloudForms Management Engine -# Basic user assigned the `admin` role for the project -openshift_cfme_user: cfme -# Project system account for enabling privileged pods -openshift_cfme_service_account: "system:serviceaccount:{{ openshift_cfme_project }}:default" -# All the required exports -openshift_cfme_pv_exports: - - miq-pv01 - - miq-pv02 - - miq-pv03 -# PV template files and their created object names -openshift_cfme_pv_data: - - pv_name: miq-pv01 - pv_template: miq-pv-db.yaml - pv_label: CFME DB PV - - pv_name: miq-pv02 - pv_template: miq-pv-region.yaml - pv_label: CFME Region PV - - pv_name: miq-pv03 - pv_template: miq-pv-server.yaml - pv_label: CFME Server PV - -# Tuning parameter to use more than 5 images at once from an ImageStream -openshift_cfme_maxImagesBulkImportedPerRepository: 100 +openshift_cfme_project_description: ManageIQ - CloudForms Management Engine 4.6 + +###################################################################### +# BASE TEMPLATE AND DATABASE OPTIONS +###################################################################### +# Which flavor of CFME would you like? You may install CFME using a +# podified PostgreSQL server, or you may choose to use an existing +# PostgreSQL server. +# +# Choose 'miq-template' for a podified database install +# Choose 'miq-template-ext-db' for an external database install +openshift_cfme_app_template: miq-template + +# If you are using the miq-template-ext-db template then you must add +# the required database parameters to the +# openshift_cfme_template_parameters variable. For example: +# +# openshift_cfme_template_parameters: +# DATABASE_USER: root +# DATABASE_PASSWORD: @_grrrr8Pa$$.h3r3 +# DATABASE_IP: 10.1.1.10 +# DATABASE_PORT: 5432 +# DATABASE_NAME: vmdb_production + +###################################################################### +# STORAGE OPTIONS +###################################################################### +# DEFAULT - 'nfs' +# Allowed options: nfs, external, preconfigured, cloudprovider. +openshift_cfme_storage_class: nfs +# * nfs - Best used for proof-of-concept installs. Will setup NFS on a +# cluster host (defaults to your first master in the inventory file) +# to back the required PVCs. The application requires a PVC and the +# database (which may be hosted externally) may require a +# second. PVC minimum required sizes are: 5GiB for the MIQ +# application, and 15GiB for the PostgreSQL database (20GiB minimum +# available space on an volume/partition if used specifically for +# NFS purposes) +# +# * external - You are using an external NFS server, such as a netapp +# appliance. See the STORAGE - NFS OPTIONS section below for +# required information. +# +# * preconfigured - This CFME role will do NOTHING to modify storage +# settings. This option assumes expert knowledge and that you have +# done everything required ahead of time. +# +# * cloudprovider - You are using an OCP cloudprovider integration for +# your storage class. For this to work you must have already +# configured the required inventory parameters for your cloud +# provider +# +# Ensure 'openshift_cloudprovider_kind' is defined (aws or gce) and +# that the applicable cloudprovider parameters are provided. + +###################################################################### +# STORAGE - NFS OPTIONS +###################################################################### +# [OPTIONAL] - If you are using an EXTERNAL NFS server, such as a +# netapp appliance, then you must set the hostname here. Leave the +# value as 'false' if you are not using external NFS +openshift_cfme_storage_external_nfs_hostname: false +# [OPTIONAL] - If you are using external NFS then you must set the base +# path to the exports location here. +# +# Or, change this value if you want to change the default path used +# for local NFS exports. +openshift_cfme_storage_external_nfs_base_dir: /exports/ + + +###################################################################### +# VARIOUS CONSTANTS - DO NOT OVERRIDE THESE UNDER ANY CIRCUMSTANCES +###################################################################### + +###################################################################### +# Misc enumerated values +# Allowed choices for the storage class parameter +openshift_cfme_storage_classes: + - nfs + - external + - preconfigured + - cloudprovider +# Name of the application templates with object/parameter definitions +openshift_cfme_app_templates: + - miq-template-ext-db + - miq-template +# PostgreSQL database connection parameters +openshift_cfme_db_parameters: + - DATABASE_USER + - DATABASE_PASSWORD + - DATABASE_IP + - DATABASE_PORT + - DATABASE_NAME + + +###################################################################### +# ACCOUNTING +###################################################################### +# Service Account SSCs +openshift_system_account_sccs: + - name: miq-anyuid + resource_name: anyuid + - name: miq-orchestrator + resource_name: anyuid + - name: miq-privileged + resource_name: privileged + - name: miq-httpd + resource_name: miq-httpd + +# Service Account Roles +openshift_cfme_system_account_roles: + - name: miq-orchestrator + resource_name: view + - name: miq-orchestrator + resource_name: edit + + +###################################################################### +# SCAFFOLDING - These are parameters we pre-seed that a user may or +# may not set later +###################################################################### +# A hash of parameters you want to override or set in the +# miq-template.yaml or miq-template-ext-db.yaml templates. Set this in +# your inventory file as a simple hash. Acceptable values are defined +# under the .parameters list in files/miq-template{-ext-db}.yaml +# Example: +# +# openshift_cfme_template_parameters={'APPLICATION_MEM_REQ': '512Mi'} +openshift_cfme_template_parameters: {} + +# # All the required exports +# openshift_cfme_pv_exports: +# - miq-pv01 +# - miq-pv02 +# - miq-pv03 +# # PV template files and their created object names +# openshift_cfme_pv_data: +# - pv_name: miq-pv01 +# pv_template: miq-pv-db.yaml +# pv_label: CFME DB PV +# - pv_name: miq-pv02 +# pv_template: miq-pv-region.yaml +# pv_label: CFME Region PV +# - pv_name: miq-pv03 +# pv_template: miq-pv-server.yaml +# pv_label: CFME Server PV + # TODO: Refactor '_install_app' variable. This is just for testing but # maybe in the future it should control the entire yes/no for CFME. # @@ -34,9 +156,11 @@ openshift_cfme_maxImagesBulkImportedPerRepository: 100 # --template=manageiq). If False everything UP TO 'new-app' is ran. openshift_cfme_install_app: False # Docker image to pull -openshift_cfme_application_img_name: "{{ 'registry.access.redhat.com/cloudforms45/cfme-openshift-app' if openshift_deployment_type == 'openshift-enterprise' else 'docker.io/manageiq/manageiq-pods' }}" -openshift_cfme_postgresql_img_name: "{{ 'registry.access.redhat.com/cloudforms45/cfme-openshift-postgresql' if openshift_deployment_type == 'openshift-enterprise' else 'docker.io/manageiq/manageiq-pods' }}" -openshift_cfme_memcached_img_name: "{{ 'registry.access.redhat.com/cloudforms45/cfme-openshift-memcached' if openshift_deployment_type == 'openshift-enterprise' else 'docker.io/manageiq/manageiq-pods' }}" -openshift_cfme_application_img_tag: "{{ 'latest' if openshift_deployment_type == 'openshift-enterprise' else 'app-latest-fine' }}" -openshift_cfme_memcached_img_tag: "{{ 'latest' if openshift_deployment_type == 'openshift-enterprise' else 'memcached-latest-fine' }}" -openshift_cfme_postgresql_img_tag: "{{ 'latest' if openshift_deployment_type == 'openshift-enterprise' else 'postgresql-latest-fine' }}" +# openshift_cfme_application_img_name: "{{ 'registry.access.redhat.com/cloudforms46/cfme-openshift-app' if openshift_deployment_type == 'openshift-enterprise' else 'docker.io/manageiq/manageiq-pods' }}" +# openshift_cfme_application_img_tag: "{{ 'latest' if openshift_deployment_type == 'openshift-enterprise' else 'frontend-latest' }}" + +# openshift_cfme_memcached_img_name: "{{ 'registry.access.redhat.com/cloudforms46/cfme-openshift-memcached' if openshift_deployment_type == 'openshift-enterprise' else 'docker.io/manageiq/manageiq-pods' }}" +# openshift_cfme_memcached_img_tag: "{{ 'latest' if openshift_deployment_type == 'openshift-enterprise' else 'memcached-latest-fine' }}" + +# openshift_cfme_postgresql_img_tag: "{{ 'latest' if openshift_deployment_type == 'openshift-enterprise' else 'postgresql-latest-fine' }}" +# openshift_cfme_postgresql_img_name: "{{ 'registry.access.redhat.com/cloudforms46/cfme-openshift-postgresql' if openshift_deployment_type == 'openshift-enterprise' else 'docker.io/manageiq/manageiq-pods' }}" -- cgit v1.2.3 From 8e10c53974b4b87e483ed0dfec3946383aa071c7 Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Fri, 15 Sep 2017 17:18:22 -0400 Subject: Import upstream templates. Do the work. Validate parameters. --- playbooks/common/openshift-cfme/config.yml | 2 +- roles/openshift_cfme/README.md | 373 +++++++- roles/openshift_cfme/defaults/main.yml | 133 ++- roles/openshift_cfme/files/miq-backup-job.yaml | 28 - roles/openshift_cfme/files/miq-backup-pvc.yaml | 10 - .../files/miq-pv-backup-example.yaml | 13 - roles/openshift_cfme/files/miq-pv-db-example.yaml | 13 - .../files/miq-pv-server-example.yaml | 27 - roles/openshift_cfme/files/miq-restore-job.yaml | 35 - roles/openshift_cfme/files/miq-scc-httpd.yaml | 38 - .../openshift_cfme/files/miq-template-ext-db.yaml | 771 ----------------- roles/openshift_cfme/files/miq-template.yaml | 948 --------------------- roles/openshift_cfme/files/openshift_cfme.exports | 3 - .../templates/cloudforms/cfme-backup-job.yaml | 28 + .../templates/cloudforms/cfme-backup-pvc.yaml | 10 + .../cloudforms/cfme-pv-backup-example.yaml | 13 + .../templates/cloudforms/cfme-pv-db-example.yaml | 38 + .../cloudforms/cfme-pv-server-example.yaml | 38 + .../templates/cloudforms/cfme-restore-job.yaml | 35 + .../templates/cloudforms/cfme-scc-sysadmin.yaml | 38 + .../templates/cloudforms/cfme-template-ext-db.yaml | 763 +++++++++++++++++ .../files/templates/cloudforms/cfme-template.yaml | 940 ++++++++++++++++++++ .../files/templates/manageiq/miq-backup-job.yaml | 28 + .../files/templates/manageiq/miq-backup-pvc.yaml | 10 + .../templates/manageiq/miq-pv-backup-example.yaml | 13 + .../templates/manageiq/miq-pv-db-example.yaml | 38 + .../templates/manageiq/miq-pv-server-example.yaml | 38 + .../files/templates/manageiq/miq-restore-job.yaml | 35 + .../templates/manageiq/miq-template-ext-db.yaml | 771 +++++++++++++++++ .../files/templates/manageiq/miq-template.yaml | 948 +++++++++++++++++++++ roles/openshift_cfme/handlers/main.yml | 40 - roles/openshift_cfme/meta/main.yml | 2 - roles/openshift_cfme/tasks/accounts.yml | 51 +- roles/openshift_cfme/tasks/main.yml | 76 +- .../tasks/storage/create_nfs_pvs.yml | 43 + roles/openshift_cfme/tasks/storage/create_pvs.yml | 36 - roles/openshift_cfme/tasks/storage/nfs.yml | 156 ++-- roles/openshift_cfme/tasks/template.yml | 124 ++- roles/openshift_cfme/tasks/uninstall.yml | 63 +- roles/openshift_cfme/tasks/validate.yml | 52 +- .../openshift_cfme-miq-template-ext-db.exports.j2 | 1 + .../openshift_cfme-miq-template.exports.j2 | 2 + roles/openshift_cfme/vars/main.yml | 69 ++ roles/openshift_manageiq/tasks/main.yaml | 5 - roles/openshift_nfs/README.md | 17 + roles/openshift_nfs/defaults/main.yml | 8 + roles/openshift_nfs/meta/main.yml | 16 + roles/openshift_nfs/tasks/create_export.yml | 34 + roles/openshift_nfs/tasks/firewall.yml | 40 + roles/openshift_nfs/tasks/setup.yml | 29 + roles/openshift_storage_nfs/templates/exports.j2 | 2 - 51 files changed, 4698 insertions(+), 2346 deletions(-) delete mode 100644 roles/openshift_cfme/files/miq-backup-job.yaml delete mode 100644 roles/openshift_cfme/files/miq-backup-pvc.yaml delete mode 100644 roles/openshift_cfme/files/miq-pv-backup-example.yaml delete mode 100644 roles/openshift_cfme/files/miq-pv-db-example.yaml delete mode 100644 roles/openshift_cfme/files/miq-pv-server-example.yaml delete mode 100644 roles/openshift_cfme/files/miq-restore-job.yaml delete mode 100644 roles/openshift_cfme/files/miq-scc-httpd.yaml delete mode 100644 roles/openshift_cfme/files/miq-template-ext-db.yaml delete mode 100644 roles/openshift_cfme/files/miq-template.yaml delete mode 100644 roles/openshift_cfme/files/openshift_cfme.exports create mode 100644 roles/openshift_cfme/files/templates/cloudforms/cfme-backup-job.yaml create mode 100644 roles/openshift_cfme/files/templates/cloudforms/cfme-backup-pvc.yaml create mode 100644 roles/openshift_cfme/files/templates/cloudforms/cfme-pv-backup-example.yaml create mode 100644 roles/openshift_cfme/files/templates/cloudforms/cfme-pv-db-example.yaml create mode 100644 roles/openshift_cfme/files/templates/cloudforms/cfme-pv-server-example.yaml create mode 100644 roles/openshift_cfme/files/templates/cloudforms/cfme-restore-job.yaml create mode 100644 roles/openshift_cfme/files/templates/cloudforms/cfme-scc-sysadmin.yaml create mode 100644 roles/openshift_cfme/files/templates/cloudforms/cfme-template-ext-db.yaml create mode 100644 roles/openshift_cfme/files/templates/cloudforms/cfme-template.yaml create mode 100644 roles/openshift_cfme/files/templates/manageiq/miq-backup-job.yaml create mode 100644 roles/openshift_cfme/files/templates/manageiq/miq-backup-pvc.yaml create mode 100644 roles/openshift_cfme/files/templates/manageiq/miq-pv-backup-example.yaml create mode 100644 roles/openshift_cfme/files/templates/manageiq/miq-pv-db-example.yaml create mode 100644 roles/openshift_cfme/files/templates/manageiq/miq-pv-server-example.yaml create mode 100644 roles/openshift_cfme/files/templates/manageiq/miq-restore-job.yaml create mode 100644 roles/openshift_cfme/files/templates/manageiq/miq-template-ext-db.yaml create mode 100644 roles/openshift_cfme/files/templates/manageiq/miq-template.yaml create mode 100644 roles/openshift_cfme/tasks/storage/create_nfs_pvs.yml delete mode 100644 roles/openshift_cfme/tasks/storage/create_pvs.yml create mode 100644 roles/openshift_cfme/templates/openshift_cfme-miq-template-ext-db.exports.j2 create mode 100644 roles/openshift_cfme/templates/openshift_cfme-miq-template.exports.j2 create mode 100644 roles/openshift_cfme/vars/main.yml create mode 100644 roles/openshift_nfs/README.md create mode 100644 roles/openshift_nfs/defaults/main.yml create mode 100644 roles/openshift_nfs/meta/main.yml create mode 100644 roles/openshift_nfs/tasks/create_export.yml create mode 100644 roles/openshift_nfs/tasks/firewall.yml create mode 100644 roles/openshift_nfs/tasks/setup.yml (limited to 'roles/openshift_cfme/defaults') diff --git a/playbooks/common/openshift-cfme/config.yml b/playbooks/common/openshift-cfme/config.yml index 798805698..3f3abd008 100644 --- a/playbooks/common/openshift-cfme/config.yml +++ b/playbooks/common/openshift-cfme/config.yml @@ -15,7 +15,7 @@ # poll: 0 - name: Setup CFME - hosts: m01.example.com + hosts: oo_first_master pre_tasks: - name: Create a temporary place to evaluate the PV templates command: mktemp -d /tmp/openshift-ansible-XXXXXXX diff --git a/roles/openshift_cfme/README.md b/roles/openshift_cfme/README.md index f6b62b358..5d90e532f 100644 --- a/roles/openshift_cfme/README.md +++ b/roles/openshift_cfme/README.md @@ -1,27 +1,366 @@ -## OpenShift-Ansible - CFME Role +# CloudForms Availability -# CloudForms - 4.6 +As noted in [Limitations - Product Choice](#product-choice), +CloudForms 4.6 is not yet released. Until such time, this role is +limited to installing ManageIQ, the open source project that CFME is +based on. -**Important Note**: As of 2017-09-06 the `master` branch of the -[openshift-ansible](https://github.com/openshift/openshift-ansible) -repository is now tracking changes for CloudForms 4.6. +# Table of Contents -If you installed CFME **4.5** previously using this role then you -**must** use the role from the stable `release-3.6` branch. + * [Introduction](#introduction) + * [Requirements](#requirements) + * [Role Variables](#role-variables) + * [Getting Started](#getting-started) + * [All Defaults](#all-defaults) + * [External NFS Storage](#external-nfs-storage) + * [Override PV sizes](#override-pv-sizes) + * [Override Memory Requirements](#override-memory-requirements) + * [External PostgreSQL Database](#external-postgresql-database) + * [Limitations](#limitations) + * [Product Choice](#product-choice) + * [Storage](#storage) + * [Database](#database) + * [Configuration](#configuration) + * [Configuration - Storage Classes](#configuration---storage-classes) + * [NFS (Default)](#nfs-default) + * [NFS External](#nfs-external) + * [Cloud Provider](#cloud-provider) + * [Preconfigured (Expert Configuration Only)](#preconfigured-expert-configuration-only) + * [Configuration - Database](#configuration---database) + * [Podified Database](#podified-database) + * [External Database](#external-database) + * [Customization](#customization) + * [Additional Information](#additional-information) -This role, `openshift_cfme`, in OpenShift Container Platform (OCP) 3.7 -**will not** be backwards compatible with the previous tech preview -released in OCP 3.6. +# Introduction +This role will allow a user to install CFME 4.6 or ManageIQ on an OCP +3.7 cluster. The role provides customization options for overriding +default deployment parameters. The role includes several choices for +storage classes. -# CFME/MIQ 4.5 Legacy Instructions +This role includes the following storage class options -* [OCP 3.6 - CFME 4.5 Installation Instruction](https://github.com/openshift/openshift-ansible/tree/release-3.6/roles/openshift_cfme) +* NFS - **Default** - local, on cluster +* NFS External - NFS somewhere else, like a storage appliance +* Cloud Provider - Use automatic storage provisioning from your cloud + provider (`gce` or `aws`) +* Preconfigured - **expert only**, assumes you created everything ahead + of time -The instructions linked in the bulleted item above are for the **TECH -PREVIEW** CloudForms Management Engine (ManageIQ) 4.5 release. +This role allows you to host the required PostgreSQL database podified +(on a pod in the cluster) or externally (on an existing PostgreSQL +host). -# CloudForms 4.5 Pull Requests +You may skip ahead to the [Getting Started](#getting-started) section +now for examples of how to set up your Ansible inventory for various +deployment configurations. However, you are **strongly urged** to read +through the [Configuration](#configuration) and +[Customization](#customization) sections first. -We are no longer accepting pull requests for the *Tech Preview* -CloudForms 4.5 release. +# Requirements + +* OCP 3.7 must be installed **before** running this role. + +The **default** requirements are listed in the table below. These can +be overridden through customization parameters (See +[Customization](#customization), below). + +**Note** that the application performance will suffer, or possibly +even fail to deploy, if these requirements are not satisfied. + + +| Item | Requirement | Description | Customization Parameter | +|---------------------|---------------|----------------------------------------------|-------------------------------| +| Application Memory | `≥ 4.0 Gi` | Minimum required memory for the application | `APPLICATION_MEM_REQ` | +| Application Storage | `≥ 5.0 Gi` | Minimum PV size required for the application | `APPLICATION_VOLUME_CAPACITY` | +| PostgreSQL Memory | `≥ 6.0 Gi` | Minimum required memory for the database | `POSTGRESQL_MEM_REQ` | +| PostgreSQL Storage | `≥ 15.0 Gi` | Minimum PV size required for the database | `DATABASE_VOLUME_CAPACITY` | +| Cluster Hosts | `≥ 3` | Number of hosts in your cluster | `∅` | + +The implications of this table are summarized below: + +* You need several cluster nodes +* Your cluster nodes must have lots of memory available +* You will need several GiB's of storage available + + +# Role Variables + + + +| Variable | Required | Default | Description | +|------------------------------------------------|:--------:|:------------------------------:|-------------------------------------| +| `openshift_cfme_project` | **No** | `openshift-cfme` | Namespace for the installation. | +| `openshift_cfme_project_description` | **No** | *CloudForms Management Engine* | Namespace/project description. | +| **PRODUCT CHOICE** | | | | | +| `openshift_cfme_app_template` | **No** | `miq-template` | The project flavor to install. Choices: | +| **STORAGE OPTIONS** | | | | | +| `openshift_cfme_storage_class` | **No** | `nfs` | Storage type to use, choices: