Ben Ruset
2014-Jun-22 12:49 UTC
[Puppet Users] Puppet newbie, Apache vHosts, and trying to do it the right way
Alright, this is definitely a Puppet 101 question, and I am sure that the
Puppet docs have an answer for this and I am just dense and can't find it.
I'm trying to teach myself Puppet, with the goal of managing the VPS I run
with it. Additionally, when I get a better grasp on things, I want to
deploy it at work. So while my home deployment will be small, I want to
learn how to "do it right."
I have a vanilla Puppet server and an agent. Both are managed through
Puppet.
Right now, on my agent node, I'm configuring Apache. I've got code like
this in my nodes.pp:
###
node 'hostname' {
include 'ntp'
include 'sudo'
class { 'vim':
opt_misc =>
['nu','fo=tcq','nocompatible','modeline','tabstop=2','expandtab','softtabstop=2','shiftwidth=2','backspace=indent,eol,start'],
}
class { 'apache':
serveradmin => 'whatever',
}
apache::vhost{ 'www.example.com':
default_vhost => true,
docroot => '/var/www/html/www.example.com',
logroot => '/var/log/httpd/www.example.com',
access_log_file => 'access_log',
error_log_file => 'error_log',
override => 'all',
}
some more vhosts
...
}
###
It seems like best practice is to put all of these configs in some separate
directory/file so I could end up with something like:
###
node 'hostname' {
include 'ntp'
include 'sudo'
class { 'vim':
opt_misc => $std_vim_ops
}
include 'vhost1'
include 'vhost2'
}
###
Now I guess I can make modules for each vhost, but that doesn't seem right.
How would I go about doing this? (Bear in mind that my second block of code
is just a rough approximation and I don't really know the right way to
write out what I want to do.)
Thanks for your patience. I've been searching for answers and not really
understanding what I come up with.
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/41e9486d-c072-4e14-8ee6-d91804277f74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.