Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1375706 - Puppet hosts in satellite web UI are incorrectly registered as FQDN
Summary: Puppet hosts in satellite web UI are incorrectly registered as FQDN
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts - Content
Version: 6.2.0
Hardware: All
OS: Linux
medium
high
Target Milestone: 6.4.0
Assignee: Partha Aji
QA Contact: Jan Hutař
URL:
Whiteboard:
Depends On:
Blocks: 1411935 1418822
TreeView+ depends on / blocked
 
Reported: 2016-09-13 19:32 UTC by Stephen Beal
Modified: 2021-09-09 11:56 UTC (History)
18 users (show)

Fixed In Version: rubygem-katello-3.0.0.100-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1418822 (view as bug list)
Environment:
Last Closed: 2018-10-16 18:52:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Duplicite records when registering with subscription-manager and puppet agent (35.86 KB, image/png)
2018-07-18 08:30 UTC, Ivan Necas
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 17521 0 Normal Closed need support for 'use_shortname_for_vms' for all hosts not just vms 2020-06-15 14:12:03 UTC

Description Stephen Beal 2016-09-13 19:32:55 UTC
Description of problem:

When registering a Content host with Katello, we are able to successfully register a host using the short hostname. WHen trying to register the same host with puppet, using this command:

puppet agent -t --server xxxxxxxx.xxx.xxxx.xxx --certname `hostname -s`

Puppet correctly identifies this host as a short hostname when generating the SSL certificate, however the web UI, creates a new host, one for the content host (short) and one for the puppet (FQDN). Below is the output of our registration command:

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

Satellite 6.2


Actual results:

web UI shows host for content host with shortname, and one for puppet with fqdn.


Expected results:

Consistently shows hostname used for registration (in this case, short)


Additional info:

  Based on our investigation, the Ruby template file  is displaying the column name from the PostgreSQL database named foreman/hosts. 
  
    =============
    /usr/share/foreman/app/views/hosts/_list.html.erb
 
            <% hosts.each do |host| %>
      <tr>
        <td class="ca">
          <%= check_box_tag "host_ids[]", nil, false, :id => "host_ids_#{host.id}", :class => 'host_select_boxes', :onclick => 'hostChecked(this)' %>
        </td>
        <td class="ellipsis"><%= name_column(host) %>    <---- here
        </td>
        <td class="hidden-xs ellipsis"><%= (icon(host.operatingsystem, :size => "16x16") + " #{host.operatingsystem.to_label}").html_safe if host.operatingsystem %></td>
        <td class="hidden-xs ellipsis"><%= host.environment %></td>
        <td class="hidden-tablet hidden-xs ellipsis"><%= model_name host %></td>
        <td class="hidden-tablet hidden-xs"><%= label_with_link host.hostgroup, 23, @hostgroup_authorizer %></td>
        <td class="hidden-tablet hidden-xs ellipsis"><%= last_report_column(host) %></td>
    =============

  Satellite is creating the certname correct as we can see on the SQL output you provided this afternoon, however it is not the column being displayed by the webUI which may be creating the confusing. During our tests, if we rename the value on the field "name" to match with the certname the short name is displayed, however, this was just a troubleshooting step and should not be used for now. 
  
    ==============
      
      foreman=# select id, name, certname from hosts;
         id |           name           |       certname        
        ----+--------------------------+-----------------------
          9 | xxxx13.xxx.xxxx.xxx    | 
         32 | xxxx6505.xxx.xxxx.xxx | 
         53 | xxx01.xxxx.xxxx.xxx    | 
         39 | xxlab10                  | 
         16 | xxxlab65                | 
         38 | xxxlab6507              | 
         33 | xxxlab6505              | 
         42 | xxxlab6508              | 
          5 | xxxxxx12                 | 
         37 | xxxxlab67                | 
         18 | xxxxlab6502              | 
         52 | xxxx01                  | xxxx01
         19 | xxxxlab6503              | 
         12 | xxxxx12.xxx.xxxx.xxx    | xxxxxx.xxx.xxxx.xxx
         60 | xxxxlabsat5.xxx.xxxx.xxx | xxxxlabsat5
         58 | xxxxlab01                | 
         59 | xxxxlab01.xxx.xxxx.xxx   | xxxxlab01
        (17 rows)

      foreman# update hosts set name = 'xxxxab01' where id = 59;
      foreman# commit;
      
        --- the troubleshooting step above changed the display to shortname
    ==============

    Since for a provisioning on Satellite is requires a domain it seems that is the reason of why the FQDN is being used instead the short name. Satellite (using the Foreman capabilities) requires a domain and subnet so then it assumes the FQDN. 
    
    Since you want to use short names, as defined by the Puppet certificate (CN=shortname), we will follow-up with engineering if is the situation to an RFE to use short names instead. 
    
    As you already mentioned in the case, if you override the FQDN Puppet fact via /etc/facter/facts.d you can workaround it. 

After some additional review of this, overriding the facter fact "fqdn" will _not_ be a viable workaround.  If we do this, we will lose access to that "fact" (fqdn) should we need to use it in future puppet modules.

Comment 8 Ohad Levy 2016-09-15 12:45:18 UTC

*** This bug has been marked as a duplicate of bug 1356714 ***

Comment 11 Bryan Kearney 2016-12-14 20:51:10 UTC
Connecting redmine issue http://projects.theforeman.org/issues/17102 from this bug

Comment 12 Bryan Kearney 2016-12-14 21:00:33 UTC
Upstream bug component is Infrastructure

Comment 13 Bryan Kearney 2016-12-14 21:00:36 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17102 has been resolved.

Comment 16 jcallaha 2017-03-02 15:16:15 UTC
Failed QA in Satellite 6.2.8 Snap 4. Based on conversations with justin and rich, we have determined that the required patches developed to address this issue are not aligned to this bug.

Comment 21 Satellite Program 2017-03-02 19:00:34 UTC
Upstream bug assigned to paji

Comment 22 Satellite Program 2017-03-02 19:00:42 UTC
Upstream bug assigned to paji

Comment 24 Satellite Program 2018-01-18 17:00:41 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17521 has been resolved.

Comment 25 Ivan Necas 2018-07-18 08:29:43 UTC
Failed QE in sat 6.4 snap 12, steps:

1. setting 'Append domain names to the host' to No
2. subscription-manager register --username admin --password changeme --name $(hostname -s)
3. puppet agent -t --certname `hostname -s`
4. two hosts were created, one belonging to the organization, the other one not

Another observation I had was, that even when supplying other --name and certname (such as sat-6-4-qa-rhel7-1), the host was still registered just as short name (sat-6-4-qa-rhel7).

Comment 26 Ivan Necas 2018-07-18 08:30:33 UTC
Created attachment 1459672 [details]
Duplicite records when registering with subscription-manager and puppet agent

Comment 27 Ivan Necas 2018-07-18 08:35:58 UTC
With 'Append domain names to the host' set to yes (default), the host registers as full fqdn and matching the content host and puppet host works properly.

Comment 29 Satellite Program 2018-07-18 10:00:45 UTC
Upstream bug assigned to paji

Comment 40 Bryan Kearney 2018-10-16 18:52:45 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:2927


Note You need to log in before you can comment on or make changes to this bug.