FAQ
hi All,

I'm a bit new to puppet. Is there a mailing list for puppet beginners?:)


I have a service module called postfix, which defines file in a class:

file {
'/etc/postfix/main.cf':
owner => "root",
group => "root",
mode => 644,
content => template('postfix/etc/postfix/main.cf.erb'),
notify => Service['postfix'],
require => Package['postfix']
}

This is included in the base node which is inherited by all nodes.

For one node I want to change the configuration:

node "jay.foo.com" inherits nodes_base {
include jay
}


jay (node specific) module:

class jay inherits postfix {
File ["/etc/postfix/main.cf"] {
content => template('jay/etc/postfix/main.cf.erb')
}

}


This works fine.

However I'd like to use this:

class jay {
include jay::postfix
}

class jay::postfix inherits postfix {
File ["/etc/postfix/main.cf"] {
content => template('jay/etc/postfix/main.cf.erb')
}

}

# puppet agent -t --noop
err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Could not find scope for jay::postfix at
/etc/puppet/nodes/jay/manifests/init.pp:2 on node jay.foo.com
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run



Or this:

node "jay.foo.com" inherits nodes_base {
# include jay
File ["/etc/postfix/main.cf"] {
content => template('jay/etc/postfix/main.cf.erb')
}

}


# puppet agent -t --noop
err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Only subclasses can override parameters at
/etc/puppet/manifests/nodes.pp:24 on node jay.foo.com
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
root@jay:~#


What's wrongm, what do I miss?


