How do I copy files to all clients using puppet? I have setup a puppet server and clients and I have tested the connection which was working fine. I am not a puppet expert, I am just a beginner, and I just want to know how to copy files to all clients from the puppet server? I also want to know how to delete files?
|
|
The Puppet File Server This guide covers the use of Puppet’s file serving capability. The puppet master service includes a file server for transferring static files. If a file resource declaration contains a puppet: URI in its source attribute, nodes will retrieve that file from the master’s file server:
# copy a remote file to /etc/sudoers
file { "/etc/sudoers":
mode => 440,
owner => root,
group => root,
source => "puppet:///modules/module_name/sudoers"
}
All puppet file server URIs are structured as follows:
If a server hostname is omitted (i.e. The remainder of the puppet: URI maps to the server’s filesystem in one of two ways, depending on whether the files are provided by a Serving Module Files As the vast majority of file serving should be done through modules, the Puppet file server provides a special and semi-magical mount point called modules, which is available by default. If a URI’s mount point is modules, Puppet will:
Although no additional configuration is required to use the modules mount point, some access controls can be specified in the file server configuration by adding a Serving Files From Custom Mount Points Puppet can also serve files from arbitrary mount points specified in the server’s file server configuration (see below). When serving files from a custom mount point, Puppet does not perform the additional URI abstraction used in the modules mount, and will resolve the path following the mount name as a simple directory structure. File Server Configuration The default location for the file server’s configuration data is The format of the
The following options can currently be specified for a given mount point:
path is the only required option, but since the default security configuration is to deny all access, a mount point with no allow directives would not be available to any nodes. The path can contain any or all of
the request for file Currently paths cannot contain trailing slashes or an error will result. Also take care that in Security Securing the Puppet file server consists of allowing and denying access (at varying levels of specificity) per mount point. Groups of nodes can be identified for permission or denial in three ways: by IP address, by name, or by a single global wildcard (*). Custom mount points default to denying all access. In addition to custom mount points, there are two special mount points which can be managed with If nodes are not connecting to the Puppet file server directly, e.g. using a reverse proxy and Mongrel (see Using Mongrel), then the file server will see all the connections as coming from the proxy server’s IP address rather than that of the Puppet Agent node. In this case, it is best to restrict access based on hostname. Additionally, the machine(s) acting as reverse proxy (usually 127.0.0.0/8) will need to be allowed to access the applicable mount points. Priority More specific deny and allow statements take precedence over less specific statements; that is, an allow statement for node.domain.com would let it connect despite a deny statement for *.domain.com. At a given level of specificity, deny statements take precedence over allow statements. Unpredictable behavior can result from mixing IP address directives with hostname and domain name directives, so try to avoid doing that. (Currently, if node.domain.com’s IP address is 192.168.1.80 and fileserver.conf contains allow 192.168.1.80 and deny node.domain.com, the IP-based allow directive will actually take precedence. This behavior may be changed in the future and should not be relied upon.) Host Names Host names can be specified using either a complete hostname, or specifying an entire domain using the * wildcard:
IP Addresses IP address can be specified similarly to host names, using either complete IP addresses or wildcarded addresses. You can also use CIDR-style notation:
Global allow Specifying a single wildcard will let any node access a mount point:
Note that the default behavior for custom mount points is equivalent to deny *. |
|||||||
|
