Configure hosts by using Ansible Director

Set up Ansible integration with orcharhino

You can configure hosts with Ansible collections or Ansible roles that rely on specific Ansible and Python versions.

By default, ATIX AG supports Ansible that is packaged for the platform your orcharhino Server or orcharhino Proxy Server runs on. If you want to configure different client platforms that rely on different Ansible or Python versions, you can use the Ansible Director plugin. The Ansible Director plugin allows you to manage Ansible content, Ansible Execution Environments, and Ansible environments independent of your orcharhino platform.

You can use the Ansible plugin and Ansible Director plugin simultaneously on orcharhino but they are unrelated.

Install the Ansible Director plugin on orcharhino Server

Install the Ansible Director plugin on your orcharhino Server to configure hosts with platform-independent Ansible and Python versions.

Procedure
  • On your orcharhino Server, install the Ansible Director plugin:

    $ orcharhino-installer \
    --enable-foreman-plugin-ansible-director \
    --enable-foreman-proxy-plugin-ansible-director
Verification
  1. In the orcharhino management UI, navigate to Administer > About.

  2. On the Plugins tab, verify the installation of the Ansible Director plugin.

Install the Ansible Director plugin on orcharhino Proxies

Install the Ansible Director plugin on your orcharhino Proxies to configure hosts with platform-independent Ansible and Python versions through orcharhino Proxy Servers.

Procedure
  • On your orcharhino Proxy Server, install the Ansible Director plugin:

    $ orcharhino-installer --enable-foreman-proxy-plugin-ansible-director
Verification
  1. In the orcharhino management UI, navigate to Infrastructure > orcharhino Proxies.

  2. Select your orcharhino Proxy.

  3. On the Overview tab, verify that Ansible Director is listed under Active features.

Configure the Ansible Director plugin by using orcharhino management UI

Configure the Ansible Director plugin to adjust to your orcharhino environment.

Procedure
  1. In the orcharhino management UI, navigate to Administer > Settings.

  2. Select the Ansible Director tab.

  3. Adjust the plugin to your environment. For example, you can configure a different default version of ansible-core.

Verification
  1. In the orcharhino management UI, navigate to Administer > Settings.

  2. Reload the Ansible Director tab and verify that orcharhino updated the plugin settings.

Additional resources

Configure the Ansible Director plugin by using orcharhino API

Configure the Ansible Director plugin to adjust to your orcharhino environment.

Procedure
  1. Create a JSON file, for example, data.json to define the value of the setting:

    {
      "value": "2.20.4"
    }
  2. Configure the Ansible director plugin to your environment. For example, you can change the default version of ansible-core:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request PUT \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/settings/ad_default_ansible_core_version/ \
    | jq
Verification
  • Verify that orcharhino updated the setting:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/settings/ad_default_ansible_core_version/ \
    | jq
Additional resources

Import and manage Ansible content

You can import and manage Ansible content in orcharhino to configure hosts.

You can use Ansible Director to import versioned Ansible content that you use in combination with Ansible Execution Environments and Ansible environments to configure hosts. Ansible content can rely on any Ansible core version and any Python version.

Ansible content is part of organizations.

Import Ansible content from Ansible Galaxy by using orcharhino management UI

You can import Ansible content from Ansible Galaxy into orcharhino by using orcharhino management UI. Select Ansible Galaxy as content source if you want to import Ansible content from the Ansible Galaxy, from a resource that implements the Ansible Galaxy API, from a Pulp instance, or from a content view.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_content, view_ansible_content, and view_organizations permissions.

Procedure
  1. In the orcharhino management UI, navigate to Ansible > Content.

  2. Click Import Ansible content.

  3. Select Ansible Galaxy as source and click Next.

  4. In the Identifier field, enter the namespace and name of the Ansible content separated by a dot.

  5. In the Source field, enter the URL of your Ansible Galaxy. By default, it uses galaxy.ansible.com.

  6. In the Versions field, you can add versions to limit the synchronization to one or multiple versions. Click the + sign or press enter after each version.

  7. Click Add Ansible collection to batch.

    Optionally, you can repeat the steps to add another Ansible collection.

  8. Click Next.

  9. Review your content. You can click Delete to remove an Ansible collection from the batch.

  10. Click Finish to import Ansible content.

Verification
  1. In the orcharhino management UI, navigate to Ansible > Content.

  2. For your imported Ansible content, click the arrow symbol to view the list of imported versions.

  3. Verify that orcharhino contains all selected Ansible content and versions.

Import Ansible content from Ansible Galaxy by using orcharhino API

You can import Ansible content from Ansible Galaxy into orcharhino by using orcharhino API. Select Ansible Galaxy as content source if you want to import Ansible content from the Ansible Galaxy, from a resource that implements the Ansible Galaxy API, from a Pulp instance, or from a content view.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_content, view_ansible_content, and view_organizations permissions.

Procedure
  1. Create a JSON file, for example, data.json to define your Ansible content:

    {
      "organization_id": "My_Organization_ID",
      "units": [
        {
          "unit_name": "My_Namespace.My_Name",
          "unit_type": "collection",
          "unit_source_type": "galaxy",
          "unit_source": "https://galaxy.ansible.com",
          "unit_versions": [
            "My_First_Version",
            "My_Second_Version"
          ]
        }
      ]
    }
  2. Import Ansible content from Ansible Galaxy:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request POST \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/ \
    | jq

    orcharhino starts the import task and returns output similar to:

    {
      "id": "My_Task_ID",
      "label": "ForemanAnsibleDirector::Actions::AnsibleContentUnit::Bulk::Import",
      "started_at": "2026-03-11 09:59:31 UTC"
    }
Verification
  • Query the orcharhino API to verify that the task finished successfully:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/foreman_tasks/api/tasks/My_Task_ID/details/ \
    | jq ".result"

Import Ansible content from a Git repository by using orcharhino management UI

You can import Ansible content from a Git repository into orcharhino by using orcharhino management UI. Select Git repository if you want to import Ansible content from a remote Git repository.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_content, view_ansible_content, and view_organizations permissions.

Procedure
  1. In the orcharhino management UI, navigate to Ansible > Content.

  2. Click Import Ansible content.

  3. Select Git repository as source and click Next.

  4. In the Identifier field, enter the namespace and name of your Ansible collection as specified in galaxy.yml separated by a dot.

  5. In the Repository URL field, enter the URL of your Git repository ending with .git.

  6. If you want to limit the synchronization of Ansible content to specific Git references, enter them in the References field. Click the + sign or press enter after each version.

  7. Click Add Ansible collection to batch.

    Optionally, you can repeat the steps to add another Ansible collection.

  8. Click Next.

  9. Review your content. You can click Delete to remove an Ansible collection from the batch.

  10. Click Finish to import Ansible content.

Verification
  1. In the orcharhino management UI, navigate to Ansible > Content.

  2. For your imported Ansible content, click the arrow symbol to view the list of imported versions.

  3. Verify that orcharhino contains all selected Ansible content and versions.

Import Ansible content from a Git repository by using orcharhino API

You can import Ansible content from a Git repository into orcharhino by using orcharhino API. Select Git repository if you want to import Ansible content from a remote Git repository.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_content, view_ansible_content, and view_organizations permissions.

Procedure
  1. Create a JSON file, for example, data.json to define your Ansible content:

    {
      "organization_id": "My_Organization_ID",
      "units": [
        {
          "unit_name": "My_Namespace.My_Name",
          "unit_type": "collection",
          "unit_source_type": "galaxy",
          "unit_source": "https://galaxy.ansible.com",
          "unit_versions": [
            "My_First_Version",
            "My_Second_Version"
          ]
        }
      ]
    }
  2. Import Ansible content from a Git repository:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request POST \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/ \
    | jq

    orcharhino starts the import task and returns output similar to:

    {
      "id": "My_Task_ID",
      "label": "ForemanAnsibleDirector::Actions::AnsibleContentUnit::Bulk::Import",
      "started_at": "2026-03-11 09:59:31 UTC"
    }
