Defining Ansible AWX Observer jobs

The Ansible AWX observer supports load jobs. When a load job is run, it will gather and read data from an Ansible AWX instance of your choice. When a load job is run, it will load a baseline topology data view from Ansible AWX through its REST APIs.

Before you begin

Important: The Ansible AWX Observer supports the on-premise Ansible AWX version 21.14.0 and Tower API version 3.8.6.

The Ansible AWX Observer is installed as part of the core installation procedure.

Ensure you have the Ansible AWX details to hand, such as the host, port, user and token before defining and running the observer job.
Required: Before defining the observer load job, you must obtain a personal access token (PAT) from AWX. The token authentication is recommended for the usage of Tower's API.
  1. From the menu bar, navigate to the Users page that is under the Access section.
  2. Select a username, then click the Token option.
  3. Click on the + (plus) icon.
  4. Leave the application field blank, and choose read for the token’s access.
Remember: Swagger documentation for the observer is available at the following default location: https://<your host>/1.0/ansibleawx-observer/swagger

About this task

The Ansible AWX Observer imports ITSM Resource Topology Service data to Agile Service Manager.

ansibleawx_observer_common.sh
The configuration file you use to customize Ansible AWX Observer settings.
The parameters defined here are then used by ansibleawx_observer_load_start.sh to trigger the Ansible AWX Observer jobs.
Tip: Alternatively, you can set the appropriate environment variables. If an environment variable is set, it takes precedence over the configuration file settings.
You define and start the following job. You must edit the parameters in the configuration file before running these jobs.
Full Topology Upload job
A transient (one-off) job that loads all requested topology data.
This job is started by the ansibleawx_observer_load_start.sh script.

Procedure

To edit the parameters in the configuration file

  1. Open the ansibleawx_observer_common.sh configuration file and edit at least the following parameters:
    ansibleawx_host
    The hostname of the Ansible AWX instance
    ansibleawx_port
    The port of the Ansible AWX instance
    ansibleawx_user
    The owner of the token
    ansibleawx_token
    The bearer token in encrypted format
    ansibleawx_sslTruststoreFile
    The Ansible AWX truststore file in jks format
    ansibleawx_passwordSslTruststoreFile
    The Ansible AWX truststore file's password in encrypted format
    For encryption: Run the encrypt_password.sh script in the ASM_HOME/bin directory:
    ./bin/encrypt_password.sh
    Enter and then confirm the password. The encryption utility returns an encrypted version.
    SSL requirements: To acquire SSL certificates and build SSL truststores, use the relevant instructions in the following section: Configuring observer job security

To start the Load job

  1. To start the Ansible AWX Observer Full Topology Upload job, use the following command:
    $ASM_HOME/bin/ansibleawx_observer_load_start.sh

Results

The load job loads all requested topology data, and runs only once. Run this job whenever you need Ansible AWX topology data refreshed.

What to do next

You can also use the following scripts:
ansibleawx_observer_load_stop.sh
Stops the Load job
ansibleawx_observer_job_list.sh
Lists the status of current jobs
ansibleawx_observer_log_level.sh
Sets the log level
Remember: As an alternative to being configured using the Observer Configuration UI, observer jobs have scripts to start and stop all available jobs, to list the status of a current job, and to set its logging levels. These scripts can be run with -h or --help to display help information, and with -v or --verbose to print out the details of the actions performed by the script, including the full cURL command. For the on-prem version of Agile Service Manager, observer scripts are configured for specific jobs by editing the script configuration files.