Bug #3214
closedNo location / Organization if host added by default from puppet run
Added by Jon Shanks about 11 years ago. Updated over 6 years ago.
Description
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.
Updated by Dominic Cleal about 11 years ago
- Related to Bug #1830: Puppet run triggers "no puppet proxy defined - cant continue" after 1.0 upgrade added
Updated by Dominic Cleal about 11 years ago
- Category set to Organizations and Locations
Linking to #1830, as that also suggests picking up some data about hosts based on the smart proxy that uploaded reports/facts.
Updated by Dominic Cleal about 11 years ago
Workaround: go to the host list page, use the tickboxes to select the host(s) and then use Assign Location or Organisation from the "Select Actions" dropdown menu to change it.
Updated by Jim Greenleaf about 11 years ago
As discussed in IRC, we are interested in the ability to auto-set the location of our nodes based on an arbitrary fact, known to facter.
Updated by Anonymous about 11 years ago
- Target version changed from 1.10.0 to 1.9.3
Updated by Lukas Zapletal almost 11 years ago
- Status changed from New to Assigned
- Assignee 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.
Updated by Anonymous almost 11 years ago
- Target version changed from 1.9.3 to 1.9.2
Updated by Lukas Zapletal almost 11 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.
Updated by Dominic Cleal almost 11 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.
Updated by Dominic Cleal almost 11 years ago
- Status changed from Assigned to New
- Assignee deleted (
Lukas Zapletal)
Updated by Daniel Lobato Garcia almost 11 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.
Updated by Marek Hulán almost 11 years ago
+1 for what Daniel described if that's feasible
Updated by Dominic Cleal almost 11 years ago
+1, though I'd drop the regexp bit (as discussed on IRC) and use a 1:1 mapping of fact value to the name (or rather, label for when we have inheritance) of the taxonomy.
Updated by Daniel Lobato Garcia almost 11 years ago
- Status changed from New to Assigned
- Assignee set to Daniel Lobato Garcia
Sure thing, I'm using two facts
foreman_location
foreman_organization
and they represent the full label of each taxonomy as they can be nested now.
Updated by Dominic Cleal almost 11 years ago
It's probably best that the names of the facts are added as settings too, just in case people need/want to change them.
Updated by Daniel Lobato Garcia almost 11 years ago
Updated by Daniel Lobato Garcia almost 11 years ago
- Status changed from Assigned to Ready For Testing
Updated by Anonymous almost 11 years ago
- Target version changed from 1.9.2 to 1.9.1
Updated by Anonymous almost 11 years ago
- Target version changed from 1.9.1 to 1.9.0
Updated by Dominic Cleal over 10 years ago
- Has duplicate Bug #4668: (nightlies 3-14-14) a system not provisioned via foreman but registered appears as "any org" host and cannot be moved added
Updated by Dominic Cleal over 10 years ago
- Translation missing: en.field_release set to 4
Updated by Daniel Lobato Garcia over 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset e88536b278c403ae2e0e34f0e0e2de457bf95383.
Updated by Dominic Cleal over 10 years ago
- Related to Refactor #4992: Default Puppet run organization/location should be defined on model not setting added
Updated by Dominic Cleal over 10 years ago
- Related to Bug #5690: Taxonomy fact name not retrieved from settings added
Updated by Stephen Benjamin almost 10 years ago
- Related to Bug #9654: If taxonomies are seeded, they should be the default orgs added