Manage Apache Vhosts

Hi All,

I'm kinda figuring out how to manage Apache Vhosts with Foreman and be able
to enable or disable them.

Normally you would have a site.pp with the following:

Simple vhost definition:

apache::vhost { 'site1.name.tld':
port => '80',
docroot => '/path/to/docroot1',
}

Simple vhost definition:

apache::vhost { 'site2.name.tld':
port => '80',
docroot => '/path/to/docroot2',
}

But as Foreman sees variables like docroot and port you can set or actually
needs to I'm confused how to manage the config for a Vhost.

At the moment things like docroot, port, etc are variables in my manifests
and I can set them in Foreman, but this is general for all Vhosts and not
specific per Vhost. This is not the biggest problem, but I also want to be
able to run a a2enmod and a2dismod per vhost that I want to enable or
disable, so I need to check this in my manifest. My idea was to create two
arrays, vhost_enabled and vhost_disabled and run through both arrays in
some way, the general config is ideal than maybe.

Are there people that have good examples for such purpose, or for other
config that need the same way of management ? Default puppet modules are
not ideal with Foreman have seen.

I hope someone can help me out here!

Thanks,

Matt

Most people would probably tell you to use hiera to store your Vhost data,
and have your manifests/modules use something like create_resources to
actually create the apache::vhost resource.

··· On Tue, Jul 15, 2014 at 7:41 AM, wrote:

Hi All,

I’m kinda figuring out how to manage Apache Vhosts with Foreman and be
able to enable or disable them.

Normally you would have a site.pp with the following:

Simple vhost definition:

apache::vhost { ‘site1.name.tld’:
port => ‘80’,
docroot => ‘/path/to/docroot1’,
}

Simple vhost definition:

apache::vhost { ‘site2.name.tld’:
port => ‘80’,
docroot => ‘/path/to/docroot2’,
}

But as Foreman sees variables like docroot and port you can set or
actually needs to I’m confused how to manage the config for a Vhost.

At the moment things like docroot, port, etc are variables in my manifests
and I can set them in Foreman, but this is general for all Vhosts and not
specific per Vhost. This is not the biggest problem, but I also want to be
able to run a a2enmod and a2dismod per vhost that I want to enable or
disable, so I need to check this in my manifest. My idea was to create two
arrays, vhost_enabled and vhost_disabled and run through both arrays in
some way, the general config is ideal than maybe.

Are there people that have good examples for such purpose, or for other
config that need the same way of management ? Default puppet modules are
not ideal with Foreman have seen.

I hope someone can help me out here!

Thanks,

Matt


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

I have defined vhosts as apache sub modules in the past then passed them as
variables to Forman that will drop in vhost files and link them.

Something like:

apache::vhost::foo
apache::vhost::bar
apache:vhost::ben

then I can declare which of them in Foreman I want, none, some or all on a
server. Works well for other apps that have a similar setup.

Jim

··· On 15 July 2014 12:41, wrote:

Hi All,

I’m kinda figuring out how to manage Apache Vhosts with Foreman and be
able to enable or disable them.

Normally you would have a site.pp with the following:

Simple vhost definition:

apache::vhost { ‘site1.name.tld’:
port => ‘80’,
docroot => ‘/path/to/docroot1’,
}

Simple vhost definition:

apache::vhost { ‘site2.name.tld’:
port => ‘80’,
docroot => ‘/path/to/docroot2’,
}

But as Foreman sees variables like docroot and port you can set or
actually needs to I’m confused how to manage the config for a Vhost.

At the moment things like docroot, port, etc are variables in my manifests
and I can set them in Foreman, but this is general for all Vhosts and not
specific per Vhost. This is not the biggest problem, but I also want to be
able to run a a2enmod and a2dismod per vhost that I want to enable or
disable, so I need to check this in my manifest. My idea was to create two
arrays, vhost_enabled and vhost_disabled and run through both arrays in
some way, the general config is ideal than maybe.

Are there people that have good examples for such purpose, or for other
config that need the same way of management ? Default puppet modules are
not ideal with Foreman have seen.

I hope someone can help me out here!

Thanks,

Matt


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Can you elaborate on using yaml to do this. I was setting up a set of
vhosts for a friend and needed something like this. I ended up just
avoiding it altogether and hand jamming things manually. :frowning:

Basically, I want to avoid other backends. So far Foreman and Puppet seem
to be all I need. I can provision to EC2, and to the local ESX cluster, and
I can do some basic modules. Problems comes when wanting to do stuff like
this, the docs are weak on using parameterization to pass stuff to various
modules I pull down from the forge.

