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 1777820 - [RFE] Make hammer-cli available for RHEL 8 systems
Summary: [RFE] Make hammer-cli available for RHEL 8 systems
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Packaging
Version: 6.4
Hardware: Unspecified
OS: Linux
high
high with 2 votes
Target Milestone: 6.11.0
Assignee: satellite6-bugs
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-11-28 11:45 UTC by momran
Modified: 2024-06-13 22:19 UTC (History)
16 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-05 14:27:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SAT-9737 0 None None None 2023-01-20 16:05:35 UTC
Red Hat Product Errata RHSA-2022:5498 0 None None None 2022-07-05 14:28:06 UTC

Description momran 2019-11-28 11:45:35 UTC
Description of problem:
-----------------------
Customer wants to use hammer-cli on a RHEL 8 system to perform the following tasks:
1. Upload an RPM from a RHEL 8 system to their Satellite 6.x server.
2. Promote content view to lifecycle environment.
3. List packages.
4. List hosts.
(Please refer to the 'Steps to Reproduce' section for more details).

Currently, hammer-cli is only available for RHEL 7.


Version-Release number of selected component (if applicable):
-------------------------------------------------------------
tfm-rubygem-hammer_cli-0.13.1.1-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_remote_execution-0.1.0-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_bootdisk-0.1.3.3-3.el7sat.noarch
tfm-rubygem-hammer_cli_foreman-0.13.2.3-1.el7sat.noarch
tfm-rubygem-hammer_cli_csv-2.3.1-2.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_virt_who_configure-0.0.3-2.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_docker-0.0.6-3.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_discovery-1.0.0-2.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_openscap-0.1.6-1.el7sat.noarch
tfm-rubygem-hammer_cli_katello-0.13.4.3-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_admin-0.0.8-2.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_tasks-0.0.12-2.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_templates-0.1.0-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_ansible-0.1.1-1.el7sat.noarch


How reproducible:
-----------------
Always


Steps to Reproduce:
-------------------

1. Upload an RPM from a RHEL 8 system to Satellite 6.x server:
   ~~~
   hammer --server https://satellite.example.com repository upload-content --organization example_org --name 'SOE RHEL 8' --product 'SOE RHEL 8' --path ~/path/to.rpm 
   ~~~

2. Promote content view to lifecycle environment:
   ~~~
   hammer content-view version promote --content-view "Database" --version 1 --to-lifecycle-environment "Development" --organization "My_Organization"
   ~~~

3. List packages:
   ~~~
   hammer package list --product 'SOE RHEL 8' --search soe-initial-2.1.0-9.el7.noarch.rpm
   ~~~

4. List hosts:
   ~~~
   hammer --csv -s satellite.example.com host list
   ~~~


Actual results:
---------------
None, since hammer-cli is not available for RHEL 8.


Expected results:
-----------------
To be able to perform the above actions on a RHEL 8 system using hammer-cli.


Business Justification:
-----------------------

Customer will deliver RHEL 8 to their costumers.
Customer have development servers to develop their own software. They want to develop packages for RHEL 8 on a RHEL 8 development server. Developing packages for RHEL 8 on a RHEL 7 development server is not an option, because a lot of their software packages behave differently on RHEL 8.

Comment 2 Oleh Fedorenko 2019-11-29 16:43:30 UTC
Since this is not an actual bug in hammer, but packaging related issue, moving this to Packaging component.

Comment 5 Kenny Tordeurs 2021-04-07 08:32:09 UTC
// Proposal for workaround:

This can be done from a RHEL8 client with the following requirements:

1) Enable Ansible repo:
# subscription-manager repos --enable ansible-2.9-for-rhel-8-x86_64-rpms

2) Install Ansible:
# dnf install ansible 


3) Generate the token on https://cloud.redhat.com/ansible/automation-hub/token
Add following to ansible.cfg
~~~
[galaxy]
server_list = automation_hub
[galaxy_server.automation_hub]
url=https://cloud.redhat.com/api/automation-hub/
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
~~~

4a) Install the Satellite collections:
# ansible-galaxy collection install redhat.satellite

