Project

General

Profile

Actions

Bug #15546

closed

Facts not being imported when in build mode

Added by Ivan Necas almost 8 years ago. Updated almost 7 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
Importers
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

When provisioning with puppet enabled, the 422 Unprocessable Entity error gets produced every time
with the first puppet run.

Also, this prevents other types of facts (such as subscription-manager ones) to be refused as well.

I'm not sure about the reasons why it's there but it would be nice if we could address this
in a bit better way than it is right now.

Actions #1

Updated by Ivan Necas almost 8 years ago

  • Subject changed from 422 Unprocessable Entity in production.log to Facts not being imported when in build mode
  • Description updated (diff)
Actions #2

Updated by Daniel Lobato Garcia almost 8 years ago

https://github.com/theforeman/foreman/blob/develop/app/models/host/base.rb#L144 is what's preventing them to be imported.

I suppose the reason is that when that line was written (2013, and it seems that the method was written well before then) there was no reason why a host would get facts without being built.

If you're getting the 422 because of that line, try to remove it, write a small test & I'd be happy to review :)

Actions #3

Updated by Dominic Cleal almost 8 years ago

Configuration management facts determined from the build environment may be significantly different to facts from the post-build/runtime environment, so shouldn't be imported during build. The importers may change associations or attributes of the host, like OS or network interface details.

Actions #4

Updated by Dominic Cleal almost 8 years ago

  • Category changed from Inventory to Importers
Actions #5

Updated by Marek Hulán almost 8 years ago

So this behavior should be perhaps configurable per importer type?

Actions #6

Updated by Ivan Necas almost 8 years ago

what about importing the facts but not transferring it to associations in built phase? Btw. the ultimate solution would be if
the facts didn't influence the provisioning part. I've seen many times the OS fact import preaking the re-build functionality.

Actions #7

Updated by Marek Hulán almost 7 years ago

  • Status changed from New to Rejected

I'm closing this since I think Dominic explained the reason. Separation of facts and influence on OS is I believed tracked elsewhere. Feel free to reopen if I misunderstood.

Actions

Also available in: Atom PDF