Problem:
When I provision or remove hosts within Foreman+Katello+Ansible, I don’t know how to perform additional one-off tasks on other hosts to finalize the provisioning/removal.
Expected outcome:
When I provision a host within Foreman+Katello+Ansible, I need to perform a few additional manual tasks on other hosts:
- Add the host to my LibreNMS monitoring system.
- Add the host to my NFSen collector.
- Add manual DHCPv6 reservations (until ISC DHCPv6 OMAPI supports IPv6 and Foreman supports that).
Likewise, if I am removing the host I need to perform similar removal steps like those above (replacing “add” with “remove”). Ideally, this could be done via one-off Ansible tasks within Foreman itself. For example, once a host is provisioned, an Ansible task is executed against the LibreNMS server to add the host to monitoring. I’m curious, however, what other people do in these particular scenarios or whether Foreman+Ansible supports this and I’m just not seeing in documentation how to accomplish it.
Foreman and Proxy versions:
foreman-release-3.1.2-1.el8.noarch
Foreman and Proxy plugin versions:
ansible-core-2.12.2-2.el8.x86_64
katello-common-4.3.0-1.el8.noarch
Distribution and version:
CentOS 8 Stream
Other relevant data: