No location / Organization if host added by default from puppet run
|Assigned To:||Daniel Lobato Garcia|
|Category:||Organizations and Locations|
|Target version:||Sprint 21|
|Found in release:||Pull request:|
|Velocity based estimate||-|
When a host does a puppet run, but the host isn't known by foreman, the reports / facts are pushed to the host at the end of the run and the host is added to foreman. I am guessing the location / organization is selected based on the puppet smart proxy that has pushed up the facts + reports, so it naturally associates the host with those are that associated with the smart proxy. However, when i edit host, they are greyed out and autoamtically selected, if i select the host, it shows a blank location + organization under the properties section.
I have had to delete the host and add it manually to get these feels populated.
#7 Updated by Lukas Zapletal about 4 years ago
- Status changed from New to Assigned
- Assigned To set to Lukas Zapletal
Investigating options how to solve that.
12:08 Dominic | lzap: one trouble with copying from the proxy is that a proxy can be assigned to multiple orgs/locs, but the host can only be in one 12:08 Dominic | I'm also wary of using facts as inputs, but I suppose it'll work. It all feels quite similar to knowing the default host group, would be | nice if we had a generic mechanism for assigning hosts.
#9 Updated by Lukas Zapletal about 4 years ago
First of all, from Foreman 1.4 (about to be released soon), it is only possible to change Location/Organization from Host list by selecting hosts and then via the Action button. This workflow is able to catch for mismatched records. So you shoudl be able to change it anytime.
I would consider this bug as SOLVED.
Possible resolutions to what Jim recommend:
A) Define org/loc as a global setting. That would mean that all registered hosts via puppet goes into single org/loc. Users could define permissions and filters that would allow permissions to some users that would set their destinations. EASY.
B) Select one of org/loc from the proxy. Since proxy can have multiple org/loc assigned, the "first" random one would be picked up. EASY.
C) Each proxy could define org/loc that would be used - just a variation of A. NORMAL.
X) (Optional) Use facts for setting default org/loc, possibilty to disable this via global settings tho.
Ohad, Dominic - what you think? I'd rather file new issue for the new solution and close this one.
#10 Updated by Dominic Cleal about 4 years ago
I prefer A or C. If you're doing A though, I think it might be better (clearer?) as an attribute of the taxonomies rather than settings. While I like getting the location/org from the proxy, the many to one issue bothers me - I would prefer something slightly more inflexible, but is more deterministic.
Please just use this issue number, it represents the problem well and already has votes etc.
#12 Updated by Daniel Lobato Garcia almost 4 years ago
I would go for A) and X), the user would choose a fact and a regex and depending on the regex it'd go to one taxonomy or another. I've personally wrote a few facts to identify the location of a host so this is something I'd definitely find useful.
Users would go to the properties of the taxonomy, and there they can click on a tab 'Hosts' where they can choose a fact name and a regex. Then every host that is auto placed into the taxonomies that match this regex. I'd add an informative message saying that if an incoming host has a fact that could place him in two organizations/locations, it'll choose the first ones alphabetically.