··· On Tuesday, July 15, 2014 7:41:08 PM UTC+8, yamaka...@gmail.com wrote: > > Hi All, > > I'm kinda figuring out how to manage Apache Vhosts with Foreman and be > able to enable or disable them. > > Normally you would have a site.pp with the following: > > > # Simple vhost definition: > apache::vhost { 'site1.name.tld': > port => '80', > docroot => '/path/to/docroot1', > } > > # Simple vhost definition: > apache::vhost { 'site2.name.tld': > port => '80', > docroot => '/path/to/docroot2', > } > > > But as Foreman sees variables like docroot and port you can set or > actually needs to I'm confused how to manage the config for a Vhost. > > At the moment things like docroot, port, etc are variables in my manifests > and I can set them in Foreman, but this is general for all Vhosts and not > specific per Vhost. This is not the biggest problem, but I also want to be > able to run a a2enmod and a2dismod per vhost that I want to enable or > disable, so I need to check this in my manifest. My idea was to create two > arrays, vhost_enabled and vhost_disabled and run through both arrays in > some way, the general config is ideal than maybe. > > Are there people that have good examples for such purpose, or for other > config that need the same way of management ? Default puppet modules are > not ideal with Foreman have seen. > > I hope someone can help me out here! > > Thanks, > > Matt >

I'm not sold on hiera yet. Its seems really nice, but yet another layer on
top of already complex stuff…

R

··· On Tuesday, July 15, 2014 7:41:08 PM UTC+8, yamaka...@gmail.com wrote: > > Hi All, > > I'm kinda figuring out how to manage Apache Vhosts with Foreman and be > able to enable or disable them. > > Normally you would have a site.pp with the following: > > > # Simple vhost definition: > apache::vhost { 'site1.name.tld': > port => '80', > docroot => '/path/to/docroot1', > } > > # Simple vhost definition: > apache::vhost { 'site2.name.tld': > port => '80', > docroot => '/path/to/docroot2', > } > > > But as Foreman sees variables like docroot and port you can set or > actually needs to I'm confused how to manage the config for a Vhost. > > At the moment things like docroot, port, etc are variables in my manifests > and I can set them in Foreman, but this is general for all Vhosts and not > specific per Vhost. This is not the biggest problem, but I also want to be > able to run a a2enmod and a2dismod per vhost that I want to enable or > disable, so I need to check this in my manifest. My idea was to create two > arrays, vhost_enabled and vhost_disabled and run through both arrays in > some way, the general config is ideal than maybe. > > Are there people that have good examples for such purpose, or for other > config that need the same way of management ? Default puppet modules are > not ideal with Foreman have seen. > > I hope someone can help me out here! > > Thanks, > > Matt >

Hi Jim,

Thanks all, comparing to the Heira ideas, the idea was not to use that :slight_smile:

So you actually use a file per vhost ? Like site1.pp site2.pp site3.pp ?

Cheers,

Matt

··· Op dinsdag 15 juli 2014 14:29:58 UTC+2 schreef Paradoxbound: > > I have defined vhosts as apache sub modules in the past then passed them > as variables to Forman that will drop in vhost files and link them. > > Something like: > > apache::vhost::foo > apache::vhost::bar > apache:vhost::ben > > then I can declare which of them in Foreman I want, none, some or all on a > server. Works well for other apps that have a similar setup. > > Jim > > > On 15 July 2014 12:41, <yamaka...@gmail.com > wrote: > >> Hi All, >> >> I'm kinda figuring out how to manage Apache Vhosts with Foreman and be >> able to enable or disable them. >> >> Normally you would have a site.pp with the following: >> >> >> # Simple vhost definition: >> apache::vhost { 'site1.name.tld': >> port => '80', >> docroot => '/path/to/docroot1', >> } >> >> # Simple vhost definition: >> apache::vhost { 'site2.name.tld': >> port => '80', >> docroot => '/path/to/docroot2', >> } >> >> >> But as Foreman sees variables like docroot and port you can set or >> actually needs to I'm confused how to manage the config for a Vhost. >> >> At the moment things like docroot, port, etc are variables in my >> manifests and I can set them in Foreman, but this is general for all Vhosts >> and not specific per Vhost. This is not the biggest problem, but I also >> want to be able to run a a2enmod and a2dismod per vhost that I want to >> enable or disable, so I need to check this in my manifest. My idea was to >> create two arrays, vhost_enabled and vhost_disabled and run through both >> arrays in some way, the general config is ideal than maybe. >> >> Are there people that have good examples for such purpose, or for other >> config that need the same way of management ? Default puppet modules are >> not ideal with Foreman have seen. >> >> I hope someone can help me out here! >> >> Thanks, >> >> Matt >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Foreman users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to foreman-user...@googlegroups.com . >> To post to this group, send email to forema...@googlegroups.com >> . >> Visit this group at http://groups.google.com/group/foreman-users. >> For more options, visit https://groups.google.com/d/optout. >> > >

