FAQ
Hi List,

Puppet Version: v2.7.13

Question - If I correctly setup multiple manifestdir's in the puppet.conf
file how can I import a node pp file located in a different directory tree
to site.pp?

My configuration information is below.

In my puppet.conf file I have setup an environment called "stable", within
this environment I have setup the manifestdir, modulepath and manifest
settings like so:

------------------------- (Begin Extract) --------------------------------

[stable]
*manifestdir*=/srv/puppetmaster/stable/manifests:*
/srv/puppetmaster/stable/site-nodes*
modulepath=/srv/puppetmaster/stable/modules:/srv/puppetmaster/stable/site-modules
*manifest=/srv/puppetmaster/stable/manifests/site.pp*

------------------------- (End Extract) --------------------------------


If I run a config print against the manifestdir against the
stable environment it outputs the correct paths:

------------------------- (Begin Extract) --------------------------------
root@core ~# *puppet config print --environment stable manifestdir*
/srv/puppetmaster/stable/manifests:/srv/puppetmaster/stable/site-nodes
------------------------- (End Extract) --------------------------------

In my site.pp file I have

------------------------- (Begin Extract) --------------------------------
root@core stable/manifests# pwd
/srv/puppetmaster/stable/manifests

root@core stable/manifests# cat site.pp
Exec { path =>
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" }

import "core.mob.ifoley.local.pp"

node default {

fail ("

Please create a node file for this computer !

")
}
------------------------- (End Extract) --------------------------------

In my core.mob.ifoley.local pp file I have

------------------------- (Begin Extract) --------------------------------

root@core stable/site-nodes# pwd
/srv/puppetmaster/stable/site-nodes

root@core stable/site-nodes# cat core.mob.ifoley.local.pp
node 'core.mob.ifoley.local' {
notice("Inside core pp file")
}


------------------------- (End Extract) --------------------------------

On the puppet client when I run the Puppet apply it gives the below output.

------------------------- (Begin Extract) --------------------------------

root@core ~# puppet agent --server puppet.mob.ifoley.local --environment
stable --no-daemonize --verbose --onetime
info: Retrieving plugin
info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb
info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb
info: Loading facts in
/etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb
info: Loading facts in
/etc/puppet/modules/concat/lib/facter/concat_basedir.rb
info: Loading facts in /var/lib/puppet/lib/facter/concat_basedir.rb
info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
*err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Could not parse for environment stable: No file(s) found for import of
'core.mob.ifoley.local.pp' at /srv/puppetmaster/stable/manifests/site.pp:8
on node core.mob.ifoley.local*
info: Not using expired catalog for core.mob.ifoley.local from cache;
expired at Wed Apr 25 08:22:31 +1000 2012
notice: Using cached catalog
err: Could not retrieve catalog; skipping run

------------------------- (End Extract) --------------------------------

If I move the core.mob.ifoley.local.pp file into the same directory as the
site.pp file then it correctly imports the file and spits out the notice
message.

Am I doing something wrong?

Any help would be greatly appricated.

Thanks,

Peter.

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

  • Luke Bigum at Apr 25, 2012 at 7:56 am
    I don't think $manifestdir will take a directory list, only a single
    directory. From the 2.7.12 docs:

    [root@puppet ~]# puppet --genconf | grep -B2 -A1 manifestdir

    # The entry-point manifest for puppet master.
    # The default value is '$manifestdir/site.pp'.
    manifest = /etc/puppet/manifests/site.pp
    --
    # Where puppet master looks for its manifests.
    # The default value is '$confdir/manifests'.
    manifestdir = /etc/puppet/manifests

    Is this your directory structure?

    /srv/puppetmaster/stable/manifests/
    /srv/puppetmaster/stable/manifests/site.pp
    /srv/puppetmaster/stable/site-nodes/
    /srv/puppetmaster/stable/site-nodes/core.mob.ifoley.local.pp

    The import function is relative, so you could try do this:

    import "../site-nodes/*.pp"

    Or move the site-nodes directory under stable/manifests/ and do this:

    import "site-nodes/*.pp"
    On 25/04/12 08:26, Peter Foley wrote:
    Hi List,

    Puppet Version: v2.7.13

    Question - If I correctly setup multiple manifestdir's in the
    puppet.conf file how can I import a node pp file located in a
    different directory tree to site.pp?

    My configuration information is below.

    In my puppet.conf file I have setup an environment called "stable",
    within this environment I have setup the manifestdir, modulepath and
    manifest settings like so:

    ------------------------- (Begin Extract) --------------------------------

    [stable]
    *manifestdir*=/srv/puppetmaster/stable/manifests:*/srv/puppetmaster/stable/site-nodes*
    modulepath=/srv/puppetmaster/stable/modules:/srv/puppetmaster/stable/site-modules
    *manifest=/srv/puppetmaster/stable/manifests/site.pp*

    ------------------------- (End Extract)
    --------------------------------


    If I run a config print against the manifestdir against the
    stable environment it outputs the correct paths:

    ------------------------- (Begin Extract)
    --------------------------------
    root@core ~# *puppet config print --environment stable manifestdir*
    /srv/puppetmaster/stable/manifests:/srv/puppetmaster/stable/site-nodes
    ------------------------- (End Extract)
    --------------------------------

    In my site.pp file I have

    ------------------------- (Begin Extract)
    --------------------------------
    root@core stable/manifests# pwd
    /srv/puppetmaster/stable/manifests

    root@core stable/manifests# cat site.pp
    Exec { path =>
    "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" }

    import "core.mob.ifoley.local.pp"

    node default {

    fail ("

    Please create a node file for this computer !

    ")
    }
    ------------------------- (End Extract)
    --------------------------------

    In my core.mob.ifoley.local pp file I have

    ------------------------- (Begin Extract)
    --------------------------------

    root@core stable/site-nodes# pwd
    /srv/puppetmaster/stable/site-nodes

    root@core stable/site-nodes# cat core.mob.ifoley.local.pp
    node 'core.mob.ifoley.local' {
    notice("Inside core pp file")
    }


    ------------------------- (End Extract)
    --------------------------------

    On the puppet client when I run the Puppet apply it gives the below
    output.

    ------------------------- (Begin Extract) --------------------------------

    root@core ~# puppet agent --server puppet.mob.ifoley.local
    --environment stable --no-daemonize --verbose --onetime
    info: Retrieving plugin
    info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb
    info: Loading facts in
    /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb
    info: Loading facts in
    /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb
    info: Loading facts in
    /etc/puppet/modules/concat/lib/facter/concat_basedir.rb
    info: Loading facts in /var/lib/puppet/lib/facter/concat_basedir.rb
    info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
    info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
    info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
    *err: Could not retrieve catalog from remote server: Error 400 on
    SERVER: Could not parse for environment stable: No file(s) found for
    import of 'core.mob.ifoley.local.pp' at
    /srv/puppetmaster/stable/manifests/site.pp:8 on node
    core.mob.ifoley.local*
    info: Not using expired catalog for core.mob.ifoley.local from cache;
    expired at Wed Apr 25 08:22:31 +1000 2012
    notice: Using cached catalog
    err: Could not retrieve catalog; skipping run

    ------------------------- (End Extract)
    --------------------------------

    If I move the core.mob.ifoley.local.pp file into the same directory as
    the site.pp file then it correctly imports the file and spits out the
    notice message.

    Am I doing something wrong?

    Any help would be greatly appricated.

    Thanks,

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

    --
    Luke Bigum

    Information Systems
    Ph: +44 (0) 20 3192 2520
    luke.bigum@lmax.com | http://www.lmax.com
    LMAX, Yellow Building, 1A Nicholas Road, London W11 4AN



    FX and CFDs are leveraged products that can result in losses exceeding
    your deposit. They are not suitable for everyone so please ensure you
    fully understand the risks involved. The information in this email is not
    directed at residents of the United States of America or any other
    jurisdiction where trading in CFDs and/or FX is restricted or prohibited
    by local laws or regulations.

    The information in this email and any attachment is confidential and is
    intended only for the named recipient(s). The email may not be disclosed
    or used by any person other than the addressee, nor may it be copied in
    any way. If you are not the intended recipient please notify the sender
    immediately and delete any copies of this message. Any unauthorised
    copying, disclosure or distribution of the material in this e-mail is
    strictly forbidden.

    LMAX operates a multilateral trading facility. Authorised and regulated
    by the Financial Services Authority (firm registration number 509778) and
    is registered in England and Wales (number 06505809).
    Our registered address is Yellow Building, 1A Nicholas Road, London, W11
    4AN.

    --
    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 at Apr 25, 2012 at 10:59 am
    Hi Luke,

    Thanks for the reply. That makes sense now ... my issue was thinking
    it had the same behavour as the modulepath setting.

    I might have to re-think how I was going to manage multiple
    environments and multiple users using the same or different
    environments.

    For some background on what I was thinking I was planning on having:

    1. A Repo(s) to manage settings that would be common across
    environments (with minor tweaks managed by site settings)
    /srv/puppetmaster/stable/manifests/
    /srv/puppetmaster/stable/modules/

    2. A Repo(s) that contains information that defines how an
    environments nodes are setup and run
    /srv/puppetmaster/stable/site-nodes/
    /srv/puppetmaster/stable/site-modules/

    I will just have to think a it harder on how to achieve this ...
    On Apr 25, 5:56 pm, Luke Bigum wrote:
    I don't think $manifestdir will take a directory list, only a single
    directory. From the 2.7.12 docs:

    [root@puppet ~]# puppet --genconf | grep -B2 -A1 manifestdir

    # The entry-point manifest for puppet master.
    # The default value is '$manifestdir/site.pp'.
    manifest = /etc/puppet/manifests/site.pp
    --
    # Where puppet master looks for its manifests.
    # The default value is '$confdir/manifests'.
    manifestdir = /etc/puppet/manifests

    Is this your directory structure?

    /srv/puppetmaster/stable/manifests/
    /srv/puppetmaster/stable/manifests/site.pp
    /srv/puppetmaster/stable/site-nodes/
    /srv/puppetmaster/stable/site-nodes/core.mob.ifoley.local.pp
    Yes this is correct.
    The import function is relative, so you could try do this:

    import "../site-nodes/*.pp"

    Or move the site-nodes directory under stable/manifests/ and do this:

    import "site-nodes/*.pp"
    As mentioned above I will have a think about how I want things setup
    now.
    --
    Luke Bigum

    Information Systems
    Ph: +44 (0) 20 3192 2520
    luke.bi...@lmax.com |http://www.lmax.com
    LMAX, Yellow Building, 1A Nicholas Road, London W11 4AN
    Thanks for your help.

    Peter.

    --
    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 25, '12 at 7:26a
activeApr 25, '12 at 10:59a
posts3
users2
websitepuppetlabs.com

2 users in discussion

Peter: 2 posts Luke Bigum: 1 post

People

Translate

site design / logo © 2022 Grokbase