Chapter 4. Managing your Ansible automation controller subscription
Chapter 4. Managing your Ansible automation controller subscription Before you can use automation controller, you must have a valid subscription, which authorizes its use. 4.1. Subscription Types Red Hat Ansible Automation Platform is provided at various levels of support and number of machines as an annual subscription. Standard: Manage any size environment Enterprise 8x5 support and SLA Maintenance and upgrades included Review the SLA at Product Support Terms of Service Review the Red Hat Support Severity Level Definitions Premium: Manage any size environment, including mission-critical environments Premium 24x7 support and SLA Maintenance and upgrades included Review the SLA at Product Support Terms of Service Review the Red Hat Support Severity Level Definitions All subscription levels include regular updates and releases of automation controller, Ansible, and any other components of the Platform. For more information, contact Ansible through the Red Hat Customer Portal or at http://www.ansible.com/contact-us/ . 4.2. Obtaining an authorized Ansible automation controller subscription If you already have a subscription to a Red Hat product, you can acquire an automation controller subscription through that subscription. If you do not have a subscription to Red Hat Ansible Automation Platform and Red Hat Satellite, you can request a trial subscription. Procedure If you have a Red Hat Ansible Automation Platform subscription, use your Red Hat customer credentials when you launch the automation controller to access your subscription information. See Importing a subscription . If you have a non-Ansible Red Hat or Satellite subscription, access automation controller with one of these methods: Enter your username and password on the license page. Obtain a subscriptions manifest from the Subscription Allocations page on the Red Hat Customer Portal. For more information, see Obtaining a subscriptions manifest . If you do not have a Red Hat Ansible Automation Platform subscription, go to Try Red Hat Ansible Automation Platform and request a trial subscription. Additional resources To understand what is supported with your subscription, see Automation controller licensing, updates and support . If you have issues with your subscription, contact your Sales Account Manager or Red Hat Customer Service at: https://access.redhat.com/support/contact/customerService/ . 4.3. Obtaining a subscriptions manifest To upload a subscriptions manifest, first set up your subscription allocations: Procedure Navigate to https://access.redhat.com/management/subscription_allocations . The Subscriptions Allocations page contains no subscriptions until you create one. Click Create New subscription allocation . Note If Create New subscription allocation does not display, or is disabled, you do not have the proper permissions to create subscription allocations. To create a subscription allocation, you must either be an Administrator on the Customer Portal, or have the Manage Your Subscriptions role. Contact an access.redhat.com administrator, or organization administrator who can grant you permission to manage subscriptions. Enter a Name for your subscription and select 6.15 from the Type drop-down menu. Click Create . When your subscriptions manifest is successfully created, the number indicated to Entitlements indicates the number of entitlements associated with your subscription. 4.3.1. Setting up a subscriptions manifest To obtain a subscriptions manifest, you must add an entitlement to your subscriptions through the Subscriptions tab. Procedure Click the Subscriptions tab. If there are no subscriptions to display, click Add Subscriptions . The following screen enables you to select and add entitlements to put in the manifest file. You can select multiple Ansible Automation Platform subscriptions in your subscription allocation. Valid Ansible Automation Platform subscriptions commonly go by the name "Red Hat Ansible Automation..." . Specify the number of entitlements or managed nodes to put in the manifest file. This enables you to split up a subscription, for example: 400 nodes on a development cluster and 600 nodes for the production cluster, out of a 1000 node subscription. Note You can apply multiple subscriptions to a single installation by adding multiple subscriptions of the same type to a manifest file and uploading them. Similarly, a subset of a subscription can be applied by only allocating a portion of the subscription when creating the manifest. Click Submit . The allocations you specified, when successfully added, are displayed in the Subscriptions tab. Click the Details tab to access the subscription manifest file. Click Export Manifest to export the manifest file for this subscription. A folder pre-pended with manifest_ is downloaded to your local drive. Multiple subscriptions with the same SKU are aggregated. When you have a subscription manifest, go to the Subscription screen. Click Browse to upload the entire manifest file. Navigate to the location where the file is saved. Do not open it or upload individual parts of it. 4.4. Importing a subscription After you have obtained an authorized Ansible Automation Platform subscription, you must import it into the automation controller system before you can use automation controller. Note You are opted in for Automation Analytics by default when you activate the automation controller on first time log in. This helps Red Hat improve the product by delivering you a much better user experience. You can opt out, by doing the following: From the navigation panel, select Settings and select the Miscellaneous System settings option. Click Edit . Toggle the Gather data for Automation Analytics switch to the off position. Click Save . For opt-in of Automation Analytics to be effective, your instance of automation controller must be running on Red Hat Enterprise Linux. For more information, see the Automation Analytics section. Prerequisites You have obtained a subscriptions manifest. For more information, see Obtaining a subscriptions manifest . Procedure Launch automation controller for the first time. The Subscription Management screen displays. Retrieve and import your subscription by completing either of the following steps: If you have obtained a subscription manifest, upload it by navigating to the location where the file is saved. The subscription manifest is the complete .zip file, and not only its component parts. Note If the Browse option in the Subscription manifest option is disabled, clear the username and password fields to enable it. The subscription metadata is then retrieved from the RHSM/Satellite API, or from the manifest provided. If many subscription counts were applied in a single installation, automation controller combines the counts but uses the earliest expiration date as the expiry (at which point you must refresh your subscription). If you are using your Red Hat customer credentials, enter your username and password on the license page. Use your Satellite username or password if your automation controller cluster nodes are registered to Satellite with Subscription Manager. After you enter your credentials, click Get Subscriptions . Automation controller retrieves your configured subscription service. Then, it prompts you to select the subscription that you want to run and applies that metadata to automation controller. You can log in over time and retrieve new subscriptions if you have renewed. Click . Review and check the I agree to the End User License Agreement checkbox and click Submit . After your subscription is accepted, automation controller displays the subscription details and opens the Dashboard. To return to the Subscription settings screen from the Dashboard, select Settings Subscription settings from the Subscription option in the navigation panel. Optional: To return to the Subscription settings screen from the Dashboard, select Settings Subscription settings option in the navigation panel. Troubleshooting your subscription When your subscription expires (you can check this in the Subscription details of the Subscription settings window), you must renew it in automation controller. You can do this by either importing a new subscription, or setting up a new subscription. If you meet the "Error fetching licenses" message, check that you have the proper permissions required for the Satellite user. The automation controller administrator requires this to apply a subscription. The Satellite username and password is used to query the Satellite API for existing subscriptions. From the Satellite API, the automation controller receives metadata about those subscriptions, then filters through to find valid subscriptions that you can apply. These are then displayed as valid subscription options in the UI. The following Satellite roles grant proper access: Custom with view_subscriptions and view_organizations filter Viewer Administrator Organization Administrator Manager Use the Custom role for your automation controller integration, as it is the most restrictive. For more information, see the Satellite documentation on managing users and roles. Note The System Administrator role is not equal to the Administrator user checkbox, and does not offer enough permissions to access the subscriptions API page. 4.5. Add a subscription manually If you are unable to apply or update the subscription information by using the automation controller user interface, you can upload the subscriptions manifest manually in an Ansible Playbook. Use the license module in the ansible.controller collection: - name: Set the license using a file license: manifest: "/tmp/my_manifest.zip" For more information, see the Automation controller license module . 4.6. Attaching Subscriptions You must have valid Ansible Automation Platform subscriptions attached before installing Ansible Automation Platform. Note Attaching subscriptions is unnecessary if your Red Hat account has enabled Simple Content Access Mode . However, you must register to Red Hat Subscription Management (RHSM) or Red Hat Satellite before installing Ansible Automation Platform. Procedure To find the pool_id of your subscription, enter the following command: # subscription-manager list --available --all | grep "Ansible Automation Platform" -B 3 -A 6 The command returns the following: Subscription Name: Red Hat Ansible Automation Platform, Premium (5000 Managed Nodes) Provides: Red Hat Ansible Engine Red Hat Single Sign-On Red Hat Ansible Automation Platform SKU: MCT3695 Contract: ******** Pool ID: ******************** Provides Management: No Available: 4999 Suggested: 1 To attach this subscription, enter the following command: # subscription-manager attach --pool=<pool_id> If all nodes have attached, then the repositories are found. To check whether the subscription attached successfully, enter the following command: # subscription-manager list --consumed To remove this subscription, enter the following command: #subscription-manager remove --pool=<pool_id> 4.7. Troubleshooting: Keep your subscription in compliance Your subscription has two possible statuses: Compliant : Indicates that your subscription is appropriate for the number of hosts that you have automated within your subscription count. Out of compliance : Indicates that you have exceeded the number of hosts in your subscription. Compliance is computed as follows: managed > manifest_limit => non-compliant managed =< manifest_limit => compliant Where: managed is the number of unique managed hosts without deletions, and manifest_limit is the number of managed hosts in the subscription manifest. Other important information displayed are: Hosts automated : Host count automated by the job, which consumes the license count. Hosts imported : Host count considering unique host names across all inventory sources. This number does not impact hosts remaining. Hosts remaining : Total host count minus hosts automated. Hosts deleted : Hosts that were deleted, freeing the license capacity. Active hosts previously deleted : Number of hosts now active that were previously deleted. For example, if you have a subscription capacity of 10 hosts: Starting with 9 hosts, 2 hosts were added and 3 hosts were deleted, you now have 8 hosts (compliant). 3 hosts were automated again, now you have 11 hosts, which puts you over the subscription limit of 10 (non-compliant). If you delete hosts, refresh the subscription details to see the change in count and status. 4.8. Viewing the host activity Procedure In the navigation panel, select Host Metrics to view the activity associated with hosts, such as those that have been automated and deleted. Each unique hostname is listed and sorted by the user's preference. Note A scheduled task automatically updates these values on a weekly basis and deletes jobs with hosts that were last automated more than a year ago. Delete unnecessary hosts directly from the Host Metrics view by selecting the desired hosts and clicking Delete . These are soft-deleted, meaning their records are not removed, but are not being used and thereby not counted towards your subscription. 4.9. Host metric utilities Automation controller provides a way to generate a CSV output of the host metric data and host metric summary through the Command Line Interface (CLI). You can also soft delete hosts in bulk through the API. 4.9.1. awx-manage utility The awx-manage utility supports the following options: awx-manage host_metric --csv This command produces host metric data, a host metrics summary file, and a cluster info file. To package all the files into a single tarball for distribution and sharing use: awx-manage host_metric --tarball To specify the number of rows ( <n> ) to output to each file: awx-manage host_metric --tarball --rows_per_file <n> The following is an example of a configuration file: Automation Analytics receives and uses the JSON file. 4.9.2. API endpoint functions The API lists only non-deleted records and are sortable by last_automation and used_in_inventories columns. You can use the host metric API endpoint, api/v2/host_metric to soft delete hosts: api/v2/host_metric <n> DELETE A monthly scheduled task automatically deletes jobs that uses hosts from the Host Metric table that were last automated more than a year ago.
- name: Set the license using a file license: manifest: "/tmp/my_manifest.zip" subscription-manager list --available --all | grep "Ansible Automation Platform" -B 3 -A 6 Subscription Name: Red Hat Ansible Automation Platform, Premium (5000 Managed Nodes) Provides: Red Hat Ansible Engine Red Hat Single Sign-On Red Hat Ansible Automation Platform SKU: MCT3695 Contract: ******** Pool ID: ******************** Provides Management: No Available: 4999 Suggested: 1 subscription-manager attach --pool=<pool_id> subscription-manager list --consumed #subscription-manager remove --pool=<pool_id> managed > manifest_limit => non-compliant managed =< manifest_limit => compliant awx-manage host_metric --csv awx-manage host_metric --tarball awx-manage host_metric --tarball --rows_per_file <n> api/v2/host_metric <n> DELETE