The way we are setting up the foreman environment is to have ansible callbacks from the different systems send facts into the foreman server, which in turn, creates a new host. The problem with that is, if the ansible playbook has an inventory hosts set to localhost, then foreman will create the new host with that name in the system. Is there a way to set the callback to use the systems hostname rather than the the inventory hosts name?
- hosts: localhost tasks: - name: Update system yum: name: "*" state: latest become: yes ~
Callback settings in ansible.cfg
[callback_foreman] url = 'fqdn' ssl_cert = /projects/pub.pem ssl_key = /projects/key.pem verify_certs = /projects/ca.pem
Foreman and Proxy versions:
Foreman 3.7 RHEL 8