Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1374285 - API lacks ability to modify/specify hostgroup openscap capsule via API or hammer cli
API lacks ability to modify/specify hostgroup openscap capsule via API or ham...
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: SCAP Plugin (Show other bugs)
6.2.0
Unspecified Unspecified
medium Severity medium (vote)
: Unspecified
: Unused
Assigned To: Marek Hulan
Sanket Jagtap
: Triaged
: 1380654 (view as bug list)
Depends On:
Blocks: 1459226
  Show dependency treegraph
 
Reported: 2016-09-08 07:57 EDT by Will D
Modified: 2018-02-21 11:46 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-02-21 11:46:43 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 16490 None None None 2016-09-08 08:30 EDT
Foreman Issue Tracker 20681 None None None 2017-08-21 10:59 EDT
Foreman Issue Tracker 20862 None None None 2017-09-18 10:31 EDT

  None (edit)
Description Will D 2016-09-08 07:57:53 EDT
Description of problem:
API lacks ability to modify/specify hostgroup openscap capsule via API or hammer cli

Version-Release number of selected component (if applicable):
foreman-1.11.0.51-1.el7sat.noarch
foreman-compute-1.11.0.51-1.el7sat.noarch
foreman-debug-1.11.0.51-1.el7sat.noarch
foreman-ec2-1.11.0.51-1.el7sat.noarch
foreman-gce-1.11.0.51-1.el7sat.noarch
foreman-installer-1.11.0.10-1.el7sat.noarch
foreman-installer-katello-3.0.0.56-1.el7sat.noarch
foreman-libvirt-1.11.0.51-1.el7sat.noarch
foreman-openstack-1.11.0.51-1.el7sat.noarch
foreman-ovirt-1.11.0.51-1.el7sat.noarch
foreman-postgresql-1.11.0.51-1.el7sat.noarch
foreman-proxy-1.11.0.5-1.el7sat.noarch
foreman-rackspace-1.11.0.51-1.el7sat.noarch
foreman-selinux-1.11.0.2-1.el7sat.noarch
foreman-vmware-1.11.0.51-1.el7sat.noarch
katello-3.0.0-11.el7sat.noarch
katello-certs-tools-2.4.0-1.el7sat.noarch
katello-client-bootstrap-1.1.0-2.el7sat.noarch
katello-common-3.0.0-11.el7sat.noarch
katello-debug-3.0.0-11.el7sat.noarch
katello-default-ca-1.0-1.noarch
katello-installer-base-3.0.0.56-1.el7sat.noarch
katello-selinux-3.0.1.2-1.el7sat.noarch
katello-server-ca-1.0-1.noarch
katello-service-3.0.0-11.el7sat.noarch
pulp-katello-1.0.1-1.el7sat.noarch
puppet-foreman_scap_client-0.3.3-10.el7sat.noarch
slvdcrvsat02.nfcu.net-foreman-client-1.0-1.noarch
slvdcrvsat02.nfcu.net-foreman-proxy-1.0-1.noarch
slvdcrvsat02.nfcu.net-foreman-proxy-client-1.0-1.noarch
tfm-rubygem-foreman_bootdisk-6.1.0.3-1.el7sat.noarch
tfm-rubygem-foreman_discovery-5.0.0.9-1.el7sat.noarch
tfm-rubygem-foreman_docker-2.0.1.11-1.el7sat.noarch
tfm-rubygem-foreman_hooks-0.3.11-1.el7sat.noarch
tfm-rubygem-foreman_openscap-0.5.3.17-1.el7sat.noarch
tfm-rubygem-foreman-redhat_access-1.0.11-1.el7sat.noarch
tfm-rubygem-foreman_remote_execution-0.3.0.11-1.el7sat.noarch
tfm-rubygem-foreman-tasks-0.7.14.6-3.el7sat.noarch
tfm-rubygem-foreman_theme_satellite-0.1.26-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman-0.5.1.9-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_admin-0.0.5-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_bootdisk-0.1.3.3-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_discovery-0.0.2.3-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_docker-0.0.6-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_remote_execution-0.0.5.3-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_tasks-0.0.10.3-1.el7sat.noarch
tfm-rubygem-hammer_cli_katello-0.0.22.25-1.el7sat.noarch
tfm-rubygem-katello-3.0.0.73-1.el7sat.noarch


How reproducible:
Every time

