Bug #15546
closed
Facts not being imported when in build mode
Added by Ivan Necas almost 9 years ago.
Updated almost 8 years ago.
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.
- Subject changed from 422 Unprocessable Entity in production.log to Facts not being imported when in build mode
- Description updated (diff)
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 :)
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.
- Category changed from Inventory to Importers
So this behavior should be perhaps configurable per importer type?
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.
- 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.
Also available in: Atom
PDF