On Sep 30, 2014, at 2:50 PM, Nicolas lino <
nicola...@gmail.com> wrote:
> Hello and sorry for my English.
>
> I have my first module but I have a prblem:
>
> My manifest:
> #
> #
> #
> class nginx {
> $nginx_conf = '/etc/nginx/conf.d'
>
> service { 'nginx':
> ensure => running,
> enable => true,
> hasrestart => true,
> require => File['/etc/nginx/nginx.conf'],
> restart => '/etc/init.d/nginx reload'
> }
>
> file { '/etc/nginx/nginx.conf':
> ensure => latest,
> mode => '0644',
> owner => 'root',
> group => 'root',
> source => "puppet:///modules/nginx/nginx.conf",
> } ////////line22
You cannot use 'latest' for the file resource's ensure parameter. That value only applies to package resources. Puppet will always ensure that the file on a client matches whatever version of file exists at the path specified in the manifest. You should use one of the following values for the ensure parameter: file, directory, link, absent. 'present' is also supported, but I encourage you to avoid it and be explicit by specifying the type of file. In your case, 'file' is the correct choice.