Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1317257

Summary: Unable to extend the Satellite Discovery Image with custom facts
Product: Red Hat Satellite Reporter: jalviso <jalviso>
Component: Discovery ImageAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Sachin Ghai <sghai>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.1.7CC: bbuckingham, sghai, sthirugn
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
URL: http://projects.theforeman.org/issues/14201
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 11:43:21 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:
Attachments:
Description Flags
discovered host that uses fdi_zips=sghai_ext.zip and zip includes 'discovery_extenaion' fact with value 'installed'
none
discovery_extension facts displayed with value 'installed' none

Comment 3 Lukas Zapletal 2016-03-15 09:43:33 UTC
Reproduced, image for Satellite 6.2 affected as well.

I will provide you new image build soon. Thanks for investigation.

Comment 4 Lukas Zapletal 2016-03-15 09:54:23 UTC
Patch provided in https://github.com/theforeman/foreman-discovery-image/pull/68/files

Comment 5 Bryan Kearney 2016-03-15 10:01:46 UTC
Upstream bug component is Discovery Plugin

Comment 7 Bryan Kearney 2016-03-15 16:01:34 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/14201 has been closed
-------------
Anonymous
Applied in changeset commit:foreman-discovery-image|2f741bf25041febd91703d51f7c50f327addefbb.

Comment 12 Sachin Ghai 2016-04-15 07:53:11 UTC
Verified with sat6.2 GA snap8.1


I can extend the discovery image with custom facts using fdi.zips.  I used example_zip an built a zip sghai_ext.zip that includes 'discovery_extension' facts with value 'installed' and discovered a host successfully. I can see "discovered_extension=installed" under facts console screen.

And in UI under Fact's software section

Please see attached screenshot.

Comment 13 Sachin Ghai 2016-04-15 07:55:22 UTC
Created attachment 1147486 [details]
discovered host that uses fdi_zips=sghai_ext.zip and zip includes 'discovery_extenaion' fact with value 'installed'

Comment 14 Sachin Ghai 2016-04-15 07:56:24 UTC
Created attachment 1147487 [details]
discovery_extension facts displayed with value 'installed'

Comment 15 Sachin Ghai 2016-04-15 08:27:22 UTC
As per comment2, now correct permissions 755 are set.


[root@fdi ~]# ll /etc/NetworkManager/dispatcher.d/15-get-zip-server
-rwxr-xr-x 1 root root 1200 Apr 13 08:41 /etc/NetworkManager/dispatcher.d/15-get-zip-server

Comment 16 Sachin Ghai 2016-04-15 08:29:58 UTC
discovery-fetch-extensions successfully downloads the zip extension as below:


Apr 15 08:20:00 fdi discovery-fetch-extensions[1194]: Archive:  /tmp/tmp.kZ79t4vev4
Apr 15 08:20:00 fdi discovery-fetch-extensions[1194]: creating: /opt/extension/autostart.d/
Apr 15 08:20:00 fdi discovery-fetch-extensions[1194]: inflating: /opt/extension/autostart.d/01_zip.sh
Apr 15 08:20:00 fdi discovery-fetch-extensions[1194]: inflating: /opt/extension/bin/ntpdate
Apr 15 08:20:00 fdi discovery-fetch-extensions[1194]: inflating: /opt/extension/facts/discovery_extension.rb
Apr 15 08:20:00 fdi discovery-fetch-extensions[1194]: inflating: /opt/extension/lib/ruby/discovery_extension.rb
Apr 15 08:20:00 fdi discovery-fetch-extensions[1194]: extracting: /opt/extension/lib/ruby/your-rubylibs-go-here
Apr 15 08:20:00 fdi discovery-fetch-extensions[1194]: extracting: /opt/extension/lib/your-libs-go-here
Apr 15 08:20:00 fdi systemd[1]: Started Download zip extensions to this image.

Comment 19 Bryan Kearney 2016-07-27 11:43:21 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/RHBA-2016:1501