Verification
  • Query the orcharhino API to verify that the task finished successfully:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/foreman_tasks/api/tasks/My_Task_ID/details/ \
    | jq ".result"

Import Ansible content based on a YML file by using orcharhino management UI

You can import Ansible content based on a YML file into orcharhino by using orcharhino management UI. Select YML file if you want to paste a requirements.yml file into the orcharhino management UI.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_content, view_ansible_content, and view_organizations permissions.

Procedure
  1. In the orcharhino management UI, navigate to Ansible > Content.

  2. Click Import Ansible content.

  3. Select YML file as source.

Verification
  1. In the orcharhino management UI, navigate to Ansible > Content.

  2. For your imported Ansible content, click the arrow symbol to view the list of imported versions.

  3. Verify that orcharhino contains all selected Ansible content and versions.

Import Ansible content based on a YML file by using orcharhino API

You can import Ansible content based on a YML file into orcharhino by using orcharhino API. Select YML file if you want to upload a requirements.yml file to orcharhino.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_content, view_ansible_content, and view_organizations permissions.

Procedure
  1. Create a JSON file, for example, data.json to define your Ansible content:

    {
      "organization_id": "My_Organization_ID",
      "units": [
        {
          "unit_name": "My_Namespace.My_Name",
          "unit_type": "collection",
          "unit_source_type": "galaxy",
          "unit_source": "https://galaxy.ansible.com",
          "unit_versions": [
            "My_First_Version",
            "My_Second_Version"
          ]
        }
      ]
    }
  2. Import Ansible content based on a YML file:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request POST \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/ \
    | jq

    orcharhino starts the import task and returns output similar to:

    {
      "id": "My_Task_ID",
      "label": "ForemanAnsibleDirector::Actions::AnsibleContentUnit::Bulk::Import",
      "started_at": "2026-03-11 09:59:31 UTC"
    }
Verification
  • Query the orcharhino API to verify that the task finished successfully:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/foreman_tasks/api/tasks/My_Task_ID/details/ \
    | jq ".result"

Delete imported Ansible content by using orcharhino management UI

You can delete imported Ansible content from orcharhino by using orcharhino management UI.

Prerequisites
  • Your orcharhino account has a role that grants the destroy_ansible_content, view_ansible_content, and view_organizations permissions.

Procedure
  1. In the orcharhino management UI, navigate to Ansible > Content.

  2. For the content that you want to delete, from the options menu, click Delete.

  3. Click Confirm.

Verification
  1. In the orcharhino management UI, navigate to Ansible > Content.

  2. Verify that the content you have deleted is not part of the list anymore.

Delete imported Ansible content by using orcharhino API

You can delete imported Ansible content from orcharhino by using orcharhino API. This procedure deletes all versions of your imported Ansible content from orcharhino.

Prerequisites
  • Your orcharhino account has a role that grants the destroy_ansible_content, view_ansible_content, and view_organizations permissions.

Procedure
  1. Optional: List imported Ansible content:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/ \
    | jq ".results | .[]"
  2. Create a JSON file, for example, data.json to define the Ansible content that you want to delete:

    {
      "units": [
        {
          "unit_id": "My_Ansible_Content_ID"
        }
      ]
    }
  3. Delete imported Ansible content from orcharhino:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request DELETE \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/ \
    | jq
Verification
  • List imported Ansible content on orcharhino:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/ \
    | jq ".results | .[]"

    Verify that the Ansible content that you have deleted is not part of the output.

Delete versions of imported Ansible content by using orcharhino management UI

You can delete versions of imported Ansible content from orcharhino by using orcharhino management UI.

Prerequisites
  • Your orcharhino account has a role that grants the destroy_ansible_content, view_ansible_content, and view_organizations permissions.

Procedure
  1. In the orcharhino management UI, navigate to Ansible > Content.

  2. Click the arrow symbol next to your imported Ansible content.

  3. For the version that you want to delete, from the options menu, click Delete.

  4. Click Confirm.

Verification
  1. In the orcharhino management UI, navigate to Ansible > Content.

  2. Click the arrow symbol next to your imported Ansible content.

  3. Verify that the version you have deleted is not part of the list anymore.

Delete versions of imported Ansible content by using orcharhino API

You can delete versions of imported Ansible content from orcharhino by using orcharhino API. This procedure deletes specific versions of your imported Ansible content from orcharhino.

Prerequisites
  • Your orcharhino account has a role that grants the destroy_ansible_content, view_ansible_content, and view_organizations permissions.

Procedure
  1. Optional: List imported Ansible content:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/ \
    | jq ".results | .[]"
  2. Create a JSON file, for example, data.json to define the versions of your Ansible content that you want to delete:

    {
      "units": [
        {
          "unit_id": "My_Ansible_Content_ID",
          "unit_version_ids": [
            "My_First_Version_ID",
            "My_Second_Version_ID"
          ]
        }
      ]
    }
  3. Delete versions of imported Ansible content from orcharhino:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request DELETE \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/ \
    | jq
Verification
  • List all versions of imported Ansible content:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/ \
    | jq ".results | .[]"

    Verify that the versions that you have deleted are not part of the output.

Customize Ansible content

You can customize Ansible content in orcharhino to deviate from default settings in Ansible collections and roles to configure hosts.

By convention, all Ansible collections and roles provide default values for variables. By customizing the default values, you can adjust the Ansible content to your environment.

Types of overrides

You can override values of Ansible variables at different levels in orcharhino.

By convention, all Ansible collections and roles provide default values. You can customize these values at different levels and in different scopes.

Global overrides

You can overwrite the default value for all hosts in orcharhino by using global overrides. Global overrides are used by orcharhino in favor of default values from Ansible collections and roles.

Matchers

You can use simple or custom matchers to override values in orcharhino for specific sets of hosts. For example, you can create a matcher for specific subnets or host groups. Simple and custom matchers override global overrides.

Hosts

You can override values for individual hosts in orcharhino. Overrides at a host level take precedence over any other value definition in orcharhino.

Customize default values of Ansible variables by using orcharhino management UI

You can set custom default values of Ansible variables in orcharhino by using orcharhino management UI. Global custom values help you define a baseline for your environment.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_variable_overrides, destroy_ansible_variable_overrides, destroy_ansible_variables, edit_ansible_variable_overrides, edit_ansible_variables, view_ansible_content, view_ansible_variable_overrides, view_ansible_variables, and view_organizations permissions.

  • Your orcharhino contains imported Ansible content.

Procedure
  1. In the orcharhino management UI, navigate to Ansible > Content.

  2. From the list of Ansible content, select a version.

  3. Select an Ansible role.

  4. Use the toggle to enable the variable override.

  5. Click the Edit icon.

  6. On the Base variable tab, click the Edit icon.

  7. In the Default value field, enter your custom default value.

  8. Click the Save icon to submit your change to orcharhino.

Verification
  1. In the orcharhino management UI, navigate to Ansible > Content.

  2. From the list of Ansible content, select a version.

  3. Select an Ansible role.

  4. Use the toggle to enable the variable override.

  5. Click the Edit icon.

  6. Verify that orcharhino contains your custom default value.

Customize default values of Ansible variables by using orcharhino API

You can set custom default values of Ansible variables in orcharhino by using orcharhino API. Global custom values help you define a baseline for your environment.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_variable_overrides, destroy_ansible_variable_overrides, destroy_ansible_variables, edit_ansible_variable_overrides, edit_ansible_variables, view_ansible_content, view_ansible_variable_overrides, view_ansible_variables, and view_organizations permissions.

  • Your orcharhino contains imported Ansible content.

