I want to have a dependency on whether or not a package is installed. I see in the package type that there is a ''status'', that can presumably be read. How can I use that in my recipe? For example, something like: if Package["syslog"] => installed { file "/etc/syslog.conf" { blah blah } } Thanks! David
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1> if Package["syslog"] => installed { > file "/etc/syslog.conf" { > blah blah > } > }How about: package{''syslog'': ensure => installed } file{"/etc/syslog.conf": require => Package[''syslog''], blah blah } cheers pete -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkteQSgACgkQbwltcAfKi380fgCgo8bYXQYGHh0JmJRSeypHUkTt KeIAn1IfTi6MYVKeSnStR1mlcdb/4h6P =d49v -----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.
Ah, but I don''t want to ensure that the package is installed. In fact, sometimes it won''t be - on purpose. And I want to change the recipes behavior based on that fact. David Bishop On Jan 25, 2010, at 8:11 PM, Peter Meier <peter.meier@immerda.ch> wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > >> if Package["syslog"] => installed { >> file "/etc/syslog.conf" { >> blah blah >> } >> } > > How about: > > package{''syslog'': ensure => installed } > file{"/etc/syslog.conf": > require => Package[''syslog''], > blah blah > } > > cheers pete > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAkteQSgACgkQbwltcAfKi380fgCgo8bYXQYGHh0JmJRSeypHUkTt > KeIAn1IfTi6MYVKeSnStR1mlcdb/4h6P > =d49v > -----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 > . >-- 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 01/25/2010 08:44 PM, David Bishop wrote:> Ah, but I don''t want to ensure that the package is installed. In fact, > sometimes it won''t be - on purpose. And I want to change the recipes > behavior based on that fact.Bingo. You nailed it. "based on that *fact*" (emphasis mine) You need to write a fact in order to do this. The alternative is to write two versions of the manifest; one where you force it installed like Peter suggested, and one where you ensure it''s absent. -Doug