Ansible host health / get facts / Monitor Jobs / disk space

Problem:
We are using Anisble rather than Puppet. Our older Foreman uses Puppet where the Puppet agent running on hosts reports on the hosts’ health. For Ansible, I am using an Ansible playbook:

- name: Ansible Bueller Bueller Ping
  hosts: all
  become: yes
  become_user: root
  gather_facts: true
  tasks:
    - name: Show host's hostname
      debug:
        msg: "{{ ansible_ssh_host }}"

which is stored in a Job Template and run on a schedule of once an hour.

This seems to work in the same way as Puppet Agent. We have two problems, one of which is certainly related, the jobs are scheduled to run every hour. All of these turn up in the Job Invocations list obscuring other jobs and their results. The second problem is that the PostgeSQL database becomes very large over time. The cronjobs are almost identical on the Puppet Foreman compared to the Ansible Foreman with the exception of Puppet jobs.

Yesterday, I had to run, mildly panicking:

foreman-rake katello:delete_orphaned_content RAILS_ENV=production
foreman-rake foreman_tasks:cleanup:config
foreman-rake foreman_tasks:cleanup:run
foreman-rake audits:expire days=10
foreman-rake reports:expire days=7
foreman-rake foreman_tasks:cleanup TASK_SEARCH='label = Actions::Katello::Repository::Sync' STATES='stopped'
su - postgres -c 'vacuumdb --full --all'

The vacuumdb did the trick of recovering the disk space but don’t know what influence the previous commands had on this outcome.

I’m surprised that I need to run ‘vacuumdb --full --all’.

The Ansible playbook to gather facts is, I think, the biggest difference between the two systems.

Please, is there another way to do the same thing with populating the Job Invocations list and, possibly, not chewing through disk space?

Expected outcome:
To ascertain the health of Anisble configured hosts.

Foreman and Proxy versions:
foreman-3.10.0-1.el9.noarch
foreman-proxy-3.10.0-1.el9.noarch

Foreman and Proxy plugin versions:
rubygem-foreman_ansible-14.0.0-1.fm3_11.el9.noarch

Distribution and version:
Rocky Linux 9.4

Other relevant data: