Hi John,

It's ok with unless => "/bin/bash -c '[ `/bin/rpm -q --qf %{VERSION} 
facter` = 1.7.6 ]'"

thanks a lot




Le mercredi 14 janvier 2015 18:34:58 UTC+1, puppetstan a écrit :
>
> Hi,
>
> I would like to update the package facter on all of my servers. (I can not 
> use INSTALL_OPTIONS because my puppet version is too old)
>
> I added a condition--> if the package facter is installed AND if facter 
> version is not facter-1.7.6-1.el6.x86_64.rpm I install the package but I 
> think 
> I have an error in my onlyif condition because it does not work.
>
> Can you have an idea please?
> Thanks in advance
>
> regards
>
>
> class paquet::redhat6-64 {
>
>         package {'facter':
>                   provider => 'rpm',
>         #          install_options => ['-Uvh'],
>                   source => "/tmp/facter-1.7.6-1.el6.x86_64.rpm",
>                   require => File["/tmp/facter-1.7.6-1.el6.x86_64.rpm"],
>                   notify => Service["puppet"],
>               }
>
>        file { "/tmp/facter-1.7.6-1.el6.x86_64.rpm":
>        source => "puppet:///modules/paquet/facter-1.7.6-1.el6.x86_64.rpm"
>        }
>
>         exec {'rpm updates':
>         command => '/bin/rpm -Uvh /tmp/facter-1.7.6-1.el6.x86_64.rpm',
>         onlyif => "/bin/rpm -q facter and ('/usr/bin/facter -v' != 
> facter-1.7.6)",
> }
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/38ab035b-f407-4ae1-af08-d286058b3001%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to