Trouble with file in module 'source => "puppet://...'"

192 views
Skip to first unread message

Charly Mathieu

unread,
May 21, 2013, 11:55:08 AM5/21/13
to puppet...@googlegroups.com
Hello,

I'm trying to write my first module, but I have a problem with a conf file I want to be managed with puppet.
It's an apache2 vhost file, so the name is "www.example.com", my ressource is like :

file { 'a2site' :
ensure => present,
path => '/etc/apache2/sites-available/www.example.com',
source => "puppet://modules/websitemodule/${conf_file}/etc/apache2/sites-available/www.example.com",
require => File['a2conf'],
}

When I apply it, I got : 

err: /Stage[main]/Websitemodule::Initwordpress/File[a2site]: Could not evaluate: getaddrinfo: Temporary failure in name resolution Could not retrieve file metadata for puppet://modules/websitemodule//etc/apache2/sites-available/www.example.com: getaddrinfo: Temporary failure in name resolution at /etc/puppet/modules/websitemodule/manifests/init.pp:53
 
I think puppet understand that it has to look on the internet, with the protocol "puppet", because it reads the ".com" at the end.

How can I fix this ?

Thank you :)

Matthew Burgess

unread,
May 21, 2013, 12:00:34 PM5/21/13
to puppet...@googlegroups.com
Hi Charly,

I think you're just missing a 3rd '/' in your source, i.e. it should be:

puppet:///modules/websitemodule/${conf_file}/etc/apache2/sites-available/www.example.com"

Here, 'puppet://' is the protocol and the next '/' is for the root of the puppet file server.

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

Ramin K

unread,
May 21, 2013, 12:00:53 PM5/21/13
to puppet...@googlegroups.com
On 5/21/2013 8:55 AM, Charly Mathieu wrote:
> Hello,
>
> I'm trying to write my first module, but I have a problem with a conf
> file I want to be managed with puppet.
> It's an apache2 vhost file, so the name is "www.example.com", my
> ressource is like :
>
> file { 'a2site' :
> ensure => present,
> path => '/etc/apache2/sites-available/www.example.com',
> source =>
> "puppet://modules/websitemodule/${conf_file}/etc/apache2/sites-available/www.example.com",
> require => File['a2conf'],
> }

It's possible to serve files from other places than the Puppetmaster
using this syntax. Note the two forward slashes.
puppet://servername/path/to/file

In your case you want the file to come from the local server, so you
need three forward slashes to indicate that as in following.
puppet:///local/path/to/file

Ramin



Charly Mathieu

unread,
May 22, 2013, 2:48:44 AM5/22/13
to puppet...@googlegroups.com, ramin...@badapple.net
Ah yes ! Thank you, that makes sense actually, I didn't realized it before.

Thank to both of you, have a nice day :)
Reply all
Reply to author
Forward
0 new messages