Bug 2025926

Summary: [RFE] Identify host Build Token using hammer
Product: Red Hat Satellite Reporter: mithun kalyat <mkalyat>
Component: HostsAssignee: aabramov
Status: CLOSED ERRATA QA Contact: Peter Dragun <pdragun>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.8.0CC: apatel, inecas, kgaikwad, ofedoren, rabajaj
Target Milestone: 6.12.0Keywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-16 13:33:03 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:

Description mithun kalyat 2021-11-23 12:17:10 UTC
[RFE] Identify host Build Token using hammer

1. Proposed title of this feature request  

Unable to get the host build token using hammer when the host is in 'build mode'

2. What is the nature and description of the request?  

Currently the following command gives almost all details about the host when it is in 'build mode'. However the 'Token' which is valid for 360 minutes is not listed. Token is visible from Satellite webui All hosts ---> host.example.com ---> Properties

   # hammer host info --id NN --show-hidden-parameters true 

For example:
=================================================
[root@sat ~]# hammer host info --id 25 --show-hidden-parameters true
Id:                       25
Name:                     host.example.com
Organization:             RedHat
Location:                 GSS
Puppet Environment:       production
Cert name:                host.example.com
Managed:                  yes
Installed at:             
Last report:              
Status:                   
    Global Status: Warning
    Build Status:  Pending installation
Network:                  
    IPv4 address: 192.168.xx.xxx
    IPv6 address: 
    MAC:          00:50:xx:xx:xx:xx
    Subnet ipv4:  satellite-subnet
    Domain:       sat.example.com
Network interfaces:       
 1) Id:           27
    Identifier:   
    Type:         interface (primary, provision, execution)
    MAC address:  00:50:xx:xx:xx:xx
    IPv4 address: 192.168.xx.xxx
    IPv6 address: 
    FQDN:         host.example.com
Operating system:         
    Architecture:           x86_64
    Operating System:       RedHat-7.7
    Build:                  yes
    Partition Table:        Kickstart default
    PXE Loader:             PXELinux BIOS
    Custom partition table:
Parameters:               

All parameters:           
    host_registration_remote_execution => true
    host_registration_insights => true
    enable-puppet5 => true
    enable-epel => false
Additional info:          
    Owner:      Admin User
    Owner Id:   4
    Owner Type: User
    Enabled:    yes
    Comment:
OpenSCAP Proxy:           
Content Information:      
    Content View:          
        ID:   1
        Name: Default Organization View
    Lifecycle Environment: 
        ID:   1
        Name: Library
    Content Source:        
        ID:   1
        Name: rhsat.example.com
    Kickstart Repository:  
        ID:   18
        Name: 18
    Applicable Packages:   0
    Upgradable Packages:   0
    Applicable Errata:     
        Enhancement: 0
        Bug Fix:     0
        Security:    0
Subscription Information: 
    UUID:            
    Last Checkin:    
    Release Version: 
    Autoheal:        
    Registered To:   
    Registered At:
Host Collections:
====================================
      
"Build Token' section needs to be added in the above parameters and should be able to list while running the hammer command.

Comment 2 Oleh Fedorenko 2021-12-09 14:19:08 UTC
Created redmine issue https://projects.theforeman.org/issues/34120 from this bug

Comment 3 Bryan Kearney 2021-12-18 20:06:12 UTC
Upstream bug assigned to aabramov

Comment 4 Bryan Kearney 2021-12-18 20:06:14 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34120 has been resolved.

Comment 6 Peter Dragun 2022-08-24 11:21:39 UTC
Verified on Sat 6.12 snap 7, the token can be listed using hammer, no need to use `--show-hidden-parameters true`

Comment 10 errata-xmlrpc 2022-11-16 13:33:03 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 (Important: Satellite 6.12 Release), 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-2022:8506