|
Denmat |
at May 24, 2013 at 6:51 am
|
⇧ |
| |
Hi Dan,
so first you will need to layout your puppet directories like so:
.
├── manifests
│ └── site.pp
└── modules
└── my_module
├── files
│ └── my_file
├── manifests
│ └── init.pp
└── templates
└── a_template.erb
In site.pp above you can add something like:
node server1 {
include my_module
}
Or you could do something like this:
node default {
include my_module
}
node server1 inherits default { }
Now default could be named 'webservers', 'dbservers' or whatever group of
servers you want.
You can even do something like:
node /server\d+/ {
include my_module
}
Here we are just including my_module for all nodes named server1 or 2 or N.
Now there are smarter ways to layout your node definitions and you wouldn't
normally include them in the the site.pp but this will give you the idea to
start off with - you can put them into a separate nodes.pp file(s) or into
something like a Hiera data structure. Anyway, have a look here for more
detail on node definitions.
http://docs.puppetlabs.com/puppet/3/reference/lang_node_definitions.htmlInside your module you might want to define what servers get what based on
things like facts. If so then this might give you some pointers too:
http://docs.puppetlabs.com/puppet/3/reference/lang_conditional.htmlHTH
Den
On Fri, May 24, 2013 at 4:32 AM, Dan Hyatt wrote:Hi all,
How from the master server do I push a file to a client server (server
group of 3-4 servers)?
I know I saw it in the documentation, but now all I can find is the
templates which is in next steps, unless it is easier to setup a templete
to push out to a small set of servers.
Been reading all the puppet documentation I can find. I googled it (no
luck) In between getting puppet vm and getting my permanent VMWare license,
so it could be in there.
The simple thing I need to do for now is to be able to point at a client
server to push the files out to the clients.
My POC and initial need is to just be able to push our configuation files
and scripts to the correct servers. Often only 3-4 files dependant per
server type (JBOSS, Apache, and various apps), and making sure if anyone
changes those files on the client it is overwritten with the standard file.
My test module is:
file { 'newfile':
ensure => present,
#path => '/home/daniel/newfile',
path => '/home/daniel/my_file',
owner => 'daniel',
group => 'artesia',
mode => 0640,
#source => '/etc/puppetlabs/puppet/modules/my_module/my_file',
source => 'puppet:///modules/my_module/my_file',
}
--
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. --
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.