Thanks,
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

  • Ryan Coleman at May 30, 2012 at 3:59 pm

    On Wed, May 30, 2012 at 6:27 AM, Papp Tamas wrote:
    hi All, Hi.
    I'm a bit new to puppet. Is there a mailing list for puppet beginners?:)
    Welcome! No, but this list is for all skill levels.

    <SNIP>
    However I'd like to use this:

    class jay {
    include jay::postfix
    }

    class jay::postfix inherits postfix {
    File ["/etc/postfix/main.cf"] {
    content => template('jay/etc/postfix/main.cf.erb')
    }

    }

    #  puppet agent -t --noop
    err: Could not retrieve catalog from remote server: Error 400 on SERVER:
    Could not find scope for jay::postfix at
    /etc/puppet/nodes/jay/manifests/init.pp:2 on node jay.foo.com
    warning: Not using cache on failed catalog
    err: Could not retrieve catalog; skipping run
    The issue here is how your module is structured in relation to what
    Puppet expects to automatically find your manifests.

    In jay module, manifests directory, Puppet expects init.pp to have the
    jay class.

    If you want to have a jay::postfix class, Puppet expects to find it in
    jay/manifests/postfix.pp. So, if your init.pp currently contains the
    class jay::postfix, rename that file to postfix.pp and try again.

    Reference: http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html#module-layout


    Or this:

    node "jay.foo.com" inherits nodes_base {
    #   include jay
    File ["/etc/postfix/main.cf"] {
    content => template('jay/etc/postfix/main.cf.erb')
    }

    }


    # puppet agent -t --noop
    err: Could not retrieve catalog from remote server: Error 400 on SERVER:
    Only subclasses can override parameters at /etc/puppet/manifests/nodes.pp:24
    on node jay.foo.com
    warning: Not using cache on failed catalog
    err: Could not retrieve catalog; skipping run
    root@jay:~#
    In this case, Puppet is telling you that you can only override
    resources in a class that inherits another class. You can't do this
    outside of a class. You were on the right track above.

    Cheers!

    --Ryan

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Papp Tamas at May 30, 2012 at 10:29 pm

    On 05/30/2012 05:58 PM, Ryan Coleman wrote:
    The issue here is how your module is structured in relation to what
    Puppet expects to automatically find your manifests.

    In jay module, manifests directory, Puppet expects init.pp to have the
    jay class.

    If you want to have a jay::postfix class, Puppet expects to find it in
    jay/manifests/postfix.pp. So, if your init.pp currently contains the
    class jay::postfix, rename that file to postfix.pp and try again.

    Reference: http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html#module-layout
    Of course I tried this way:

    [...some example...]


    At least, I thought, I did:)


    Thank you very much,
    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Papp Tamas at May 30, 2012 at 10:52 pm

    On 05/31/2012 12:29 AM, Papp Tamas wrote:
    On 05/30/2012 05:58 PM, Ryan Coleman wrote:
    The issue here is how your module is structured in relation to what
    Puppet expects to automatically find your manifests.

    In jay module, manifests directory, Puppet expects init.pp to have the
    jay class.

    If you want to have a jay::postfix class, Puppet expects to find it in
    jay/manifests/postfix.pp. So, if your init.pp currently contains the
    class jay::postfix, rename that file to postfix.pp and try again.

    Reference:
    http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html#module-layout
    Of course I tried this way:

    [...some example...]


    At least, I thought, I did:)
    Rather not..

    It's OK, if I use include postfix::bob and the classes for this way.


    But:

    # puppet agent -t --noop
    err: Could not retrieve catalog from remote server: Error 400 on SERVER:
    Could not find scope for bob::postfix at
    /etc/puppet/nodes/bob/manifests/init.pp:2 on node bob.foo.com
    warning: Not using cache on failed catalog
    err: Could not retrieve catalog; skipping run

    IF:

    node "bob.maramaros.chemaxon.local" inherits nodes_LXC {
    include bob
    }


    # cat init.pp
    class bob {
    include bob::postfix
    }

    # cat postfix.pp
    class bob::postfix inherits postfix {
    File ["/etc/postfix/main.cf"] {
    content => template('bob/etc/postfix/main.cf.erb')
    }

    }


    OR

    # puppet agent -t --noop
    err: Could not retrieve catalog from remote server: Error 400 on SERVER:
    Could not find scope for bob::postfix at
    /etc/puppet/manifests/nodes.pp:6 on node bob.foo.com
    warning: Not using cache on failed catalog
    err: Could not retrieve catalog; skipping run

    IF:

    node "bob.foo.com" inherits nodes_LXC {
    include bob::postfix
    }

    class bob::postfix inherits postfix {
    File ["/etc/postfix/main.cf"] {
    content => template('bob/etc/postfix/main.cf.erb')
    }

    }



    So I still miss something, but I don't see what or where or any clue.

    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Jcbollinger at May 31, 2012 at 1:22 pm

    On May 30, 5:52 pm, Papp Tamas wrote:
    So I still miss something, but I don't see what or where or any clue.
    I suspect you have a problem either with paths or with permissions.
    Supposing you have not configured custom directories, your setup
    should look like this:

    <puppet base>
    L puppet.conf
    L manifests/
    L site.pp
    L modules/
    L bob/
    L manifests/
    L init.pp
    L postfix.pp
    L postfix/
    L manifests/
    L init.pp

    Classes that have the same name as their module ( == classes whose
    names are in the topmost namespace) should appear in their modules'
    init.pp files. Other classes directly in their modules' namespaces
    should appear in manifest files that are siblings to their modules'
    init.pp.

    Thus, class 'bob' should appear in modules/bob/manifests/init.pp.
    Class 'bob::postfix' should appear in modules/bob/manifests/
    postfix.pp. Class 'postfix' should appear in modules/postfix/
    manifests/init.pp.

    Furthermore, the whole tree must be readable, and the directories
    traversible, by the puppetmaster user (often 'puppet', and typically
    *not* root).


    John

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Papp Tamas at Jun 1, 2012 at 10:29 am

    On 05/31/2012 03:22 PM, jcbollinger wrote:
    I suspect you have a problem either with paths or with permissions.
    I don't find anything related to this.
    Supposing you have not configured custom directories, your setup
    should look like this:

    <puppet base>
    L puppet.conf
    L manifests/
    L site.pp
    L modules/
    L bob/
    L manifests/
    L init.pp
    L postfix.pp
    L postfix/
    L manifests/
    L init.pp
    That's true with slight modifications (eg.
    Classes that have the same name as their module ( == classes whose
    names are in the topmost namespace) should appear in their modules'
    init.pp files. Other classes directly in their modules' namespaces
    should appear in manifest files that are siblings to their modules'
    init.pp.

    Thus, class 'bob' should appear in modules/bob/manifests/init.pp.
    Class 'bob::postfix' should appear in modules/bob/manifests/
    postfix.pp. Class 'postfix' should appear in modules/postfix/
    manifests/init.pp.

    Furthermore, the whole tree must be readable, and the directories
    traversible, by the puppetmaster user (often 'puppet', and typically
    *not* root).
    I can send you the /etc/puppet directory, if you prefer. However
    configuration is pretty simple.


    Anyway, there is a strace log:

    select(9, [3 7], [], [], {0, 0}) = 0 (Timeout)
    stat("/etc/puppet/modules/bob", {st_mode=S_IFDIR|0755, st_size=4096,
    ...}) = 0
    stat("/etc/puppet/modules/bob/metadata.json", 0x7fff452bd2a0) = -1
    ENOENT (No such file or directory)
    stat("/etc/puppet/modules/bob/manifests/init.pp", {st_mode=S_IFREG|0644,
    st_size=36, ...}) = 0
    stat("/etc/puppet/modules/bob/manifests/init.rb", 0x7fff452bdc20) = -1
    ENOENT (No such file or directory)
    lstat("*/etc/puppet/modules/bob/manifests/bob/postfix.pp*",
    0x7fff452bdf70) = -1 ENOENT (No such file or directory)
    lstat("/etc/puppet/modules/bob/manifests/bob/postfix.rb",
    0x7fff452bdf70) = -1 ENOENT (No such file or directory)
    select(9, [3 7], [], [], {0, 0}) = 0 (Timeout)
    rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
    getcwd("/", 200) = 2
    select(9, [3 7], [], [], {0, 0}) = 0 (Timeout)
    stat("/etc/puppet/modules/bob", {st_mode=S_IFDIR|0755, st_size=4096,
    ...}) = 0
    stat("/etc/puppet/modules/bob/metadata.json", 0x7fff452bd2a0) = -1
    ENOENT (No such file or directory)
    stat("/etc/puppet/modules/bob/manifests/init.pp", {st_mode=S_IFREG|0644,
    st_size=36, ...}) = 0
    stat("/etc/puppet/modules/bob/manifests/init.rb", 0x7fff452bdc20) = -1
    ENOENT (No such file or directory)
    lstat("/etc/puppet/modules/bob/manifests/bob.pp", 0x7fff452be0c0) = -1
    ENOENT (No such file or directory)
    lstat("/etc/puppet/modules/bob/manifests/bob.rb", 0x7fff452be0c0) = -1
    ENOENT (No such file or directory)
    select(9, [3 7], [], [], {0, 0}) = 0 (Timeout)
    select(9, [3 7], [], [], {0, 0}) = 0 (Timeout)
    rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
    getcwd("/", 200) = 2
    select(9, [3 7], [], [], {0, 0}) = 0 (Timeout)
    stat("/etc/puppet/modules/bob", {st_mode=S_IFDIR|0755, st_size=4096,
    ...}) = 0
    stat("/etc/puppet/modules/bob/metadata.json", 0x7fff452bd2a0) = -1
    ENOENT (No such file or directory)
    stat("/etc/puppet/modules/bob/manifests/init.pp", {st_mode=S_IFREG|0644,
    st_size=36, ...}) = 0
    stat("/etc/puppet/modules/bob/manifests/init.rb", 0x7fff452bdc20) = -1
    ENOENT (No such file or directory)
    lstat("/etc/puppet/modules/bob/manifests/init.pp",
    {st_mode=S_IFREG|0644, st_size=36, ...}) = 0
    lstat("/etc/puppet/modules/bob/manifests/init.rb", 0x7fff452be0c0) = -1
    ENOENT (No such file or directory)
    stat("/etc/puppet/modules/bob/manifests/init.pp", {st_mode=S_IFREG|0644,
    st_size=36, ...}) = 0
    select(9, [3 7], [], [], {0, 0}) = 0 (Timeout)
    select(9, [3 7], [], [], {0, 0}) = 0 (Timeout)
    rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
    rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
    rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
    rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
    rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
    rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
    rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
    select(9, [3 7], [], [], {0, 0}) = 0 (Timeout)
    sendto(5, "<27>Jun 1 12:12:14 puppet-master[47038]: Could not find
    scope for bob::postfix at /etc/puppet/modules/bob/manifests/init.pp:2 on
    node bob.maramaros.chemaxon.local", 163, MSG_NOSIGNAL, NULL, 0) = 163
    select(9, [3 7], [], [], {0, 0}) = 0 (Timeout)
    rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
    rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
    select(9, [3 7], [], [], {0, 0}) = 0 (Timeout)
    sendto(5, "<27>Jun 1 12:12:14 puppet-master[47038]: Could not find
    scope for bob::postfix at /etc/puppet/modules/bob/manifests/init.pp:2 on
    node bob.maramaros.chemaxon.local", 163, MSG_NOSIGNAL, NULL, 0) = 163
    select(9, [3 7], [], [], {0, 0}) = 0 (Timeout)


    If I create a symlink for that directory, it finds it, but still not good:

    getcwd("/", 200) = 2
    select(9, [3 7], [], [], {0, 0}) = 0 (Timeout)
    stat("/etc/puppet/modules/bob", {st_mode=S_IFDIR|0755, st_size=4096,
    ...}) = 0
    stat("/etc/puppet/modules/bob/metadata.json", 0x7fff452bd2a0) = -1
    ENOENT (No such file or directory)
    stat("/etc/puppet/modules/bob/manifests/init.pp", {st_mode=S_IFREG|0644,
    st_size=36, ...}) = 0
    stat("/etc/puppet/modules/bob/manifests/init.rb", 0x7fff452bdc20) = -1
    ENOENT (No such file or directory)
    *lstat("/etc/puppet/modules/bob/manifests/bob/postfix.pp",
    {st_mode=S_IFREG|0644, st_size=130, ...}) = 0*
    lstat("/etc/puppet/modules/bob/manifests/bob/postfix.rb",
    0x7fff452bdf70) = -1 ENOENT (No such file or directory)
    *stat("/etc/puppet/modules/bob/manifests/bob/postfix.pp",
    {st_mode=S_IFREG|0644, st_size=130, ...}) = 0*
    select(9, [3 7], [], [], {0, 0}) = 0 (Timeout)
    select(9, [3 7], [], [], {0, 0}) = 0 (Timeout)
    rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
    getcwd("/", 200) = 2
    select(9, [3 7], [], [], {0, 0}) = 0 (Timeout)
    stat("/etc/puppet/modules/bob", {st_mode=S_IFDIR|0755, st_size=4096,
    ...}) = 0
    stat("/etc/puppet/modules/bob/metadata.json", 0x7fff452bd2a0) = -1
    ENOENT (No such file or directory)
    stat("/etc/puppet/modules/bob/manifests/init.pp", {st_mode=S_IFREG|0644,
    st_size=36, ...}) = 0
    stat("/etc/puppet/modules/bob/manifests/init.rb", 0x7fff452bdc20) = -1
    ENOENT (No such file or directory)
    lstat("/etc/puppet/modules/bob/manifests/bob.pp", 0x7fff452be0c0) = -1
    ENOENT (No such file or directory)
    lstat("/etc/puppet/modules/bob/manifests/bob.rb", 0x7fff452be0c0) = -1
    ENOENT (No such file or directory)
    select(9, [3 7], [], [], {0, 0}) = 0 (Timeout)
    rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
    getcwd("/", 200) = 2
    select(9, [3 7], [], [], {0, 0}) = 0 (Timeout)
    stat("/etc/puppet/modules/bob", {st_mode=S_IFDIR|0755, st_size=4096,
    ...}) = 0
    stat("/etc/puppet/modules/bob/metadata.json", 0x7fff452bd2a0) = -1
    ENOENT (No such file or directory)
    stat("/etc/puppet/modules/bob/manifests/init.pp", {st_mode=S_IFREG|0644,
    st_size=36, ...}) = 0
    stat("/etc/puppet/modules/bob/manifests/init.rb", 0x7fff452bdc20) = -1
    ENOENT (No such file or directory)
    lstat("/etc/puppet/modules/bob/manifests/init.pp",
    {st_mode=S_IFREG|0644, st_size=36, ...}) = 0
    lstat("/etc/puppet/modules/bob/manifests/init.rb", 0x7fff452be0c0) = -1
    ENOENT (No such file or directory)
    stat("/etc/puppet/modules/bob/manifests/init.pp", {st_mode=S_IFREG|0644,
    st_size=36, ...}) = 0



    I've no idea how bob.pp should look like.
    BTW, this is an Ubuntu 12.04 with default configuration.

    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Jcbollinger at Jun 1, 2012 at 2:34 pm

    On Jun 1, 5:29 am, Papp Tamas wrote:
    On 05/31/2012 03:22 PM, jcbollinger wrote:

    I suspect you have a problem either with paths or with permissions.
    I don't find anything related to this.
    Supposing you have not configured custom directories, your setup
    should look like this:
    <puppet base>
    L puppet.conf
    L manifests/
    L site.pp
    L modules/
    L bob/
    L manifests/
    L init.pp
    L postfix.pp
    L postfix/
    L manifests/
    L init.pp
    That's true with slight modifications (eg.

    You didn't say what those modifications were, but probably they are
    what's killing you. For the modules and classes in this example,
    Puppet's autoloader expects *exactly* the layout I showed.

    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.

    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) [...]
    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.

    [...]
    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.


    John

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Papp Tamas at Jun 8, 2012 at 3:09 pm
    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Jcbollinger at Jun 11, 2012 at 2:22 pm

    On Jun 8, 10:09 am, Papp Tamas wrote:
    On 06/01/2012 04:34 PM, jcbollinger wrote:

    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 .

    It should not be a problem for site.pp to import a "node.pp" manifest.

    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

    My bad. Puppet is indeed looking in the wrong directory there.

    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.

    You are right about that.

    [... directory tree ...]

    That layout looks ok, though some of the characters didn't translate.
    *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"

    }

    Having that import statement inside your node declaration looks
    suspicious. Do you intend it to mean something different there than
    it would outside the node block, either immediately before or
    immediately after? If so, then it may not mean what you think it
    means. I recommend you move it outside the block, though I would be
    surprised if that solved the problem you asked about.

    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.

    Other than the oddly-placed "import" statement, I don't a problem
    either. I recommend you try to reduce all this to the minimum
    possible manifest set that will reproduce the problem. Odds are that
    the process of doing so will reveal the problem to you, but if it
    doesn't then what's left will be easier for the rest of us to analyze.


    John

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Marc Lucke at Aug 23, 2012 at 3:45 am
    I note that the check_https command that the puppet module generates is check_http -H $HOSTNAME -S $ARG1

    I'd like to specify $ARG1 so that so that I can check return strings, check SSL certificates et al. but I couldn't find any way to do it other than nagios_command which seems pretty wasteful

    Is it possible to set $ARG1 ?


    Marc

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Peter Brown at Aug 23, 2012 at 4:18 am
    Hi,

    $ARG1 in a nagios check is what comes after the first ! in the check.
    Which module are you using to generate your nagios setup?
    On 23 August 2012 13:44, Marc Lucke wrote:
    I note that the check_https command that the puppet module generates is check_http -H $HOSTNAME -S $ARG1

    I'd like to specify $ARG1 so that so that I can check return strings, check SSL certificates et al. but I couldn't find any way to do it other than nagios_command which seems pretty wasteful

    Is it possible to set $ARG1 ?


    Marc

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Marc Lucke at Aug 23, 2012 at 4:36 am
    I inherited the module so I'm not sure. I did see some check_commands with ! and was wondering; I didn't connect the dots.

    Thank you!! :)
    On 23/08/2012, at 2:18 PM, Peter Brown wrote:

    Hi,

    $ARG1 in a nagios check is what comes after the first ! in the check.
    Which module are you using to generate your nagios setup?
    On 23 August 2012 13:44, Marc Lucke wrote:
    I note that the check_https command that the puppet module generates is check_http -H $HOSTNAME -S $ARG1

    I'd like to specify $ARG1 so that so that I can check return strings, check SSL certificates et al. but I couldn't find any way to do it other than nagios_command which seems pretty wasteful

    Is it possible to set $ARG1 ?


    Marc

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Peter Brown at Aug 24, 2012 at 4:12 am
    No worries.
    Glad you got it working.
    On 23 August 2012 14:35, Marc Lucke wrote:
    I inherited the module so I'm not sure. I did see some check_commands with ! and was wondering; I didn't connect the dots.

    Thank you!! :)
    On 23/08/2012, at 2:18 PM, Peter Brown wrote:

    Hi,

    $ARG1 in a nagios check is what comes after the first ! in the check.
    Which module are you using to generate your nagios setup?
    On 23 August 2012 13:44, Marc Lucke wrote:
    I note that the check_https command that the puppet module generates is check_http -H $HOSTNAME -S $ARG1

    I'd like to specify $ARG1 so that so that I can check return strings, check SSL certificates et al. but I couldn't find any way to do it other than nagios_command which seems pretty wasteful

    Is it possible to set $ARG1 ?


    Marc

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedMay 30, '12 at 1:32p
activeAug 24, '12 at 4:12a
posts13
users5
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase