Configure the Ansible plug-ins

After installing the Ansible plug-ins, configure them to connect to your Ansible Automation Platform instance and enable software templates.

Add the following configuration to your Red Hat Developer Hub custom ConfigMap (for example, app-config-rhdh).

  • For Operator deployments, edit the ConfigMap directly.
  • For Helm deployments, edit the ConfigMap referenced in upstream.backstage.extraAppConfig.

Configure the Ansible Dev Tools Server

The creatorService URL is required for the Ansible plug-ins to provision new projects using the provided software templates.

Procedure

Add the following code to your Red Hat Developer Hub app-config-rhdh.yaml file.
kind: ConfigMap
apiVersion: v1
metadata:
  name: app-config-rhdh
...
data:
  app-config-rhdh.yaml: |-
    ansible:
      creatorService:
        baseUrl: 127.0.0.1
        port: '8000'
...

Configure Ansible Automation Platform details

Connect Red Hat Developer Hub to your automation controller by configuring the Ansible Automation Platform details. This configuration uses a Personal Access Token (PAT) to authenticate the plug-ins, which allows them to interact with your automation environment.

About this task

Note

The Ansible plug-ins continue to function regardless of the Ansible Automation Platform subscription status.

Procedure

  1. Create a Personal Access Token (PAT) with "read and write” scope in automation controller, following the Applications section of Access management and authentication.
  2. Edit your custom Red Hat Developer Hub config map, for example app-config-rhdh.
  3. Add your Ansible Automation Platform details to app-config-rhdh.yaml.
    1. Set the baseURL key with your automation controller URL.
    2. Set the token key with the generated token value that you created in Step 1.
    3. Set the checkSSL key to true or false.

      If checkSSL is set to true, the Ansible plug-ins verify whether the SSL certificate is valid.

      data:
        app-config-rhdh.yaml: |
          ...
          ansible:
          ...
            rhaap:
              baseUrl: '<https://MyControllerUrl>'
              token: '<AAP Personal Access Token>'
              checkSSL: true
      Note

      You are responsible for protecting your Red Hat Developer Hub installation from external and unauthorized access. Manage the backend authentication key like any other secret. Meet strong password requirements, do not expose it in any configuration files, and only inject it into configuration files as an environment variable.

Add Ansible plug-ins software templates

Add Ansible Automation Platform software templates to your Red Hat Developer Hub instance so users can create new Ansible playbooks and collection projects based on Ansible best practices.

Procedure

  1. Edit your custom Red Hat Developer Hub config map, for example app-config-rhdh.
  2. Add the following code to your Red Hat Developer Hub app-config-rhdh.yaml file.
    data:
      app-config-rhdh.yaml: |
        catalog:
          ...
          locations:
            ...
            - type: url
              target: https://github.com/ansible/ansible-rhdh-templates/blob/main/all.yaml
              rules:
                - allow: [Template]

Configure Role Based Access Control

Red Hat Developer Hub offers Role-based Access Control (RBAC) functionality. RBAC can then be applied to the Ansible plug-ins content.

Procedure

Assign the following roles:
  • Members of the admin:superUsers group can select templates in the Create tab of the Ansible plug-ins to create playbook and collection projects.
  • Members of the admin:users group can view templates in the Create tab of the Ansible plug-ins.

    The following example adds RBAC to Red Hat Developer Hub.

    data:
      app-config-rhdh.yaml: |
        plugins:
        ...
        permission:
          enabled: true
          rbac:
            admin:
              users:
                - name: user:default/<user-scm-ida>
              superUsers:
                - name: user:default/<user-admin-idb>

    For more information about permission policies and managing RBAC, refer to the Authorization in Red Hat Developer Hub guide.