Hi, I was looking for a solution to change the value of a variable using include (http://reductivelabs.com/trac/puppet/wiki/ CommonMisconceptions), and found an interesting solution on the kinial SPEC (http://reductivelabs.com/trac/puppet/wiki/KinialSpec). But I can''t find more about this project ? iClassify derives from this spec, but the interesting part (inheritance) is not supported. So anyone has implemented kinial ? Thanks, Benoit --~--~---------~--~----~------------~-------~--~----~ 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 Feb 4, 2009, at 1:20 PM, benoit wrote:> > Hi, > > I was looking for a solution to change the value of a variable using > include (http://reductivelabs.com/trac/puppet/wiki/ > CommonMisconceptions), and found an interesting solution on the kinial > SPEC (http://reductivelabs.com/trac/puppet/wiki/KinialSpec). But I > can''t find more about this project ? > iClassify derives from this spec, but the interesting part > (inheritance) is not supported. So anyone has implemented kinial ?As far as I know no one has implemented it, other than 90% of its behaviour is available if you use ldap nodes. And, actually, I think I''ve published a trival script that uses yaml storage for node information but still supports inheritance. I can republish if you''re interested; it really is simple. -- I can''t understand why a person will take a year to write a novel when he can easily buy one for a few dollars. -- Fred Allen --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ 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 02/05/2009 06:03 AM, Luke Kanies wrote:> On Feb 4, 2009, at 1:20 PM, benoit wrote: > > >> Hi, >> >> I was looking for a solution to change the value of a variable using >> include (http://reductivelabs.com/trac/puppet/wiki/ >> CommonMisconceptions), and found an interesting solution on the kinial >> SPEC (http://reductivelabs.com/trac/puppet/wiki/KinialSpec). But I >> can''t find more about this project ? >> iClassify derives from this spec, but the interesting part >> (inheritance) is not supported. So anyone has implemented kinial ? >> > > As far as I know no one has implemented it, other than 90% of its > behaviour is available if you use ldap nodes. And, actually, I think > I''ve published a trival script that uses yaml storage for node > information but still supports inheritance. I can republish if you''re > interested; it really is simple. > >What are the 10% missing ? Does ldap node implements multi-inheritance as describes in the kinial spec ? Thanks. --~--~---------~--~----~------------~-------~--~----~ 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 Feb 5, 2009, at 4:49 AM, Benoit Decherf wrote:> On 02/05/2009 06:03 AM, Luke Kanies wrote: >> >> On Feb 4, 2009, at 1:20 PM, benoit wrote: >> >> >>> Hi, >>> >>> I was looking for a solution to change the value of a variable using >>> include (http://reductivelabs.com/trac/puppet/wiki/ >>> CommonMisconceptions), and found an interesting solution on the >>> kinial >>> SPEC (http://reductivelabs.com/trac/puppet/wiki/KinialSpec). But I >>> can''t find more about this project ? >>> iClassify derives from this spec, but the interesting part >>> (inheritance) is not supported. So anyone has implemented kinial ? >>> >> As far as I know no one has implemented it, other than 90% of its >> behaviour is available if you use ldap nodes. And, actually, I think >> I''ve published a trival script that uses yaml storage for node >> information but still supports inheritance. I can republish if >> you''re >> interested; it really is simple. >> >> > What are the 10% missing ? > Does ldap node implements multi-inheritance as describes in the > kinial spec ?Heh, well, I haven''t looked at the kinial stuff in a long time, so I basically made up the 90% number. No, ldap doesn''t support multiple inheritance, although it would be easy to add. Other than that, it probably does have nearly all of the functionality. It just doesn''t have all of the other stuff I wanted. -- There are no such things as applied sciences, only applications of science. -- Louis Pasteur --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Benoit, If you want to globally change the value of a variable something that may either be a feature or a bug(?) is to pass it through an ERB and use a ''!'' ruby statement. It changes it in memory until the puppetmaster is restarted. I.e. $myvar = ''foo'' define bar ($stupidvar = "nil" ) { stupidvar = template(changeglobal.erb) } --- changeglobal.erb --- <% myvar.gsub!(/^.*$/new string/) %> --- end --- It seems to work in 0.24.6, but heck if I know if it''s supposed to. Trevor On Wed, Feb 4, 2009 at 14:20, benoit <bdecherf@gmail.com> wrote:> > Hi, > > I was looking for a solution to change the value of a variable using > include (http://reductivelabs.com/trac/puppet/wiki/ > CommonMisconceptions), and found an interesting solution on the kinial > SPEC (http://reductivelabs.com/trac/puppet/wiki/KinialSpec). But I > can''t find more about this project ? > iClassify derives from this spec, but the interesting part > (inheritance) is not supported. So anyone has implemented kinial ? > > Thanks, > Benoit > > > >--~--~---------~--~----~------------~-------~--~----~ 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 Feb 5, 2009, at 9:45 AM, Trevor Vaughan wrote:> > Benoit, > > If you want to globally change the value of a variable something that > may either be a feature or a bug(?) is to pass it through an ERB and > use a ''!'' ruby statement. > > It changes it in memory until the puppetmaster is restarted. > > I.e. > > $myvar = ''foo'' > > define bar ($stupidvar = "nil" ) { > stupidvar = template(changeglobal.erb) > } > > --- changeglobal.erb --- > > <% myvar.gsub!(/^.*$/new string/) %> > > --- end --- > > It seems to work in 0.24.6, but heck if I know if it''s supposed to.Heh, nice. Yeah, Puppet''s call-by-value, so if you modify the value, the modification will stick. I can''t see us ever changing that. -- Don''t throw away the old bucket until you know whether the new one holds water. -- Swedish Proverb --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
So, can we officially call it a feature? I''ve been avoiding using it because I thought that it was a problem but it does get around the "can''t change a variable" issue. You just have to be *really* careful about changing it. Trevor On Thu, Feb 5, 2009 at 10:55, Luke Kanies <luke@madstop.com> wrote:> > On Feb 5, 2009, at 9:45 AM, Trevor Vaughan wrote: > >> >> Benoit, >> >> If you want to globally change the value of a variable something that >> may either be a feature or a bug(?) is to pass it through an ERB and >> use a ''!'' ruby statement. >> >> It changes it in memory until the puppetmaster is restarted. >> >> I.e. >> >> $myvar = ''foo'' >> >> define bar ($stupidvar = "nil" ) { >> stupidvar = template(changeglobal.erb) >> } >> >> --- changeglobal.erb --- >> >> <% myvar.gsub!(/^.*$/new string/) %> >> >> --- end --- >> >> It seems to work in 0.24.6, but heck if I know if it''s supposed to. > > Heh, nice. Yeah, Puppet''s call-by-value, so if you modify the value, > the modification will stick. I can''t see us ever changing that. > > -- > Don''t throw away the old bucket until you know whether the new one > holds water. -- Swedish Proverb > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 Feb 5, 2009, at 9:56 AM, Trevor Vaughan wrote:> > So, can we officially call it a feature? > > I''ve been avoiding using it because I thought that it was a problem > but it does get around the "can''t change a variable" issue. You just > have to be *really* careful about changing it.Um, sure? I don''t like committing to things, but...> > On Thu, Feb 5, 2009 at 10:55, Luke Kanies <luke@madstop.com> wrote: >> >> On Feb 5, 2009, at 9:45 AM, Trevor Vaughan wrote: >> >>> >>> Benoit, >>> >>> If you want to globally change the value of a variable something >>> that >>> may either be a feature or a bug(?) is to pass it through an ERB and >>> use a ''!'' ruby statement. >>> >>> It changes it in memory until the puppetmaster is restarted. >>> >>> I.e. >>> >>> $myvar = ''foo'' >>> >>> define bar ($stupidvar = "nil" ) { >>> stupidvar = template(changeglobal.erb) >>> } >>> >>> --- changeglobal.erb --- >>> >>> <% myvar.gsub!(/^.*$/new string/) %> >>> >>> --- end --- >>> >>> It seems to work in 0.24.6, but heck if I know if it''s supposed to. >> >> Heh, nice. Yeah, Puppet''s call-by-value, so if you modify the value, >> the modification will stick. I can''t see us ever changing that. >> >> -- >> Don''t throw away the old bucket until you know whether the new one >> holds water. -- Swedish Proverb >> --------------------------------------------------------------------- >> Luke Kanies | http://reductivelabs.com | http://madstop.com >> >> >>> >> > > >-- It is curious that physical courage should be so common in the world and moral courage so rare. -- Mark Twain --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ok. About the external nodes, why doesn''t it possible to use definition ? I use definition to create an instance of tomcat for exemple. So I''d like to be able to create a node with 2 or more instances. Why there is this limitation ?>> What are the 10% missing ? >> Does ldap node implements multi-inheritance as describes in the >> kinial spec ? >> > > Heh, well, I haven''t looked at the kinial stuff in a long time, so I > basically made up the 90% number. > > No, ldap doesn''t support multiple inheritance, although it would be > easy to add. > > Other than that, it probably does have nearly all of the > functionality. It just doesn''t have all of the other stuff I wanted. > >--~--~---------~--~----~------------~-------~--~----~ 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 Feb 5, 2009, at 10:36 AM, Benoit Decherf wrote:> Ok. > > About the external nodes, why doesn''t it possible to use definition ? > I use definition to create an instance of tomcat for exemple. So I''d > like to be able to create a node with 2 or more instances. > Why there is this limitation ?You can use definitions, you just can''t use them in your external nodes tool. Put the definitions in a class, and use the external nodes tool to specify that a node is a member of that class. -- When a man tells you that he got rich through hard work, ask him: ''Whose?'' --Don Marquis --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ 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 Feb 5, 7:27 pm, Luke Kanies <l...@madstop.com> wrote:> On Feb 5, 2009, at 10:36 AM, Benoit Decherf wrote: > > > Ok. > > > About the external nodes, why doesn''t it possible to use definition ? > > I use definition to create an instance of tomcat for exemple. So I''d > > like to be able to create a node with 2 or more instances. > > Why there is this limitation ? > > You can use definitions, you just can''t use them in your external > nodes tool. Put the definitions in a class, and use the external > nodes tool to specify that a node is a member of that class. >You can do this, but it remove a lot of interest you have when using external nodes. It means you have to provides one class per definition use (for each distinct list of couples (param, value) that you must provide to the call to your definition) Could you give more details on the reasons why definitions are not implemented in external nodes ? - is it only a lack of time ? - the difficulty of implementing it ? (would it involve a lot of code change ?) - an incompatibility with the future eveloution of the langage/ implementation ? nicolas --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi> You can do this, but it remove a lot of interest you have when using > external nodes. > It means you have to provides one class per definition use (for each > distinct list of couples (param, value) that you must provide to the > call to your definition)no. you can use the variables provided by the external tool in the classes you include. you even then could implement kind of default values for these variables in the class. for an illustration: $test = ''foobar'' include testclass class testclass { case $test { '''': { $test = ''default_value'' } } $testparam = "test_${test}" testdefine{"name_${test}": param => $testparam } } define testdefine( $param ){ notice("${name} called with ${param}") } --- # puppet foo.pp notice: Scope(Testdefine[name_foobar]): name_foobar called with test_foobar this is completely besides the discussion if it should be able to call defines from an external tool. cheers pete --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
It''s not a good solution. In our company, we separate the system admins and the dev. When the developers create an application, they provide the puppet class to deploy the application. In some case, an application can be deployed several times in the same host. (several instances of the application). To do that, developer provide a definition. Then, the system admin should create there host with as much instances as they want : node machine1 { install_appli{"instance1": ... } install_appli{"instance2": ... } } So using external nodes they have to create the class class appli_instances { install_appli{"instance1": ... } install_appli{"instance2": ... } } and use external node to use the appli_instances class. SO they will have to maintain classes (.pp files) AND nodes (LDAP or other). That''s not a good solution in my opinion. Why definitions aren''t supported by external node ? (Will they be supported in the future ?) On 02/06/2009 09:45 AM, Peter Meier wrote:> Hi > > >> You can do this, but it remove a lot of interest you have when using >> external nodes. >> It means you have to provides one class per definition use (for each >> distinct list of couples (param, value) that you must provide to the >> call to your definition) >> > > no. you can use the variables provided by the external tool in the > classes you include. you even then could implement kind of default > values for these variables in the class. > > for an illustration: > > $test = ''foobar'' > > include testclass > > class testclass { > case $test { > '''': { $test = ''default_value'' } > } > > $testparam = "test_${test}" > > testdefine{"name_${test}": param => $testparam } > } > > define testdefine( $param ){ > notice("${name} called with ${param}") > } > > --- > # puppet foo.pp > notice: Scope(Testdefine[name_foobar]): name_foobar called with test_foobar > > this is completely besides the discussion if it should be able to call > defines from an external tool. > > cheers pete > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> > no. you can use the variables provided by the external tool in the > > classes you include. you even then could implement kind of default > > values for these variables in the class. >In think your example gives a false idea of a solution because you have only one call to the definition If you don''t know in advance how many call you''ll have to use, you must say N times some thing like => testdefine{"name_${test_i}": param => $testparam_i } Moreover if you have several arguments to the definition you end up with a bunch of parameters to deal with. So each time you want to change the number of calls, you have to modify the class, which mean writing some .pp file Thus the benefits of using external node is lost by the need to modify this class each time.>> this is completely besides the discussion if it should be able to call >> defines from an external tool.well, it''s an extension of the discussion. If i can''t do something with the language it is a good question to know if we can change or extend it, no ? Do you want me to start a new topic ? nicolas --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi>> > no. you can use the variables provided by the external tool in the >> > classes you include. you even then could implement kind of default >> > values for these variables in the class. >> > > In think your example gives a false idea of a solution because you > have only one call to the definition > If you don''t know in advance how many call you''ll have to use, > you must say N times some thing like => testdefine{"name_${test_i}": > param => $testparam_i } > Moreover if you have several arguments to the definition you end up > with a bunch of parameters to deal with. > > So each time you want to change the number of calls, you have to > modify the class, which mean writing some .pp file > Thus the benefits of using external node is lost by the need to modify > this class each time.yeah I missed that point. My solution doesn''t work if you''d like to call a define more than once. actually you could do it with an array. however then the define can''t have any params. :/>>> this is completely besides the discussion if it should be able to call >>> defines from an external tool. > > well, it''s an extension of the discussion. If i can''t do something > with the language it is a good question to know if we can change or > extend it, no ?for sure.> Do you want me to start a new topic ?I think the current topic is good enough to discuss if this is possible and might be the problems. Maybe it''s not even a big deal for you to implement it, if people can redirect you to the right place. cheers pete --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hello, A Divendres 06 Febrer 2009, Peter Meier va escriure:> Hi > > >> > no. you can use the variables provided by the external tool in the > >> > classes you include. you even then could implement kind of default > >> > values for these variables in the class. > > > > In think your example gives a false idea of a solution because you > > have only one call to the definition > > If you don''t know in advance how many call you''ll have to use, > > you must say N times some thing like => testdefine{"name_${test_i}": > > param => $testparam_i } > > Moreover if you have several arguments to the definition you end up > > with a bunch of parameters to deal with. > > > > So each time you want to change the number of calls, you have to > > modify the class, which mean writing some .pp file > > Thus the benefits of using external node is lost by the need to modify > > this class each time. > > yeah I missed that point. My solution doesn''t work if you''d like to > call a define more than once. actually you could do it with an array. > however then the define can''t have any params. :/If you apply the patch in http://projects.reductivelabs.com/issues/show/1858 to puppetmaster, you can call functions from an external nodes hash, wich can contain the parameters for the function: external nodes yaml: files: passwd: owner: root group: root mode: 644 source: xxxxx shadow: owner: root group: shadow mode: 640 source: yyyyy puppet manifest: define remote_file($owner, $group,$mode,$source,$source) { ... } remote_file { $files: } function "remote_file" is called two times with different arguments each time> >>> this is completely besides the discussion if it should be able to call > >>> defines from an external tool. > > > > well, it''s an extension of the discussion. If i can''t do something > > with the language it is a good question to know if we can change or > > extend it, no ? > > for sure. > > > Do you want me to start a new topic ? > > I think the current topic is good enough to discuss if this is > possible and might be the problems. Maybe it''s not even a big deal for > you to implement it, if people can redirect you to the right place. > > cheers pete > >--~--~---------~--~----~------------~-------~--~----~ 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 Feb 6, 2009, at 2:04 AM, nicolas wrote:> > On Feb 5, 7:27 pm, Luke Kanies <l...@madstop.com> wrote: >> On Feb 5, 2009, at 10:36 AM, Benoit Decherf wrote: >> >>> Ok. >> >>> About the external nodes, why doesn''t it possible to use >>> definition ? >>> I use definition to create an instance of tomcat for exemple. So I''d >>> like to be able to create a node with 2 or more instances. >>> Why there is this limitation ? >> >> You can use definitions, you just can''t use them in your external >> nodes tool. Put the definitions in a class, and use the external >> nodes tool to specify that a node is a member of that class. >> > > You can do this, but it remove a lot of interest you have when using > external nodes.I guess I''m confused. One of my standing principles is that nothing should be done per-host, rather a class should be built to model any functionality, so that you''re not tied to hostnames. Based on this ideal, I didn''t see the need for resources attached to nodes. In fact, I wouldn''t allow it in my own environment if it were allowed.> > It means you have to provides one class per definition use (for each > distinct list of couples (param, value) that you must provide to the > call to your definition) > > Could you give more details on the reasons why definitions are not > implemented in external nodes ? > - is it only a lack of time ? > - the difficulty of implementing it ? (would it involve a lot of code > change ?) > - an incompatibility with the future eveloution of the langage/ > implementation ?As above, it was a design decision. Like all design decisions, though, I''m willing to revisit it if it seems the decision was in error. -- When a man tells you that he got rich through hard work, ask him: ''Whose?'' --Don Marquis --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> >>> About the external nodes, why doesn''t it possible to use > >>> definition ? > >>> I use definition to create an instance of tomcat for exemple. So I''d > >>> like to be able to create a node with 2 or more instances. > >>> Why there is this limitation ? > > >> You can use definitions, you just can''t use them in your external > >> nodes tool. Put the definitions in a class, and use the external > >> nodes tool to specify that a node is a member of that class. > > > You can do this, but it remove a lot of interest you have when using > > external nodes. > > I guess I''m confused. > > One of my standing principles is that nothing should be done per-host, > rather a class should be built to model any functionality, so that > you''re not tied to hostnames. > > Based on this ideal, I didn''t see the need for resources attached to > nodes. In fact, I wouldn''t allow it in my own environment if it were > allowed. > >Maybe there is something I missed about definitions. I though it was a notion related to the notion of a class. I''m confused too, because your answer make me think that you consider definition call like resources. Is it the case ? My only request was to be able to put parameters, classes and definitions calls in nodes. Here the request to have definition (call) in the external nodes.> > > It means you have to provides one class per definition use (for each > > distinct list of couples (param, value) that you must provide to the > > call to your definition) > > > Could you give more details on the reasons why definitions are not > > implemented in external nodes ? > > - is it only a lack of time ? > > - the difficulty of implementing it ? (would it involve a lot of code > > change ?) > > - an incompatibility with the future eveloution of the langage/ > > implementation ? > > As above, it was a design decision. > > Like all design decisions, though, I''m willing to revisit it if it > seems the decision was in error. > > -- > When a man tells you that he got rich through hard work, ask > him: ''Whose?'' --Don Marquis > --------------------------------------------------------------------- > Luke Kanies |http://reductivelabs.com|http://madstop.comnicolas --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> > Maybe there is something I missed about definitions. I though it was > a notion related to the notion of a class. > I''m confused too, because your answer make me think that you > consider definition call like resources. Is it the case ? > > My only request was to be able to put parameters, classes and > definitions calls in nodes. Here the request to have definition (call) > in the external nodes. >maybe the confusion comes from the fact that you must define a resource with the same syntax that you use to call a definition x { "name" : parameters } if calling a definition used a different syntax, would''nt it be better ? Calling a definition should be equivalent to including a class. nicolas --~--~---------~--~----~------------~-------~--~----~ 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 Mon, Feb 9, 2009 at 9:24 AM, nicolas <ncapponi@yahoo.fr> wrote:> > >> >> Maybe there is something I missed about definitions. I though it was >> a notion related to the notion of a class. >> I''m confused too, because your answer make me think that you >> consider definition call like resources. Is it the case ? >> >> My only request was to be able to put parameters, classes and >> definitions calls in nodes. Here the request to have definition (call) >> in the external nodes. >> > > maybe the confusion comes from the fact that you must define a > resource with the same syntax that you use to call a definition > x { "name" : parameters } > if calling a definition used a different syntax, would''nt it be > better ? > Calling a definition should be equivalent to including a class.This is the biggest mistake I see amongst people new to Puppet. A definition isn''t "called." A definition is not a function. Puppet is a declarative language, not an imperative language. You need to make this conceptual jump to understand the Puppet way of doing things. Conceptually, a definition IS a resource. Let me repeat that: Definition == Resource That is why the syntax is the same. Definitions provide you the ability to create composite resources that abstract away the details of the individual resource "atoms" (file, service, etc.) that are required to make up your defined resource. Calling a definition absolutely should *NOT* be equivalent to including a class, they are very different collections. Definitions are used to abstract away collections of resources while maintaining the ability to have multiple "instances" of the defined resource. So, you can have multiple subversion::working-copy instances within a single class of machine, this is a critical capability to have! Classes are collections used to wholly define a role that a certain node plays. So, while it may take multiple subversion::working-copy instances to make up a webserver, you don''t want multiple "webserver" roles on a single node, that''s conceptually weird. --Paul --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> This is the biggest mistake I see amongst people new to Puppet. A > definition isn''t "called." A definition is not a function. Puppet is a > declarative language, not an imperative language. You need to make > this conceptual jump to understand the Puppet way of doing things. > > Conceptually, a definition IS a resource. Let me repeat that: > > Definition == Resource > > That is why the syntax is the same. Definitions provide you the > ability to create composite resources that abstract away the details > of the individual resource "atoms" (file, service, etc.) that are > required to make up your defined resource. > > Calling a definition absolutely should *NOT* be equivalent to > including a class, they are very different collections. Definitions > are used to abstract away collections of resources while maintaining > the ability to have multiple "instances" of the defined resource. So, > you can have multiple subversion::working-copy instances within a > single class of machine, this is a critical capability to have! > Classes are collections used to wholly define a role that a certain > node plays. So, while it may take multiple subversion::working-copy > instances to make up a webserver, you don''t want multiple "webserver" > roles on a single node, that''s conceptually weird. > > --Paulok paul, thanks for clarifying this. I think my misconception comes from what we''re trying to do. We have webapps that have instances defined for different set of countries So we have definitions like : define webapp-instance($countries, ...) And then for a set of machines we want to deploy our instances, but no machine has the exact same requirement : node node1 { webapp-instance { "es_fr", countries = ["es", "fr"] } webapp-instance { "uk", countries = ["uk"] } } node node2 { webapp-instance { "es_it", countries = ["es", "it"] } webapp-instance { "de", countries = ["de"] } } and so on... So, if I follow your guidelines, I should define intermediate classes and then use theses classes in the nodes class webapp_instance_es_fr { webapp-instance { "es_fr", countries = ["es", "fr"] } } class webapp_instance_uk { webapp-instance { "uk", countries = ["uk"] } } class webapp_instance_"de" { webapp-instance { "de", countries = ["de"] } } and then put theses classes in my nodes : node node1 { include webapp_instance_es_fr include webapp_instance_uk } Although this step makes sense, it happens that using "definition call" (how should I say ?) directly in nodes is easier because people in charge of managing nodes don''t have to write intermediate classes that only act as wrapper. As there is almost no machine with the same country configuration (that is, a class will only be used by one machine in practice), the overhead of writing intermediate classes gives no real benefits, even if conceptually cleaner. Any comment on this ? thanks nicolas --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---