4b) Or download the collection manually, copy it to your system and configure the collection path in your ansible.cfg
https://cloud.redhat.com/ansible/automation-hub/repo/published/redhat/satellite/content

Here is a quick sample playbook for some of the steps that you are doing:
~~~
---
- hosts: satellite
  gather_facts: no
  collections:
    - redhat.satellite


  tasks:
    - include_vars: vars.yml


    - name: "Create product test_product"
      redhat.satellite.product:
        username: "{{ katello_admin_user }}"
        password: "{{ katello_admin_password }}"
        server_url: "{{ katello_url }}"
        name: "test_product"
        organization: "Default Organization"
        state: present

    - name: "Create repository testrepo in test_product"
      redhat.satellite.repository:
        username: "{{ katello_admin_user }}"
        password: "{{ katello_admin_password }}"
        server_url: "{{ katello_url }}"
        name: "testrepo"
        state: present
        content_type: "yum"
        product: "test_product"
        organization: "Default Organization"

    - name: Create a directory if it does not exist
      ansible.builtin.file:
        path: /tmp/builds
        state: directory
        mode: '0755'

    - name: Copy rpms to Satellite
      copy:
        src: /home/builds/
        dest: /tmp/builds/
        remote_src: no

    - name: "Upload my.rpm"
      redhat.satellite.content_upload:
        username: "{{ katello_admin_user }}"
        password: "{{ katello_admin_password }}"
        server_url: "{{ katello_url }}"
        src: "{{ item }}"
        repository: "testrepo"
        product: "test_product"
        organization: "Default Organization"
      loop:
        - /tmp/builds/acpica-tools-20180629-3.el8.x86_64.rpm
        - /tmp/builds/NetworkManager-adsl-1.26.0-14.el8_3.x86_64.rpm
        - /tmp/builds/NetworkManager-config-server-1.26.0-14.el8_3.noarch.rpm


    - name: Recursively remove directory
      ansible.builtin.file:
        path: /tmp/builds
        state: absent
~~~

# cat vars.yml 
~~~
katello_admin_user: admin
katello_admin_password: password
katello_url: https://ktordeur-sat65.sysmgmt.lan
satellite_fqdn: ktordeur-sat65.sysmgmt.lan
~~~

-> The password variable can be encrypted with vault -> https://docs.ansible.com/ansible/latest/user_guide/vault.html#creating-encrypted-variables

# ansible-playbook playbook.yml 
~~~
PLAY [satellite] ****************************************************************************************************************************************************************************************************************************

TASK [include_vars] *************************************************************************************************************************************************************************************************************************
Wednesday 07 April 2021  08:18:57 +0000 (0:00:00.041)       0:00:00.041 ******* 
ok: [ktordeur-sat65.sysmgmt.lan]

TASK [Create product test_product] **********************************************************************************************************************************************************************************************************
Wednesday 07 April 2021  08:18:57 +0000 (0:00:00.039)       0:00:00.081 ******* 
ok: [ktordeur-sat65.sysmgmt.lan]

TASK [Create repository testrepo in test_product] *******************************************************************************************************************************************************************************************
Wednesday 07 April 2021  08:19:00 +0000 (0:00:02.531)       0:00:02.613 ******* 
ok: [ktordeur-sat65.sysmgmt.lan]

TASK [Create a directory if it does not exist] **********************************************************************************************************************************************************************************************
Wednesday 07 April 2021  08:19:02 +0000 (0:00:01.871)       0:00:04.485 ******* 
changed: [ktordeur-sat65.sysmgmt.lan]

TASK [Copy rpms to Satellite] ***************************************************************************************************************************************************************************************************************
Wednesday 07 April 2021  08:19:03 +0000 (0:00:00.727)       0:00:05.213 ******* 
changed: [ktordeur-sat65.sysmgmt.lan]