Steps to Reproduce:
1. hammer hostgroup create --help | grep scap (no option for scap
2. Via Foreman/Katello/Satellite API docs, no reference to set openscap capsule for hostgroup
3.

Actual results:
None

Expected results:
Should be able to configure the openscap capsule for a hostgroup via hammer cli or API requests

Additional info:
Comment 1 Marek Hulan 2016-09-08 08:30:56 EDT
Created redmine issue http://projects.theforeman.org/issues/16490 from this bug
Comment 3 Marek Hulan 2016-10-05 04:50:18 EDT
*** Bug 1380654 has been marked as a duplicate of this bug. ***
Comment 13 Marek Hulan 2017-08-21 10:59:55 EDT
Both linked issues must be fixed. They are currently pending review. Once they are in, this will allow do commands such as

> hammer host info --id 2
> hammer hostgroup info --id 2

which will contain e.g. (similar to Puppet Proxy ID)

> OpenSCAP Proxy:         1

also creating/updating will be available

> hammer host update --id 2 --openscap-proxy-id 1
> hammer hostgroup create --name openscap --openscap-proxy-id 1

All is to be found in /apidoc after new apipie cache is generated e.g. by

> foreman-rake apipie:cache

Note for QE: this also touched WebUI, the OpenSCAP proxy field should now support inheriting like other proxy fields. The label and inline helps changed. UI part should be also tested.
Comment 14 pm-sat@redhat.com 2017-08-21 12:00:37 EDT
Upstream bug assigned to mhulan@redhat.com
Comment 15 pm-sat@redhat.com 2017-08-21 12:00:44 EDT
Upstream bug assigned to mhulan@redhat.com
Comment 16 pm-sat@redhat.com 2017-09-14 04:00:37 EDT
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20681 has been resolved.
Comment 19 Sanket Jagtap 2017-10-18 06:13:41 EDT
Satellite 6.3.0 snap 20

FOR HOSTGROUP:

hammer hostgroup update --help
--openscap-proxy-id OPENSCAP_PROXY_ID                     ID of OpenSCAP Capsule

hammer hostgroup info --id 1
Id:                     1
'''
'''
Locations:              
    Default Location
Organizations:          
    Default Organization
Parent Id:              
OpenSCAP Proxy:         1
Content View:           RHEL 6 CV
Lifecycle Environment:  DEV
Content Source:         satellite

[root@dell-per630-fc-01 ~]# hammer hostgroup update --id 1 --openscap-proxy-id 1
Hostgroup updated
[root@dell-per630-fc-01 ~]# hammer hostgroup info --id 1
Id:                     1
'''
'''
Locations:              
    Default Location
Organizations:          
    Default Organization
Parent Id:              
OpenSCAP Proxy:         1
Content View:           RHEL 6 CV
Lifecycle Environment:  DEV
Content Source:         dell-per630-fc-01.

hammer> hostgroup create --name test --openscap-proxy-id 1
Hostgroup created
hammer> hostgroup info --id 2
Id:                     2
Name:                   test
Title:                  test
Puppet CA Proxy Id:     
Puppet Master Proxy Id: 
Puppetclasses:          

Parameters:             

Parent Id:              
OpenSCAP Proxy:         1
Content View:           
Lifecycle Environment:  
Content Source:



The new sub-command is exposed for the hostgroup
------------------------------------------------------------------------------
For HOST
According to the https://bugzilla.redhat.com/show_bug.cgi?id=1374285#c13

hammer> host info --id 13
Id:                       13
UUID:                     e72746d7-47a3-4351-b447-a12152c41dcd
Name:                     rocky-pridham.
""""
OpenSCAP Proxy:

There is the OpenScap Proxy field available via INFO command , but on trying to update this
host update --help
No --openscap-proxy-id command

host update --id 13 --openscap-proxy-id 1
Could not update the host:
  Error: Unrecognised option '--openscap-proxy-id'
  
  See: ' host update --help'

We should also be able to manipulate proxy for individual host.

Was this missed or should this be tracked under issue?
Comment 20 Marek Hulan 2017-10-18 10:12:29 EDT
This now fails for host only, the reason is that hosts controller is required before foreman_openscap plugin is initiated. This is caused by katello https://github.com/Katello/katello/blob/7ef4d0cba21d867581bafdf875e366d874c0cefc/lib/katello/plugin.rb#L248

I suggest we change this to VERIFIED since for hostgroups it works, and opening a separate issue for hosts with the information from above. Users should be unblocked by this.
Comment 21 Marek Hulan 2017-10-18 10:43:03 EDT
If you're going to open separate issue, please link it to http://projects.theforeman.org/issues/21382, I sent a fix upstream for it already.
Comment 22 Sanket Jagtap 2017-10-23 04:54:56 EDT
Verifying this as per the comments #19 and #20

New Issue filed for host: https://bugzilla.redhat.com/show_bug.cgi?id=1505295
Comment 23 Bryan Kearney 2018-02-21 11:42:38 EST
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
Comment 24 Bryan Kearney 2018-02-21 11:46:43 EST
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

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