United States | How to Add Ansible Roles to Satellite 6.4 and 6.5

Sebastian Baszcyj - 24.04.202020200424

How to Add Ansible Roles to Satellite 6.4 and 6.5

United States | How to Add Ansible Roles to Satellite 6.4 and 6.5

Satellite 6 has been initially released with the Open Source version of the Puppet to provide the config management in the managed Red Hat fleet. In the meantime, Red Hat acquired Ansible. Users of the Satellite had to wait until Satellite 6.4 to finally see full integration with the Ansible. But what can Satellite do with the Ansible? A short answer is: pretty much everything that is possible with the Puppet and more.

This blog presents how the Ansible Roles can be added to the Satellite 6.4 and how they can be used for the config management and more (and by more, I mean Insights).

With the release of the Satellite 6.4, Ansible is finally installed on the Satellite server itself. Wait … actually, there is a new repository:

rhel-7-server-ansible-2.6-rpms

But let’s get to it.

The recommendation is to install a few system roles, which Red Hat conveniently packaged for us.

You can do it executing the following command on the Satellite server:

yum install rhel-system-roles

Once you installed the system roles, you can find some Red Hat prepared Ansible roles under:

/usr/share/ansible/roles

Remember this location as this is the directory where your own roles will be copied to.

To add them to Satellite, navigate to the Satellite and log in as … preferably admin or other user with enough system privileges.

1. Navigate to Configure –> Ansible –> Roles

United States | How to Add Ansible Roles to Satellite 6.4 and 6.5

2. In the right upper corner, select ‘From satellite or capsule name’:

United States | How to Add Ansible Roles to Satellite 6.4 and 6.5

3. You will see the list of the Ansible roles available under /usr/share/ansible/roles. Select the roles you are interested in and click ‘Update’

4. The following list (except roles starting with ^seb.*) are the roles provided by Red Hat:

United States | How to Add Ansible Roles to Satellite 6.4 and 6.5

5. I recommend using RedHatInsights.insights-client role as it installs and configures Insights on the servers if you are entitled to Insights (Smart Management Sub).

6. Once the roles are imported, you have several options. If you want to use them on one server only, navigate to Hosts –> All Hosts. Click ‘Edit’ next to the selected host:

United States | How to Add Ansible Roles to Satellite 6.4 and 6.5

7. Click on the Ansible Roles tab and select roles you would like to be executed against your host. Click Submit … The role(s) have been added to your host.

United States | How to Add Ansible Roles to Satellite 6.4 and 6.5

8. After clicking Submit button, you will be taken to Server Details. Click Run Ansible roles button to execute the start the Ansible roles against the given host:

United States | How to Add Ansible Roles to Satellite 6.4 and 6.5

9. You will be taken to another view, where you can monitor the Ansible role run. Alternatively, you can navigate to Monitor –> Tasks and select ‘Remote action: Run ansible roles on your_host’:

United States | How to Add Ansible Roles to Satellite 6.4 and 6.5

10. The Task view provides you with the output from all the Ansible Tasks. Note that the roles are executed in the order you added them to the list:

United States | How to Add Ansible Roles to Satellite 6.4 and 6.5

11. What about variables? Variables are set for host, hostgroups etc.

United States | How to Add Ansible Roles to Satellite 6.4 and 6.5

United States | How to Add Ansible Roles to Satellite 6.4 and 6.5

Additional notes:

1. Satellite is using the foreman-proxy ssh key to authenticate to the remote systems by default.

2. Satellite will run the Ansible roles periodically against the server(s), so it is mandatory to either remove the roles from the host after the successful run, or making sure your role is idempotent.

3. The role does not require inventory file.

4. The role requires hosts: all to be set and the role name. For example:


– hosts: all
roles:
– { role: seb-system-roles.rh-config }

5. Other Ansible variables etc are honoured.

6. Keep in mind that you should define default values for all your variables under defaults to ensure your Ansible role is executed correctly even if one of the variables is not defined in Parameters.

Given you now mastered the Ansible roles in Satellite – happy administration 🙂

Should you have any questions – please let me know.

THANK YOU FOR YOUR SUBMISSION!

United States | How to Add Ansible Roles to Satellite 6.4 and 6.5

The form was submitted successfully.

Join the Insentra Community with the Insentragram Newsletter

Hungry for more?

If you’re waiting for a sign, this is it.

We’re a certified amazing place to work, with an incredible team and fascinating projects – and we’re ready for you to join us! Go through our simple application process. Once you’re done, we will be in touch shortly!

Who is Insentra?

Imagine a business which exists to help IT Partners & Vendors grow and thrive.

Insentra is a 100% channel business. This means we provide a range of Advisory, Professional and Managed IT services exclusively for and through our Partners.

Our #PartnerObsessed business model achieves powerful results for our Partners and their Clients with our crew’s deep expertise and specialised knowledge.

We love what we do and are driven by a relentless determination to deliver exceptional service excellence.

United States | How to Add Ansible Roles to Satellite 6.4 and 6.5

Insentra ISO 27001:2013 Certification

SYDNEY, WEDNESDAY 20TH APRIL 2022 – We are proud to announce that Insentra has achieved the  ISO 27001 Certification.