Foreman Heira support requires plugins and is another layer of complexity
for the user to learn if he is new as I suspect to both Foreman and Puppet.
He wants to see some results and not push deliverables back to learn
another tool. He can alway go back and refactor his code the situation gets
messy later.

Jim

··· On 15 July 2014 13:38, Josh Baird wrote:

Most people would probably tell you to use hiera to store your Vhost data,
and have your manifests/modules use something like create_resources to
actually create the apache::vhost resource.

On Tue, Jul 15, 2014 at 7:41 AM, yamakasi.014@gmail.com wrote:

Hi All,

I’m kinda figuring out how to manage Apache Vhosts with Foreman and be
able to enable or disable them.

Normally you would have a site.pp with the following:

Simple vhost definition:

apache::vhost { ‘site1.name.tld’:
port => ‘80’,
docroot => ‘/path/to/docroot1’,
}

Simple vhost definition:

apache::vhost { ‘site2.name.tld’:
port => ‘80’,
docroot => ‘/path/to/docroot2’,
}

But as Foreman sees variables like docroot and port you can set or
actually needs to I’m confused how to manage the config for a Vhost.

At the moment things like docroot, port, etc are variables in my
manifests and I can set them in Foreman, but this is general for all Vhosts
and not specific per Vhost. This is not the biggest problem, but I also
want to be able to run a a2enmod and a2dismod per vhost that I want to
enable or disable, so I need to check this in my manifest. My idea was to
create two arrays, vhost_enabled and vhost_disabled and run through both
arrays in some way, the general config is ideal than maybe.

Are there people that have good examples for such purpose, or for other
config that need the same way of management ? Default puppet modules are
not ideal with Foreman have seen.

I hope someone can help me out here!

Thanks,

Matt


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Hi Matt,

yes that what I have done in the past, it probably not the most elegant
solutions or even possibly the most correct but it worked well and was easy
to use and understand by the rest of the team who were all completely new
to Foreman Puppet and the whole configuration management thing. There is no
reason why you could not paramtize the values in both the main apache
module and the vhost modules and store them in Heira as Josh suggested. In
fact that would mean the variables were stored and text file rather than
the foreman DB which is then manageable with the same VCS you use for your
manifests and other code.

Jim

··· On 15 July 2014 13:56, wrote:

Hi Jim,

Thanks all, comparing to the Heira ideas, the idea was not to use that :slight_smile:

So you actually use a file per vhost ? Like site1.pp site2.pp site3.pp ?

Cheers,

Matt

Op dinsdag 15 juli 2014 14:29:58 UTC+2 schreef Paradoxbound:

I have defined vhosts as apache sub modules in the past then passed them
as variables to Forman that will drop in vhost files and link them.

Something like:

apache::vhost::foo
apache::vhost::bar
apache:vhost::ben

then I can declare which of them in Foreman I want, none, some or all on
a server. Works well for other apps that have a similar setup.

Jim

On 15 July 2014 12:41, yamaka...@gmail.com wrote:

Hi All,

I’m kinda figuring out how to manage Apache Vhosts with Foreman and be
able to enable or disable them.

Normally you would have a site.pp with the following:

Simple vhost definition:

apache::vhost { ‘site1.name.tld’:
port => ‘80’,
docroot => ‘/path/to/docroot1’,
}

Simple vhost definition:

apache::vhost { ‘site2.name.tld’:
port => ‘80’,
docroot => ‘/path/to/docroot2’,
}

But as Foreman sees variables like docroot and port you can set or
actually needs to I’m confused how to manage the config for a Vhost.

At the moment things like docroot, port, etc are variables in my
manifests and I can set them in Foreman, but this is general for all Vhosts
and not specific per Vhost. This is not the biggest problem, but I also
want to be able to run a a2enmod and a2dismod per vhost that I want to
enable or disable, so I need to check this in my manifest. My idea was to
create two arrays, vhost_enabled and vhost_disabled and run through both
arrays in some way, the general config is ideal than maybe.

Are there people that have good examples for such purpose, or for other
config that need the same way of management ? Default puppet modules are
not ideal with Foreman have seen.

I hope someone can help me out here!

Thanks,

Matt


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-user...@googlegroups.com.
To post to this group, send email to forema...@googlegroups.com.

Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

This should give you some good ideas:

https://ask.puppetlabs.com/questions/scope:all/sort:activity-desc/page:1/query:apache%20hiera/

Josh

··· On Tue, Jul 15, 2014 at 6:27 PM, Robert Vernon wrote:

Can you elaborate on using yaml to do this. I was setting up a set of
vhosts for a friend and needed something like this. I ended up just
avoiding it altogether and hand jamming things manually. :frowning:

Basically, I want to avoid other backends. So far Foreman and Puppet seem
to be all I need. I can provision to EC2, and to the local ESX cluster, and
I can do some basic modules. Problems comes when wanting to do stuff like
this, the docs are weak on using parameterization to pass stuff to various
modules I pull down from the forge.

On Tuesday, July 15, 2014 7:41:08 PM UTC+8, yamaka...@gmail.com wrote:

Hi All,

I’m kinda figuring out how to manage Apache Vhosts with Foreman and be
able to enable or disable them.

Normally you would have a site.pp with the following:

Simple vhost definition:

apache::vhost { ‘site1.name.tld’:
port => ‘80’,
docroot => ‘/path/to/docroot1’,
}

Simple vhost definition:

apache::vhost { ‘site2.name.tld’:
port => ‘80’,
docroot => ‘/path/to/docroot2’,
}

But as Foreman sees variables like docroot and port you can set or
actually needs to I’m confused how to manage the config for a Vhost.

At the moment things like docroot, port, etc are variables in my
manifests and I can set them in Foreman, but this is general for all Vhosts
and not specific per Vhost. This is not the biggest problem, but I also
want to be able to run a a2enmod and a2dismod per vhost that I want to
enable or disable, so I need to check this in my manifest. My idea was to
create two arrays, vhost_enabled and vhost_disabled and run through both
arrays in some way, the general config is ideal than maybe.

Are there people that have good examples for such purpose, or for other
config that need the same way of management ? Default puppet modules are
not ideal with Foreman have seen.

I hope someone can help me out here!

Thanks,

Matt


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Hi,

This was my first opinion too, it might be still…

But what would be your solution in this issue ?

Cheers,

Matt

··· Op donderdag 17 juli 2014 03:51:42 UTC+2 schreef Robert Vernon: > > I'm not sold on hiera yet. Its seems really nice, but yet another layer on > top of already complex stuff... > > R > > On Tuesday, July 15, 2014 7:41:08 PM UTC+8, yamaka...@gmail.com wrote: >> >> Hi All, >> >> I'm kinda figuring out how to manage Apache Vhosts with Foreman and be >> able to enable or disable them. >> >> Normally you would have a site.pp with the following: >> >> >> # Simple vhost definition: >> apache::vhost { 'site1.name.tld': >> port => '80', >> docroot => '/path/to/docroot1', >> } >> >> # Simple vhost definition: >> apache::vhost { 'site2.name.tld': >> port => '80', >> docroot => '/path/to/docroot2', >> } >> >> >> But as Foreman sees variables like docroot and port you can set or >> actually needs to I'm confused how to manage the config for a Vhost. >> >> At the moment things like docroot, port, etc are variables in my >> manifests and I can set them in Foreman, but this is general for all Vhosts >> and not specific per Vhost. This is not the biggest problem, but I also >> want to be able to run a a2enmod and a2dismod per vhost that I want to >> enable or disable, so I need to check this in my manifest. My idea was to >> create two arrays, vhost_enabled and vhost_disabled and run through both >> arrays in some way, the general config is ideal than maybe. >> >> Are there people that have good examples for such purpose, or for other >> config that need the same way of management ? Default puppet modules are >> not ideal with Foreman have seen. >> >> I hope someone can help me out here! >> >> Thanks, >> >> Matt >> >

Hiera is really good and is very helpful if you have a complex set of
requirements. I also like hiera-pgp for securing passwords. The setup I am
building for my latest client is going to be a simple Foreman and Puppet
setup as for their requirements would be overkill and I will be passing my
work on to a team either new or very inexperienced these tools. I feel it
is about finding an appropriate level of technology for your needs.

Jim

··· On 17 July 2014 02:51, Robert Vernon wrote:

I’m not sold on hiera yet. Its seems really nice, but yet another layer on
top of already complex stuff…

R

On Tuesday, July 15, 2014 7:41:08 PM UTC+8, yamaka...@gmail.com wrote:

Hi All,

I’m kinda figuring out how to manage Apache Vhosts with Foreman and be
able to enable or disable them.

Normally you would have a site.pp with the following:

Simple vhost definition:

apache::vhost { ‘site1.name.tld’:
port => ‘80’,
docroot => ‘/path/to/docroot1’,
}

