Setting Up the Command-Line Interface

This section provides information about setting up the Oracle Linux Automation Manager Command Line Interface.

Task 1: Install the Command-Line Interface

You can install the Command-Line interface on the same system as the Oracle Linux Automation Manager server or a different Oracle Linux 8 system that can connect to the Oracle Linux Automation Manager server.

The following procedure describes how to setup your Oracle Linux 8 system to install the Oracle Linux Automation Manager Command-Line Interface:

  1. Setup the Oracle Linux Automation Manager server as described in Oracle Linux Automation Manager Installation Guide.

  2. If you are running the CLI on a different machine running Oracle Linux 8, enable the DNF repositories or the ULN channels as described in Oracle Linux Automation Manager Installation Guide.
  3. On the same machine running the Oracle Linux Automation Manager server or on a different machine, install the ol-automation-manager-cli package.
    sudo dnf install ol-automation-manager-cli
  4. Ensure the machine you are using can access the ports setup on Oracle Linux Automation Manager.

Task 2: Run a Command-Line Interface Command

Run a command-line interface command and specify one or more of the command-line options. For example,

  1. Obtain an authentication token for the user account you want to use the command-line interface. For more information about obtaining a token authentication, see Authenticating.
  2. From a terminal on your system, use the following syntax:
    awx --conf.host https://<hostname or IP address> --conf.token <access_token> <resource> <action> <optional_arguments> <input/output formatting>

    In the previous syntax,

    • <hostname or IP address> is the hostname or IP address of the Oracle Linux Automation Manager server,
    • <access_token> is an Oauth2 token,
    • <resource> is a resource on which to perform an action,
    • <action> is an action to be performed on a resource,
    • <optional_arguments> are any further options to be specified for the action,
    • <input/output formatting> is any extra formatting options to be applied to the response

    For more information about these parameters, see Using the Command-Line Interface.

    For example, the following command lists all users configured on an Oracle Linux Automation Manager server:

    awx --conf.host https://192.102.118.107 --conf.token h7a3NPiam8Or4px7Kkoe87cWcTeixz users list
    {
         "count": 3,
         "next": null,
         "previous": null,
         "results": [
              {
                   "id": 1,
                   "type": "user",
                   "url": "/api/v2/users/1/",
                   "related": {
                        "teams": "/api/v2/users/1/teams/",
                        "organizations": "/api/v2/users/1/organizations/",
                        "admin_of_organizations": "/api/v2/users/1/admin_of_organizations/",
                        "projects": "/api/v2/users/1/projects/",
                        "credentials": "/api/v2/users/1/credentials/",
                        "roles": "/api/v2/users/1/roles/",
                        "activity_stream": "/api/v2/users/1/activity_stream/",
                        "access_list": "/api/v2/users/1/access_list/",
                        "tokens": "/api/v2/users/1/tokens/",
                        "authorized_tokens": "/api/v2/users/1/authorized_tokens/",
                        "personal_tokens": "/api/v2/users/1/personal_tokens/"
                   },
                   "summary_fields": {
                        "user_capabilities": {
                             "edit": true,
                             "delete": false
                        }
                   },
                   "created": "2024-08-12T16:46:26.217924Z",
                   "modified": "2024-08-12T16:48:34.750654Z",
                   "username": "admin",
    
    ....