FAQ
Hello!
I'm migrating from an older version of puppet (puppet --version =
0.25.4) to 2.6.2.

The current directory structure of puppet is:

puppet
---manifest
---site.pp
---classes

---<whole bunch of .pp files,no sub directories, no
init.pp, not being detected>
---modules

---<whole buch of modules, able to be imported>

An example of one of the clasess/*.pp files is:
# Software required for "core" servers as per the service catalogue
# This is in addition to base software which is the minimum for a
running server

#
class admin_tools {
package { "screen": ensure => latest }
package { "lynx": ensure => latest }
package { "lsscsi": ensure => latest }
package { "dosfstools": ensure => latest }
}


The problem I'm having is puppet --test gives me:

err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Could not parse for environment production: No file(s) found for import
of 'classes/*.pp' at /etc/puppet/manifests/site.pp:13 on node
zvsv02.opus.co.nz

My site.pp file looks like:
# Root manifest file. Must exist; everything gets included from here.
# Also includes some root level configuration (file buckets etc)

#NB: No default "node". If a client doesn't match, we want to know
about it, not carry on blithely

import "common"
import "classes/*.pp"

<bunch of declared nodes>

I'm confident the nodes are properly formatted so I have committed them.
The the problem I find is if I comment out import "classes/*.pp" then I
don't get the error about importing the classes/*.pp, but then the nodes
can't import the .pp files that are located inside the classes directory
because it hasn't been imported.
So I guess my question is, how can I get puppet to import all these .pp
files (which I assume are classes) so that nodes can find them?

--
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

  • Jcbollinger at Apr 20, 2012 at 1:48 pm

    On Apr 19, 7:00 pm, Gino Lisignoli wrote:
    Hello!
    I'm migrating from an older version of puppet (puppet --version =
    0.25.4) to 2.6.2.

    The current directory structure of puppet is:

    puppet
    ---manifest
    ---site.pp
    ---classes

    ---<whole bunch of .pp files,no sub directories, no
    init.pp, not being detected>
    ---modules

    ---<whole buch of modules, able to be imported>
    An example of one of the clasess/*.pp files is:
    # Software required for "core" servers as per the service catalogue
    # This is in addition to base software which is the minimum for a
    running server

    #
    class admin_tools {
    package { "screen": ensure => latest }
    package { "lynx": ensure => latest }
    package { "lsscsi": ensure => latest }
    package { "dosfstools": ensure => latest }

    }

    The problem I'm having is puppet --test gives me:

    err: Could not retrieve catalog from remote server: Error 400 on SERVER:
    Could not parse for environment production: No file(s) found for import
    of 'classes/*.pp' at /etc/puppet/manifests/site.pp:13 on node
    zvsv02.opus.co.nz

    My site.pp file looks like:
    # Root manifest file.  Must exist; everything gets included from here.
    # Also includes some root level configuration (file buckets etc)

    #NB: No default "node".  If a client doesn't match, we want to know
    about it, not carry on blithely

    import "common"
    import "classes/*.pp"

    <bunch of declared nodes>

    I'm confident the nodes are properly formatted so I have committed them.
    The the problem I find is if I comment out import "classes/*.pp" then I
    don't get the error about importing the classes/*.pp, but then the nodes
    can't import the .pp files that are located inside the classes directory
    because it hasn't been imported.
    So I guess my question is, how can I get puppet to import all these .pp
    files (which I assume are classes) so that nodes can find them?

    It is not obvious why 'import' is not finding the manifests you
    expect, but here are some possibilities:

    1) the 'classes' directory or the files therein are not accessible to
    the user/group as whom the puppet master is running

    2) the 'classes' directory or the files therein are not accessible to
    the the puppet master's SELinux security context (and you are running
    SELinux in enforcing mode)

    3) the 'classes' directory does not contain any files matching "*.pp"

    4) the 'classes' directory is not actually present

    Please also consider this excerpt from the Puppet Language Guide,
    however: "You should almost never use [import], as almost every use
    case for it has been replaced by the module autoloader. In particular,
    you should never use any import statements inside a module, as the
    behavior of import within autoloaded manifests is undefined."

    I'm not sure how new that text is, but the autoloader has worked
    substantially as it does now at least as far back as Puppet 0.24.8.


    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedApr 20, '12 at 12:00a
activeApr 20, '12 at 1:48p
posts2
users2
websitepuppetlabs.com

2 users in discussion

Jcbollinger: 1 post Gino Lisignoli: 1 post

People

Translate

site design / logo © 2022 Grokbase