Simple vhost definition:

apache::vhost { ‘site2.name.tld’:
port => ‘80’,
docroot => ‘/path/to/docroot2’,
}

But as Foreman sees variables like docroot and port you can set or
actually needs to I’m confused how to manage the config for a Vhost.

At the moment things like docroot, port, etc are variables in my
manifests and I can set them in Foreman, but this is general for all Vhosts
and not specific per Vhost. This is not the biggest problem, but I also
want to be able to run a a2enmod and a2dismod per vhost that I want to
enable or disable, so I need to check this in my manifest. My idea was to
create two arrays, vhost_enabled and vhost_disabled and run through both
arrays in some way, the general config is ideal than maybe.

Are there people that have good examples for such purpose, or for other
config that need the same way of management ? Default puppet modules are
not ideal with Foreman have seen.

I hope someone can help me out here!

Thanks,

Matt


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Hi Jim,

You are right, rocksolid but not elegant, but that's an opinion indeed.

I think that site(x).pp could be stored in foreman as well, why not, but
how ?

Would it be something like:

apache::vhost::site {

$allvhostvars?

}

Matt

··· Op dinsdag 15 juli 2014 15:06:46 UTC+2 schreef Paradoxbound: > > Hi Matt, > > yes that what I have done in the past, it probably not the most elegant > solutions or even possibly the most correct but it worked well and was easy > to use and understand by the rest of the team who were all completely new > to Foreman Puppet and the whole configuration management thing. There is no > reason why you could not paramtize the values in both the main apache > module and the vhost modules and store them in Heira as Josh suggested. In > fact that would mean the variables were stored and text file rather than > the foreman DB which is then manageable with the same VCS you use for your > manifests and other code. > > Jim > > > > > On 15 July 2014 13:56, <yamaka...@gmail.com > wrote: > >> Hi Jim, >> >> Thanks all, comparing to the Heira ideas, the idea was not to use that :) >> >> So you actually use a file per vhost ? Like site1.pp site2.pp site3.pp ? >> >> Cheers, >> >> Matt >> >> >> >> Op dinsdag 15 juli 2014 14:29:58 UTC+2 schreef Paradoxbound: >>> >>> I have defined vhosts as apache sub modules in the past then passed them >>> as variables to Forman that will drop in vhost files and link them. >>> >>> Something like: >>> >>> apache::vhost::foo >>> apache::vhost::bar >>> apache:vhost::ben >>> >>> then I can declare which of them in Foreman I want, none, some or all on >>> a server. Works well for other apps that have a similar setup. >>> >>> Jim >>> >>> >>> On 15 July 2014 12:41, wrote: >>> >>>> Hi All, >>>> >>>> I'm kinda figuring out how to manage Apache Vhosts with Foreman and be >>>> able to enable or disable them. >>>> >>>> Normally you would have a site.pp with the following: >>>> >>>> >>>> # Simple vhost definition: >>>> apache::vhost { 'site1.name.tld': >>>> port => '80', >>>> docroot => '/path/to/docroot1', >>>> } >>>> >>>> # Simple vhost definition: >>>> apache::vhost { 'site2.name.tld': >>>> port => '80', >>>> docroot => '/path/to/docroot2', >>>> } >>>> >>>> >>>> But as Foreman sees variables like docroot and port you can set or >>>> actually needs to I'm confused how to manage the config for a Vhost. >>>> >>>> At the moment things like docroot, port, etc are variables in my >>>> manifests and I can set them in Foreman, but this is general for all Vhosts >>>> and not specific per Vhost. This is not the biggest problem, but I also >>>> want to be able to run a a2enmod and a2dismod per vhost that I want to >>>> enable or disable, so I need to check this in my manifest. My idea was to >>>> create two arrays, vhost_enabled and vhost_disabled and run through both >>>> arrays in some way, the general config is ideal than maybe. >>>> >>>> Are there people that have good examples for such purpose, or for other >>>> config that need the same way of management ? Default puppet modules are >>>> not ideal with Foreman have seen. >>>> >>>> I hope someone can help me out here! >>>> >>>> Thanks, >>>> >>>> Matt >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Foreman users" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to foreman-user...@googlegroups.com. >>>> To post to this group, send email to forema...@googlegroups.com. >>>> >>>> Visit this group at http://groups.google.com/group/foreman-users. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "Foreman users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to foreman-user...@googlegroups.com . >> To post to this group, send email to forema...@googlegroups.com >> . >> Visit this group at http://groups.google.com/group/foreman-users. >> For more options, visit https://groups.google.com/d/optout. >> > >

