Hi there! I´ve started looking into puppet for about one week now, I have to say that I am NOT a developer, i occasionally write a shellscript or another but thats about it, so maybe my problem is that i dont see the whole picture yet.. I kind of know what i want to do, but at the moment i don´t realy see how i can accomplish that.. :/ thing is, I have (for now "just") about 100 servers and about 30 different services to manage so the problem described below is.. well, you´ll see (or I´m damn ignorant, always a possibility..) server-series A; service 1 (W instances) service 2 (Y instances) server-series B; service 1 (X instances) service 2 (Z instances) instances share basepath; differ in instancepath; share config/runningpath serverA/service1/01/configpath serverA/service1/02/configpath serverA/service2/01/configpath [...] serverB/service1/01/configpath serverB/service2/01/configpath serverB/service2/02/configpath how to define the difference in the instancepath? wildcards? evaluation of instancepathfolder? I did not realy find anything in the documentation regarding pathsubstitution or wildcards or anything, if soemone could point me in the right direction, please.. hardcoding all possible values (say 1 through 15) would be kind of the opposite of what i intend to do, on the other hand I dont realy have a clue as to how to do this, as i cant use classes (which would be hardcoding as I understood them until now) and I am lacking the understanding as to how to do this in general, what options do i have to do this? Thanks for taking a quick look (and not laughting about the language skills, I´m from germany.. ;) ) Simon _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On Jan 19, 2007, at 7:23 AM, simon wrote:> Hi there! > > I´ve started looking into puppet for about one week now, I have to say > that I am NOT a developer, i occasionally write a shellscript or > another > but thats about it, so maybe my problem is that i dont see the whole > picture yet.. I kind of know what i want to do, but at the moment i > don´t realy see how i can accomplish that.. :/I''ll see if I can help, then. You shouldn''t need to be a developer to use Puppet.> thing is, I have (for now "just") about 100 servers and about 30 > different services to manage so the problem described below is.. well, > you´ll see (or I´m damn ignorant, always a possibility..) > > server-series A; service 1 (W instances) > service 2 (Y instances) > > server-series B; service 1 (X instances) > service 2 (Z instances) > > instances share basepath; differ in instancepath; share config/ > runningpath > > serverA/service1/01/configpath > serverA/service1/02/configpath > serverA/service2/01/configpath > [...] > serverB/service1/01/configpath > serverB/service2/01/configpath > serverB/service2/02/configpath > > > how to define the difference in the instancepath? wildcards? > evaluation > of instancepathfolder? > I did not realy find anything in the documentation regarding > pathsubstitution or wildcards or anything, if soemone could point > me in > the right direction, please..Variables are substituted in double-quoted strings, so if you''re setting a path, you could do something like the following: file { "/$hostname/$service/$instance": ... } You should be able to use that variable substitution anywhere you''d use a string in Puppet, although unlike in the shell you''ll need to quote most uses. E.g., you don''t have to quote variables by themselves: file { "/tmp/myfile": owner => $user } But you will need to quote multiple variables: file { "/tmp/myfile": content => "$one$two" } In general, if you''re not sure, then quote.> hardcoding all possible values (say 1 through 15) would be kind of the > opposite of what i intend to do, on the other hand I dont realy have a > clue as to how to do this, as i cant use classes (which would be > hardcoding as I understood them until now) and I am lacking the > understanding as to how to do this in general, what options do i > have to > do this?Hardcoding is definitely bad. How are the instances set up? What kind of service is this? It sounds like you should have a defined type to create instances; something like this: define myservice($base = "/services", $service) { file { "/$base/$service/$name": ... } } Then you''d just create the instances you need: myservice { instance01: service => A } Make sense?> Thanks for taking a quick look (and not laughting about the language > skills, I´m from germany.. ;) ) > Simon > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users-- I don''t always know what I''m talking about, but I''m always pretty much convinced that I''m right. -- musician Mojo Nixon --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Luke Kanies schrieb:> On Jan 19, 2007, at 7:23 AM, simon wrote: > > >> Hi there! >> >> I´ve started looking into puppet for about one week now, I have to say >> that I am NOT a developer, i occasionally write a shellscript or >> another >> but thats about it, so maybe my problem is that i dont see the whole >> picture yet.. I kind of know what i want to do, but at the moment i >> don´t realy see how i can accomplish that.. :/ >> > > I''ll see if I can help, then. You shouldn''t need to be a developer > to use Puppet. >You have. Late last night realization dawned and when I read your mail this morning it was a very good reference, thanks a lot! I just mixed up some things in my head realy bad.. ;) (s.b.)> >> thing is, I have (for now "just") about 100 servers and about 30 >> different services to manage so the problem described below is.. well, >> you´ll see (or I´m damn ignorant, always a possibility..) >> >> server-series A; service 1 (W instances) >> service 2 (Y instances) >> >> server-series B; service 1 (X instances) >> service 2 (Z instances) >> >> instances share basepath; differ in instancepath; share config/ >> runningpath >> >> serverA/service1/01/configpath >> serverA/service1/02/configpath >> serverA/service2/01/configpath >> [...] >> serverB/service1/01/configpath >> serverB/service2/01/configpath >> serverB/service2/02/configpath >> >> >> how to define the difference in the instancepath? wildcards? >> evaluation >> of instancepathfolder? >> I did not realy find anything in the documentation regarding >> pathsubstitution or wildcards or anything, if soemone could point >> me in >> the right direction, please.. >> > > Variables are substituted in double-quoted strings, so if you''re > setting a path, you could do something like the following: > > file { "/$hostname/$service/$instance": ... } > > You should be able to use that variable substitution anywhere you''d > use a string in Puppet, although unlike in the shell you''ll need to > quote most uses. E.g., you don''t have to quote variables by themselves: > > file { "/tmp/myfile": owner => $user } > > But you will need to quote multiple variables: > > file { "/tmp/myfile": content => "$one$two" } > > In general, if you''re not sure, then quote. >Right, I understood that, my problem just was misunderstanding the way puppet operates - I thought I tell puppet to investigate my system that was running previously to installing puppet with the servicesdefinitions I have set in puppet, without specifying where wich service with how many instances is running and puppet will sort the rest out. This idea just doesn´t work because I have the aforementioned multiple instances (thats why I asked these strange questions about directory-evaluation and path substitution..) and my question was (although quite differently phrased ;) ) how I could get puppet to build its own "site.pp" for the servicestructures that are allready running. Way I understand it now is to "re-define" the already running servers preciseley the way they are (e.g. "Server A" has "service B" running with instances "1", "2" and "3"). First tests work as they should.> >> hardcoding all possible values (say 1 through 15) would be kind of the >> opposite of what i intend to do, on the other hand I dont realy have a >> clue as to how to do this, as i cant use classes (which would be >> hardcoding as I understood them until now) and I am lacking the >> understanding as to how to do this in general, what options do i >> have to >> do this? >> > > Hardcoding is definitely bad. > How are the instances set up? What kind of service is this? > It sounds like you should have a defined type to create instances; > something like this: > > define myservice($base = "/services", $service) { > file { "/$base/$service/$name": ... } > } > > Then you''d just create the instances you need: > > myservice { instance01: service => A } > > Make sense? > >Makes sense and works as should. Thanks a lot!>> Thanks for taking a quick look (and not laughting about the language >> skills, I´m from germany.. ;) ) >> Simon >> _______________________________________________ >> Puppet-users mailing list >> Puppet-users@madstop.com >> https://mail.madstop.com/mailman/listinfo/puppet-users >> > > > -- > I don''t always know what I''m talking about, but I''m always pretty much > convinced that I''m right. > -- musician Mojo Nixon > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >