Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1518575 - [RFE] Provide feedback when Puppet class import fails
Summary: [RFE] Provide feedback when Puppet class import fails
Keywords:
Status: NEW
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Puppet
Version: 6.2.12
Hardware: x86_64
OS: Linux
medium
medium vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Peter Ondrejka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-29 08:44 UTC by Beat Rubischon
Modified: 2019-03-29 07:00 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 22593 None None None 2018-02-15 12:22:29 UTC

Description Beat Rubischon 2017-11-29 08:44:20 UTC
Description of problem:

Foreman offers three possibilities to refresh the internal list of Puppet classes:

* Button on https://satellite.example.com/puppetclasses
* hammer proxy import-classes --id $CAPSULE --environment $ENV
* POST /api/environments/$ENV/smart_proxies/$CAPSULE/import_puppetclasses

The syntax of the Puppet modules is checked, but not reported back to the user. Even worse the classes are silently removed from all associated hosts and hostgroups.

Version-Release number of selected component (if applicable):

Satellite 6.2.12

How reproducible:

always

Steps to Reproduce:

# cd /etc/puppet
# mkdir rubis
# cd rubis/
# mkdir modules
# cd modules/
# git clone https://github.com/puppetlabs/helloworld
# hammer environment create --name rubis --locations LAB --organizations "BRubisch LAB"
# hammer proxy import-classes --id 1 --environment rubis

-> class is visible in https://satellite.example.com/puppetclasses, Foreman's production log:

2017-11-28 13:51:26 b768c46b [app] [I] Started POST "/api/environments/8/smart_proxies/1/import_puppetclasses" for ::1 at 2017-11-28 13:51:26 +0100
2017-11-28 13:51:26 b768c46b [app] [I] Processing by Api::V2::SmartProxiesController#import_puppetclasses as JSON
2017-11-28 13:51:26 b768c46b [app] [I]   Parameters: {"dryrun"=>false, "apiv"=>"v2", "environment_id"=>"8", "id"=>"1", "smart_proxy"=>{}}
2017-11-28 13:51:26 b768c46b [app] [I] Authorized user admin(Admin User)
2017-11-28 13:51:27 b768c46b [app] [I]   Rendered api/v1/import_puppetclasses/show.json.rabl within api/layouts/import_puppetclasses_layout (1.8ms)
2017-11-28 13:51:27 b768c46b [app] [I] Completed 200 OK in 834ms (Views: 6.6ms | ActiveRecord: 26.5ms)

# vi helloworld/manifests/init.pp
Add a curly bracket at the end of the file
# hammer proxy import-classes --id 1 --environment rubis

-> class is gone from in https://satellite.example.com/puppetclasses, neither hammer nor the Foreman's production log shows any errors:

2017-11-28 13:51:39 0582f668 [app] [I] Started POST "/api/environments/8/smart_proxies/1/import_puppetclasses" for ::1 at 2017-11-28 13:51:39 +0100
2017-11-28 13:51:39 0582f668 [app] [I] Processing by Api::V2::SmartProxiesController#import_puppetclasses as JSON
2017-11-28 13:51:39 0582f668 [app] [I]   Parameters: {"dryrun"=>false, "apiv"=>"v2", "environment_id"=>"8", "id"=>"1", "smart_proxy"=>{}}
2017-11-28 13:51:39 0582f668 [app] [I] Authorized user admin(Admin User)
2017-11-28 13:51:40 0582f668 [app] [I]   Rendered api/v1/import_puppetclasses/show.json.rabl within api/layouts/import_puppetclasses_layout (1.6ms)
2017-11-28 13:51:40 0582f668 [app] [I] Completed 200 OK in 813ms (Views: 2.5ms | ActiveRecord: 31.0ms)

Actual results:

No notification about the broken Puppet class

Expected results:

User is alerted about the error

Additional info:

Ideally we would keep the linkage from hosts and hostgroups to the Puppet class, even it's temporary unusable.

Comment 3 Ondřej Pražák 2018-02-15 12:22:27 UTC
Created redmine issue http://projects.theforeman.org/issues/22593 from this bug


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