I wasn't talking about using Foreman to store hiera data. It sounds like
he just needs to pass data to his manifests/modules. Hiera, no matter what
backend you are using, (JSON, yaml, foreman, etc) is one way to do this.

mywebserver.mydomain.com.yaml:

apache::vhost:
mywebsite:
docroot: /var/somewhere
serveradmin: john@doe.com

Use Foreman to bind a class/module that utilizes this hiera data.

··· On Tue, Jul 15, 2014 at 8:48 AM, James Bailey wrote:

Foreman Heira support requires plugins and is another layer of complexity
for the user to learn if he is new as I suspect to both Foreman and Puppet.
He wants to see some results and not push deliverables back to learn
another tool. He can alway go back and refactor his code the situation gets
messy later.

Jim

On 15 July 2014 13:38, Josh Baird joshbaird@gmail.com wrote:

Most people would probably tell you to use hiera to store your Vhost
data, and have your manifests/modules use something like create_resources
to actually create the apache::vhost resource.

On Tue, Jul 15, 2014 at 7:41 AM, yamakasi.014@gmail.com wrote:

Hi All,

I’m kinda figuring out how to manage Apache Vhosts with Foreman and be
able to enable or disable them.

Normally you would have a site.pp with the following:

Simple vhost definition:

apache::vhost { ‘site1.name.tld’:
port => ‘80’,
docroot => ‘/path/to/docroot1’,
}

Simple vhost definition:

apache::vhost { ‘site2.name.tld’:
port => ‘80’,
docroot => ‘/path/to/docroot2’,
}

But as Foreman sees variables like docroot and port you can set or
actually needs to I’m confused how to manage the config for a Vhost.

At the moment things like docroot, port, etc are variables in my
manifests and I can set them in Foreman, but this is general for all Vhosts
and not specific per Vhost. This is not the biggest problem, but I also
want to be able to run a a2enmod and a2dismod per vhost that I want to
enable or disable, so I need to check this in my manifest. My idea was to
create two arrays, vhost_enabled and vhost_disabled and run through both
arrays in some way, the general config is ideal than maybe.

Are there people that have good examples for such purpose, or for other
config that need the same way of management ? Default puppet modules are
not ideal with Foreman have seen.

I hope someone can help me out here!

Thanks,

Matt


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

I don't have access to my old code but the module was very basic apart from
the vhost code. Within the manifest I created a vhosts directory with the
vhost1.pp, vhost2.pp etc files. I then declared them in the main module. In
Foreman it appeared as a variable vhosts, by default blank but by adding a
list of required vhosts Puppet would provision them.

As I said crude and kludgey but it worked and all you needed to do to add a
new vhost was copy, paste and edit.

Jim

··· On 15 July 2014 14:12, wrote:

Hi Jim,

You are right, rocksolid but not elegant, but that’s an opinion indeed.

I think that site(x).pp could be stored in foreman as well, why not, but
how ?

Would it be something like:

apache::vhost::site {

$allvhostvars?

}

Matt

Op dinsdag 15 juli 2014 15:06:46 UTC+2 schreef Paradoxbound:

Hi Matt,

yes that what I have done in the past, it probably not the most elegant
solutions or even possibly the most correct but it worked well and was easy
to use and understand by the rest of the team who were all completely new
to Foreman Puppet and the whole configuration management thing. There is no
reason why you could not paramtize the values in both the main apache
module and the vhost modules and store them in Heira as Josh suggested. In
fact that would mean the variables were stored and text file rather than
the foreman DB which is then manageable with the same VCS you use for your
manifests and other code.

Jim

On 15 July 2014 13:56, yamaka...@gmail.com wrote:

Hi Jim,

Thanks all, comparing to the Heira ideas, the idea was not to use that :slight_smile:

So you actually use a file per vhost ? Like site1.pp site2.pp site3.pp ?

Cheers,

Matt

Op dinsdag 15 juli 2014 14:29:58 UTC+2 schreef Paradoxbound:

I have defined vhosts as apache sub modules in the past then passed
them as variables to Forman that will drop in vhost files and link them.

Something like:

apache::vhost::foo
apache::vhost::bar
apache:vhost::ben

then I can declare which of them in Foreman I want, none, some or all
on a server. Works well for other apps that have a similar setup.

Jim

On 15 July 2014 12:41, yamaka...@gmail.com wrote:

Hi All,

I’m kinda figuring out how to manage Apache Vhosts with Foreman and be
able to enable or disable them.

Normally you would have a site.pp with the following:

Simple vhost definition:

apache::vhost { ‘site1.name.tld’:
port => ‘80’,
docroot => ‘/path/to/docroot1’,
}

