A collection of task oriented solutions in Puppet

 

File source without specifying 'modules'

Challenge

You want to clear "DEPRECATION NOTICE: Files found in modules without specifying 'modules'" messages

Solution

# this will cause the deprecation notice
file { '/etc/mymodule.conf':
  source => 'puppet:///mymodule/mymodule.conf',
}

# this won't cause the deprecation notice
file { '/etc/mymodule.conf':
  source => 'puppet:///modules/mymodule/mymodule.conf',
}

Explanation

When running puppet you see lines that look like this on your screen or in the logs:

DEPRECATION NOTICE: Files found in modules without specifying 'modules'
in file path will be deprecated in the next major release. Please fix
module 'mymodule' when no 0.24.x clients are present

This is an ever decreasingly seen deprecation notice that was introduced, and was most often seen, when upgrading from the 0.24 to 0.25 series of puppet releases. The fix is simple, adding the literal 'modules' to the path in your source lines after specifying the server, is enough to fix the complaint, and could often be automatically corrected with a little scripting or sed.

It is now most often seen when copying example code from older blog posts or sample modules.