Download Ansible Playbooks for Confluent Platform

Download Confluent Platform Ansible collection

Starting in Confluent Platform 7.0, Ansible Playbooks for Confluent Platform (Confluent Ansible) is packaged as an Ansible Collection.

If you are using Ansible 2.11 or higher, download the Confluent Ansible collection using the ansible-galaxy command as described in this section.

You can download the Confluent Ansible collection from the following places:

Download the Confluent Platform collection from Ansible Automation Hub

To install Confluent Platform collection from Ansible Automation Hub, follow the steps in this section.

  1. Create the ansible.cfg file in your home directory or in your current working directory and specify Red Hat Automation Hub as your default collection server. For example:

    [defaults]
    hash_behaviour=merge
    callback_whitelist=profile_tasks
    remote_tmp=~/.ansible/tmp
    collections_paths=~/.ansible/collections:../../../
    
    [ssh_connection]
    pipelining = True
    timeout=30
    
    [galaxy]
    server_list = automation_hub
    
    [galaxy_server.automation_hub]
    url=https://console.redhat.com/api/automation-hub/content/inbound-confluent/
    auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
    token=<provide token here>
    
  2. Now, install the collection from Red Hat Automation Hub by following the steps in Download the Confluent Platform collection from Ansible Galaxy.

For details, see Getting Started with Red Hat Ansible Automation Hub.

Download the Confluent Platform collection from Ansible Galaxy

To install the latest Confluent collection:
ansible-galaxy collection install confluent.platform

The command downloads the collection into your default collections directory, ~/.ansible/collections/ansible_collections/confluent/platform/.

Note

Confluent Ansible 7.3.0 had a hot-fix to solve a breaking issue for using RHEL as a managed node. To download the hot-fix collection artifacts:

ansible-galaxy collection install confluent.platform:7.3.0-221111

To install a specific version of the Confluent collection:
Append the version number along with the package name in the ansible-galaxy command . For example:
ansible-galaxy collection install confluent.platform:7.3.0
To download the Confluent collection behind a proxy:

Run the following command with the https_proxy environment variable:

https_proxy=http://proxy-server:port/ \
  ansible-galaxy collection install confluent.platform

For more details on package installation from Ansible Galaxy, see Galaxy User Guide.

Download the Confluent Platform collection from the GitHub source repository

As an alternative to the recommended methods above, you can install the package directly from the source repository.

To download Ansible Playbooks for Confluent Platform onto your controller, run the following command. The command pulls the roles and playbooks into your default collections directory.

ansible-galaxy collection install \
  git+https://github.com/confluentinc/cp-ansible.git

Additionally, you can specify a branch of Ansible Playbooks for Confluent Platform with the following command. 7.0 or higher is supported for <branch>.

ansible-galaxy collection install \
  git+https://github.com/confluentinc/cp-ansible.git,<branch>

Build Ansible Playbooks for Confluent Platform collection

An option to install Ansible Playbooks for Confluent Platform collection behind a proxy is to clone the repo and locally build the collection tarball which you will use to install the collection. The steps to build and install are:

  1. Set up a proxy server:

    git config --global http.proxy http://proxy-server:port/
    git config --global https.proxy http://proxy-server:port/
    
  2. Download the Ansible Playbooks for Confluent Platform code:

    git clone https://github.com/confluentinc/cp-ansible.git
    cd cp-ansible
    git checkout 7.3.0-post
    
  3. Create the collection:

    ansible-galaxy collection build
    

    The command builds a tarball of the collection in the current directory.

  4. Upload the collection tarball to your control node.

  5. Install the collection on your Ansible control node:

    ansible-galaxy collection install <the tarball created in the previous step>
    

Configure hash merging

Ansible Playbooks for Confluent Platform requires hash merging to be enabled. Configure the setting in your Ansible configuration file as below:

[defaults]
hash_behaviour=merge