Javatpoint Logo
Javatpoint Logo

Puppet File Server

As we know, Puppet uses the client and server model where one system works as a server called puppet server and the other works as a client called puppet agent or puppet client. This feature of the file server allows in copying the files around several systems. This functionality of the Puppet file serving function comes as part of the central Puppet daemon. Puppetmasterd and client functions are used to provide sourcing file attributes as the file object.

In the above part of code, the file serving functions of Puppet abstract the topology of the local filesystem by supporting the module for file service. We will specify the file serving module in the following format:

Creating a File Server

Puppet Server uses a file server to transfer the output of static files to the agents. Most of the files can be served via modules if we need to serve larger files that should not be with a module, for that you can create a custom file server mount point and let the puppet serve those files from another directory.

Step 1: Create a directory that can be accessed by puppet and copy the files which needed to be exported to this directory.

Step 2: Create fileserver.conf and define directory and hosts that can access this directory.

Defining File Server

Fileserver.conf uses a one-off file format that resembles an INI file without equal (=) signs. It is a series of mount-point stances, each consisting of:

  • A [mount_point_name] surrounded by square brackets. This is the name used in puppet:/// URLs for files in this mount point.
  • A path directive, where there is an absolute path on disk, or where files from the mount point are stored.
  • An allow * directive.

Example:

In the above example, we have created two locations from which files will be served. The first one is a scripts directory and the second location packages. Both directories can be created under the same location where the modules directory is available. To check the location of the module, we can use the following parameter:

Now, let's see the manifests, which are used to access files from the above directories served by the file server.


Next TopicPuppet Classes




Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA