Questions regarding Puppet with httpd.conf

351 views
Skip to first unread message

the_fonz

unread,
Feb 8, 2012, 6:46:08 PM2/8/12
to Puppet Users
Hi,

I'd like to start using Puppet to manage an httpd.conf file across
several webservers. I have a Puppet server and client config setup and
have followed a couple of simple "How To's" to get off the ground. I'm
syncing a couple of files and ensuring certain packages are installed
etc on the client.

Now, here 's where I'm stuck... what happens if the httpd.conf file is
slightly different on each webserver? For example, each httpd.conf
file has multiple Virtual Host entries that are defined by the
webservers IP. <VirtualHost 10.3.200.131:80> for example.

How do I manage one httpd.conf file from the Puppet server given the
VirtualHost IP's will be different on each server? I guess I just want
to "taylor" the http.conf file for each weberserver but manage it from
the Puppet Server.

If anyone can give me a few pointers it would be appreciated.

Thanks,

Michael Stahnke

unread,
Feb 8, 2012, 8:56:21 PM2/8/12
to puppet...@googlegroups.com
On Wed, Feb 8, 2012 at 3:46 PM, the_fonz <tim_st...@hotmail.com> wrote:
> Hi,
>
> I'd like to start using Puppet to manage an httpd.conf file across
> several webservers. I have a Puppet server and client config setup and
> have followed a couple of simple "How To's" to get off the ground. I'm
> syncing a couple of files and ensuring certain packages are installed
> etc on the client.
>
> Now, here 's where I'm stuck... what happens if the httpd.conf file is
> slightly different on each webserver? For example, each httpd.conf
> file has multiple Virtual Host entries that are defined by the
> webservers IP. <VirtualHost 10.3.200.131:80> for example.

You'll want to look at http://docs.puppetlabs.com/guides/templating.html

You can use a template and have it fill in variables. Luckily, the
host's IP address is already available as a variable via facter.


>
> How do I manage one httpd.conf file from the Puppet server given the
> VirtualHost IP's will be different on each server? I guess I just want
> to "taylor" the http.conf file for each weberserver but manage it from
> the Puppet Server.
>
> If anyone can give me a few pointers it would be appreciated.
>
> Thanks,
>

> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
>

Brian Gallew

unread,
Feb 9, 2012, 12:45:52 AM2/9/12
to puppet...@googlegroups.com
Further, you should remember that there is no reason for an Apache configuration to be monolithic.  Apache is perfectly happy to have a bunch of files to include.  Throw in a naming convention (e.g. files named foo.ssl will be included by my SSL config file) and you've got some real flexibility.

Russell Van Tassell

unread,
Feb 9, 2012, 4:34:01 PM2/9/12
to puppet...@googlegroups.com
On Wed, Feb 8, 2012 at 3:46 PM, the_fonz <tim_st...@hotmail.com> wrote:
Hi,

I'd like to start using Puppet to manage an httpd.conf file across
several webservers.

Others have already correctly steered you towards templates for this sort of thing, but I have one aside...
 
each httpd.conf
file has multiple Virtual Host entries that are defined by the
webservers IP. <VirtualHost 10.3.200.131:80> for example.

Just like to point out that, unless you have specific reason for binding apache only to one interface, it's perfectly acceptable to throw wildcards in to these declarations (ie. software virtual hosting versus hardware). It has the added effect of simplifying configurations (though, as I hinted at previously, there may be other security related implications or similar that prevents you from doing this sort of thing).


the_fonz

unread,
Feb 10, 2012, 4:44:59 AM2/10/12
to Puppet Users
Thanks for the replies, they were very helpful. I'll post back if I
have any problems.

On Feb 9, 5:45 am, Brian Gallew <g...@gallew.org> wrote:
> Further, you should remember that there is no reason for an Apache
> configuration to be monolithic.  Apache is perfectly happy to have a bunch
> of files to include.  Throw in a naming convention (e.g. files named
> foo.ssl will be included by my SSL config file) and you've got some real
> flexibility.
>
> On Wed, Feb 8, 2012 at 5:56 PM, Michael Stahnke <stah...@puppetlabs.com>wrote:
>
>
>
>
>
>
>
> > On Wed, Feb 8, 2012 at 3:46 PM, the_fonz <tim_stockf...@hotmail.com>
> > wrote:
> > > Hi,
>
> > > I'd like to start using Puppet to manage an httpd.conf file across
> > > several webservers. I have a Puppet server and client config setup and
> > > have followed a couple of simple "How To's" to get off the ground. I'm
> > > syncing a couple of files and ensuring certain packages are installed
> > > etc on the client.
>
> > > Now, here 's where I'm stuck... what happens if the httpd.conf file is
> > > slightly different on each webserver? For example, each httpd.conf
> > > file has multiple Virtual Host entries that are defined by the
> > > webservers IP. <VirtualHost 10.3.200.131:80> for example.
>
> > You'll want to look athttp://docs.puppetlabs.com/guides/templating.html
>
> > You can use a template and have it fill in variables.  Luckily, the
> > host's IP address is already available as a variable via facter.
>
> > > How do I manage one httpd.conf file from the Puppet server given the
> > > VirtualHost IP's will be different on each server? I guess I just want
> > > to "taylor" the http.conf file for each weberserver but manage it from
> > > the Puppet Server.
>
> > > If anyone can give me a few pointers it would be appreciated.
>
> > > Thanks,
>
> > > --
> > > You received this message because you are subscribed to the Google
> > Groups "Puppet Users" group.> > To post to this group, send email topuppe...@googlegroups.com.
> > > To unsubscribe from this group, send email to>puppet-users...@googlegroups.com.
> > > For more options, visit this group at
> >http://groups.google.com/group/puppet-users?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Puppet Users" group.> To post to this group, send email topuppe...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages