On 06/01/2012 04:34 PM, jcbollinger wrote:
Sorry about the late answer.
You didn't say what those modifications were, but probably they are
what's killing you. For the modules and classes in this example,
If I see well, the only one is a node.pp imported from site.pp .
Puppet's autoloader expects *exactly* the layout I showed.
It is.
Moreover, as I wrote before, "Other classes directly in their modules'
namespaces should appear in manifest files that are siblings to their
modules' init.pp." To be clear, that means class "bob::postfix"
should be defined in modules/bob/manifests/postfix.pp. Class "bob",
on the other hand, should be defined in modules/bob/manifests/init.pp
because it is in the top-level namespace.
It's quite clear and obvious.
In any case, your strace shows that the problem is indeed with paths.
You even appear to have flagged the line that says so:
lstat("*/etc/puppet/modules/bob/manifests/bob/postfix.pp*",
0x7fff452bdf70) = -1 ENOENT (No such file or directory)
The real path:
/etc/puppet/modules/bob/manifests/postfix.pp
The question is that why it search for it under path 'bob/bob' ? It's
supposed to be only bob because 'include bob::postfix' means that.
If I create a symlink for that directory, it finds it, but still not good:
What's "not good" about it? The strace doesn't show any obvious
problem.
not good = does not work
The class does not carry out.
I've no idea how bob.pp should look like.
You do not need a manifest named "bob.pp" for the example. If you had
a class named bob::bob, however, then you would put its definition in
modules/bob/manifests/bob.pp.
I mean I didn't find a rational reason, why it looks for it.
This is the directory structure:
??? auth.conf
??? etckeeper-commit-post
??? etckeeper-commit-pre
??? files
??? fileserver.conf
??? manifests
? ??? nodes.pp
? ??? site.pp
??? modules
[...some modules...]
? ??? bob
? ? ??? manifests
? ? ? ??? init.pp
? ? ? ??? postfix.pp
? ? ??? templates
? ? ??? etc
? ? ??? postfix
? ? ??? main.cf.erb
[...some modules...]
? ??? postfix
? ? ??? files
? ? ? ??? etc
? ? ? ??? aliases
? ? ??? manifests
? ? ? ??? aliases.pp
? ? ? ??? bob.pp
? ? ? ??? init.pp
? ? ??? templates
? ? ??? etc
? ? ??? mailname.erb
? ? ??? postfix
? ? ??? main.cf.erb
[...some modules...]
??? puppet.conf
??? templates
86 directories, 75 files
*site.pp:*
# The filebucket option allows for file backups to the server
filebucket { main: server => 'puppet.foo.com' }
# Set global defaults - including backing up all files to the main
filebucket and adds a global path
File { backup => main }
Exec { path => "/usr/bin:/usr/sbin/:/bin:/sbin" }
node default {
import "nodes"
}
node nodes_LINUX inherits default {
[...some user definition....]
}
include apt
include cron
include ldap_client
include munin_node
include postfix
include ssh
include sudo
include system
include packages
include rsyslog
include users
include nagios_agent
}
node nodes_LXC inherits nodes_LINUX {
include packages::lxc
}
node nodes_ESXL inherits nodes_LINUX {
include packages::hwl
include backup
}
node nodes_HWL inherits nodes_LINUX {
include packages::hwl
include backup
}
*nodes.pp:*
#########################
#### LXC Linux node #####
#########################
node "bob.foo.com" inherits nodes_LXC {
include bob
}
The module called 'postfix' works fine, I don't copy its contents here.
*module called 'bob':*
# cat /etc/puppet/modules/bob/manifests/init.pp
class bob {
include bob::postfix
}
# cat /etc/puppet/modules/bob/manifests/postfix.pp
class bob::postfix inherits postfix {
File ["/etc/postfix/main.cf"] {
content => template('bob/etc/postfix/main.cf.erb')
}
}
I'm trying to figure outt. what the problem is, but I don't see.
Again, this is the error message:
# puppet agent -t
err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Could not find scope for bob::postfix at
/etc/puppet/modules/bob/manifests/init.pp:2 on node bob.foo.com
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
Thank you,
tamas
--
You received this message because you are subscribed to the Google Groups "Puppet
Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.