jerome moliere
2010-Apr-14 10:37 UTC
[Puppet Users] Total newbie question: customization of configuration files managed by a Puppet server
Hi, excuse me if this question is a stupid one.... I''m about convincing my customers to use Puppet before this, I ''d like to make a POC with part from the current complexity ... Like any company (I guess) , we have different envrionments: - development - staging - production... Applications are deployed on 2 sites (40km of fiber channel wires between these 2 sites) Each environment induces a different list from IPs (servers), HA constraints present or not and so on.. I''d like to make a POC with one the service deplyoed here (the one I''m responsible of) Jboss servers: - Java applications (so require a JRE) - Unix service present - different config files (many in the Java world) On each machine I want to start 4 instances of the same Jboss service using different VIP addresses (ethernet bonding) so I want to do something like this (this is a very simplistic view because each server has got hundred of different config files but who cares): / / jboss1 server all deploy log4j.xml /jboss2 server all deploy log4j.xml /jboss3 server all deploy log4j.xml /jboss4 server all deploy log4j.xml The files under control will have the structure and quitely same contents (template) but they will use different IPs, different machine names, different ports and so on... I''d like to know if it was possible to manage such kind of structure because manys amples use static files ...(/etc/passwd). Does Puppet enable to manage /etc/passwd$i files ? Contents from this file would be scripted using ruby of course sorry for this long post and thank for your patience for those reaching the end!! Thanks Jerome -- 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.
Michael DeHaan
2010-Apr-14 13:56 UTC
Re: [Puppet Users] Total newbie question: customization of configuration files managed by a Puppet server
On Wed, Apr 14, 2010 at 6:37 AM, jerome moliere <jerome.moliere@gmail.com> wrote:> Hi, > excuse me if this question is a stupid one.... > I''m about convincing my customers to use Puppet before this, I ''d like > to make a POC with part from the current complexity ... > Like any company (I guess) , we have different envrionments: > - development > - staging > - production... > Applications are deployed on 2 sites (40km of fiber channel wires > between these 2 sites) > > Each environment induces a different list from IPs (servers), HA > constraints present or not and so on.. > > I''d like to make a POC with one the service deplyoed here (the one I''m > responsible of) Jboss servers: > - Java applications (so require a JRE) > - Unix service present > - different config files (many in the Java world) > > On each machine I want to start 4 instances of the same Jboss service > using different VIP addresses (ethernet bonding) so I want to do > something like this (this is a very simplistic view because each > server has got hundred of different config files but who cares): > / > / jboss1 > server > all > deploy > log4j.xml > /jboss2 > server > all > deploy > log4j.xml > /jboss3 > server > all > deploy > log4j.xml > /jboss4 > server > all > deploy > log4j.xml >This looks like a good place to use a defined type for a java app server, and use that resource multiple times with different variables passed in.> > The files under control will have the structure and quitely same > contents (template) but they will use different IPs, different machine > names, different ports and so on... > > I''d like to know if it was possible to manage such kind of structure > because manys amples use static files ...(/etc/passwd). Does Puppet > enable to manage /etc/passwd$i files ? Contents from this file would > be scripted using ruby of courseNot sure what you mean by /etc/password$i ... do you mean something like building a file out of smaller parts? In this case, absolutely... Actually in that case you what to use the User resource, but in cases where you want to build a common file out of multiple pieces created by multiple defined resources, this is a good place to use the File Fragment idiom, which you can see a bit of here: http://www.devco.net/archives/2010/02/19/building_files_from_fragments_with_puppet.php --Michael -- 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.
jerome moliere
2010-Apr-14 14:07 UTC
Re: [Puppet Users] Total newbie question: customization of configuration files managed by a Puppet server
2010/4/14 Michael DeHaan <michael@puppetlabs.com>> On Wed, Apr 14, 2010 at 6:37 AM, jerome moliere > <jerome.moliere@gmail.com> wrote: > > Hi, > > excuse me if this question is a stupid one.... > > I''m about convincing my customers to use Puppet before this, I ''d like > > to make a POC with part from the current complexity ... > > Like any company (I guess) , we have different envrionments: > > - development > > - staging > > - production... > > Applications are deployed on 2 sites (40km of fiber channel wires > > between these 2 sites) > > > > Each environment induces a different list from IPs (servers), HA > > constraints present or not and so on.. > > > > I''d like to make a POC with one the service deplyoed here (the one I''m > > responsible of) Jboss servers: > > - Java applications (so require a JRE) > > - Unix service present > > - different config files (many in the Java world) > > > > On each machine I want to start 4 instances of the same Jboss service > > using different VIP addresses (ethernet bonding) so I want to do > > something like this (this is a very simplistic view because each > > server has got hundred of different config files but who cares): > > / > > / jboss1 > > server > > all > > deploy > > log4j.xml > > /jboss2 > > server > > all > > deploy > > log4j.xml > > /jboss3 > > server > > all > > deploy > > log4j.xml > > /jboss4 > > server > > all > > deploy > > log4j.xml > > > > This looks like a good place to use a defined type for a java app > server, and use that resource > multiple times with different variables passed in. > > > > > The files under control will have the structure and quitely same > > contents (template) but they will use different IPs, different machine > > names, different ports and so on... > > > > I''d like to know if it was possible to manage such kind of structure > > because manys amples use static files ...(/etc/passwd). Does Puppet > > enable to manage /etc/passwd$i files ? Contents from this file would > > be scripted using ruby of course > >hi Michael, tanks for your answer, I''ll try to be more precise..> Not sure what you mean by /etc/password$i ... do you mean something > like building a file out > of smaller parts? In this case, absolutely... > >No, in fact I''d like to have a common template file used in different contexts to produce a target file.. Let''s say in each environment I''ve got the same database definition file in Jboss jargon means a file : mydb-ds.xml contents from that file will be specific to point different databases depending from the site, HA failures and so on But I ''ve got another constraint: I want on each machine to ''duplicate'' services , instantiate them with different contextual values a good example (simpler) would be with Apache servers running on different ports: 80 for production 8080 for testing My jboss servers will bind a different IP but use the same configuration profile (same set of files) but with contents depending from rules (it''s my problem not yours)... That''s why I draw the schema with: / /jboss1 /jboss2 /jboss3 /jboss4 Trying to rewrite my question with more accuracy: Is there a way with Puppet to manage a template file and to deploy it following certain rules on the client node? I don''t want just a ruby interpretation of the contents from the script but I want: - execute some logic to find where to copy it - then execute the script and generate the file I hope to be clear cheers Jerome> Actually in that case you what to use the User resource, but in cases > where you want to build > a common file out of multiple pieces created by multiple defined > resources, this is a good place > to use the File Fragment idiom, which you can see a bit of here: > > > http://www.devco.net/archives/2010/02/19/building_files_from_fragments_with_puppet.php > > --Jerome Moliere - Mentor/J http://romjethoughts.blogspot.com/ auteur Eyrolles -- 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.