Hey everyone,
i’ve tried to use ansible to add hosts to foreman with the callback_foreman plugin.
It’s actually working pretty well but everytime a playbook is executed, all addressed hosts are added additionally instead of just updating the facts.
I’d really like to do all the playbook execution stuff on the main ansible node and use foreman just for some graphical listing.
So here is my question: Is there a configuration file to specify the option to just update the facts and not add the same hosts again and again or am i missing something?
Foreman version: 2.5.0
Linux Distribution: Ubuntu 20.04.2 LTS Server
/etc/ansible/ansible.cfg:
[defaults]
callback_whitelist = foreman
[callback_foreman]
url = ‘https://ansible-foreman’
ssl_cert = /etc/puppetlabs/puppet/ssl/certs/certificate.pem
ssl_key = /etc/puppetlabs/puppet/ssl/private_keys/private_key.pem
verify_certs = /etc/puppetlabs/puppet/ssl/certs/ca.pem
/etc/foreman-proxy/ansible.cfg
[defaults]
callback_whitelist = theforeman.foreman.foreman
local_tmp = /tmp
host_key_checking = False
stdout_callback = yaml
roles_path = /etc/ansible/roles:/usr/share/ansible/roles
[callback_foreman]
url = ‘https://ansible-foreman’
ssl_cert = /etc/puppetlabs/puppet/ssl/certs/certificate.pem
ssl_key = /etc/puppetlabs/puppet/ssl/private_keys/private_key.pem
verify_certs = /etc/puppetlabs/puppet/ssl/certs/ca.pem
[ssh_connection]
ssh_args = -o ProxyCommand=none -C -o ControlMaster=auto -o ControlPersist=60s
Thank you in advance!