Multiple hosts with ansible facts

Hello all

Problem:

When i try to register one host via the ansible fact to foreman, i got multiple recording for only one host

Expected outcome:

Is it possible to have only one recording for each host ?

Thank you !

Can you specify what versions are you on?
And what steps did you do to register this host to foreman?

Thanks for you attention, i am running via ansible this playbook to register my hosts to foreman :

ansible-playbook foreman.yml -b -K

  • hosts: qualifpart2
    become: true
    gather_facts: yes

    tasks:

    • name: Distribution
      debug: msg=“{{ ansible_distribution }}”

ansible --version
ansible 2.9.23

System Information

Version 3.9.1

About the module of foreman →

foreman-tasks The goal of this plugin is to unify the way of showing task statuses across the Foreman instance. It defines Task model for keeping the information about the tasks and Lock for assigning the tasks to resources. The locking allows dealing with preventing multiple colliding tasks to be run on the same resource. It also optionally provides Dynflow infrastructure for using it for managing the tasks. Ivan Nečas 9.0.4
foreman_ansible Ansible integration with Foreman Daniel Lobato Garcia 13.0.3
foreman_puppet Allow assigning Puppet environments and classes to the Foreman Hosts. Ondřej Ezr and Shira Maximov 6.2.0
foreman_remote_execution A plugin bringing remote execution to the Foreman, completing the config management functionality with remote management functionality. Foreman Remote Execution team 12.0.5

I remember a similar problem in the past where the report created a host with only the hostname and foreman added the domain part, so every time the host got reported it was created as a new one as it did not match the previous ones.

But here it looks like it’s the same domain, correct @peutre?

yes that’s the same domain for each server