File serving with Puppet

226 views
Skip to first unread message

John Kennedy

unread,
Apr 27, 2011, 2:26:39 PM4/27/11
to puppet...@googlegroups.com
I am trying to serve some files though Puppet. I have configured
fileserver.conf on the Puppet master:

# Configuration
[configuration]
path /etc/puppet/manifests/files/configuration/%H
# Modules
[modules]
allow *.example.co.uk

I know I need to configure the client to look for the files. I have read
the docs and I have come up with the following snippet to retrieve a
test file:

file { "/home/newlook/text.jck":
mode => 400,
owner => root,
group => root,
source => puppet:////etc/puppet/manifests/files/configuration \
/host/test.jck
}

Where host is the FQDN of the client.

Where does this little snippet need to go on the client? Does it get a
section in puppet.conf? Do I need a fileserver.conf file on the client
with this in it?

Any help would be appreciated.
--
John Kennedy

Patrick

unread,
Apr 28, 2011, 4:25:02 AM4/28/11
to puppet...@googlegroups.com

Alright. You're under a few misconceptions. First, the normal, and recommended was to serve files is through a module. This requires no changes to any "*.conf" files and is quick and painless. If you need the features you're using, here's an example from my config to get you started:

Manifest:
file { "/etc/openvpn/server.conf":
owner => "root",
group => "root",
mode => 644,
source => "puppet:///private/openvpn/server.conf",
}


fileserver.conf:
[private]
path /etc/puppet/private/%d/%h
allow *

File location:
/etc/puppet/private/domain/computer_name/openvpn/server.conf

Notes:
Because the path is changed per-client, I don't need access restrictions.
There's 3 not 4 slashes in the URL.
The local path is invisible to the client, and the client can't see that in the URL

Reply all
Reply to author
Forward
0 new messages