TASK [Upload my.rpm] ************************************************************************************************************************************************************************************************************************
Wednesday 07 April 2021  08:19:05 +0000 (0:00:02.859)       0:00:08.072 ******* 
changed: [ktordeur-sat65.sysmgmt.lan] => (item=/tmp/builds/acpica-tools-20180629-3.el8.x86_64.rpm)
changed: [ktordeur-sat65.sysmgmt.lan] => (item=/tmp/builds/NetworkManager-adsl-1.26.0-14.el8_3.x86_64.rpm)
changed: [ktordeur-sat65.sysmgmt.lan] => (item=/tmp/builds/NetworkManager-config-server-1.26.0-14.el8_3.noarch.rpm)

TASK [Recursively remove directory] *********************************************************************************************************************************************************************************************************
Wednesday 07 April 2021  08:19:20 +0000 (0:00:14.638)       0:00:22.711 ******* 
changed: [ktordeur-sat65.sysmgmt.lan]

PLAY RECAP **********************************************************************************************************************************************************************************************************************************
ktordeur-sat65.sysmgmt.lan : ok=7    changed=4    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Wednesday 07 April 2021  08:19:21 +0000 (0:00:00.483)       0:00:23.195 ******* 
=============================================================================== 
Upload my.rpm ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 14.64s
Copy rpms to Satellite --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2.86s
Create product test_product ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2.53s
Create repository testrepo in test_product ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1.87s
Create a directory if it does not exist ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.73s
Recursively remove directory --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.48s
include_vars ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.04s
~~~

Comment 7 Mike McCune 2022-01-28 22:33:49 UTC
Upon review of our valid but aging backlog the Satellite Team has concluded that this Bugzilla does not meet the criteria for a resolution in the near term, and are planning to close in a month. This message may be a repeat of a previous update and the bug is again being considered to be closed. If you have any concerns about this, please contact your Red Hat Account team. Thank you.

Comment 9 Mike McCune 2022-03-18 19:44:22 UTC
Thank you for your interest in Red Hat Satellite. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this feel free to contact your Red Hat Account Team. Thank you.

Comment 10 Mike McCune 2022-04-11 19:01:31 UTC
After evaluation, this bug should not have been closed, we are planning on RHEL 8 support for Satellite in our upcoming 6.11 release targeted in 2022. Re-opening.

Comment 11 Lukas Pramuk 2022-04-19 11:58:11 UTC
VERIFIED.

@Satellite 6.11.0 Snap16
rubygem-hammer_cli-3.1.0-1.el8sat.noarch
rubygem-hammer_cli_foreman-3.1.0-1.el8sat.noarch
rubygem-hammer_cli_katello-1.3.1-1.el8sat.noarch

by this simple manual reproducer:

# rpm -qa *hammer*
rubygem-hammer_cli-3.1.0-1.el8sat.noarch
rubygem-hammer_cli_katello-1.3.1-1.el8sat.noarch
rubygem-hammer_cli_foreman_bootdisk-0.3.0-2.el8sat.noarch
rubygem-hammer_cli_foreman_azure_rm-0.2.2-1.el8sat.noarch
rubygem-hammer_cli_foreman_remote_execution-0.2.2-1.el8sat.noarch
rubygem-hammer_cli_foreman_discovery-1.1.0-1.el8sat.noarch
rubygem-hammer_cli_foreman_puppet-0.0.5-1.el8sat.noarch
rubygem-hammer_cli_foreman_webhooks-0.0.2-1.el8sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.17-1.el8sat.noarch
rubygem-hammer_cli_foreman_templates-0.2.0-2.el8sat.noarch
rubygem-hammer_cli_foreman_virt_who_configure-0.0.9-1.el8sat.noarch
rubygem-hammer_cli_foreman_openscap-0.1.13-1.el8sat.noarch
rubygem-hammer_cli_foreman_ansible-0.3.4-1.el8sat.noarch
rubygem-hammer_cli_foreman_admin-1.1.0-1.el8sat.noarch
rubygem-hammer_cli_foreman-3.1.0-1.el8sat.noarch

# hammer organization list
# hammer location list
# hammer host list
# hammer host info --id 2
# hammer location info --id 2
# hammer capsule info --id 1

>>> there is now hammer cli tool provided on RHEL8 and it is operational

Comment 17 errata-xmlrpc 2022-07-05 14:27:54 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 (Moderate: Satellite 6.11 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:5498


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