Procedure
  1. Optional: Get a list of Ansible content IDs:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/ \
    | jq ".results [] .id"

    Note down the ID of your Ansible content in orcharhino.

  2. Optional: Get a list of Ansible roles in your Ansible content:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/My_Ansible_Content_ID/ \
    | jq ".roles [] .name"
  3. Optional: Get a list of variables in your Ansible roles:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/My_Ansible_Content_ID/ \
    | jq ".roles []" | jq 'select(.name == "My_Ansible_Role_Name")' | jq ".variables []"

    Note down the ID of the Ansible variable that you want to customize.

  4. Create a JSON file, for example, data.json to define your custom default value:

    {
      "ansible_variable": {
        "key": "My_Ansible_Variable_Name",
        "type": "My_Ansible_Variable_Type",
        "default_value": "My_Default_Value",
        "overridable": true
      }
    }
  5. Set a custom default value for an Ansible variable:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request POST \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_variables/My_Ansible_Variable_ID/ \
    | jq
Verification
  • Query the orcharhino API to verify that orcharhino set the Ansible variable override successfully:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/My_Ansible_Content_ID/ \
    | jq ".roles []" | jq 'select(.name == "My_Ansible_Role_Name")' | jq ".variables []" | jq 'select (.name == "My_Ansible_Variable_Name")'

Customize values of Ansible variables using simple matchers by using orcharhino management UI

You can set custom values of Ansible variables in orcharhino by using orcharhino management UI. Simple matchers help you override values for specific hosts by FQDN or by host group.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_variable_overrides, destroy_ansible_variable_overrides, destroy_ansible_variables, edit_ansible_variable_overrides, edit_ansible_variables, view_ansible_content, view_ansible_variable_overrides, view_ansible_variables, and view_organizations permissions.

  • Your orcharhino contains imported Ansible content.

Procedure
  1. In the orcharhino management UI, navigate to Ansible > Content.

  2. From the list of Ansible content, select a version.

  3. Select an Ansible role.

  4. Use the toggle to enable the variable override.

  5. Click the Edit icon.

  6. On the Overrides tab, click Create override.

  7. Set the toggle to Simple Matcher Creation.

  8. In the Matcher type menu, select your simple matcher type.

  9. In the Matcher value menu, select your simple matcher value.

  10. In the Override value field, enter your custom value.

  11. Click Submit to save your override.

Verification
  1. In the orcharhino management UI, navigate to Ansible > Content.

  2. From the list of Ansible content, select a version.

  3. Select an Ansible role.

  4. Use the toggle to enable the variable override.

  5. Click the Edit icon.

  6. Verify that orcharhino contains your custom value.

Customize values of Ansible variables using simple matchers by using orcharhino API

You can set custom values of Ansible variables in orcharhino by using orcharhino API. Simple matchers help you override values for specific hosts by FQDN or by host group.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_variable_overrides, destroy_ansible_variable_overrides, destroy_ansible_variables, edit_ansible_variable_overrides, edit_ansible_variables, view_ansible_content, view_ansible_variable_overrides, view_ansible_variables, and view_organizations permissions.

  • Your orcharhino contains imported Ansible content.

Procedure
  1. Optional: Get a list of Ansible content IDs:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/ \
    | jq ".results [] .id"

    Note down the ID of your Ansible content in orcharhino.

  2. Optional: Get a list of Ansible roles in your Ansible content:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/My_Ansible_Content_ID/ \
    | jq ".roles [] .name"
  3. Optional: Get a list of variables in your Ansible roles:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/My_Ansible_Content_ID/ \
    | jq ".roles []" | jq 'select(.name == "My_Ansible_Role_Name")' | jq ".variables []"

    Note down the ID of the Ansible variable that you want to customize.

  4. Create a JSON file, for example, data.json to define your custom value:

    {
      "override": {
        "value": "My_Custom_Value",
        "matcher": "My_Matcher_Type",
        "matcher_value": "My_Matcher_Value"
      }
    }

    You can use hostgroup to match host groups or fqdn to match hosts by FQDN.

  5. Set a custom value for an Ansible variable:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request POST \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_variables/My_Ansible_Variable_ID/overrides/ \
    | jq
Verification
  • Query the orcharhino API to verify that orcharhino set the Ansible variable override successfully:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/My_Ansible_Content_ID/ \
    | jq ".roles []" | jq 'select(.name == "My_Ansible_Role_Name")' | jq ".variables []" | jq 'select (.name == "My_Ansible_Variable_Name")'

Customize values of Ansible variables using custom matchers by using orcharhino management UI

You can set custom values of Ansible variables in orcharhino by using orcharhino management UI. Custom matchers help you override values for specific sets of hosts, for example, hosts that match a regular expression.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_variable_overrides, destroy_ansible_variable_overrides, destroy_ansible_variables, edit_ansible_variable_overrides, edit_ansible_variables, view_ansible_content, view_ansible_variable_overrides, view_ansible_variables, and view_organizations permissions.

  • Your orcharhino contains imported Ansible content.

Procedure
  1. In the orcharhino management UI, navigate to Ansible > Content.

  2. From the list of Ansible content, select a version.

  3. Select an Ansible role.

  4. Use the toggle to enable the variable override.

  5. Click the Edit icon.

  6. On the Base variable tab, click the Edit icon.

  7. In the Default value field, enter your custom default value.

  8. Click the Save icon to submit your change to orcharhino.

Verification
  1. In the orcharhino management UI, navigate to Ansible > Content.

  2. From the list of Ansible content, select a version.

  3. Select an Ansible role.

  4. Use the toggle to enable the variable override.

  5. Click the Edit icon.

  6. Verify that orcharhino contains your custom value.

Customize values of Ansible variables using custom matchers by using orcharhino API

You can set custom default values of Ansible variables in orcharhino by using orcharhino API. Global custom values help you define a baseline for your environment.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_variable_overrides, destroy_ansible_variable_overrides, destroy_ansible_variables, edit_ansible_variable_overrides, edit_ansible_variables, view_ansible_content, view_ansible_variable_overrides, view_ansible_variables, and view_organizations permissions.

  • Your orcharhino contains imported Ansible content.

Procedure
  1. Optional: Get a list of Ansible content IDs:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/ \
    | jq ".results [] .id"

    Note down the ID of your Ansible content in orcharhino.

  2. Optional: Get a list of Ansible roles in your Ansible content:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/My_Ansible_Content_ID/ \
    | jq ".roles [] .name"
  3. Optional: Get a list of variables in your Ansible roles:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/My_Ansible_Content_ID/ \
    | jq ".roles []" | jq 'select(.name == "My_Ansible_Role_Name")' | jq ".variables []"

    Note down the ID of the Ansible variable that you want to customize.

  4. Create a JSON file, for example, data.json to define your custom value:

    {
      "override": {
        "value": "My_Custom_Value",
        "matcher": "My_Matcher_Type",
        "matcher_value": "My_Matcher_Value"
      }
    }

    You can use hostgroup to match host groups or fqdn to match hosts by FQDN.

  5. Set a custom value for an Ansible variable:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request POST \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_variables/My_Ansible_Variable_ID/overrides/ \
    | jq
Verification
  • Query the orcharhino API to verify that orcharhino set the Ansible variable override successfully:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/My_Ansible_Content_ID/ \
    | jq ".roles []" | jq 'select(.name == "My_Ansible_Role_Name")' | jq ".variables []" | jq 'select (.name == "My_Ansible_Variable_Name")'

Customize values of Ansible variables for a host by using orcharhino management UI

You can set custom values of Ansible variables for a host by using orcharhino management UI. Setting a value for a specific host overrides all other levels and is helpful to test and debug host configurations.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_variable_overrides, destroy_ansible_variable_overrides, destroy_ansible_variables, edit_ansible_variable_overrides, edit_ansible_variables, view_ansible_content, view_ansible_variable_overrides, view_ansible_variables, and view_organizations permissions.

  • Your host has an Ansible environment assigned to it.

