Chapter 6. Configuring overcloud software with the director Operator

You can configure your overcloud after you have provisioned virtual and bare metal nodes for your overcloud. You must create an OpenStackPlaybookGenerator resource to generate your Ansible playbooks, register your nodes to either the Red Hat Customer Portal or Red Hat Satellite, and then run the tripleo-deploy.sh script to apply the configuration to your nodes

6.1. Creating Ansible playbooks for overcloud configuration with OpenStackPlaybookGenerator

After you provision the overcloud infrastructure, you must create a set of Ansible playbooks to configure the Red Hat OpenStack Platform (RHOSP) software on the overcloud nodes. You create these playbooks with the OpenStackPlaybookGenerator resource, which uses the config-download feature in RHOSP director to convert heat configuration to playbooks.

Prerequisites

  • Ensure your OpenShift Container Platform cluster is operational and you have installed the director Operator correctly.
  • Ensure that you have installed the oc command line tool on your workstation.
  • Configure a git-secret Secret that contains authentication details for your remote Git repository.
  • Configure a tripleo-tarball-config ConfigMap that contains your custom heat templates.
  • Configure a heat-env-config ConfigMap that contains your custom environment files.

Procedure

  1. Create a file named openstack-playbook-generator.yaml on your workstation. Include the resource specification to generate the Ansible playbooks. For example, the specification to generate the playbooks is as follows:

    apiVersion: osp-director.openstack.org/v1beta1
    kind: OpenStackPlaybookGenerator
    metadata:
      name: default
      namespace: openstack
    spec:
      imageURL: registry.redhat.io/rhosp-beta/openstack-tripleoclient:16.2
      gitSecret: git-secret
      heatEnvConfigMap: heat-env-config
      tarballConfigMap: tripleo-tarball-config

    Set the following values in the resource specification:

    metadata.name
    Set to the name of the Compute node bare metal set, which is default.
    metadata.namespace
    Set to the director Operator namespace, which is openstack.
    spec.gitSecret
    Set to the ConfigMap that contains the Git authentication credentials, which is git-secret.
    spec.tarballConfigMap
    Set to the ConfigMap that contains the tarball with your custom heat templates, which is tripleo-tarball-config.
    spec.heatEnvConfigMap
    Set to the ConfigMap that contains your custom environment files, which is heat-env-config.

    For more descriptions of the values you can use in the spec section, view the specification schema in the custom resource definition for the openstackplaybookgenerator CRD:

    $ oc describe crd openstackplaybookgenerator

    Save the file when you have finished configuring the Ansible playbook generator specification.

  2. Create the Ansible playbook generator:

    $ oc create -f openstack-playbook-generator.yaml -n openstack

Verification

  • View the resource for the playbook generator:

    $ oc get openstackplaybookgenerator/default -n openstack

6.2. Ephemeral heat container image source parameters

To create an ephemeral heat service, The OpenStackPlaybookGenerator resource requires four specific container images from registry.redhat.io:

  • openstack-heat-api
  • openstack-heat-engine
  • openstack-mariadb
  • openstack-rabbitmq

You can change the source location of these images with the spec.ephemeralHeatSettings parameter. For example, if you host these images or a Red Hat Satellite Server, you can change the spec.ephemeralHeatSettings parameter and sub-parameters to use the Red Hat Satellite Server as the source for these images.

apiVersion: osp-director.openstack.org/v1beta1
kind: OpenStackPlaybookGenerator
metadata:
  name: default
  namespace: openstack
spec:
  imageURL: registry.redhat.io/rhosp-beta/openstack-tripleoclient:16.2
  gitSecret: git-secret
  heatEnvConfigMap: heat-env-config
  tarballConfigMap: tripleo-tarball-config
  ephemeralHeatSettings:
    heatAPIImageURL: <heat_api_image_location>
    heatEngineImageURL: <heat_engine_image_location>
    mariadbImageURL: <mariadb_image_location>
    rabbitImageURL: <rabbitmq_image-location>

Set the following values in the resource specification:

spec.ephemeralHeatSettings.heatAPIImageURL
Image location for the heat API.
spec.ephemeralHeatSettings.heatEngineImageURL
Image location for the heat engine.
spec.ephemeralHeatSettings.mariadbImageURL
Image location for MariaDB.
spec.ephemeralHeatSettings.rabbitImageURL
Image location for RabbitMQ.

6.3. Playbook generation interactive mode parameter

To debug playbook generation operations, you can set the OpenStackPlaybookGenerator resource to use interactive mode.

apiVersion: osp-director.openstack.org/v1beta1
kind: OpenStackPlaybookGenerator
metadata:
  name: default
  namespace: openstack
spec:
  imageURL: registry.redhat.io/rhosp-beta/openstack-tripleoclient:16.2
  gitSecret: git-secret
  heatEnvConfigMap: heat-env-config
  tarballConfigMap: tripleo-tarball-config
  interactive: true

In this mode, the OpenStackPlaybookGenerator resource creates the environment to start rendering the playbooks but does not automatically render the playbooks.

