Nigel Kersten
2010-May-08 03:43 UTC
[Puppet Users] Puppet docs, defined types and requires.
I don''t know if it''s just me, but I find this example horribly confusing, and I''m wondering if it''s just really out of date. http://docs.puppetlabs.com/guides/language_tutorial.html#definitions define svn_repo($path) { exec {"create_repo_${name}": command => "/usr/bin/svnadmin create $path/$title", unless => "/bin/test -d $path", } if $require { Exec["create_repo_${name}"]{ require +> $require, } } } svn_repo { puppet: path => "/var/svn", require => Package[subversion], } It doesn''t really make any sense to me. What''s the problem with the require being set on Svn_repo[puppet] rather than Svn_repo[puppet]/Exec[create_repo_puppet] ? Another problem is that this model breaks down entirely if you need to set a require on Exec[create_repo_puppet] itself as Puppet will complain that the require has already been defined. (which seems kind of odd given the use of plusignment, but I don''t use this syntax ever, so maybe it''s just me.) It just feels like you could accomplish the same thing with: define svn_repo($path) { exec {"create_repo_${name}": command => "/usr/bin/svnadmin create $path/$title", unless => "/bin/test -d $path", } } svn_repo { puppet: path => "/var/svn", require => Package[subversion], } with the added bonus that you can set additional requires inside the defined type without having to jump through any hoops. Were metaparameters not supported with defined types in the past? -- nigel -- 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.
James Turnbull
2010-May-08 04:08 UTC
Re: [Puppet Users] Puppet docs, defined types and requires.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 8/05/10 1:43 PM, Nigel Kersten wrote:> I don''t know if it''s just me, but I find this example horribly > confusing, and I''m wondering if it''s just really out of date.Patches accepted... :) Regards James - -- Author of: * Pro Linux System Administration (http://tinyurl.com/linuxadmin) * Pulling Strings with Puppet (http://tinyurl.com/pupbook) * Pro Nagios 2.0 (http://tinyurl.com/pronagios) * Hardening Linux (http://tinyurl.com/hardeninglinux) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEVAwUBS+TjoyFa/lDkFHAyAQKC3wf/RuZyusZvbBrqtVYRmJLcm6EwmBA65A9v qgis5F53yqCarNGcG2Jd5TxbeCDCScCwHUxRaAkDeZwE/dPHOmPWQind46SiH1Ub KGqKi1Bb9bEuOy0Xg5Rmbuh3mR8+++oj8nlDarkSr6Jr3eFetYfH/CzW55YpdbKp brWCLYv1gbW/zqtjGrEPGClUmqsOrg+FElolwkq+msfXHWfHtzEjTpwt4L8HAnEm W0XtaKJS/EloCD3uYuMTVVrTbXUMus339fD6AK7YwrU/TANfnDNFL8A0D/zgDuaf puC2j82ugg6AniVvbIllr5kJVqqn9I2Sbcv84aqCwPSORcZ4Q5V71g==5/WE -----END PGP SIGNATURE----- -- 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.
Nigel Kersten
2010-May-08 13:47 UTC
Re: [Puppet Users] Puppet docs, defined types and requires.
On Fri, May 7, 2010 at 9:08 PM, James Turnbull <james@lovedthanlost.net>wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 8/05/10 1:43 PM, Nigel Kersten wrote: > > I don''t know if it''s just me, but I find this example horribly > > confusing, and I''m wondering if it''s just really out of date. > > Patches accepted... :) >Well I first thought I''d check to see if I was missing something... Can you see any reason why that example is structured the way it is? There''s kind of a patch at the bottom of my original post too ;)> Regards > > James > > - -- > Author of: > * Pro Linux System Administration (http://tinyurl.com/linuxadmin) > * Pulling Strings with Puppet (http://tinyurl.com/pupbook) > * Pro Nagios 2.0 (http://tinyurl.com/pronagios) > * Hardening Linux (http://tinyurl.com/hardeninglinux) > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.7 (Darwin) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iQEVAwUBS+TjoyFa/lDkFHAyAQKC3wf/RuZyusZvbBrqtVYRmJLcm6EwmBA65A9v > qgis5F53yqCarNGcG2Jd5TxbeCDCScCwHUxRaAkDeZwE/dPHOmPWQind46SiH1Ub > KGqKi1Bb9bEuOy0Xg5Rmbuh3mR8+++oj8nlDarkSr6Jr3eFetYfH/CzW55YpdbKp > brWCLYv1gbW/zqtjGrEPGClUmqsOrg+FElolwkq+msfXHWfHtzEjTpwt4L8HAnEm > W0XtaKJS/EloCD3uYuMTVVrTbXUMus339fD6AK7YwrU/TANfnDNFL8A0D/zgDuaf > puC2j82ugg6AniVvbIllr5kJVqqn9I2Sbcv84aqCwPSORcZ4Q5V71g=> =5/WE > -----END PGP SIGNATURE----- >-- nigel -- 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.
James Turnbull
2010-May-09 03:36 UTC
Re: [Puppet Users] Puppet docs, defined types and requires.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 8/05/10 11:47 PM, Nigel Kersten wrote:>> Well I first thought I''d check to see if I was missing something... Can >> you see any reason why that example is structured the way it is? > >> There''s kind of a patch at the bottom of my original post too ;) >It pre-dates my time on the project. Happy to see a re-write of that section. Regards James Turnbull - -- Author of: * Pro Linux System Administration (http://tinyurl.com/linuxadmin) * Pulling Strings with Puppet (http://tinyurl.com/pupbook) * Pro Nagios 2.0 (http://tinyurl.com/pronagios) * Hardening Linux (http://tinyurl.com/hardeninglinux) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEVAwUBS+YtoSFa/lDkFHAyAQIKUggAldH8vZR4Xqpg2NR6qcYWFYHFGOZtWKKK kXWhLcTyrFZnqLtjJ+dNXpn6FVLZMLcc++1jm2avzMVIhabTYsjmq5CzIiH8rHE3 j67tBETVCfSzIeMmvmZyhe0kciJrsUhFMmAO4BpoeRnmDcmc2agVOD7VSzu/DG8n CypzwyYq6AAY1mQvEs76QYeSaRYR121OERlQhKEfjo4XsCG802m/ziZPuVw8QV3T PWC50663sHCYiW0LGF3pFOSwRvKH6WujSJtN1T1sia5G75HkvMWx0s87I5qnBGuj tSXNmqF9qfnRjZB9Klp3at/xqsvDm9Seb6JRJlGsMWnF9sOUVy1+6g==30O/ -----END PGP SIGNATURE----- -- 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.