Procedure
  1. In the orcharhino management UI, navigate to Hosts > All Hosts.

  2. Select your host.

  3. On the Ansible Director tab, select the Variables tab.

  4. From the list of customizable variables, click the Edit icon for the variable that you want to override.

  5. In the Edit override window, set the custom value for your host.

  6. Click Confirm to submit your change to orcharhino.

Verification
  1. In the orcharhino management UI, navigate to Hosts > All Hosts.

  2. Select your host.

  3. On the Ansible Director tab, select the Variables tab.

  4. From the list of customizable variables, click the Edit icon for the variable that you want to override.

Next steps
  • Apply the configuration to your host.

Customize values of Ansible variables for a host by using orcharhino API

You can set custom values of Ansible variables for a host by using orcharhino API. Setting a value for a specific host overrides all other levels and is helpful to test and debug host configurations.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_variable_overrides, destroy_ansible_variable_overrides, destroy_ansible_variables, edit_ansible_variable_overrides, edit_ansible_variables, view_ansible_content, view_ansible_variable_overrides, view_ansible_variables, and view_organizations permissions.

  • Your host has an Ansible environment assigned to it.

Procedure
  1. Optional: Get a list of Ansible content IDs:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/ \
    | jq ".results [] .id"

    Note down the ID of your Ansible content in orcharhino.

  2. Optional: Get a list of Ansible roles in your Ansible content:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/My_Ansible_Content_ID/ \
    | jq ".roles [] .name"
  3. Optional: Get a list of variables in your Ansible roles:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/My_Ansible_Content_ID/ \
    | jq ".roles []" | jq 'select(.name == "My_Ansible_Role_Name")' | jq ".variables []"

    Note down the ID of the Ansible variable that you want to customize.

  4. Create a JSON file, for example, data.json to define a custom value for your host:

    {
      "override": {
        "value": "My_Custom_Value",
        "matcher": "fqdn",
        "matcher_value": "My_FQDN"
      }
    }
  5. Set a custom value for an Ansible variable for your host:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request POST \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_variables/My_Ansible_Variable_ID/overrides/ \
    | jq
Verification
  • Query the orcharhino API to verify that orcharhino set the Ansible variable override successfully for your host:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/My_Ansible_Content_ID/ \
    | jq ".roles []" | jq 'select(.name == "My_Ansible_Role_Name")' | jq ".variables []" | jq 'select (.name == "My_Ansible_Variable_Name")'
Next steps
  • Apply the configuration to your host.

Ansible variable precedence

You can define values of Ansible variables at different levels in orcharhino. The Ansible variable precedence describes the order of inheritance.

Ansible content

By convention, Ansible content that adheres to Ansible good practices defines default values for Ansible roles and playbooks. orcharhino uses those values as default values.

Global overrides

Global overrides are useful to set default values for your orcharhino environment. They override the default values of imported Ansible content.

Host group overrides

Host group overrides define the value for Ansible variables on a per-host group basis. They override the default values of global overrides.

FQDN overrides

FQDN overrides define the value for Ansible variables on a per-host basis. They override all other levels.

Additional resources

Build and manage Ansible Execution Environments

You can manage and build Ansible Execution Environments in orcharhino to define custom environments to configure hosts. Ansible Execution Environments are OCI-based container images built based on specific base container images and include a specific Ansible version.

Ansible Execution Environments give you control over the environment used to run Ansible Playbooks and Ansible roles against hosts to configure them. The base container image defines the Python version.

Ansible Execution Environments are part of organizations.

Supported Python versions

The Python version used to run Ansible to configure hosts is determined by the base container image. It must be compatible with the ansible-core releases on pypi.org.

Table 1. Ansible version per Python version
Ansible version Python versions

2.20

3.12, 3.13, 3.14

2.19

3.11, 3.12, 3.13

2.18

3.11, 3.12, 3.13

2.17

3.10, 3.11, 3.12

2.16

3.10, 3.11, 3.12

Table 2. Container Image and default Python version
Operating system Default Python version

AlmaLinux 10.1

3.12

Debian 13

3.13

Fedora 44

3.14

Ubuntu 26.04

3.14

Build an Ansible Execution Environment by using orcharhino management UI

You can build an Ansible Execution Environment in orcharhino by using orcharhino management UI. An Ansible Execution Environment is defined by its base container image and version of ansible-core.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_execution_environments, edit_ansible_execution_environments, view_ansible_content, view_ansible_execution_environments, and view_organizations permissions.

Procedure
  1. In the orcharhino management UI, navigate to Ansible > Execution Environments.

  2. Click Create Execution Environment.

  3. In the Name field, enter the name of your Ansible Execution Environment.

  4. In the Base-Image URL field, enter the name of the base container image. You can reference any container image from an OCI-compatible container registry or any container image that you have synchronized to orcharhino.

    ATIX AG recommends to use a fully qualified container image name, for example, quay.io/fedora/fedora:44.

  5. In the Ansible version field, enter the version of ansible-core.

    Ensure that the version is available on the Python Package Index (PyPI), for example, 2.20.4.

  6. Click the Save icon to save your Ansible Execution Environment.

Verification
  1. In the orcharhino management UI, navigate to Ansible > Execution Environments.

  2. For your Ansible Execution Environment, verify that the build status icon is green.

Build an Ansible Execution Environment by using orcharhino API

You can build an Ansible Execution Environment in orcharhino by using orcharhino API. An Ansible Execution Environment is defined by its base container image and version of ansible-core.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_execution_environments, edit_ansible_execution_environments, view_ansible_content, view_ansible_execution_environments, and view_organizations permissions.

Procedure
  1. Create a JSON file, for example, data.json to define your Ansible Execution Environment:

    {
      "organization_id": "My_Organization_ID",
      "execution_environment": {
        "name": "My_Ansible_Execution_Environment_Name",
        "base_image_url": "My_Base_Container_Image_URL",
        "ansible_version": "My_Ansible_Version"
      }
    }
  2. Build your Ansible Execution Environment:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request POST \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/execution_environments/ \
    | jq
Verification
  • Query the orcharhino API to verify that orcharhino built the Ansible Execution Environment successfully:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/execution_environments/ \
    | jq ".results | .[]"

    Verify that build_status reported by orcharhino equals success.

Change an Ansible Execution Environment by using orcharhino management UI

You can change an Ansible Execution Environment in orcharhino by using orcharhino management UI. You can change the name, base container image, or version of ansible-core.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_execution_environments, edit_ansible_execution_environments, view_ansible_content, view_ansible_execution_environments, and view_organizations permissions.

Procedure
  1. In the orcharhino management UI, navigate to Ansible > Execution Environments.

  2. For your Ansible Execution Environment, click the Edit icon.

    You can rename the Ansible Execution Environment, rebuild it based on another container image, or include a different version of Ansible.

  3. Click the Save icon to change your Ansible Execution Environment.

Verification
  1. In the orcharhino management UI, navigate to Ansible > Execution Environments.

  2. For your Ansible Execution Environments, verify that the build status icon is green.

Change an Ansible Execution Environment by using orcharhino API

You can change an Ansible Execution Environment in orcharhino by using orcharhino API. You can change the name, base container image, or version of ansible-core.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_execution_environments, edit_ansible_execution_environments, view_ansible_content, view_ansible_execution_environments, and view_organizations permissions.

Procedure
  1. Optional: Get a list of your Ansible Execution Environment:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/execution_environments/ \
    | jq ".results | .[]"
  2. Create a JSON file, for example, data.json to define your Ansible Execution Environment:

    {
      "execution_environment": {
        "name": "My_Ansible_Execution_Environment_Name",
        "base_image_url": "My_Container_Image_URL",
        "ansible_version": "My_Ansible_Version"
      }
    }

    You must provide values for all fields, even if you do not want to change them.

  3. Change your Ansible Execution Environment:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request PATCH \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/ansible_content/My_Ansible_Execution_Environment_ID/ \
    | jq
