On 9/30/14 2:50 PM, Nicolas lino 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
> 
>   file { $nginx_conf:
>     ensure  => directory,
>     mode    => '0644',
>     owner   => 'root',
>     group   => 'root',
>   }
> 
> }
> 
> Directory structure:
> [root@v702uprod manifests]# tree /etc/puppet/modules/
> /etc/puppet/modules/
> ├── API
> └── nginx
>     ├── files
>     │   └── nginx.conf
>     ├── manifests
>     │   └── init.pp
>     └── templates
> 
> 
> The problem:
> Error: Failed to apply catalog: Validation of
> File[/etc/nginx/nginx.conf] failed: You cannot specify more than one of
> content, source, target at /etc/puppet/m
> odules/nginx/manifests/init.pp:22
> Wrapped exception:
> You cannot specify more than one of content, source, target
> 
> 
> 
> someone comes up with the problem???
> 
> 
> 
> 
> 
> -- 

Hi Nicolas,

Try changing the file's ensure from 'latest' to file.

You might also try using an existing module instead of reinventing the
wheel.

https://forge.puppetlabs.com/modules?utf-8=%E2%9C%93&sort=rank&q=nginx

Best regards,
-g

-- 
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile: +1.206.414.8658

-- 
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/542B081B.4070905%40garretthoneycutt.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to