Integrating orcharhino and AWX, Ansible Automation Platform, or Oracle Linux Automation Manager

You can integrate orcharhino and AWX, Ansible Automation Platform, or Oracle Linux Automation Manager to use orcharhino Server as a dynamic inventory source for AWX, Ansible Automation Platform, or Oracle Linux Automation Manager.

You can also use the provisioning callback function to run playbooks on hosts managed by orcharhino, from either the host or AWX, Ansible Automation Platform, or Oracle Linux Automation Manager. When provisioning new hosts from orcharhino Server, you can use the provisioning callback function to trigger playbook runs from AWX, Ansible Automation Platform, or Oracle Linux Automation Manager. The playbook configures the host after the provisioning process.

The Ansible plug-in for configuration management relies on Ansible roles, which are assigned to hosts or host groups.

If you want to use Ansible playbooks, have a look at the application centric deployment (ACD) plug-in. ACD helps you deploy and configure multi host applications using an Ansible playbook and application definition. For more information, see Application Centric Deployment.

Adding orcharhino Server to AWX, Ansible Automation Platform, or Oracle Linux Automation Manager as a dynamic inventory item

To add orcharhino Server to AWX, Ansible Automation Platform, or Oracle Linux Automation Manager as a dynamic inventory item, you must create a credential for a orcharhino Server user on AWX, Ansible Automation Platform, or Oracle Linux Automation Manager, add an AWX, Ansible Automation Platform, or Oracle Linux Automation Manager user to the credential, and then configure an inventory source.

Prerequisites
  • If your orcharhino deployment is large, for example, managing tens of thousands of hosts, using a non-admin user can negatively impact performance because of time penalties that accrue during authorization checks. For large deployments, consider using an admin user.

  • For non-admin users, you must assign the Ansible Tower Inventory Reader role to your orcharhino Server user. For more information about managing users, roles, and permission filters, see Creating and Managing Roles in Administering orcharhino.

  • You must host your orcharhino Server and AWX, Ansible Automation Platform, or Oracle Linux Automation Manager on the same network or subnet.

Procedure
  1. In the AWX, Ansible Automation Platform, or Oracle Linux Automation Manager web UI, create a credential for your orcharhino. For more information about creating credentials, see Add a New Credential and orcharhino Credentials in the Automation Controller User Guide. Note that this part of the Ansible documentation also applies to orcharhino.

    Table 1. orcharhino credentials
    Credential Type: orcharhino

    orcharhino URL:

    https://orcharhino.example.com

    Username:

    The username of the orcharhino user with the integration role.

    Password:

    The password of the orcharhino user.

  2. Add an AWX, Ansible Automation Platform, or Oracle Linux Automation Manager user to the new credential. For more information about adding a user to a credential, see Getting Started with Credentials in the Automation Controller User Guide.

  3. Add a new inventory. For more information, see Add a new inventory in the Automation Controller User Guide.

  4. In the new inventory, add orcharhino Server as the inventory source, specifying the following inventory source options. For more information, see Add Source in the Automation Controller User Guide.

    Table 2. Inventory source options
    Source orcharhino

    Credential

    The credential you create for orcharhino Server.

    Overwrite

    Select

    Overwrite Variables

    Select

    Update on Launch

    Select

    Cache Timeout

    90

  5. Ensure that you synchronize the source that you add.

Configuring provisioning callback for a host

When you create hosts in orcharhino, you can use AWX, Ansible Automation Platform, or Oracle Linux Automation Manager to run playbooks to configure your newly created hosts. This is called provisioning callback in AWX, Ansible Automation Platform, or Oracle Linux Automation Manager.

The provisioning callback function triggers a playbook run from AWX, Ansible Automation Platform, or Oracle Linux Automation Manager as part of the provisioning process. The playbook configures the host after the provisioning process.

For more information about provisioning callbacks, see Provisioning Callbacks in the Automation Controller User Guide.

In orcharhino Server, the Kickstart Default and Kickstart Default Finish templates include three snippets:

  1. ansible_provisioning_callback

  2. ansible_tower_callback_script

  3. ansible_tower_callback_service

You can add parameters to hosts or host groups to provide the credentials that these snippets can use to run Ansible Playbooks on your newly created hosts.

Prerequisites

Before you can configure provisioning callbacks, you must add orcharhino as a dynamic inventory in AWX, Ansible Automation Platform, or Oracle Linux Automation Manager. For more information, see Integrating orcharhino and AWX, Ansible Automation Platform, or Oracle Linux Automation Manager.

In the AWX, Ansible Automation Platform, or Oracle Linux Automation Manager web UI, you must complete the following tasks:

  1. Create a machine credential for your new host. Ensure that you enter the same password in the credential that you plan to assign to the host that you create in orcharhino. For more information, see Add a New Credential in the Automation Controller User Guide.

  2. Create a project. For more information, see Projects in the AWX, Ansible Automation Platform, or Oracle Linux Automation Manager User Guide.

  3. Add a job template to your project. For more information, see Job Templates in the Automation Controller User Guide.

  4. In your job template, you must enable provisioning callbacks, generate the host configuration key, and note the template_ID of your job template. For more information about job templates, see Job Templates in the Automation Controller User Guide.

Procedure
  1. In the orcharhino management UI, navigate to Configure > Host Group.

  2. Create a host group or edit an existing host group.

  3. In the Host Group window, click the Parameters tab.

  4. Click Add Parameter.

  5. Enter the following information for each new parameter:

    Table 3. Host parameters
    Name Value Description

    ansible_tower_provisioning

    true

    Enables Provisioning Callback.

    ansible_tower_fqdn

    controller.example.com

    The fully qualified domain name (FQDN) of your AWX, Ansible Automation Platform, or Oracle Linux Automation Manager. Do not add https because this is appended by orcharhino.

    ansible_job_template_id

    template_ID

    The ID of your provisioning template that you can find in the URL of the template: /templates/job_template/5.

    ansible_host_config_key

    config_KEY

    The host configuration key that your job template generates in AWX, Ansible Automation Platform, or Oracle Linux Automation Manager.

  6. Click Submit.

  7. Create a host using the host group.

  8. On the new host, enter the following command to start the ansible-callback service:

    $ systemctl start ansible-callback
  9. On the new host, enter the following command to output the status of the ansible-callback service:

    $ systemctl status ansible-callback

    Provisioning callback is configured correctly if the command returns the following output:

    orcharhino.example.com systemd[1]: Started Provisioning callback to AWX, Ansible Automation Platform, or Oracle Linux Automation Manager...
Manual provisioning callback
  • You can use the provisioning callback URL and the host configuration key from a host to call AWX, Ansible Automation Platform, or Oracle Linux Automation Manager:

    $ curl \
    --data curl \
    --data host_config_key=My_Host_Config_Key \
    --insecure \
    --show-error \
    --silent \
    https://controller.example.com/api/v2/job_templates/8/callback/

    Ensure that you use https when you enter the provisioning callback URL.

This triggers the playbook run specified in the template against the host.

The text and illustrations on this page are licensed by ATIX AG under a Creative Commons Attribution Share Alike 4.0 International ("CC BY-SA 4.0") license. This page also contains text from the official Foreman documentation which uses the same license ("CC BY-SA 4.0").