Verification
  • Query the orcharhino API to verify that orcharhino changed the Ansible Execution Environment successfully:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/execution_environments/ \
    | jq ".results | .[]"

Delete an Ansible Execution Environment by using orcharhino management UI

You can delete an Ansible Execution Environment from orcharhino by using orcharhino management UI.

Prerequisites
  • Your orcharhino account has a role that grants the destroy_ansible_execution_environments, view_ansible_content, view_ansible_execution_environments, and view_organizations permissions.

Procedure
  1. In the orcharhino management UI, navigate to Ansible > Execution Environments.

  2. For your Ansible Execution Environment, click the Delete icon.

  3. Click Confirm to delete your Ansible Execution Environment from orcharhino.

Verification
  1. In the orcharhino management UI, navigate to Ansible > Execution Environments.

  2. Verify that orcharhino does not contain your deleted Ansible Execution Environment.

Delete an Ansible Execution Environment by using orcharhino API

You can delete an Ansible Execution Environment from orcharhino by using orcharhino API.

Prerequisites
  • Your orcharhino account has a role that grants the destroy_ansible_execution_environments, view_ansible_content, view_ansible_execution_environments, and view_organizations permissions.

Procedure
  1. Optional: List all Ansible Execution Environments in orcharhino:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/execution_environments/ \
    | jq ".results | .[]"
  2. Delete your Ansible Execution Environment from orcharhino:

    $ curl \
    --header "Accept: application/json" \
    --request DELETE \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/execution_environments/My_Ansible_Execution_Environment_ID/ \
    | jq
Verification
  • Query the orcharhino API to verify that your Ansible Execution Environment is no longer present on orcharhino:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/execution_environments/ \
    | jq ".results | .[]"

Manage Ansible environments

You can manage Ansible environments in orcharhino to configure hosts based on their assigned Ansible environment.

You can use Ansible Director to control Ansible content that you use to configure hosts by defining and assigning Ansible environments. Ansible environments work similar to lifecycle environments to distribute content to hosts.

An Ansible lifecycle environment path is a list of consecutive lifecycle environments. You can promote content from left to right.

Each Ansible lifecycle environment path contains one or more Ansible lifecycle environments. Each Ansible lifecycle environment is a set of Ansible content.

Ansible environments are part of organizations.

Create an Ansible lifecycle environment path by using orcharhino management UI

You can create an Ansible lifecycle environment path by using orcharhino management UI. Similar to content management, Ansible lifecycle environment paths allow you to develop, test, and run the same Ansible content in production in different versions.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_lifecycle_environment_paths, edit_ansible_lifecycle_environment_paths, view_ansible_content, view_ansible_lifecycle_environment_paths, view_ansible_lifecycle_environments, and view_organizations permissions.

Procedure
  1. In the orcharhino management UI, navigate to Ansible > Environments.

  2. Click Create lifecycle environment path.

  3. In the Unnamed LCE Path field, click the Edit icon.

  4. Enter a name for your lifecycle environment path and click the Save icon.

  5. Click Confirm to rename your lifecycle environment path.

Verification
  1. In the orcharhino management UI, navigate to Ansible > Environments.

  2. Verify that orcharhino shows your newly created lifecycle environment path.

Create an Ansible lifecycle environment path by using orcharhino API

You can create an Ansible lifecycle environment path by using orcharhino API. Similar to content management, Ansible lifecycle environment paths allow you to develop, test, and run the same Ansible content in production in different versions.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_lifecycle_environment_paths, edit_ansible_lifecycle_environment_paths, view_ansible_content, view_ansible_lifecycle_environment_paths, view_ansible_lifecycle_environments, and view_organizations permissions.

Procedure
  1. Create a JSON file, for example, data.json to define your Ansible lifecycle environment path:

    {
      "lifecycle_environment_path": {
        "name": "My_Ansible_Lifecycle_Environment_Path_Name"
      },
      "organization_id": "My_Organization_ID"
    }
  2. Create an Ansible lifecycle environment path:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request POST \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/paths/ \
    | jq
Verification
  • Query the orcharhino API to verify that orcharhino created the Ansible lifecycle environment path successfully:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/paths/ \
    | jq ".results | .[] | .name"

Delete an Ansible lifecycle environment path by using orcharhino management UI

You can delete an Ansible lifecycle environment path in orcharhino by using orcharhino management UI.

Prerequisites
  • Your orcharhino account has a role that grants the destroy_ansible_lifecycle_environment_paths, view_ansible_content, view_ansible_lifecycle_environment_paths, view_ansible_lifecycle_environments, and view_organizations permissions.

Procedure
  1. In the orcharhino management UI, navigate to Ansible > Environments.

  2. In your Ansible lifecycle environment path, click the Delete icon.

  3. Click Confirm to delete your Ansible lifecycle environment path.

Verification
  1. In the orcharhino management UI, navigate to Ansible > Environments.

  2. Verify that orcharhino does not contain your previously deleted Ansible lifecycle environment path.

Delete an Ansible lifecycle environment path by using orcharhino API

You can delete an Ansible lifecycle environment path in orcharhino by using orcharhino management UI.

Prerequisites
  • Your orcharhino account has a role that grants the destroy_ansible_lifecycle_environment_paths, view_ansible_content, view_ansible_lifecycle_environment_paths, view_ansible_lifecycle_environments, and view_organizations permissions.

Procedure
  1. Optional: List all Ansible lifecycle environment paths in orcharhino:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/paths/ \
    | jq ".results | .[]"
  2. Delete your Ansible lifecycle environment path from orcharhino:

    $ curl \
    --header "Accept: application/json" \
    --request DELETE \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/paths/My_Ansible_Lifecycle_Environment_Path_ID/ \
    | jq
Verification
  • Verify that orcharhino does not contain your previously deleted Ansible lifecycle environment path:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/paths/ \
    | jq ".results | .[]"

Create an Ansible lifecycle environment by using orcharhino management UI

You can create an Ansible lifecycle environment by using orcharhino management UI. Similar to content management, Ansible lifecycle environments allow you to version control content for different phases of the lifecycle of a host.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_lifecycle_environment_paths, edit_ansible_lifecycle_environment_paths, view_ansible_content, view_ansible_lifecycle_environment_paths, view_ansible_lifecycle_environments, and view_organizations permissions.

  • Your orcharhino contains an Ansible lifecycle environment path.

  • Your orcharhino contains an Ansible Execution Environment.

  • Your orcharhino contains Ansible content.

Procedure
  1. In the orcharhino management UI, navigate to Ansible > Environments.

  2. In your Ansible lifecycle environment path, click Create lifecycle environment.

  3. For your Ansible lifecycle environment, click None next to Execution Environment.

  4. From the list of Ansible Execution Environments, click Assign for the Execution Environment that you want to use for this lifecycle environment.

  5. For your Ansible lifecycle environment, click the Ansible icon.

  6. From the list of Ansible content, select Ansible content that you want to use for this lifecycle environment.

  7. Click Confirm to assign content to your lifecycle environment.

Verification
  1. In the orcharhino management UI, navigate to Ansible > Environments.

  2. Verify that orcharhino shows your newly created lifecycle environment.

Create an Ansible lifecycle environment by using orcharhino API

You can create an Ansible lifecycle environment by using orcharhino API. Similar to content management, Ansible lifecycle environments allow you to version control content for different phases of the lifecycle of a host.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_lifecycle_environment_paths, edit_ansible_lifecycle_environment_paths, view_ansible_content, view_ansible_lifecycle_environment_paths, view_ansible_lifecycle_environments, and view_organizations permissions.

  • Your orcharhino contains an Ansible lifecycle environment path.

  • Your orcharhino contains an Ansible Execution Environment.

  • Your orcharhino contains Ansible content.

