Posts tagged puppet

Puppet: Files found in modules without specifying ‘modules’ in file path will be deprecated in the next major release

DEPRECATION NOTICE: Files found in modules without specifying ‘modules’ in file path will be deprecated in the next major release.

If you get this warning in your puppet logs, you should take action (only if you don’t have any Puppet agent with a version <= 0.24) and modify all you references to file resources.
For example, if you have a module named 'ssh', normally, up to puppet 0.25 you would reference a file to it as:

source => ["puppet:///ssh/authorized_keys",]

But now, you need to insert a ‘module’ identifier in between like this:

source => ["puppet:///modules/ssh/authorized_keys",]

Just a small note: It seems that the templates do not need any modification.

Synchronization methods of a file with Puppet

0

Usually, to synchronize a file with remote hosts, using puppet, one would use the following pattern:

file { "/etc/init.d/pvfs2-server":
owner => root, group => root,
mode => 755,
source => "puppet:///files/pvfs2-server"
}

(using “source” to copy data as-is, and using “template(“filename”) to use a template structure as data).

Or, if one wishes to directly set the content of the target file:

file { "/etc/init.d/pvfs2-server":
owner => root, group => root,
mode => 755,
source => "puppet:///files/pvfs2-server"
}

Please note that on the first line, for example ‘file { “/etc/mpd.conf”:’), the “/etc/mpd.conf” is a merge of two functionalities/concepts: Usually, the syntax is clear and simple:

file { mon_fichier_mpd_conf:
path => "/etc/mpd.conf",
[...]
}

The first line is about the resource description. Its goal is to be able to reference to it a little later from another resources (Notify[], etc.). By putting directly the file path and name (I think it’s identified as a filename and not as a description because there are quotes, or maybe it’s because it begins with a slash?) you mege the “path” attribute with its description.
On the other end, we’ll not be able to reference to it later, if you need to.

You may also need to synchronize a file that is not present in the repository (puppet:///files/*). That usually happens, for example, when that file is regenerated by an external program or an external action (like /etc/passwd).

file {"/etc/passwd":
owner => root, group => root, mode => 644,
content => file("/etc/passwd")
}

Go to Top