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. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Wed, Oct 13, 2010 at 10:56 AM, EAMiller <thnntn@gmail.com> 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" 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 puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Wed, Oct 13, 2010 at 8:06 PM, Nigel Kersten <nigel@explanatorygap.net> wrote:> On Wed, Oct 13, 2010 at 10:56 AM, EAMiller <thnntn@gmail.com> 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 puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 10/14/2010 05:06 AM, Nigel Kersten wrote:> On Wed, Oct 13, 2010 at 10:56 AM, EAMiller <thnntn@gmail.com> 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" > > 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 > }Hi, custom facts sure are elegant, but isn''t this problem exactly what extlookup has been conceived for? This is an actual question I''m asking since i''ve not yet managed to properly acquaint myself with the concept. Regards, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Fri, Oct 15, 2010 at 5:05 AM, Felix Frank <felix.frank@alumni.tu-berlin.de> wrote:> On 10/14/2010 05:06 AM, Nigel Kersten wrote: >> On Wed, Oct 13, 2010 at 10:56 AM, EAMiller <thnntn@gmail.com> 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" >> >> 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 >> } > > Hi, > > custom facts sure are elegant, but isn''t this problem exactly what > extlookup has been conceived for? > > This is an actual question I''m asking since i''ve not yet managed to > properly acquaint myself with the concept.Not necessarily. This is about providing local controls so machine owners can manipulate behavior, rather than a central authoritative store. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.