Bug 1139268

Summary: Incorrect foreman organization/location when the host was created by puppet agent
Product: Red Hat Satellite Reporter: Pavel Studeník <pstudeni>
Component: PuppetAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Sanket Jagtap <sjagtap>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0.4CC: ahumbe, bkearney, ehelms, jsherril, mtaru, sjagtap
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:17 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: 1141828    
Bug Blocks:    

Description Pavel Studeník 2014-09-08 13:56:34 UTC
Description of problem:
I created new host by puppet agent. I look at detail of the host and organization and location is without value and I can't change it.

Value foreman_organization, foreman_location doesn't exist in system. The first organization is chosen (sorted by alphabet) on edit host page.


Version-Release number of selected component (if applicable):
Satellite 6.0.4

How reproducible:
always

Steps to Reproduce:
1. create new host by puppet agent
2. set default forman_organization and foreman_location then doesn't exist
3. look at detail of new host

Actual results:
this system is possible create 

Expected results:
I can't create new host without correct location and organizatin

Workaround:
set correct default value for remote system

rlRun "mkdir -p /etc/facter/facts.d"
echo "foreman_organization=<ORG>" > /etc/facter/facts.d/sat6.txt
echo "foreman_location=<LOC>" >> /etc/facter/facts.d/sat6.txt

Comment 1 RHEL Program Management 2014-09-08 14:03:16 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Justin Sherrill 2014-09-26 18:23:54 UTC
This may be a dupe of https://bugzilla.redhat.com/show_bug.cgi?id=1124435 

The summary sort of describes a few different issues.

Comment 4 Dominic Cleal 2014-09-29 07:18:35 UTC
(In reply to Justin Sherrill from comment #3)
> This may be a dupe of https://bugzilla.redhat.com/show_bug.cgi?id=1124435 

That just covers the edit page, which doesn't show empty values well.  This BZ covers the root cause, and the dependent BZ covers a refactor that should fix it.

Comment 6 Bryan Kearney 2015-05-11 21:29:10 UTC
Dependent bug is 6.2, moving this one as well.

Comment 10 Chris Duryee 2016-09-22 12:16:31 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=1124435 has likely fixed this. Marking as ON_QA for verification.

Comment 14 Sanket Jagtap 2018-01-24 10:04:04 UTC
Build: Satellite 6.3.0 snap 33

1. Created a host through puppet. Ran puppet-agent -t on host
2. Host appears in All host page, without org and loc
3. On trying to edit host, The Org and location fields are disabled for edit

1. Created a host through puppet. Ran puppet-agent -t on host
2. Added custom facts for Org and location with correct values orgA , locA
3. Host appears in All host page, with orgA and locA
4. Visited the content hosts page, filtered orgA and locA, the host was shown
5. Visited the content hosts page, filtered orgA and locB, the host was not shown.

The content hosts was correctly filered depending on it's org/loc on content host page.

Comment 17 Satellite Program 2018-02-21 16:54:17 UTC
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/RHSA-2018:0336