Puppet knows to look in the files directory in your module.

There's a bit of an explanation here:


https://docs.puppetlabs.com/puppet/latest/reference/modules_fundamentals.html


Rich

On Wed, Oct 7, 2015 at 10:31 PM Wei Chen <chenwei2...@gmail.com> wrote:

> Hi John,
>
> Thanks very much. It works now with your code. But even though I can't
> understand, why I have to take out the 'files' ? The file to be copied, the
> "s001is35-test.conf", locates under "/etc/puppet/modules/httpd/files/" on
> the server.
>
> Wei
>
>
> Am Mittwoch, 7. Oktober 2015 21:17:34 UTC+2 schrieb jcbollinger:
>>
>>
>>
>> On Tuesday, October 6, 2015 at 8:02:23 AM UTC-5, Wei Chen wrote:
>>>
>>> Hi all,
>>>
>>> As I run following command:
>>>
>>> puppet agent --server s001ap38-test --no-daemonize --verbose --onetime
>>>
>>> I got error as follow:
>>> ...
>>> err: Failed to apply catalog: Parameter source failed on
>>> File[/etc/httpd/conf.d/s001is35-test.conf]: Cannot use URLs of type
>>> 's001ap38-test' as source for fileserving at
>>> /etc/puppet/modules/httpd/manifests/init.pp:12
>>> ...
>>>
>>> My init.pp looks as follow:
>>>
>>> class httpd {
>>> package { httpd:
>>>         ensure => present,
>>>         }
>>>
>>> file { "/etc/httpd/conf.d/s001is35-test.conf":
>>>         owner => "root",
>>>         group => "root",
>>>         mode => 0440,
>>>         source =>
>>> "s001ap38-test://$puppetmaster/modules/httpd/files/s001is35-test.conf",
>>>         require => Package["httpd"],
>>>         }
>>> }
>>>
>>> Note: the $puppetmaster is defined in "site.pp" as follow:
>>> import 'nodes.pp'
>>> $puppetmaster = 's001ap38-test'
>>>
>>>
>>> I want to know what is the reason to the error? I guess the sentence
>>> "source =>
>>> "s001ap38-test://$puppetmaster/modules/httpd/files/s001is35-test.conf"," in
>>> the init.pp could be the reason. But I have no idea how to fix it. Could
>>> someone help?
>>>
>>>
>>
>> You guess correctly.  The value of the 'source' attribute should be a URI
>> identifying a resource (HTTP sense) whose content should be used as the
>> file content, or else it should be a path on the local file system to
>> another file from which the content should be copied.  Not only is
>> 's001ap38-test' not a known URI scheme, but Puppet anyway supports only the
>> 'file' and 'puppet' schemes.  It looks like you want
>>
>>   source => "puppet:///modules/httpd/s001is35-test.conf"
>>
>> John
>>
>> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/23dab341-b962-432a-97c4-8136459a4a9f%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/23dab341-b962-432a-97c4-8136459a4a9f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAPGcbtCdi9p%2BsX6FvfHcZrtrXn0-4WL%3Deqr6eBuNh71Bbs3oJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to