On 21 June 2013 07:04, Roman Alekseev <rs.aleks...@gmail.com> wrote:

> Is the module below correct?
>
> class nginx {
>
> if defined(Package['nginx']) {
> 
>         file { "/tmp/puppet-nginx.sh":
>
>                         ensure          => "present",
>                         owner           => "root",
>                         group           => "root",
>                         mode            => 0755,
>                         source          =>
> "puppet://$puppetserver/modules/nginx/puppet-nginx.sh",
>
>                         require         => Package['nginx'],
>                 }
>
> }
>

The 'if defined()' is not required at all and, if I understand recent
discussions correctly, will lead to parse-order issues with your manifests.

Basically, without that in there, the rest of it says "Install a file
containing a copy of puppet-nginx.sh from the puppet server, but only if
the nginx package is installed", which I think is what you're after.  See
http://docs.puppetlabs.com/learning/ordering.html#packagefileservice for a
good example of the common 'package, file, service' idiom.

Regards,

Matt.

> --
> 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