# ansible-playbook -v [-i /path/to/inventory] \ playbooks/openshift-management/add_container_provider.yml
After deploying ManageIQ on OKD as described in Running the Installer, there are two methods for enabling container provider integration. You can manually add OKD as a container provider, or you can try the playbooks included with this role.
See the following ManageIQ documentation for steps on manually adding your OKD cluster as a container provider:
Automated container provider integration can be accomplished using the playbooks included with this role.
This playbook:
Gathers the necessary authentication secrets.
Finds the public routes to the ManageIQ application and the cluster API.
Makes a REST call to add the OKD cluster as a container provider.
To run the container provider playbook:
# ansible-playbook -v [-i /path/to/inventory] \ playbooks/openshift-management/add_container_provider.yml
As well as providing playbooks to integrate your current OKD cluster into your ManageIQ deployment, this role includes a script which allows you to add multiple container platforms as container providers in any arbitrary ManageIQ server. The container platforms can be OKD or OpenShift Container Platform.
Using the multiple provider script requires manual configuration and setting an
EXTRA_VARS
parameter on the CLI when running the playbook.
To prepare the multiple provider script, complete the following manual configuration:
Copy the files/examples/container_providers.yml example somewhere, such as /tmp/cp.yml. You will be modifying this file.
If you changed your ManageIQ name or password, update the hostname
,
user
, and password
parameters in the management_server
key in the
container_providers.yml file that you copied.
Fill in an entry under the container_providers
key for each container platform
cluster you want to add as container providers.
The following parameters must be configured:
auth_key
- This is the token of a service account that has cluster-admin
privileges.
hostname
- This is the host name that points to the cluster API. Each container provider must have a unique host name.
name
- This is the name of the cluster to be displayed in the ManageIQ server container providers overview page. This must be unique.
To obtain the $ oc serviceaccounts get-token -n management-infra management-admin |
The following parameters may be optionally configured:
port
- Update this key if your container platform cluster runs the API on a port other than 8443
.
endpoint
- You may enable SSL verification (verify_ssl
) or change the validation setting to ssl-with-validation
. Support for custom trusted CA certificates is not currently available.
As an example, consider the following scenario:
You copied the container_providers.yml file to /tmp/cp.yml.
You want to add two OpenShift Container Platform clusters.
Your ManageIQ server runs on mgmt.example.com
For this scenario, you would customize /tmp/cp.yml as follows:
container_providers:
- connection_configurations:
- authentication: {auth_key: "<token>", authtype: bearer, type: AuthToken} (1)
endpoint: {role: default, security_protocol: ssl-without-validation, verify_ssl: 0}
hostname: "<provider_hostname1>"
name: <display_name1>
port: 8443
type: "ManageIQ::Providers::Openshift::ContainerManager"
- connection_configurations:
- authentication: {auth_key: "<token>", authtype: bearer, type: AuthToken} (1)
endpoint: {role: default, security_protocol: ssl-without-validation, verify_ssl: 0}
hostname: "<provider_hostname2>"
name: <display_name2>
port: 8443
type: "ManageIQ::Providers::Openshift::ContainerManager"
management_server:
hostname: "<hostname>"
user: <user_name>
password: <password>
1 | Replace <token> with the management token for this cluster. |
To run the multiple-providers integration script, you must provide the path to
the container providers configuration file as an EXTRA_VARS
parameter to the
ansible-playbook
command. Use the -e
(or --extra-vars
) parameter to set
container_providers_config
to the configuration file path:
# ansible-playbook -v [-i /path/to/inventory] \ -e container_providers_config=/tmp/cp.yml \ playbooks/openshift-management/add_many_container_providers.yml
After the playbook completes, you should find two new container providers in
your ManageIQ service. Navigate to the Compute → Containers → Providers
page to see an overview.
After adding either a single or multiple container providers, the new provider(s) must be refreshed in ManageIQ to get all the latest data about the container provider and the containers being managed. This involves navigating to each provider in the ManageIQ web console and clicking a refresh button for each.
See the following ManageIQ documentation for steps: