Bug #3214

No location / Organization if host added by default from puppet run

Added by Jon Shanks almost 4 years ago. Updated over 2 years ago.

Status:Closed
Priority:Normal
Assigned To:Daniel Lobato Garcia
Category:Organizations and Locations
Target version:Sprint 21
Difficulty: Bugzilla link:
Found in release: Pull request:
Story points-
Velocity based estimate-
Release1.5.0Release relationshipAuto

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.


Related issues

Related to Foreman - Bug #1830: Puppet run triggers "no puppet proxy defined - cant conti... Closed 08/20/2012
Related to Foreman - Refactor #4992: Default Puppet run organization/location should be define... New 04/01/2014
Related to Foreman - Bug #5690: Taxonomy fact name not retrieved from settings Closed 05/13/2014
Related to Foreman - Bug #9654: If taxonomies are seeded, they should be the default orgs Closed 03/05/2015
Duplicated by Foreman - Bug #4668: (nightlies 3-14-14) a system not provisioned via foreman ... Duplicate 03/14/2014

Associated revisions

Revision e88536b2
Added by Daniel Lobato Garcia over 3 years ago

fixes #3214 - set taxonomy for hosts created via Puppet from facts or a default setting

History

#1 Updated by Dominic Cleal almost 4 years ago

  • Related to Bug #1830: Puppet run triggers "no puppet proxy defined - cant continue" after 1.0 upgrade added

#2 Updated by Dominic Cleal almost 4 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.

#3 Updated by Dominic Cleal almost 4 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.

#4 Updated by Jim Greenleaf almost 4 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.

#5 Updated by Dmitri Dolguikh almost 4 years ago

  • Target version set to Sprint 17

#6 Updated by Dmitri Dolguikh almost 4 years ago

  • Target version changed from Sprint 17 to Sprint 18

#7 Updated by Lukas Zapletal over 3 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.

#8 Updated by Dmitri Dolguikh over 3 years ago

  • Target version changed from Sprint 18 to Sprint 19

#9 Updated by Lukas Zapletal over 3 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 over 3 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.

#11 Updated by Dominic Cleal over 3 years ago

  • Status changed from Assigned to New
  • Assigned To deleted (Lukas Zapletal)

#12 Updated by Daniel Lobato Garcia over 3 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.

#13 Updated by Marek Hulán over 3 years ago

+1 for what Daniel described if that's feasible

#14 Updated by Dominic Cleal over 3 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.

#15 Updated by Daniel Lobato Garcia over 3 years ago

  • Status changed from New to Assigned
  • Assigned To 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.

#16 Updated by Dominic Cleal over 3 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.

#18 Updated by Daniel Lobato Garcia over 3 years ago

  • Status changed from Assigned to Ready For Testing

#19 Updated by Dmitri Dolguikh over 3 years ago

  • Target version changed from Sprint 19 to Sprint 20

#20 Updated by Dmitri Dolguikh over 3 years ago

  • Target version changed from Sprint 20 to Sprint 21

#21 Updated by Dominic Cleal over 3 years ago

  • Duplicated by Bug #4668: (nightlies 3-14-14) a system not provisioned via foreman but registered appears as "any org" host and cannot be moved added

#22 Updated by Dominic Cleal over 3 years ago

  • Release set to 1.5.0

#23 Updated by Daniel Lobato Garcia over 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#24 Updated by Dominic Cleal over 3 years ago

  • Related to Refactor #4992: Default Puppet run organization/location should be defined on model not setting added

#25 Updated by Dominic Cleal over 3 years ago

  • Related to Bug #5690: Taxonomy fact name not retrieved from settings added

#26 Updated by Anonymous over 2 years ago

Spam deleted by administrator.

#27 Updated by Stephen Benjamin over 2 years ago

  • Related to Bug #9654: If taxonomies are seeded, they should be the default orgs added

Also available in: Atom PDF