Este contenido no está disponible en el idioma seleccionado.

Chapter 2. Using Ansible roles to automate repetitive tasks on hosts


Ansible roles provide a way to standardize and automate configuration and maintenance tasks on hosts registered to Satellite. After importing and assigning roles to hosts or host groups, you can execute them through Satellite to apply consistent configurations and perform routine maintenance operations on your hosts.

2.1. Assigning Ansible roles to an existing host

You can use Ansible roles for remote management of Satellite clients.

Prerequisites

  • Ensure that you have configured and imported Ansible roles.

Procedure

  1. In the Satellite web UI, navigate to Hosts > All Hosts.
  2. Select the host and click Edit.
  3. On the Ansible Roles tab, select the role that you want to add from the Available Ansible Roles list.
  4. Click the + icon to add the role to the host. You can add more than one role.
  5. Click Submit.
  6. Optional: 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.

Next steps

2.2. Removing Ansible roles from a host

Use the following procedure to remove Ansible roles from a host.

Procedure

  1. In the Satellite web UI, navigate to Hosts > All Hosts.
  2. Select the host and click Edit.
  3. Select the Ansible Roles tab.
  4. In the Assigned Ansible Roles area, click the - icon to remove the role from the host. Repeat to remove more roles.
  5. 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

  1. In the Satellite web UI, navigate to Hosts > All Hosts.
  2. Select a host.
  3. Select the Ansible Roles tab.
  4. In the Assigned Ansible Roles area, you can change the order of the roles by dragging and dropping the roles into the preferred position.
  5. 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

Procedure

  1. In the Satellite web UI, navigate to Hosts > All Hosts.
  2. Select the checkbox of the host that contains the Ansible role you want to run.
  3. From the Select Action list, select Run all Ansible roles.
  4. You can view the status of your Ansible job on the Run Ansible roles page. To rerun a job, click Rerun.

2.5. Assigning Ansible roles to a host group

You can use Ansible roles for remote management of Satellite clients.

Prerequisites

Procedure

  1. In the Satellite web UI, navigate to Configure > Host Groups.
  2. Click the host group name to which you want to assign an Ansible role.
  3. On the Ansible Roles tab, select the role that you want to add from the Available Ansible Roles list.
  4. Click the + icon to add the role to the host group. You can add more than one role.
  5. 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

Procedure

  1. In the Satellite web UI, navigate to Configure > Host Groups.
  2. From the list in the Actions column for the host group, select Run all Ansible roles.
  3. You can view the status of your Ansible job on the Run Ansible roles page. Click Rerun to rerun a job.

2.7. Running Ansible roles in check mode

You can run Ansible roles in check mode through the Satellite web UI.

Prerequisites

Procedure

  1. In the Satellite web UI, navigate to Hosts > All Hosts.
  2. Click Edit for the host you want to enable check mode for.
  3. In the Parameters tab, ensure that the host has a parameter named ansible_roles_check_mode with type boolean set to true.
  4. Click Submit.
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2026 Red Hat
Volver arriba