Procedure
  1. Optional: Get a list of all Ansible lifecycle environment paths:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/paths/ \
    | jq ".results | .[]"
  2. Create a JSON file, for example, data.json to define your Ansible lifecycle environment:

    {
      "lifecycle_environment": {
        "name": "My_Ansible_Lifecycle_Environment_Name",
        "position": -1
      },
      "lifecycle_environment_path_id": "My_Ansible_Lifecycle_Environment_Path_ID",
      "organization_id": "My_Organization_ID"
    }

    -1 as position means that you append a lifecycle environment to all lifecycle environments in your path.

  3. Create an Ansible lifecycle environment:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request POST \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/ \
    | jq
  4. Create a JSON file, for example, data.json to define the Ansible Execution Environment of your Ansible lifecycle environment:

    {
      "lifecycle_environment": {
        "description": "My_Description",
        "name": "My_Ansible_Lifecycle_Environment_Name",
        "execution_environment_id": "My_Ansible_Execution_Environment_ID"
      }
    }
  5. Assign an Ansible Execution Environment to your Ansible lifecycle environment:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request PUT \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/My_Ansible_Lifecycle_Environment_ID/ \
    | jq
  6. Create a JSON file, for example, data.json to define the Ansible content of your Ansible lifecycle environment:

    {
      "content_assignments": [
        {
          "id": "My_Ansible_Content_ID",
          "version": "My_Ansible_Content_Version"
        }
      ],
      "organization_id": "My_Organization_ID"
    }
  7. Assign Ansible content to your Ansible lifecycle environment:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request PATCH \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/My_Ansible_Lifecycle_Environment_ID/ \
    | jq
Verification
  • Query the orcharhino API to verify that orcharhino created the Ansible lifecycle environment successfully:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/My_Ansible_Lifecycle_Environment_ID/ \
    | jq

Assign an Ansible Execution Environment to an Ansible lifecycle environment by using orcharhino management UI

You can assign an Ansible Execution Environment to an Ansible lifecycle environment by using orcharhino management UI. Ansible Execution Environments provide the environment to run Ansible to configure hosts.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_lifecycle_environment_paths, edit_ansible_lifecycle_environment_paths, view_ansible_content, view_ansible_lifecycle_environment_paths, view_ansible_lifecycle_environments, and view_organizations permissions.

  • Your orcharhino contains an Ansible lifecycle environment path.

  • Your orcharhino contains an Ansible Execution Environment.

Procedure
  1. In the orcharhino management UI, navigate to Ansible > Environments.

  2. In your Ansible lifecycle environment path, for your Ansible lifecycle environment, click None next to Execution Environment.

  3. From the list of Ansible Execution Environments, click Assign for the Execution Environment that you want to use for this lifecycle environment.

Verification
  1. In the orcharhino management UI, navigate to Ansible > Environments.

  2. Verify that orcharhino shows your newly assigned Ansible Execution Environment for your selected Ansible lifecycle environment.

Assign an Ansible Execution Environment to an Ansible lifecycle environment by using orcharhino API

You can assign an Ansible Execution Environment to an Ansible lifecycle environment by using orcharhino API. Ansible Execution Environments provide the environment to run Ansible to configure hosts.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_lifecycle_environment_paths, edit_ansible_lifecycle_environment_paths, view_ansible_content, view_ansible_lifecycle_environment_paths, view_ansible_lifecycle_environments, and view_organizations permissions.

  • Your orcharhino contains an Ansible lifecycle environment path.

  • Your orcharhino contains an Ansible Execution Environment.

Procedure
  1. Optional: Get a list of all Ansible Execution Environments:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/execution_environments/ \
    | jq ".results | .[]"
  2. Create a JSON file, for example, data.json to define your Ansible Execution Environment:

    {
      "lifecycle_environment": {
        "description": "My_Description",
        "name": "My_Ansible_Lifecycle_Environment_Name",
        "execution_environment_id": "My_Ansible_Execution_Environment_ID"
      }
    }
  3. Assign an Ansible Execution Environment to your Ansible lifecycle environment:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request PUT \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/My_Ansible_Lifecycle_Environment_ID/ \
    | jq
Verification
  • Query the orcharhino API to verify that orcharhino assigned the Ansible Execution Environment to your Ansible lifecycle environment successfully:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/My_Ansible_Lifecycle_Environment_ID/ \
    | jq

Assign Ansible content to an Ansible lifecycle environment by using orcharhino management UI

You can assign Ansible content to an Ansible lifecycle environment by using orcharhino management UI. Ansible content consists of imported Ansible collections and roles in specific versions.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_lifecycle_environment_paths, edit_ansible_lifecycle_environment_paths, view_ansible_content, view_ansible_lifecycle_environment_paths, view_ansible_lifecycle_environments, and view_organizations permissions.

  • Your orcharhino contains an Ansible lifecycle environment path.

  • Your orcharhino contains Ansible content.

Procedure
  1. In the orcharhino management UI, navigate to Ansible > Environments.

  2. For your Ansible lifecycle environment, click the Ansible icon.

  3. From the list of Ansible content, select versions of Ansible content that you want to use for this lifecycle environment.

  4. Click Confirm to assign content to your lifecycle environment.

Verification
  1. In the orcharhino management UI, navigate to Ansible > Environments.

  2. Verify that orcharhino shows your newly assigned Ansible content for your Ansible lifecycle environment.

Assign Ansible content to an Ansible lifecycle environment by using orcharhino API

You can assign Ansible content to an Ansible lifecycle environment by using orcharhino API. Ansible content consists of imported Ansible collections and roles in specific versions.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_lifecycle_environment_paths, edit_ansible_lifecycle_environment_paths, view_ansible_content, view_ansible_lifecycle_environment_paths, view_ansible_lifecycle_environments, and view_organizations permissions.

  • Your orcharhino contains an Ansible lifecycle environment path.

  • Your orcharhino contains Ansible content.

Procedure
  1. Optional: Get a list of all Ansible lifecycle environments within your Ansible lifecycle environment path:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/My_Ansible_Lifecycle_Environment_Path_ID/ \
    | jq
  2. Create a JSON file, for example, data.json to define Ansible content for your Ansible lifecycle environment:

    {
      "content_assignments": [
        {
          "id": "My_Ansible_Content_ID",
          "version": "My_Ansible_Content_Version"
        }
      ],
      "organization_id": "My_Organization_ID"
    }
  3. Assign Ansible content to your Ansible lifecycle environment:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request PATCH \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/My_Ansible_Lifecycle_Environment_ID/ \
    | jq
Verification
  • Query the orcharhino API to verify that orcharhino assigned the Ansible content to your Ansible lifecycle environment successfully:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/My_Ansible_Lifecycle_Environment_ID/ \
    | jq ".content"

Promote an Ansible lifecycle environment by using orcharhino management UI

You can promote an Ansible lifecycle environment within an Ansible lifecycle environment path by using orcharhino management UI. Ansible lifecycle environments are named sets of Ansible content and Ansible Execution Environments.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_lifecycle_environment_paths, edit_ansible_lifecycle_environment_paths, view_ansible_content, view_ansible_lifecycle_environment_paths, view_ansible_lifecycle_environments, and view_organizations permissions.

  • You have at least two Ansible lifecycle environments within an Ansible lifecycle environment path.

  • You have assigned Ansible content, an Ansible Execution Environment, or both, to your left Ansible lifecycle environment.

Procedure
  1. In the orcharhino management UI, navigate to Ansible > Environments.

  2. In your Ansible lifecycle environment path, click the Arrow icon between two Ansible lifecycle environments.

Verification
  1. In the orcharhino management UI, navigate to Ansible > Environments.

  2. Verify that orcharhino shows the Equal icon between your two Ansible lifecycle environments.

Promote an Ansible lifecycle environment by using orcharhino API

