Bug 1260697
Summary: | [RFE] As a CLI user, I should be able to set the Content Source for a host and hostgroup. | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Bryan Kearney <bkearney> |
Component: | Content Management | Assignee: | Katello Bug Bin <katello-bugs> |
Status: | CLOSED ERRATA | QA Contact: | Martin Korbel <mkorbel> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 6.0.4 | CC: | abalakht, ahumbe, anerurka, bbuckingham, carlospec, csulekha, frank.reimer, jbhatia, jentrena, john.thiesfeld, katello-bugs, kbidarka, ktordeur, mhulan, mkorbel, mmithaiw, msomasun, pdwyer, rankumar, rjain, sauchter, sjr, sraut, sthirugn, tomckay, tstrachota, vedprakash.nimbalkar, xdmoon |
Target Milestone: | Unspecified | Keywords: | FutureFeature, PrioBumpGSS, Triaged |
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | http://projects.theforeman.org/issues/7597 | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Enhancement | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-02-21 12:30:53 UTC | Type: | --- |
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: | 1316897 | ||
Bug Blocks: | 1115190, 1122832 |
Description
Bryan Kearney
2015-09-07 13:14:18 UTC
Created from redmine issue http://projects.theforeman.org/issues/7597 My comment from redmine: I see that --content-source-id is available to both hammer host and hostgroup update, is this issue resolved? Moving to POST since upstream bug http://projects.theforeman.org/issues/7597 has been closed I show it for hostgroup in 6.2, but not host [root@sat-test-rhel7 scenarios.d]# hammer hostgroup update --help | grep content --content-source-id CONTENT_SOURCE_ID --content-view CONTENT_VIEW_NAME Name to search by --content-view-id CONTENT_VIEW_ID content view numeric identifier [root@sat-test-rhel7 scenarios.d]# hammer host update --help | grep content [root@sat-test-rhel7 scenarios.d]# Moving this to POST in 6.3 to get caught int he next rebase from upstream. FAILQA on version tfm-rubygem-hammer_cli-0.8.0-1 Hammer return error for this case, the variant with id works well. > hammer hostgroup update --content-view "test view" --id 1 Could not update the hostgroup: Error: Missing options to search organization The note for parameter "--content-source-id". It works well but we cannot get status via hammer. > hammer hostgroup info --id 1 Id: 1 Name: Test Group Title: Test Group Puppet CA Proxy Id: Puppet Master Proxy Id: Puppetclasses: Parameters: Locations: Default Location Organizations: Default Organization Parent Id: Content View: Default Organization View Lifecycle Environment: Library Other options look good, it works as we expect. > hammer hostgroup update --content-view-id 2 --id 1 > hammer hostgroup info --id 1 ... Content View: test view ... > hammer host update --content-view "test view" --id 2 > hammer host info --id 2 ... Content View: test view ... > hammer host update --content-view-id 1 --id 2 Content View: Default Organization View DOC: > hammer hostgroup update --help | grep content --content-source-id CONTENT_SOURCE_ID Content source ID --content-view CONTENT_VIEW_NAME Name to search by --content-view-id CONTENT_VIEW_ID content view numeric identifier > hammer host update --help | grep content --content-view CONTENT_VIEW_NAME Name to search by --content-view-id CONTENT_VIEW_ID content view numeric identifier Upstream bug component is Hammer - Content Is https://bugzilla.redhat.com/show_bug.cgi?id=1332908 a DUP of this bugzilla? *** Bug 1332908 has been marked as a duplicate of this bug. *** *** Bug 1351773 has been marked as a duplicate of this bug. *** Update: Host part seems to be fixed by bz 1390153, host group will take more time, since host group does not support facets. Further progress is blocked on following upstream issue http://projects.theforeman.org/issues/16630 Displaying the content source in info action is tracked here: https://bugzilla.redhat.com/show_bug.cgi?id=1313056 Usage of --content-view was fixed by (requires --query-organization now): https://bugzilla.redhat.com/show_bug.cgi?id=1416862 --content-source-id is present in both host and hostgroup create and update in upstream so I'm switching this to ON_QA for verification. [root@qe-rhel7 ~]# hammer -u admin -p changeme host create --help | grep -i content-source --content-source-id CONTENT_SOURCE_ID [root@qe-hel7 ~]# hammer -u admin -p changeme host update --help | grep -i content-source --content-source-id CONTENT_SOURCE_ID [root@qe-rhel7 ~]# hammer -u admin -p changeme hostgroup create --help | grep -i content-source --content-source-id CONTENT_SOURCE_ID Content source ID [root@qe-rhel7 ~]# hammer -u admin -p changeme hostgroup update --help | grep -i content-source --content-source-id CONTENT_SOURCE_ID Content source ID [root@qe-rhel7 ~]# hammer -u admin -p changeme hostgroup info --id 2 | grep -i "content source" Content Source: sat6-hostname.redhat.com VERIFIED with Sat6.3.0-snap11.0 hammer -u admin -p changeme hostgroup create --name='RHEL 7 Server 64-bit HG' --content-view='RHEL 7 CV' --environment-id=1 --lifecycle-environment='DEV' --content-source-id="1" --puppet-proxy="$(hostname)" --puppet-ca-proxy="$(hostname)" --query-organization-id="1" --puppet-classes='access_insights_client,foreman_scap_client' --domain-id="1" --subnet="katello_latest" --architecture='x86_64' --operatingsystem-id="3" --partition-table='Kickstart default' --location-ids="2" Hostgroup created -------------------------------- hammer -u admin -p changeme host create --name='rhel-7-libvirt2' --root-password='changeme' --organization-id="1" --location-id="2" --hostgroup="RHEL 7 Server 64-bit HG" --compute-resource="libvirt" --compute-attributes="cpus=1, memory=1073741824, start=1" --interface="primary=true, compute_type=bridge, compute_bridge=katello_latest, compute_model=virtio" --volume="capacity=10G,format_type=qcow2" --operatingsystem-id "2" --pxe-loader 'PXELinux BIOS' --provision-method build Host created After creating the HOST, checked whether the content-source was set from the UI and it was indeed set. Will upload a screenshot shortly. ------------------------------- # hammer -u admin -p changeme hostgroup info --id 2 Id: 2 Name: RHEL 7 Server 64-bit HG Title: RHEL 7 Server 64-bit HG Operating System: RedHat 7.3 Environment: production Subnet: katello_latest Domain: sat6-domainname.redhat.com Architecture: x86_64 Partition Table: Kickstart default Puppet CA Proxy Id: 1 Puppet Master Proxy Id: 1 Puppetclasses: access_insights_client foreman_scap_client Parameters: Locations: Default Location Organizations: Default Organization Parent Id: Content View: RHEL 7 CV Lifecycle Environment: DEV Content Source: sat6-hostname.redhat.com currently there is no "content source" information available from "host info --id <id>" As per discussion with Partha on this issue. On Satellite v 6.2.12 using below API command, we can set the content source ID successfully # curl -H "Content-Type:application/json" -X PUT -u 'username:password' -k -d '{"host":{"content_source_id": "2"}}' https://satellite.example.com/api/v2/hosts/123 Replace below values appropriately: 123 : with the host ID for which content source ID needs to be updated. satellite.example.com : with FADN of the satellite server username:password : with appropriate admin user credentials "2" (content_source_id) : with appropriate capsule server ID To get the host ID and content source ID one can use below commands # hammer host list << To get host ID # hammer capsule list << To get content source ID This can be used as a workaround for now. 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 |