Simple vhost definition:

apache::vhost { ‘site2.name.tld’:
port => ‘80’,
docroot => ‘/path/to/docroot2’,
}

But as Foreman sees variables like docroot and port you can set or
actually needs to I’m confused how to manage the config for a Vhost.

At the moment things like docroot, port, etc are variables in my
manifests and I can set them in Foreman, but this is general for all Vhosts
and not specific per Vhost. This is not the biggest problem, but I also
want to be able to run a a2enmod and a2dismod per vhost that I want to
enable or disable, so I need to check this in my manifest. My idea was to
create two arrays, vhost_enabled and vhost_disabled and run through both
arrays in some way, the general config is ideal than maybe.

Are there people that have good examples for such purpose, or for
other config that need the same way of management ? Default puppet modules
are not ideal with Foreman have seen.

I hope someone can help me out here!

Thanks,

Matt


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-user...@googlegroups.com.
To post to this group, send email to forema...@googlegroups.com.

Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-user...@googlegroups.com.
To post to this group, send email to forema...@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Hi,

Hiera seems the be the way, but I'm quite stuck with it.

What I would like to have is a "override parameter" per vhost. I think you
need to fill each vhost-parameter-field with… indeed what and how will it
pick up in the .pp ?

I'm trying array and so on, but no luck by checking the yaml file.

Help is welcome here!

Thanks,

Matt

··· Op woensdag 16 juli 2014 02:15:32 UTC+2 schreef Josh: > > This should give you some good ideas: > > > https://ask.puppetlabs.com/questions/scope:all/sort:activity-desc/page:1/query:apache%20hiera/ > > Josh > > > On Tue, Jul 15, 2014 at 6:27 PM, Robert Vernon > wrote: > >> Can you elaborate on using yaml to do this. I was setting up a set of >> vhosts for a friend and needed something like this. I ended up just >> avoiding it altogether and hand jamming things manually. :( >> >> Basically, I want to avoid other backends. So far Foreman and Puppet seem >> to be all I need. I can provision to EC2, and to the local ESX cluster, and >> I can do some basic modules. Problems comes when wanting to do stuff like >> this, the docs are weak on using parameterization to pass stuff to various >> modules I pull down from the forge. >> >> >> On Tuesday, July 15, 2014 7:41:08 PM UTC+8, yamaka...@gmail.com wrote: >>> >>> Hi All, >>> >>> I'm kinda figuring out how to manage Apache Vhosts with Foreman and be >>> able to enable or disable them. >>> >>> Normally you would have a site.pp with the following: >>> >>> >>> # Simple vhost definition: >>> apache::vhost { 'site1.name.tld': >>> port => '80', >>> docroot => '/path/to/docroot1', >>> } >>> >>> # Simple vhost definition: >>> apache::vhost { 'site2.name.tld': >>> port => '80', >>> docroot => '/path/to/docroot2', >>> } >>> >>> >>> But as Foreman sees variables like docroot and port you can set or >>> actually needs to I'm confused how to manage the config for a Vhost. >>> >>> At the moment things like docroot, port, etc are variables in my >>> manifests and I can set them in Foreman, but this is general for all Vhosts >>> and not specific per Vhost. This is not the biggest problem, but I also >>> want to be able to run a a2enmod and a2dismod per vhost that I want to >>> enable or disable, so I need to check this in my manifest. My idea was to >>> create two arrays, vhost_enabled and vhost_disabled and run through both >>> arrays in some way, the general config is ideal than maybe. >>> >>> Are there people that have good examples for such purpose, or for other >>> config that need the same way of management ? Default puppet modules are >>> not ideal with Foreman have seen. >>> >>> I hope someone can help me out here! >>> >>> Thanks, >>> >>> Matt >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Foreman users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to foreman-user...@googlegroups.com . >> To post to this group, send email to forema...@googlegroups.com >> . >> Visit this group at http://groups.google.com/group/foreman-users. >> For more options, visit https://groups.google.com/d/optout. >> > >

Hi Jim,

I think you can just use one vhost.pp than and add your configs in
muliplied variable vhosts.

Maybe someone else can tell that.

Thanks!

Matt

