Project

General

Profile

Actions

Bug #5

closed

rake puppet:import:puppet_classes error.

Added by Udo Waechter about 15 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
External Nodes
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Hello,
nice work with foreman.

I try to do: rake puppet:import:puppet_classes from http://theforeman.org/wiki/foreman/External_Nodes

I did all the installation and setup steps, I use storeconfigs with mysql. This works fine.

When running "rake puppet:import:puppet_classes RAILS_ENV=production" I get:

@rake puppet:import:puppet_classes --trace RAILS_ENV=production
(in /home/admin/foreman)
  • Invoke puppet:import:puppet_classes (first_time)
  • Invoke environment (first_time)
  • Execute environment
  • Execute puppet:import:puppet_classes
    rake aborted!
    private method `split' called for nil:NilClass
    /home/admin/foreman/app/models/environment.rb:37:in `importClasses'
    /home/admin/foreman/app/models/environment.rb:33:in `each_pair'
    /home/admin/foreman/app/models/environment.rb:33:in `importClasses'
    /home/admin/foreman/lib/tasks/puppet.rake:44
    /usr/lib/ruby/1.8/rake.rb:636:in `call'
    /usr/lib/ruby/1.8/rake.rb:636:in `execute'
    /usr/lib/ruby/1.8/rake.rb:631:in `each'
    /usr/lib/ruby/1.8/rake.rb:631:in `execute'
    /usr/lib/ruby/1.8/rake.rb:597:in `invoke_with_call_chain'
    /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    /usr/lib/ruby/1.8/rake.rb:590:in `invoke_with_call_chain'
    /usr/lib/ruby/1.8/rake.rb:583:in `invoke'
    /usr/lib/ruby/1.8/rake.rb:2051:in `invoke_task'
    /usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
    /usr/lib/ruby/1.8/rake.rb:2029:in `each'
    /usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
    /usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
    /usr/lib/ruby/1.8/rake.rb:2023:in `top_level'
    /usr/lib/ruby/1.8/rake.rb:2001:in `run'
    /usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
    /usr/lib/ruby/1.8/rake.rb:1998:in `run'
    /usr/bin/rake:28
    @

@
dpkg -l rake ruby puppet facter ruby1.8
Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) ||/ Name Version Description
+++-===================-===================-======================================================
ii facter 1.5.6-2 a library for retrieving facts from operating systems
ii puppet 0.24.8-2 centralised configuration management for networks
ii rake 0.8.7-1 a ruby build program
ii ruby 4.2 An interpreter of object-oriented scripting language R
ii ruby1.8 1.8.7.72-3lenny1 Interpreter of object-oriented scripting language Ruby
@

Any clues where the problem could be?
Thanks,
udo

Actions #1

Updated by Ohad Levy about 15 years ago

Any chance your environments are not defined under the puppetmaster section?

Actions #2

Updated by Udo Waechter about 15 years ago

Ohad Levy wrote:

Any chance your environments are not defined under the puppetmaster section?

I do not have any envs defined. We do not use those.

Actions #3

Updated by Ohad Levy about 15 years ago

could you paste your puppet.conf?

Actions #4

Updated by Udo Waechter about 15 years ago

Ohad Levy wrote:

could you paste your puppet.conf?

@
  1. $Id: puppet.conf.erb 2785 2009-08-29 10:22:10Z uwaechte $

[main]
confdir=/etc/puppet
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=$vardir/ssl
yamldir = $vardir/yaml
rundir=/var/run/puppet
factsignore = .svn CVS .git
pluginsync=true
factpath=$vardir/lib/facter

[puppetmasterd]
catalog_format=marshal
reports=log,rrdgraph,store
graph=true
rrdgraph=true
templatedir=/etc/puppet/templates
modulepath=/etc/puppet/modules:/etc/puppet/modules-public:/etc/puppet/modules-common
storeconfigs=true
dbmigrate=true
dbadapter=mysql
dbmigrate=true
dbname=<secret>
dbserver=<secret>
dbuser=<secret>
dbpassword=<secret>
rails_loglevel=info

[puppetd]
  1. Make sure all log messages are sent to the right directory
  2. This directory must be writable by the puppet user
    runinterval=1800
    splay=false
    report=true
    server=puppetmaster.ikw.Uni-Osnabrueck.DE
    configtimeout=720
    #ca_server=puppetmaster.ikw.Uni-Osnabrueck.DE
    #ca_port=18139
    user=puppet
    group=puppet
    @
Actions #5

Updated by Udo Waechter about 15 years ago

ok, something went wrong in the prvious post:

http://pastie.org/612400

Actions #6

Updated by Ohad Levy about 15 years ago

Udo Waechter wrote:

ok, something went wrong in the prvious post:

http://pastie.org/612400

ok, try this diff:

diff --git a/app/models/environment.rb b/app/models/environment.rb
index 37b0e0c..e24b8c9 100644
--- a/app/models/environment.rb
+++ b/app/models/environment.rb
@@ -22,7 +22,7 @@ class Environment < ActiveRecord::Base
       conf[:main][:environments].split(",").each {|e| env[e.to_sym] = conf[e.to_sym][:modulepath]}
     else
       # we dont use environments
-      env[:production] = conf[:main][:modulepath]
+      env[:production] = conf[:main][:modulepath] || conf[:puppetmasterd][:modulepath]
     end
     return env
   end

Actions #7

Updated by Udo Waechter about 15 years ago

Ohad Levy wrote:

ok, try this diff:
[...]

Yeah! It works now, thanks alot!

Actions #8

Updated by Ohad Levy about 15 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100
Actions #9

Updated by Ohad Levy about 15 years ago

  • Target version set to 0.1
Actions

Also available in: Atom PDF