From c0f63fb902b53bc592e6862d5876af9b244ee82b Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Thu, 5 Oct 2017 15:42:18 -0400 Subject: Rename openshift_cfme role to openshift_management --- roles/openshift_management/README.md | 475 +++++++++++ roles/openshift_management/defaults/main.yml | 90 ++ .../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_management/handlers/main.yml | 0 roles/openshift_management/meta/main.yml | 18 + roles/openshift_management/tasks/accounts.yml | 28 + roles/openshift_management/tasks/main.yml | 79 ++ .../tasks/storage/create_nfs_pvs.yml | 69 ++ roles/openshift_management/tasks/storage/nfs.yml | 67 ++ .../openshift_management/tasks/storage/storage.yml | 3 + roles/openshift_management/tasks/template.yml | 128 +++ roles/openshift_management/tasks/uninstall.yml | 23 + roles/openshift_management/tasks/validate.yml | 90 ++ roles/openshift_management/vars/main.yml | 76 ++ 30 files changed, 4930 insertions(+) create mode 100644 roles/openshift_management/README.md create mode 100644 roles/openshift_management/defaults/main.yml create mode 100644 roles/openshift_management/files/templates/cloudforms/cfme-backup-job.yaml create mode 100644 roles/openshift_management/files/templates/cloudforms/cfme-backup-pvc.yaml create mode 100644 roles/openshift_management/files/templates/cloudforms/cfme-pv-backup-example.yaml create mode 100644 roles/openshift_management/files/templates/cloudforms/cfme-pv-db-example.yaml create mode 100644 roles/openshift_management/files/templates/cloudforms/cfme-pv-server-example.yaml create mode 100644 roles/openshift_management/files/templates/cloudforms/cfme-restore-job.yaml create mode 100644 roles/openshift_management/files/templates/cloudforms/cfme-scc-sysadmin.yaml create mode 100644 roles/openshift_management/files/templates/cloudforms/cfme-template-ext-db.yaml create mode 100644 roles/openshift_management/files/templates/cloudforms/cfme-template.yaml create mode 100644 roles/openshift_management/files/templates/manageiq/miq-backup-job.yaml create mode 100644 roles/openshift_management/files/templates/manageiq/miq-backup-pvc.yaml create mode 100644 roles/openshift_management/files/templates/manageiq/miq-pv-backup-example.yaml create mode 100644 roles/openshift_management/files/templates/manageiq/miq-pv-db-example.yaml create mode 100644 roles/openshift_management/files/templates/manageiq/miq-pv-server-example.yaml create mode 100644 roles/openshift_management/files/templates/manageiq/miq-restore-job.yaml create mode 100644 roles/openshift_management/files/templates/manageiq/miq-template-ext-db.yaml create mode 100644 roles/openshift_management/files/templates/manageiq/miq-template.yaml create mode 100644 roles/openshift_management/handlers/main.yml create mode 100644 roles/openshift_management/meta/main.yml create mode 100644 roles/openshift_management/tasks/accounts.yml create mode 100644 roles/openshift_management/tasks/main.yml create mode 100644 roles/openshift_management/tasks/storage/create_nfs_pvs.yml create mode 100644 roles/openshift_management/tasks/storage/nfs.yml create mode 100644 roles/openshift_management/tasks/storage/storage.yml create mode 100644 roles/openshift_management/tasks/template.yml create mode 100644 roles/openshift_management/tasks/uninstall.yml create mode 100644 roles/openshift_management/tasks/validate.yml create mode 100644 roles/openshift_management/vars/main.yml (limited to 'roles/openshift_management') diff --git a/roles/openshift_management/README.md b/roles/openshift_management/README.md new file mode 100644 index 000000000..3a71d9211 --- /dev/null +++ b/roles/openshift_management/README.md @@ -0,0 +1,475 @@ +# CloudForms Availability + +As noted in [Limitations - Product Choice](#product-choice), +[CloudForms](https://www.redhat.com/en/technologies/management/cloudforms) +(CFME) 4.6 is not yet released. Until such time, this role is limited +to installing [ManageIQ](http://manageiq.org) (MIQ), the open source +project that CFME is based on. + +After CFME 4.6 is available to customers this role will enable +(optional) logic which will install CFME or MIQ based on your +deployment type (`openshift_deployment_type`): + +* `openshift-enterprise` → CloudForms +* `origin` → ManageIQ + + +# Table of Contents + + * [Introduction](#introduction) + * [Important Notes](#important-notes) + * [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) + * [Configuration](#configuration) + * [Database](#database) + * [Podified](#podified) + * [External](#external) + * [Storage Classes](#storage-classes) + * [NFS (Default)](#nfs-default) + * [NFS External](#nfs-external) + * [Cloud Provider](#cloud-provider) + * [Preconfigured (Expert Configuration Only)](#preconfigured-expert-configuration-only) + * [Customization](#customization) + * [Uninstall](#uninstall) + * [Additional Information](#additional-information) + +# Introduction + +This role will allow a user to install CFME 4.6 or MIQ on an OCP +3.7 cluster. The role provides customization options for overriding +default deployment parameters. This role allows the user to deploy +different installation flavors: + +* **Fully Podified** - In this way all application services are ran as + pods in the container platform. +* **External Database** - In this way the application utilizes an + externally hosted database server. All other services are ran in the + container platform. + +This role includes the following storage class options: + +* 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 + +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 +first read through the [Configuration](#configuration) and +[Customization](#customization) sections as well as the following +[Important Notes](#important-notes). + +## Important Notes + +Not all parameters are present in **both** template versions (podified +db and external db). For example, while the podified database template +has a `POSTGRESQL_MEM_REQ` parameter, no such parameter is present in +the external db template, as there is no need for this information due +to there being no databases that require pods. + +*Be extra careful* if you are overriding template +parameters. Including parameters not defined in a template **will +cause errors**. + +**Container Provider Integration** - If you want add your container +platform (OCP/Origin) as a *Container Provider* in CFME/MIQ then you +must ensure that the infrastructure management hooks are installed. + +* During your OCP/Origin install, ensure that you have the + `openshift_use_manageiq` parameter set to `true` in your inventory + at install time. This will create a `management-infra` project and a + service account user. +* After CFME/MIQ is installed, obtain the `management-admin` service + account token and copy it somewhere safe. + +```bash +$ oc serviceaccounts get-token -n management-infra management-admin +eyJhuGdiOiJSUzI1NiIsInR5dCI6IkpXVCJ9.eyJpd9MiOiJrbWJldm5lbGVzL9NldnZpY2VhY2NvbW50Iiwiy9ViZXJuZXRldy5puy9zZXJ2yWNlYWNju9VubC9uYW1ld9BhY2UiOiJtYW5hZ2VtZW50LWluZnJhIiwiy9ViZXJuZXRldy5puy9zZXJ2yWNlYWNju9VubC9zZWNyZXQuumFtZSI6Im1humFnZW1lunQtYWRtyW4tbG9rZW4tdDBnOTAiLCJrbWJldm5lbGVzLmlvL9NldnZpY2VhY2NvbW50L9NldnZpY2UtYWNju9VubC5uYW1lIjoiuWFuYWbluWVubC1hZG1puiIsImt1YmVyumV0ZXMuyW8vd2VybmljZWFjY291unQvd2VybmljZS1hY2NvbW50LnVpZCI6IjRiZDM2MWQ1LWE1NDAtMTFlNy04YzI5LTUyNTQwMDliMmNkZCIsInN1YiI6InN5d9RluTpzZXJ2yWNlYWNju9VubDptYW5hZ2VtZW50LWluZnJhOm1humFnZW1lunQtYWRtyW4ifQ.B6sZLGD9O4vBu9MHwiG-C_4iEwjBXb7Af8BPw-LNlujDmHhOnQ-Oo4QxQKyj9edynfmDy2yutUyJ2Mm9HfDGWg4C9xhWImHoq6Nl7T5_9djkeGKkK7Ejvg4fA-IkrzEsZeQuluBvXnE6wvP0LCjUo_dx4pPyZJyp46teV9NqKQeDzeysjlMCyqp6AK6-Lj8ILG8YA6d_97HlzL_EgFBLAu0lBSn-uC_9J0gLysqBtK6TI0nExfhv9Bm1_5bdHEbKHPW7xIlYlI9AgmyTyhsQ6SoQWtL2khBjkG9TlPBq9wYJj9bzqgVZlqEfICZxgtXO7sYyuoje4y8lo0YQ0kZmig +``` + +* In the CFME/MIQ web interface, navigate to `Compute` → + `Containers` → `Providers` and select `⚙ Configuration` → `⊕ + Add a new Containers Provider` + +*See the [upstream documentation](http://manageiq.org/docs/reference/latest/doc-Managing_Providers/miq/index.html#containers-providers) for additional information.* + + + +# Requirements + +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, either locally or + on your cloud provider +* PV sizes can be changed by providing override values to template + parameters (see also: [Customization](#customization)) + +# Role Variables + +The following is a table of the publicly exposed variables that may be +used in your Ansible inventory to control the behavior of this +installer. + + +| Variable | Required | Default | Description | +|------------------------------------------------|:--------:|:------------------------------:|-------------------------------------| +| `openshift_management_project` | **No** | `openshift-management` | Namespace for the installation. | +| `openshift_management_project_description` | **No** | *CloudForms Management Engine* | Namespace/project description. | +| `openshift_management_install_management` | **No** | `false` | Boolean, set to `true` to install the application | +| **PRODUCT CHOICE** | | | | | +| `openshift_management_app_template` | **No** | `miq-template` | The project flavor to install. Choices: | +| **STORAGE CLASSES** | | | | | +| `openshift_management_storage_class` | **No** | `nfs` | Storage type to use, choices: