Open main menu

CDOT Wiki β

Changes

User:Prathapan

2,827 bytes added, 16:13, 23 April 2011
Release 0.2
[http://projects.puppetlabs.com/projects/puppet/wiki puppet wiki page]
 
File server configuration
 
The last release 0.1 was installing the basic puppet installation and gets the puppet working. In the puppet master there should be service that should store and deliver the needed configuration files. Puppet can be act as the file server.
 
Puppet has the server and client function in file serving. The server function is configured and initiated by the puppet master daemon. The client function is embedded into the puppet client daemon and retrieves files from the puppet master file server.
 
Lets see how to specify the puppet file server. It is done by file type resource and using the source attribute
 
Ex:
 
file { “resolv.conf”:
 
Source => “puppet://puppetmaster/etc/resolv.conf”
 
}
 
The fileserver configuration is managed by the fileserver.conf that is located in the /etc/puppet directory by default. But using the following command can change the location.
 
In the puppet master
 
#puppetmasterd --fsconfig /usr/local/etc/puppet/fileserver.conf
 
The fileserver.conf file defines paths to serve files from and it has the access control that specifying which nodes can access these files.
 
Here is an example
 
[configuration]
path /var/lib/puppet/files/configuration
allow *.senecac.on.ca
deny *
 
Here the each path being served is called a module. For example , configuration is a module. The use of modules allows puppet to abstract and simplify file system configuration and paths. The path statement specifies the location on the puppet master server where the files being served are located.
 
Lets see if we want to get the resolv.conf file from the configuration module in the file server, we simply specify as follows
 
file { “/etc/resolv.conf”:
 
source => “puppet://puppetmaster/configuration/resolv.conf”
 
}
 
what happens above is that, the file resource type need the titled /etc/resolv.conf file that is saved in the configuration module( /var/lib/puppet/files/configurtion/resolv.conf) is retrieved by the puppet.
 
This is the format for specifying the source:
 
Puppet://puppetmaster/module/files
 
Ex: source => “puppet://puppetmaster/configuration/resolv.conf”
 
This is for only single file is being down loaded by puppet and applied to the nodes. But if we want to download the full directory, there is a small changed needs to be done when specify the source.
 
file { “/etc/pam.d”:
 
source => “puppet://puppetmaster/configuration/pam.d”
recurse => “true”
 
}
 
What we have done here is that instead of just specifying the file resource type, we specify the directory /etc/pam.d. Therefore, the puppet will download pam.d directory and applied to the nodes. The recurse attribute and value true tells the puppet server that it should download all the files from the directory.
 
source:Turnbull, James.Pulling strings with puppet.firstpress
== ''' Release 0.3 ''' ==
1
edit