You can promote an Ansible lifecycle environment within an Ansible lifecycle environment path by using orcharhino API. Ansible lifecycle environments are named sets of Ansible content and Ansible Execution Environments.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_lifecycle_environment_paths, edit_ansible_lifecycle_environment_paths, view_ansible_content, view_ansible_lifecycle_environment_paths, view_ansible_lifecycle_environments, and view_organizations permissions.

  • You have at least two Ansible lifecycle environments within an Ansible lifecycle environment path.

  • You have assigned Ansible content, an Ansible Execution Environment, or both, to your left Ansible lifecycle environment.

Procedure
  1. Optional: Get a list of all Ansible lifecycle environments with your Ansible lifecycle environment path:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/paths/ \
    | jq ".results | .[]"
  2. Create a JSON file, for example, data.json to define your left and right Ansible lifecycle environments:

    {
      "promote": {
        "source_environment_id": "My_Left_Ansible_Environment_ID_",
        "target_environment_id": "My_Right_Ansible_Environment_ID_"
      }
    }
  3. Promote your Ansible lifecycle environment:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request PATCH \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/paths/My_Ansible_Lifecycle_Environment_Path_ID/promote/ \
    | jq
Verification
  • Query the orcharhino API to verify that orcharhino created the Ansible lifecycle environment successfully:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/ \
    | jq ".results | .[] | .name"

Delete an Ansible lifecycle environment by using orcharhino management UI

You can delete an Ansible lifecycle environment by using orcharhino management UI.

Procedure
  1. In the orcharhino management UI, navigate to Ansible > Environments.

  2. In your Ansible lifecycle environment path, click the Edit icon.

  3. In your Ansible lifecycle environment, click the Delete icon.

  4. Click Confirm to delete your Ansible lifecycle environment.

Verification
  1. In the orcharhino management UI, navigate to Ansible > Environments.

  2. For your Ansible lifecycle environment path, verify that orcharhino no longer shows your previously deleted Ansible lifecycle environment.

Delete an Ansible lifecycle environment by using orcharhino API

You can delete an Ansible lifecycle environment by using orcharhino API.

Procedure
  • Delete your Ansible lifecycle environment from an Ansible lifecycle environment path:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request DELETE \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/paths/ \
    | jq
Verification
  • Query the orcharhino API to verify that your Ansible lifecycle environment path no longer contains the previously deleted Ansible lifecycle environment:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/paths/ \
    | jq ".result"

Configure hosts by using Ansible

You can use Ansible to configure hosts through orcharhino. Ansible is an automation engine that helps you standardize and control your environment.

You can define your configuration payload, namely Ansible collections, roles, and variables, in orcharhino and then run them on arbitrary sets of hosts.

If you assign an Ansible environment to a host and apply the configuration through orcharhino, orcharhino Proxy starts an Ansible Execution Environment to configure your host based on the assigned Ansible roles. After a successful remote execution task, your host is configured.

If you unassign the Ansible environment from your host, the configuration of your host does not revert to its original state.

Assign an Ansible environment to a host by using orcharhino management UI

You can assign an Ansible environment to your host by using orcharhino management UI. Ansible environments define the lifecycle of the Ansible content that is used to configure your host.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_lifecycle_environment_paths, edit_ansible_lifecycle_environment_paths, view_ansible_content, view_ansible_lifecycle_environment_paths, view_ansible_lifecycle_environments, and view_organizations permissions.

  • Your orcharhino contains an Ansible lifecycle environment with an Ansible Execution Environment and Ansible content.

Procedure
  1. In the orcharhino management UI, navigate to Hosts > All Hosts.

  2. In the list of hosts, select your host.

  3. On the Overview tab, under Ansible lifecycle, click Library.

  4. Click the Edit icon.

  5. From the Lifecycle environment path menu, select your Ansible lifecycle environment path.

  6. From the Lifecycle environment menu, select your Ansible lifecycle environment.

  7. Click the Save icon to submit your changes.

Verification
  1. In the orcharhino management UI, navigate to Hosts > All Hosts.

  2. On the Overview tab, verify that orcharhino shows your newly assigned Ansible lifecycle environment path and Ansible lifecycle environment.

Assign an Ansible environment to a host by using orcharhino API

You can assign an Ansible environment to your host by using orcharhino API. Ansible environments define the lifecycle of the Ansible content that is used to configure your host.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_lifecycle_environment_paths, edit_ansible_lifecycle_environment_paths, view_ansible_content, view_ansible_lifecycle_environment_paths, view_ansible_lifecycle_environments, and view_organizations permissions.

  • Your orcharhino contains an Ansible lifecycle environment with an Ansible Execution Environment and Ansible content.

Procedure
  • Assign an Ansible environment to your host:

    $ curl \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request POST \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/My_Ansible_Lifecycle_Environment_ID/assign/HOST/My_Host_ID/ \
    | jq
Verification
  • Query the orcharhino API to verify that orcharhino shows your newly assigned Ansible environment:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/hosts/ \
    | jq ".results | .[]" | jq "select(.id == My_Host_ID)" | jq ".ansible_lifecycle_environment_id"

Assign Ansible roles to a host by using orcharhino management UI

You can assign Ansible roles to your host by using orcharhino management UI. Ansible roles define the Ansible content that is used to configure your host.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_lifecycle_environment_paths, edit_ansible_lifecycle_environment_paths, view_ansible_content, view_ansible_lifecycle_environment_paths, view_ansible_lifecycle_environments, and view_organizations permissions.

  • Your orcharhino contains an Ansible lifecycle environment with an Ansible Execution Environment and Ansible content.

Procedure
  1. In the orcharhino management UI, navigate to Hosts > All Hosts.

  2. Select your host.

  3. On the Ansible Director tab, select the Content tab.

  4. From the list of Ansible roles, select a version of an Ansible role and click on the Right Arrow icon.

  5. Click the Save icon to assign Ansible roles to your host.

Verification
  1. In the orcharhino management UI, navigate to Hosts > All Hosts.

  2. Select your host.

  3. On the Ansible Director tab, select the Content tab.

  4. Verify that orcharhino shows your newly assigned Ansible roles.

Assign Ansible roles to a host by using orcharhino API

You can assign Ansible roles to your host by using orcharhino API. Ansible roles define the Ansible content that is used to configure your host.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_lifecycle_environment_paths, edit_ansible_lifecycle_environment_paths, view_ansible_content, view_ansible_lifecycle_environment_paths, view_ansible_lifecycle_environments, and view_organizations permissions.

  • Your orcharhino contains an Ansible lifecycle environment with an Ansible Execution Environment and Ansible content.

Procedure
  1. Query the orcharhino API to get the ID of your host:

    $ curl \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/hosts/ \
    | jq ".results" | jq ".[]" | jq 'select(.name == "My_Host")' | jq ".id"
  2. Query the orcharhino API to get the ID of your Ansible lifecycle environment:

    $ curl \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/paths/ \
    | jq ".results" | jq ".[]" | jq 'select(.name == "My_Ansible_Lifecycle_Environment_Path")' | jq ".lifecycle_environments" | jq ".[]" | jq 'select(.name == "My_Ansible_Lifecycle_Environment")' | jq ".id"
  3. Query the orcharhino API to get the ID of your Ansible role:

    $ curl \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/My_Ansible_Lifecycle_Environment_ID/ \
    | jq ".content [] .roles" | jq ".[]" | jq 'select(.name == "My_Ansible_Role_Name")' | jq ".id"
  4. Create a JSON file, for example, data.json to define your Ansible environment:

    {
      "assignments": [
        {
          "assignable_name": "My_Ansible_Name",
          "assignable_namespace": "My_Ansible_Namespace",
          "assignable_role_name": "My_Ansible_Role_Name",
          "assignable_type": "ForemanAnsibleDirector::AnsibleCollectionRole"
        }
      ]
    }
  5. Assign Ansible roles to your host:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request POST \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/assignments/host/My_Host_ID/ \
    | jq