6.4. Using the tripleo-deploy.sh script

As a part of the OpenStackControlPlane resource, the director Operator creates an OpenStackClient pod that you access through a remote shell and run Red Hat OpenStack Platform commands. This pod also contains a script named tripleo-deploy.sh which you use to update your configuration and apply the latest configuration to the overcloud nodes.

You can run the tripleo-deploy.sh script with the following options:

-d
Show the Git diff comparing the newest version of the rendered playbooks to the previous accepted version.
-a
Accept the newest available version of the rendered playbooks and tag them as latest.
-p
Apply the Ansible playbooks against the overcloud nodes.

6.5. Registering the operating system of your overcloud

Before the director Operator configures the overcloud software on nodes, you must register the operating system of all nodes to either the Red Hat Customer Portal or Red Hat Satellite Server, and enable repositories for your nodes. To register your nodes, you can use the redhat_subscription Ansible module with the inventory file that the OpentackPlaybookGenerator resource creates.

Prerequisites

  • Ensure your OpenShift Container Platform cluster is operational and you have installed the director Operator correctly.
  • Ensure that you have installed the oc command line tool on your workstation.
  • Use the OpenStackControlPlane resource to create a control plane.
  • Use the OpenStackBareMetalSet resource to create bare metal Compute nodes.
  • Use the OpentackPlaybookGenerator to create the Ansible playbook configuration for your overcloud.

Procedure

  1. Access the remote shell for openstackclient:

    $ oc rsh openstackclient -n openstack
  2. Change to the cloud-admin home directory:

    $ cd /home/cloud-admin
  3. Optional: Check the diff for the overcloud Ansible playbooks:

    $ ./tripleo-deploy.sh -d
  4. Accept the newest version of the rendered Ansible playbooks and tag them as latest:

    $ ./tripleo-deploy.sh -a

    The newest version of the playbooks includes an inventory file for the overcloud configuration. You can find this inventory file on the OpenstackClient pod at /home/cloud-admin/playbooks/tripleo-ansible/inventory.yaml.

  5. Create a playbook that uses the redhat_subscription modules to register your nodes. For example, the following playbook registers Controller nodes:

    ---
    - name: Register Controller nodes
      hosts: Controller
      become: yes
      vars:
        repos:
          - rhel-8-for-x86_64-baseos-eus-rpms
          - rhel-8-for-x86_64-appstream-eus-rpms
          - rhel-8-for-x86_64-highavailability-eus-rpms
          - ansible-2.9-for-rhel-8-x86_64-rpms
          - advanced-virt-for-rhel-8-x86_64-rpms
          - openstack-16.2-for-rhel-8-x86_64-rpms
          - fast-datapath-for-rhel-8-x86_64-rpms
      tasks:
        - name: Register system
          redhat_subscription:
            username: myusername
            password: p@55w0rd!
            org_id: 1234567
            release: 8.4
            pool_ids: 1a85f9223e3d5e43013e3d6e8ff506fd
        - name: Disable all repos
          command: "subscription-manager repos --disable *"
        - name: Enable Controller node repos
          command: "subscription-manager repos --enable {{ item }}"
          with_items: "{{ repos }}"

    This play contains the following three tasks:

    • Register the node.
    • Disable any auto-enabled repositories.
    • Enable only the repositories relevant to the Controller node. The repositories are listed with the repos variable.
  6. Register the overcloud nodes to required repositories:

    ansible-playpook -i /home/cloud-admin/playbooks/tripleo-ansible/inventory.yaml ./rhsm.yaml

6.6. Applying overcloud configuration with the director Operator

You can configure the overcloud with director Operator only after you have created your control plane, provisioned your bare metal Compute nodes, and generated the Ansible playbooks to configure software on each node. When you create an OpenStackControlPlane resource, the director Operator creates an OpenStackClient pod that you access through a remote shell and run the tripleo-deploy.sh script to configure the overcloud.

Prerequisites

  • Ensure your OpenShift Container Platform cluster is operational and you have installed the director Operator correctly.
  • Ensure that you have installed the oc command line tool on your workstation.
  • Use the OpenStackControlPlane resource to create a control plane.
  • Use the OpenStackBareMetalSet resource to create bare metal Compute nodes.
  • Use the OpentackPlaybookGenerator to create the Ansible playbook configuration for your overcloud.

Procedure

  1. Access the remote shell for openstackclient:

    $ oc rsh openstackclient -n openstack
  2. Change to the cloud-admin home directory:

    $ cd /home/cloud-admin
  3. Optional: Check the diff for the overcloud Ansible playbooks:

    $ ./tripleo-deploy.sh -d
  4. Accept the newest version of the rendered Ansible playbooks and tag them as latest:

    $ ./tripleo-deploy.sh -a
  5. Apply the Ansible playbooks against the overcloud nodes:

    $ ./tripleo-deploy.sh -p
Note

You can view a log of the Ansible configuration at ~/ansible.log within the openstackclient pod.