-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Tim, *! Thank you for posting your nice apache2 recipe to the wiki! It''s really good to see how others make things happen and a good example for others. One little thing though caught my notice because I''m currently making the same naughty thing on Simple Text Recipes. There is no ensure attribute. Since you already have done all the hard work, here a simple implementation: {{{ define apache_site($ensure = ''present'', $require => ''apache2'') { case $ensure { ''present'' : { apache_enable_site { "enable_$name": require => $require } } ''absent'' : { apache_disable_site { "disable_$name": } } default: { err( "Unknown ensure value ''$ensure''" ) } } } # Examples: apache_site { ["www.example.com", "blog.example.com"]: ensure => present; "java.example.com": require => "libapache2-mod-jk", ensure => present; "nudes.example.com": ensure => absent; } }}} Similarily the module defines could be rearranged. If you agree, I could rework the recipe and also inline the *{en,dis}able* execs so that there are only the apache_site and apache_module defines. Regards, David - -- - - hallo... wie gehts heute? - - *hust* gut *rotz* *keuch* - - gott sei dank kommunizieren wir über ein septisches medium ;) -- Matthias Leeb, Uni f. angewandte Kunst, 2005-02-15 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFF230l/Pp1N6Uzh0URAscIAJ9evbZLE4ShpYvtl51l3rQDtEDTOACfTViA pRxhkcm6AFJgsWW0spwTGg0=GtO0 -----END PGP SIGNATURE-----
On 21/02/2007, at 9:58 AM, David Schmitt wrote:> > define apache_site($ensure = ''present'', $require => ''apache2'') {Are you allowed to use ''=>'' there? if so, how is it different from ''=''?
On Wed, Feb 21, 2007 at 03:23:48PM +1100, Jesse Reynolds wrote:> > On 21/02/2007, at 9:58 AM, David Schmitt wrote: > > > > define apache_site($ensure = ''present'', $require => ''apache2'') { > > Are you allowed to use ''=>'' there? if so, how is it different from ''=''?No, that''s "the syntax error we all make" -- about 2/3 of my defines with default values have that same problem the first time around. - Matt
Hi David, On 2/20/07, David Schmitt <david@schmitt.edv-bus.at> wrote:> > Thank you for posting your nice apache2 recipe to the wiki! It''s really > good > to see how others make things happen and a good example for others.Thank you :) Just trying to add my share of the work. One little thing though caught my notice because I''m currently making the> same > naughty thing on Simple Text Recipes. There is no ensure attribute. Since > you > already have done all the hard work, here a simple implementation:[snip] That''s great! Yeah, I was talking about the ensure on IRC and I kinda didn''t know how to actually implement it correctly. Your solution is great, though, because this way you can make the apache2 reload part of the define, which I wanted because I prefer to put all components (defines) in their own separate file outside of a class. Similarily the module defines could be rearranged. If you agree, I could> rework the recipe and also inline the *{en,dis}able* execs so that there > are > only the apache_site and apache_module defines.Of course I agree :) Nice of you to ask, but it''s a wiki, just change the stuff you want to change :) Especially since you''re actually improving the stuff that''s there :) I was a bit vexed that I needed the [en|dis]able parts in the name of the define, since it''s so unlike all the other types. I''m glad you know of a better solution! -- Gegroet, Tim _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday 21 February 2007 08:55, Tim Stoop wrote:> > rework the recipe and also inline the *{en,dis}able* execs so that there > > are > > only the apache_site and apache_module defines. > > Of course I agree :) Nice of you to ask, but it's a wiki, just change the > stuff you want to change :) Especially since you're actually improving the > stuff that's there :) > > I was a bit vexed that I needed the [en|dis]able parts in the name of the > define, since it's so unlike all the other types. I'm glad you know of a > better solution!But it's so much easier to give feedback on the mailinglist than on the wiki. Anyways. As mentioned on IRC, I now restructured the defines no in the wiki. Regards, David - -- - - hallo... wie gehts heute? - - *hust* gut *rotz* *keuch* - - gott sei dank kommunizieren wir über ein septisches medium ;) -- Matthias Leeb, Uni f. angewandte Kunst, 2005-02-15 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFF3Bh0/Pp1N6Uzh0URAnwfAKCQJtdAUvnnPzOSg3YDz6ef78YPwwCgo5iq 1T8uPA3hnbE2AXecy8N9jno=k1+p -----END PGP SIGNATURE----- _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On 2/21/07, Matthew Palmer <mpalmer@hezmatt.org> wrote:> No, that''s "the syntax error we all make" -- about 2/3 of my defines with > default values have that same problem the first time around. >Which shows you how thoroughly I test my recipes before I put them in the wiki :| (Apparantly, I pasted an older version... I do test them... honestly!) -- Gegroet, Tim _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users