Dan Hyatt
2013-Jun-06 15:11 UTC
[Puppet Users] simple running puppet module against a client
I am struggling with the documentation, it is a nice read but hard for me
to translate into practical application.
For instance, I am simply trying to run a module against a client.
Once I figure this out, I can move forward..
I have my module, and it works. I have it getting the file from
puppet:///module/files/myfiles and writing them to the local server.
NOW I want to check the master file against the file on server11, and if it
is not there overwrite.
In other words, I want to run module "move file" against server11
I believe I have server11 in appserver class
How do I get puppet to run the module against another server?
How do I get puppet console to run the module at my request (rather then
automatically)
Here is the documentation that has me confused.
Node Definitions
Node definitions work almost exactly like class definitions:
# Append this at the bottom of /etc/puppetlabs/puppet/manifests/site.pp
node ''agent1.localdomain'' {
# Note the quotes around the name! Node names can have characters that
# aren''t legal for class names, so you can''t always use
bare, unquoted
# strings like we do with classes.
# Any resource or class declaration can go inside here. For now:
include apache
class {''ntp'':
enable => false,
ensure => stopped,
}
}
But unlike classes, nodes are declared automatically, based on the *name*of the
node whose catalog is being compiled.
*Only one* node definition will get added to a given catalog, and any other
node definitions are effectively hidden.
An agent node’s *name* is almost always read from its certname
setting<http://docs.puppetlabs.com/references/latest/configuration.html#certname>,
which is set at install time but can be changed later. The certname is
usually (but not always) the node’s fully qualified domain name.
More on node definitions later, as well as alternate ways to assign classes
to a node.
--
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 puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
Nick Fagerlund
2013-Jun-06 18:43 UTC
[Puppet Users] Re: simple running puppet module against a client
Yeah that section of the docs needs work. Sorry. I''ll try and tell you
what
you need to know:
* There''s not a built-in way to interactively reach out to a remote
node
and apply just one class to it. That''s not how Puppet thinks of the
world:
it thinks it''s managing a complete steady state on each node, not doing
one-off tasks. So instead, you have to assign the class to the node, then
have the node do a normal puppet agent run.
* You can trigger puppet agent runs interactively using the Live Management
page in the Puppet Enterprise console. I assume you''re using a Puppet
Enterprise setup here? Go to live mgmt, go to "control puppet,"
highlight
just the node you want, and tell it to run Puppet. In a few minutes, a
report from that run will appear in the node''s page in the console, and
you
can see how it did.
* To assign a class to a node, you have several options.
- If you put `include myclass` in /etc/puppetlabs/puppet/manifests/site.pp,
OUTSIDE of any node definition, than it will be assigned to EVERY node,
including the one you''re aiming for.
- If you put `include myclass` inside a node definition in site.pp, it will
be assigned to only the target node:
node server11 {
include myclass
}
- You can do it in the console: hit "add class" in the left sidebar,
type
the name of the class and hit enter, navigate to the node''s page, and
assign the class to it as described here:
http://docs.puppetlabs.com/pe/latest/console_classes_groups.html#assigning-a-class-to-a-node
In all of these cases, you still need to trigger (or wait for) a full
puppet agent run.
Hope that helps.
N
On Thursday, June 6, 2013 8:11:51 AM UTC-7, Dan Hyatt
wrote:>
> I am struggling with the documentation, it is a nice read but hard for me
> to translate into practical application.
> For instance, I am simply trying to run a module against a client.
> Once I figure this out, I can move forward..
>
> I have my module, and it works. I have it getting the file from
> puppet:///module/files/myfiles and writing them to the local server.
> NOW I want to check the master file against the file on server11, and if
> it is not there overwrite.
>
> In other words, I want to run module "move file" against server11
>
> I believe I have server11 in appserver class
>
> How do I get puppet to run the module against another server?
> How do I get puppet console to run the module at my request (rather then
> automatically)
>
>
>
> Here is the documentation that has me confused.
>
> Node Definitions
>
> Node definitions work almost exactly like class definitions:
>
> # Append this at the bottom of /etc/puppetlabs/puppet/manifests/site.pp
>
> node ''agent1.localdomain'' {
>
> # Note the quotes around the name! Node names can have characters
that
> # aren''t legal for class names, so you can''t always
use bare, unquoted
> # strings like we do with classes.
>
> # Any resource or class declaration can go inside here. For now:
>
> include apache
>
> class {''ntp'':
> enable => false,
> ensure => stopped,
> }
>
> }
>
> But unlike classes, nodes are declared automatically, based on the
*name*of the node whose catalog is being compiled.
> *Only one* node definition will get added to a given catalog, and any
> other node definitions are effectively hidden.
>
> An agent node’s *name* is almost always read from its certname
setting<http://docs.puppetlabs.com/references/latest/configuration.html#certname>,
> which is set at install time but can be changed later. The certname is
> usually (but not always) the node’s fully qualified domain name.
>
> More on node definitions later, as well as alternate ways to assign
> classes to a node.
>
--
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 puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.