··· Op dinsdag 15 juli 2014 15:22:22 UTC+2 schreef Paradoxbound: > > I don't have access to my old code but the module was very basic apart > from the vhost code. Within the manifest I created a vhosts directory with > the vhost1.pp, vhost2.pp etc files. I then declared them in the main > module. In Foreman it appeared as a variable vhosts, by default blank but > by adding a list of required vhosts Puppet would provision them. > > As I said crude and kludgey but it worked and all you needed to do to add > a new vhost was copy, paste and edit. > > Jim > > > On 15 July 2014 14:12, <yamaka...@gmail.com > wrote: > >> Hi Jim, >> >> You are right, rocksolid but not elegant, but that's an opinion indeed. >> >> I think that site(x).pp could be stored in foreman as well, why not, but >> how ? >> >> Would it be something like: >> >> apache::vhost::site { >> >> $allvhostvars? >> >> } >> >> Matt >> >> >> Op dinsdag 15 juli 2014 15:06:46 UTC+2 schreef Paradoxbound: >>> >>> Hi Matt, >>> >>> yes that what I have done in the past, it probably not the most elegant >>> solutions or even possibly the most correct but it worked well and was easy >>> to use and understand by the rest of the team who were all completely new >>> to Foreman Puppet and the whole configuration management thing. There is no >>> reason why you could not paramtize the values in both the main apache >>> module and the vhost modules and store them in Heira as Josh suggested. In >>> fact that would mean the variables were stored and text file rather than >>> the foreman DB which is then manageable with the same VCS you use for your >>> manifests and other code. >>> >>> Jim >>> >>> >>> >>> >>> On 15 July 2014 13:56, wrote: >>> >>>> Hi Jim, >>>> >>>> Thanks all, comparing to the Heira ideas, the idea was not to use that >>>> :) >>>> >>>> So you actually use a file per vhost ? Like site1.pp site2.pp site3.pp ? >>>> >>>> Cheers, >>>> >>>> Matt >>>> >>>> >>>> >>>> Op dinsdag 15 juli 2014 14:29:58 UTC+2 schreef Paradoxbound: >>>>> >>>>> I have defined vhosts as apache sub modules in the past then passed >>>>> them as variables to Forman that will drop in vhost files and link them. >>>>> >>>>> Something like: >>>>> >>>>> apache::vhost::foo >>>>> apache::vhost::bar >>>>> apache:vhost::ben >>>>> >>>>> then I can declare which of them in Foreman I want, none, some or all >>>>> on a server. Works well for other apps that have a similar setup. >>>>> >>>>> Jim >>>>> >>>>> >>>>> On 15 July 2014 12:41, wrote: >>>>> >>>>>> Hi All, >>>>>> >>>>>> I'm kinda figuring out how to manage Apache Vhosts with Foreman and >>>>>> be able to enable or disable them. >>>>>> >>>>>> Normally you would have a site.pp with the following: >>>>>> >>>>>> >>>>>> # Simple vhost definition: >>>>>> apache::vhost { 'site1.name.tld': >>>>>> port => '80', >>>>>> docroot => '/path/to/docroot1', >>>>>> } >>>>>> >>>>>> # Simple vhost definition: >>>>>> apache::vhost { 'site2.name.tld': >>>>>> port => '80', >>>>>> docroot => '/path/to/docroot2', >>>>>> } >>>>>> >>>>>> >>>>>> But as Foreman sees variables like docroot and port you can set or >>>>>> actually needs to I'm confused how to manage the config for a Vhost. >>>>>> >>>>>> At the moment things like docroot, port, etc are variables in my >>>>>> manifests and I can set them in Foreman, but this is general for all Vhosts >>>>>> and not specific per Vhost. This is not the biggest problem, but I also >>>>>> want to be able to run a a2enmod and a2dismod per vhost that I want to >>>>>> enable or disable, so I need to check this in my manifest. My idea was to >>>>>> create two arrays, vhost_enabled and vhost_disabled and run through both >>>>>> arrays in some way, the general config is ideal than maybe. >>>>>> >>>>>> Are there people that have good examples for such purpose, or for >>>>>> other config that need the same way of management ? Default puppet modules >>>>>> are not ideal with Foreman have seen. >>>>>> >>>>>> I hope someone can help me out here! >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Matt >>>>>> >>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "Foreman users" group. >>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>> send an email to foreman-user...@googlegroups.com. >>>>>> To post to this group, send email to forema...@googlegroups.com. >>>>>> >>>>>> Visit this group at http://groups.google.com/group/foreman-users. >>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>> >>>>> >>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Foreman users" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to foreman-user...@googlegroups.com. >>>> To post to this group, send email to forema...@googlegroups.com. >>>> Visit this group at http://groups.google.com/group/foreman-users. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "Foreman users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to foreman-user...@googlegroups.com . >> To post to this group, send email to forema...@googlegroups.com >> . >> Visit this group at http://groups.google.com/group/foreman-users. >> For more options, visit https://groups.google.com/d/optout. >> > >