Hi Roman,

you can check for a defined package resource

if defined(Package['nginx']) {
  file { …… }
}

In this case the file resource will only be managed if the package resource has 
been defined.
This does not mean, that the package has been installed successfully!
For this option you have to add
require => Package['nginx'],
to your file resource.

hth,

Martin


On Jun 20, 2013, at 3:06 PM, Roman Alekseev <rs.aleks...@gmail.com> wrote:

> Hi Everyone,
> 
> Is it possible to use File directive only if some software is installed, 
> otherwise do nothing? 
> For example:
> 
> file { "/tmp/puppet-nginx-init.sh":
>                         ensure          => "present",
>                         owner           => "root",
>                         group           => "root",
>                         mode            => 0755,
>                         source          => 
> "puppet://$puppetserver/modules/nginx/puppet-nginx-init.sh",
> # only if nginx is installed
> 
>                 }
> 
> Thank you!
> 
> -- 
> 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 puppet-users+unsubscr...@googlegroups.com.
> To post to this group, send email to puppet-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to