On Wed, Oct 13, 2010 at 8:06 PM, Nigel Kersten <[email protected]> wrote:
> On Wed, Oct 13, 2010 at 10:56 AM, EAMiller <[email protected]> wrote:
>> Hi all - new to puppet - and have gotten as far as configuring a
>> staging server with two of our web apps through puppet.
>>
>> Now we plan to have developer workstations get dev environments
>> through puppet. We have ~8 developers and ~5 web apps we develop. Not
>> every developer works on every project.
>>
>> From my limited experience with puppet I plan to:
>> 1. Ask each developer what their workstation is called, and which
>> apps they work on
>> 2. Create a stanza in node.pp along the lines of:
>>
>> node "devstation-bob" inherits "default" {
>> include appB;
>> include abbE;
>> }
>>
>> This is fine for my purposes - but I wonder if there's a better way -
>> I can't imagine scaling the up too far.
>
> Write a custom fact that reads a simple data source like a text file
> that the developers can write to like:
>
> (tested briefly, may have bugs)
>
> webapps_conf = "/etc/webapps.conf"
I should have maybe clarified that this file simply contains lists of
the apps on lines, with no spaces.
appA
appB
appD
etc. You'll want to do a little bit more input validation on the data,
as people are human.
>
> if File.readable?(webapps_conf)
> f = File.open(webapps_conf, 'r')
> f.readlines.each do |line|
> webapp = line.chomp
> Facter.add("webapp_#{webapp}_enabled") do
> setcode do
> "true"
> end
> end
> end
> f.close
> end
>
> and then you'll have a data source the developers can control that
> specifies what apps they work on, and you can do conditional work in
> your manifests based upon these values.
>
> if $webapp_bar_enabled == "true" {
> include webapps::bar
> }
>
> etc etc.
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.