Verification
  • Query the orcharhino API to verify that orcharhino shows your newly assigned Ansible roles for your host:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/assignments/host/My_Host_ID/ \
    | jq

Unassign Ansible roles from a host by using orcharhino management UI

You can unassign Ansible roles from your host by using orcharhino management UI.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_lifecycle_environment_paths, edit_ansible_lifecycle_environment_paths, view_ansible_content, view_ansible_lifecycle_environment_paths, view_ansible_lifecycle_environments, and view_organizations permissions.

Procedure
  1. In the orcharhino management UI, navigate to Hosts > All Hosts.

  2. In the list of hosts, select your host.

  3. On the Ansible Director tab, click the Content tab.

  4. From the list of assigned Ansible roles, select an Ansible role and click on the Left Arrow icon.

  5. Click the Save icon to submit your changes.

Verification
  1. In the orcharhino management UI, navigate to Ansible > Environments.

  2. Verify that orcharhino shows your newly assign Ansible Execution Environment for your selected Ansible lifecycle environment.

Unassign Ansible roles from a host by using orcharhino API

You can unassign Ansible roles from your host by using orcharhino API.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_lifecycle_environment_paths, edit_ansible_lifecycle_environment_paths, view_ansible_content, view_ansible_lifecycle_environment_paths, view_ansible_lifecycle_environments, and view_organizations permissions.

Procedure
  1. Optional: Get a list of all assigned Ansible roles:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/execution_environments/ \
    | jq ".results | .[]"
  2. Create a JSON file, for example, data.json to define your Ansible roles:

    {
      "lifecycle_environment": {
        "description": "My_Description",
        "name": "My_Ansible_Lifecycle_Environment_Name",
        "execution_environment_id": "My_Ansible_Execution_Environment_ID"
      }
    }
  3. Unassign Ansible roles from your host:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request PUT \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/My_Ansible_Lifecycle_Environment_ID/ \
    | jq
Verification
  • Query the orcharhino API to verify that orcharhino unassigned the Ansible roles from your host successfully:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/ansible_director/lifecycle_environments/My_Ansible_Lifecycle_Environment_ID/ \
    | jq

Apply Ansible-based configuration to a host by using orcharhino management UI

You can apply Ansible-based configuration to your host by using orcharhino management UI.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_lifecycle_environment_paths, edit_ansible_lifecycle_environment_paths, view_ansible_content, view_ansible_lifecycle_environment_paths, view_ansible_lifecycle_environments, and view_organizations permissions.

  • Your host has Ansible roles assigned to it.

Procedure
  1. In the orcharhino management UI, navigate to Monitor > Jobs.

  2. Click Run Job.

  3. From the Job category menu, select Ansible Playbook.

  4. From the Job template menu, select Apply Ansible configuration.

  5. Click Next.

  6. Select the hosts which you want to configure.

  7. Follow the wizard to complete setting the remote job.

  8. Click Submit to apply Ansible-based configuration to your selected hosts.

Verification
  1. In the orcharhino management UI, navigate to Monitor > Jobs.

  2. In the search bar, enter Configure the host using Ansible content assigned to it.

  3. From the list of jobs, select the job that you previously started based on the search query and date.

  4. Verify that orcharhino configured your selected hosts successfully.

Apply Ansible-based configuration to a host by using orcharhino API

You can apply Ansible-based configuration to your host by using orcharhino API.

Prerequisites
  • Your orcharhino account has a role that grants the create_ansible_lifecycle_environment_paths, edit_ansible_lifecycle_environment_paths, view_ansible_content, view_ansible_lifecycle_environment_paths, view_ansible_lifecycle_environments, and view_organizations permissions.

  • Your host has Ansible roles assigned to it.

Procedure
  1. Create a JSON file, for example, data.json to define your job invocation:

    {
      "job_invocation": {
        "feature": "ansible_director_configure_host",
        "search_query": "name = host.example.com",
        "targeting_type": "static_query"
      }
    }
  2. Apply Ansible-based configuration to your host:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request POST \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/job_invocations/ \
    | jq ".id"
Verification
  • Query the orcharhino API to verify that orcharhino shows your newly assigned Ansible roles:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/job_invocations/My_Job_ID/ \
    | jq ".status_label"

Run an Ansible Playbook on a host by using orcharhino management UI

You can run a custom Ansible Playbook to configure your host through orcharhino by using orcharhino management UI.

Prerequisites
  • Your orcharhino account has a role that grants the create_job_invocations, create_template_invocations, view_hosts, view_job_invocations, view_job_templates, view_remote_execution_features, and view_smart_proxies permissions.

Procedure
  1. In the orcharhino management UI, navigate to Monitor > Jobs.

  2. Click Run Job.

  3. From the Job category menu, select Ansible Playbook.

  4. From the Job template menu, select Apply Ansible configuration.

  5. Click Next.

  6. Select the hosts which you want to configure.

  7. In the playbook field, enter your custom Ansible Playbook.

  8. Follow the wizard to complete setting the remote job.

  9. Click Submit to run an Ansible Playbook to your selected hosts.

Verification
  1. In the orcharhino management UI, navigate to Monitor > Jobs.

  2. In the search bar, enter Apply Ansible configuration.

  3. From the list of jobs, select the job that you previously started based on the search query and date.

  4. Verify that orcharhino configured your selected hosts successfully.

Run an Ansible Playbook to a host by using orcharhino API

You can run a custom Ansible Playbook to configure your host through orcharhino by using orcharhino API.

Prerequisites
  • Your orcharhino account has a role that grants the create_job_invocations, create_template_invocations, view_hosts, view_job_invocations, view_job_templates, view_remote_execution_features, and view_smart_proxies permissions.

Procedure
  1. Create a JSON file, for example, data.json to define your job invocation:

    {
      "job_invocation": {
        "feature": "ansible_run_playbook",
        "inputs": {
          "playbook": "n- name: \"My_Custom_Ansible_Playbook\"\n  hosts: all\n  tasks:\n    - name: \"My_Custom_Task\"\n      ansible.builtin.debug:\n        msg: \"My_Custom_Message\"\n...\n"
        },
        "search_query": "name = _host.example.com",
        "targeting_type": "static_query"
      }
    }
  2. Run your Ansible Playbook on your host:

    $ curl \
    --data @data.json \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --request POST \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/job_invocations/ \
    | jq ".id"

    Note the ID of the job.

Verification
  • Query the orcharhino API to verify that orcharhino ran the Ansible Playbook on your host successfully:

    $ curl \
    --header "Accept: application/json" \
    --user "My_User_Name:My_Password" \
    https://orcharhino.example.com/api/v2/job_invocations/My_Job_ID/ \
    | jq ".status_label"

Appendix A: Ansible Director settings

The Ansible Director settings define the orcharhino-wide settings of this plugin.

Setting Default value Description

Content - Default Ansible Galaxy URL

https://galaxy.ansible.com/

Default URL used when importing content from an Ansible Galaxy instance.

Execution Environments - Default ansible-core version

2.19.3

Default Ansible-Core version used for Execution Environments. Must match an available release from PyPI. pypi.org: release history of ansible-core.

Execution Environments - Default Ansible Execution Environment for Remote Execution

None

Default Execution Environment used for execution of remote execution jobs.

Execution Environments - Default Ansible Execution Environment for Ansible jobs

None

Default Execution Environment used for execution of default Ansible jobs.

Lifecycle environments - Force incremental promotion of lifecycle environments

Yes

When enabled, lifecycle environment promotions must follow the defined path incrementally, for example, from "DEV" to "TEST" to "PROD". When disabled, promotions can skip intermediate environments, for example, directly from "DEV" to "PROD" with an implicit promotion of "DEV" to "TEST".

Lifecycle environments - Prevent path deletion if lifecycle environment is in use.

No

When enabled, lifecycle environment paths can only be deleted if none of its lifecycle environments is referenced anywhere.