Coder Social home page Coder Social logo

fcarrus / satellite-subscriptions-report Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 8 KB

Generate an HTML report on your Red Hat subscriptions usage in your Satellite system, on a per-host basis. Useful during renewals and for troubleshooting purposes.

satellite-subscriptions-report's Introduction

Satellite Subscriptions Report

Generate an HTML report on your Red Hat subscriptions usage in your Satellite system, on a per-host basis.

Useful during renewals and for troubleshooting purposes.

How it works

This Ansible playbook queries the Satellite's Hosts API with your filter of choice, and for each host, it queries its data.

The data is then used to compile the HTML report. For each playbook run with a different query, the results are added to the final report.

The playbook never makes logins to the Hosts.

How to use it

The best use for this playbook is to be run from the Satellite server itself. It does not make use of the Foreman Ansible modules. But it makes full use of Ansible's multithreaded task execution, so be sure to crank up your forks in your ansible.cfg.

Use the satellite-vars.yml.example file to create your own satellite-vars.yml file. You should set your Satellite's URL and credentials with read access to hosts and subscriptions (i.e. the Viewer role).

Run the playbook with your query of choice:

$ ansible-playbook main.yml \
    -e satellite_hosts_search_query="' os_title \!~ centos or hypervisor = true '

(based on your Bash version, you might or might not need that extra backslash before the exclamation mark)

You can run the playbook multiple times with different queries, and since the previous query results are cached, the results are added to the new report.

If you run it with the same query twice, those hosts' data is refreshed.

To clean up all the cache, simply remove all .json files from the cache directory.

The Report

The report is a left join between the Hosts list and its subscriptions. It means, for each Host, it is shown multiple times - once for each subscription attached - and once if no subscriptions are attached.

Each hyperlink brings you to a handy page where to apply modifications, i.e.:

  • A host's FQDN with no subscriptions: to the Add Subscriptions page
  • A host's FQDN with subscriptions: to the List/Remove Subscriptions page
  • A Subscription's name: to the Subscription Info page

TODO

  • A CSV report maybe

satellite-subscriptions-report's People

Contributors

fcarrus avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.