Project

General

Profile

Actions

Bug #32832

open

Host auto provisioning allows an existing host to be inserted again

Added by Jean Lubatti almost 3 years ago. Updated almost 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Host registration
Target version:
-
Difficulty:
easy
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Hello,

We are operating a foreman instance with a few thousand hosts and relying on puppet/foreman for automation.

We observe a rare and seemingly extremely random behavior where puppet masters end up (once every few months or so) pushing for a single host strange facts to foreman. That triggers a "re-subscribe" of the host with mostly the same characteristics.

We are aware of the "Create new hosts when facts are uploaded" option and we have set it to "no" following this investigation.

However, we believe that in any case, allowing an existing host to be "re-entered" in the database on top of an existing record creates a very dangerous and unpredictable behavior especially considering that foreman is a pivot for the automation stack (values fed for puppet for example will depend on which entry will be returned by queries on the hosts table out of the two present values).

As such, I would propose either:

1/ enforcing unicity on the column name (that contains the FQDN) in the host table in order to maintain consistency no matter what (dynamic recording or not) directly in the database as such:

CREATE UNIQUE INDEX host_name_unique_idx ON hosts(name);

2/ alternatively ensure that the automatic registration/creation of hosts is validating unicity even when automatically called on new facts or reports creation.

Best Regards,

-Jean


Related issues 1 (1 open0 closed)

Related to Foreman - Feature #32857: Create unique database constraint on host nameNewLukas ZapletalActions
Actions

Also available in: Atom PDF