Ask Your Question
0

puppet Cannot use URLs of type 'http' as source for fileserving

asked 2016-11-28 21:12:18 -0500

weiping gravatar image

hello, everyone! I want to use other file-server instead of puppet build-in file-server which means I don't want to use "puppet:///" as file source. I tired rsync, which makes me have to modify pp files too much. So is there any other solution to fix this problem ?

here is my pp file

node 'agent-2.wp.com' {
    notify{"This is ${hostname}!Test message!":}
    file{"test.txt":
        owner => 'root',
        group => 'root',
        ensure => present,
        path => "/opt/puppet/files/test/test.txt",
        source => "http://172.16.124.129/files/test/test.txt",
    }
}

error:puppet Cannot use URLs of type 'http' as source for fileserving

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2016-12-01 15:45:36 -0500

DarylW gravatar image

It isn't a 'file' resource, but you can use the archive module to source files (and decompress archives) from various remote locations, including http, https, ftp, s3, etc..

edit flag offensive delete link more
0

answered 2016-11-30 06:38:18 -0500

updated 2016-11-30 06:48:31 -0500

is there a reason you dont want to use the puppet fileserver? If its just wanting to use directories other than moduledire/files then you can edit $confdir/fileserver.conf - in there you can add an extra_files section to point to different directories.

the file resource historically has only supported puppet:// or file:// formats https://tickets.puppetlabs.com/browse... - looksl ike released in newer versions of puppet 4..)

if you want it on a completely different server I'd suggest unfortunately using exec with wget or curl ...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2016-11-28 21:12:18 -0500

Seen: 136 times

Last updated: Dec 01 '16