Bug 1348266
Summary: | Provisioning with foreman_location and foreman_organization facts does not work anymore | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Peter Vreman <peter.vreman> |
Component: | Content Management | Assignee: | Ivan Necas <inecas> |
Status: | CLOSED ERRATA | QA Contact: | Jitendra Yejare <jyejare> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.2.0 | CC: | bbuckingham, cwelton, ehelms, inecas |
Target Milestone: | Unspecified | Keywords: | Triaged |
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | foreman-1.11.0.32-1 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-07-27 11:39:09 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1122832 |
Description
Peter Vreman
2016-06-20 15:41:38 UTC
The reason for this is happening is we started creating host records as part of subscription-manager registration (importing rhsm facts), and when puppet facts arrive right after that, there is a check for not to import facts twice in a short period (1 minute by default). Next time the puppet agent runs (in half hour) on the host, the location should be set properly. It should be enough to wait a minute for that. The core problem is the `last_compile` column, that stores the time of last facts import, regardless of the source. There are two things we can do codewise: 1. short-term: set host.update_column(:last_compile, nil) in Katello's subscription facet so that this import doesn't influence the puppet import 2. long-term: every facts type has it's own last_compile equivalent so that they don't influence each other It's also worth mentioning, that this means the puppet facts don't get imported at the first puppet call when subscription-manager call is part of provisioning. Created redmine issue http://projects.theforeman.org/issues/15524 from this bug The quickfix proposed to Katello https://github.com/Katello/katello/pull/6153 Upstream bug component is Content Management Notes on how to reproduce: The custom facts can be provided by putting a specific file to /etc/facter/facts.d/, like this: ``` cat <<SCRIPT > /etc/facter/facts.d/foreman_facts.sh #!/bin/bash cat <<EOF foreman_organization=My Organization foreman_location=BRQ EOF SCRIPT chmod a+x /etc/facter/facts.d/foreman_facts.sh ``` Facter should pick it up and you should than be able to see it when calling `facter -j` The facts can be a simple yaml file instead of the shell script. Below is our live example. The content is created during the kickstart %post, just before calling puppet for the first time. [crash] root@li-lc-1444:~# cat /etc/facter/facts.d/foreman.yaml # # Foreman registration facts created by hoi-config-subscription # # foreman_server: li-lc-1017.hag.hilti.com foreman_organization: Hilti foreman_location: HAG foreman_hostgroup: crash/IPS/Test-6.8-ci foreman_activationkey: hg-crash::IPS::Test-6.8-ci Verified! @Sat 6.2 Snap 19.1 GA Steps Followed : 1. Kept default location and organzation settings empty 2. Created Org A and Org B 3. Created location Loc A and Loc B 4. Provisioned a new host from satellite onto libvirt CR. 4. In new host, created facts foreman_location and foreman_organization, set both to Org B and Loc B resp. 4. Register a new host with satellite by running puppet agent on host and signed the cert on satellite. Observed: The new host has org and loc associated in custom facts file in host(i.e here Org B and Log B resp), which is as expected. So moving this bz to verified. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2016:1501 |