Charly Mathieu
2013-May-21 15:55 UTC
[Puppet Users] Trouble with file in module ''source => "puppet://...''"
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:53I 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 :) -- 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+unsubscribe@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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Matthew Burgess
2013-May-21 16:00 UTC
Re: [Puppet Users] Trouble with file in module ''source => "puppet://...''"
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. On Tue, May 21, 2013 at 4:55 PM, Charly Mathieu <mathieu.charly@gmail.com>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''], >> } > > > 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 :) > > -- > 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+unsubscribe@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?hl=en. > 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+unsubscribe@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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Ramin K
2013-May-21 16:00 UTC
Re: [Puppet Users] Trouble with file in module ''source => "puppet://...''"
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 -- 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+unsubscribe@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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Charly Mathieu
2013-May-22 06:48 UTC
Re: [Puppet Users] Trouble with file in module ''source => "puppet://...''"
Ah yes ! Thank you, that makes sense actually, I didn''t realized it before. Thank to both of you, have a nice day :) Le mardi 21 mai 2013 18:00:53 UTC+2, Ramin K a écrit :> > 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 > > > >-- 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+unsubscribe@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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.