On Feb 27, 5:42 am, linuxbsdfreak <linuxbsdfr...@gmail.com>
wrote:> Hi ,
>
> I am using tags according to environments Eg: prd_env and stg_env
>
> How do i implement a default node Eg:
>
> node default inherits basenode {
> tag("prd_eu")|("stg_eu"))
> include general
>
> }
>
> The above does not work.
I suppose it gives you a syntax error compiling the catalog. The
above contains unbalanced parentheses, and even beyond that does not
look syntactically correct -- the arguments to the ''tag''
function
should be a comma-separated list.
In any event, the ''tag'' function is documented to add the
specified
tag(s) to the *class or definition* containing the function call.
Node declarations are neither classes nor definitions, so even if
fixing the syntax got it working you would be unwisely relying on an
undocumented feature.
>
> I invoke the puppe agent
>
> puppet agent --test --noop --server=puppetmaster.domain.local --
> tags=prd_env|stg_env
Furthermore, the tags you are specifying to the agent do not match the
ones you are trying to declare in your manifest, so even if everything
else were working you would need to sort that out.
> Any ideas how i can allow both the env''s to use the default node.?
All your environments will use your default node in any event,
whenever no more specific node declaration matches. The tags don''t
come into play at all in that analysis. What they do is allow you to
filter the classes and resources that otherwise are declared for the
node, keeping only those that bear the chosen tag(s). Perhaps, then,
what you want is to declare the desired tags in class
''general'':
class general {
tag(''prd_env'', ''stg_env'')
# ...
}
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.