Project

General

Profile

Actions

Feature #22593

open

Provide better feedback for Puppet class import, especially for broken classes

Added by Ondřej Pražák about 6 years ago. Updated about 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Puppet integration
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Description of problem:

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

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.

Steps to Reproduce:

  1. cd /etc/puppet
  2. mkdir rubis
  3. cd rubis/
  4. mkdir modules
  5. cd modules/
  6. git clone https://github.com/puppetlabs/helloworld
  7. hammer environment create --name rubis --locations LAB --organizations "BRubisch LAB"
  8. hammer proxy import-classes --id 1 --environment rubis

-> class is visible in https://foreman.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)

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

-> class is gone from in https://foreman.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.

Actions #1

Updated by Ondřej Pražák about 6 years ago

  • Subject changed from Provide better feedback for Puppet class import, especially for broken classes to Provide better feedback for Puppet class import, especially for broken classes
  • Category changed from PuppetCA to Puppet integration
Actions

Also available in: Atom PDF