Chapter 2. Using Ansible Roles to Automate Repetitive Tasks on Satellite Hosts 2.1. Assigning Ansible Roles to an Existing Host You can use Ansible roles for remote management of Red Hat Enterprise Linux versions 8, 7, and 6.9 or later. Prerequisites Ensure that you have configured and imported Ansible roles. Procedure In the Satellite web UI, navigate to Hosts > All Hosts . Select the host and click Edit . On the Ansible Roles tab, select the role that you want to add from the Available Ansible Roles list. Click the + icon to add the role to the host. You can add more than one role. Click Submit . After you assign Ansible roles to hosts, you can use Ansible for remote execution. For more information, see Section 3.8, "Distributing SSH Keys for Remote Execution" . Overriding Parameter Variables On the Parameters tab, click Add Parameter to add any parameter variables that you want to pass to job templates at run time. This includes all Ansible playbook parameters and host parameters that you want to associate with the host. To use a parameter variable with an Ansible job template, you must add a Host Parameter . 2.2. Removing Ansible Roles from a Host Use the following procedure to remove Ansible roles from a host. Procedure In the Satellite web UI, navigate to Hosts > All Hosts . Select the host and click Edit . Select the Ansible Roles tab. In the Assigned Ansible Roles area, click the - icon to remove the role from the host. Repeat to remove more roles. Click Submit . 2.3. Changing the Order of Ansible Roles Use the following procedure to change the order of Ansible roles applied to a host. Procedure In the Satellite web UI, navigate to Hosts > All Hosts . Select a host. Select the Ansible Roles tab. In the Assigned Ansible Roles area, you can change the order of the roles by dragging and dropping the roles into the preferred position. Click Submit to save the order of the Ansible roles. 2.4. Running Ansible Roles on a Host You can run Ansible roles on a host through the Satellite web UI. Prerequisites You must configure your deployment to run Ansible roles. For more information, see Section 1.2, "Configuring your Deployment to Run Ansible Roles" . You must have assigned the Ansible roles to the host. Procedure In the Satellite web UI, navigate to Hosts > All Hosts . Select the checkbox of the host that contains the Ansible role you want to run. From the Select Action list, select Run all Ansible roles . You can view the status of your Ansible job on the Run Ansible roles page. To rerun a job, click the Rerun button. 2.5. Assigning an Ansible Role to a Host Group You can use Ansible roles for remote management of Red Hat Enterprise Linux versions 8, 7, and 6.9 or later. Prerequisite You must configure your deployment to run Ansible roles. For more information, see Section 1.2, "Configuring your Deployment to Run Ansible Roles" . Procedure In the Satellite web UI, navigate to Configure > Host Groups . Click the host group name to which you want to assign an Ansible role. On the Ansible Roles tab, select the role that you want to add from the Available Ansible Roles list. Click the + icon to add the role to the host group. You can add more than one role. Click Submit . 2.6. Running Ansible Roles on a Host Group You can run Ansible roles on a host group through the Satellite web UI. Prerequisites You must configure your deployment to run Ansible roles. For more information, see Section 1.2, "Configuring your Deployment to Run Ansible Roles" . You must have assigned the Ansible roles to the host group. You must have at least one host in your host group. Procedure In the Satellite web UI, navigate to Configure > Host Groups . From the list in the Actions column for the host group, select Run all Ansible roles . You can view the status of your Ansible job on the Run Ansible roles page. To rerun a job, click the Rerun button. 2.7. Running Ansible Roles in Check Mode You can run Ansible roles in check mode through the Satellite web UI. Prerequisites You must configure your deployment to run Ansible roles. For more information, see Section 1.2, "Configuring your Deployment to Run Ansible Roles" . You must have assigned the Ansible roles to the host group. You must have at least one host in your host group. Procedure In the Satellite web UI, navigate to Hosts > All Hosts . Click Edit for the host you want to enable check mode for. In the Parameters tab, ensure that the host has a parameter named ansible_roles_check_mode with type boolean set to true . Click Submit .

Commands: