FAQ
hi,

Specifically I would like to have something like top scope resource
defaults so as to enforce,... well,... default behaviors across our modules

for example, with the exec type: Exec { logoutput => on_failure }

However our puppet code base is rather extensive and the responsibility for
it is "distributed", so I was wondering if there was a way to set those up
in one place and affect all class and type instances across our deployments.

The only way I can think I can think of would be to declare it at the top
level of the site.pp but I would rather have in a module (we have base
modules which get installed on every nodes)

is there any other option?

thanks you,
david.

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Joe at Mar 18, 2013 at 4:59 pm
    There's no way to have the defaults in the top scope if you put them in a
    module. Module implies class, which implies a scope under top scope.

    Site.pp would be the appropriate place, but keep in mind there is no way to
    "enforce" these defaults.

    There's a fairly common practice these days of setting resource defaults in
    a class when you have multiple resources with the same parameters. I
    believe setting any defaults at a lower scope will cause puppet to ignore
    the ones set at the higher scope (not to merge them), so it's likely
    there's not a good solution to what you're trying to do short of a commit
    hook that denies any defaults outside site.pp.
    On Monday, March 18, 2013 6:01:10 AM UTC-6, [email protected] wrote:

    hi,

    Specifically I would like to have something like top scope resource
    defaults so as to enforce,... well,... default behaviors across our modules

    for example, with the exec type: Exec { logoutput => on_failure }

    However our puppet code base is rather extensive and the responsibility
    for it is "distributed", so I was wondering if there was a way to set those
    up in one place and affect all class and type instances across our
    deployments.

    The only way I can think I can think of would be to declare it at the top
    level of the site.pp but I would rather have in a module (we have base
    modules which get installed on every nodes)

    is there any other option?

    thanks you,
    david.
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
    To post to this group, send email to [email protected].
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Jcbollinger at Mar 19, 2013 at 3:34 pm

    On Monday, March 18, 2013 7:01:10 AM UTC-5, [email protected] wrote:
    hi,

    Specifically I would like to have something like top scope resource
    defaults so as to enforce,... well,... default behaviors across our modules

    for example, with the exec type: Exec { logoutput => on_failure }

    However our puppet code base is rather extensive and the responsibility
    for it is "distributed", so I was wondering if there was a way to set those
    up in one place and affect all class and type instances across our
    deployments.

    The only way I can think I can think of would be to declare it at the top
    level of the site.pp but I would rather have in a module (we have base
    modules which get installed on every nodes)

    is there any other option?
    If you need a declaration to apply globally, then it must, perforce, appear
    at top scope. Moreover, it is safest and clearest for it to appear before
    other declarations, such as node blocks.

    Although it is possible and valid to make top-scope declarations in any
    manifest, putting them outside the direct purview of site.pp produces
    issues revolving around when and even whether those declarations are
    parsed. So don't do that.

    What you can do, however, is put such declarations in a separate file, and
    'import' that file into site.pp. That's a common practice for node blocks,
    but they are just common a special case of top-scope declarations. The
    'import' function doesn't have many good uses any more, but this is exactly
    the sort of thing it's good and appropriate for.


    John

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
    To post to this group, send email to [email protected].
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedMar 18, '13 at 12:02p
activeMar 19, '13 at 3:34p
posts3
users3
websitepuppetlabs.com

3 users in discussion

David Eauee: 1 post Jcbollinger: 1 post Joe: 1 post

People

Translate

site design / logo © 2023 Grokbase