The following features of the Puppet language are deprecated, and will be removed in Puppet 4.0.
Puppet assumes class and defined type names are relative until proven otherwise. Thus, if the final namespace segment of a class in one module matches the name of another module, Puppet will sometimes load the wrong class. You can force the correct class to load by prepending
:: to it.
Relative namespacing is fixed, and the workaround is no longer required.
Puppet 3.7 does not give a deprecation warning. You can enable the future parser to avoid relative namespace issues.
Relative name lookup was introduced in pre-module versions of Puppet and reflected an outdated assumption about how modules would be used. This turned out to be a bad idea.
You can use the
inherits keyword to allow nodes to inherit definitions from other nodes.
Node inheritance is completely removed.
As of Puppet 3.7, node inheritance causes a deprecation warning:
Warning: Deprecation notice: Node inheritance is not supported in Puppet >= 4.0.0. See http://links.puppetlabs.com/puppet-node-inheritance-deprecation
In the future parser as of Puppet 3.7, node inheritance causes an error:
Error: Node inheritance is not supported in Puppet >= 4.0.0. See http://links.puppetlabs.com/puppet-node-inheritance-deprecation at c:/vagrantshared/puppet/manifests/site.pp:12:22
Node inheritance often causes ambiguous or counterintuitive behavior. More effective code reuse can be achieved using classes and defined types.
You can use the
import statement in the main manifest to compile more than one manifest without autoloading the additional files from modules.
import statements can interfere with syntax checking individual manifest files, you can also use the
ignoreimport setting to block importing when using the
puppet parser validate command.
import keyword has been removed completely and manifests can no longer be imported.
ignoreimport setting has been removed, since it’s no longer necessary.
Use of the
import keyword in Puppet 3.6 and later causes a deprecation warning:
Warning: The use of 'import' is deprecated at 1. See http://links.puppetlabs.com/puppet-import-deprecation
If any of your commit hooks or CI tools use the
ignoreimport setting, you should also see the note on
import keyword predates Puppet’s module system. Once modules were introduced, most of the use cases for
import vanished. One use case remained (importing a directory of node-specific manifests into the main manifest), but now that the main manifest can be a directory with any number of files, that last use case is gone. Since it’s now a redundant way to do things, and can behave really oddly under certain circumstances, we’re removing it.
Currently, Puppet allows matching with a =~ against non-string values.
Puppet 4.0 will not match a regexp against anything but a string.
Puppet 3.8 does not give a deprecation warning, but if you enable the future parser, any regexp matched against a non-string value will cause an error.
The ability to match a regexp against a non-string value was inconsistent, so we have removed it.
search function allows you to make relative namespacing even worse, by adding additional namespaces that Puppet will attempt to tack onto any class or defined type names.
search function is removed, and would have no effect even if it were present.
If you use this function, Puppet gives a deprecation warning:
Warning: The 'search' function is deprecated. See http://links.puppetlabs.com/search-function-deprecation
If you see this warning, stop using
search and refer to all classes and defined types by their fully qualified names.
Variable names can begin with either uppercase or lowercase letters.
Variable names cannot begin with uppercase letters.
Puppet 3.8 does not give deprecation warnings for this issue. If you turn on the future parser, you will get errors for variables starting with capital letters.
When variable names start with capital letters, it can potentially cause variable references to conflict with type references, so we’ve removed the ability to capitalize variable names.
Class names can contain hyphens, even though the documentation says that they are prohibited, and you can’t reference variables inside classes that are named this way.
Class names containing hyphens are actually prohibited.
Puppet 3.8 does not give a deprecation warning for this, but if you enable the future parser, any hyphenated class names will cause an error.
Hyphenated class names behaved inconsistently, so we have removed the ability to use hyphens in class names.
You can change the contents of already-defined arrays and hashes in Puppet code and in templates.
You cannot change the contents of arrays and hashes.
If any of your code modifies an array or hash variable, Puppet will log the following deprecation warning:
Warning: The use of mutating operations on Array/Hash is deprecated at 1. See http://links.puppetlabs.com/puppet-mutation-deprecation
If you are mutating data structures, you should change your code to create new values instead of modifying existing ones.
This behavior never should have been possible, and we have always considered it a bug.
The Ruby DSL is deprecated.
Support for the Ruby DSL is completely removed.
manifests directories of your modules for any files ending in
.rb instead of
.pp. Rewrite any code that uses the Ruby DSL in the Puppet language.
The Ruby DSL sometimes behaved erratically. When we attempted to improve it, we realized it was too heavyweight for what our users actually needed, so we’ve implemented some of the most-used Ruby abilities — such as iteration — in the Puppet DSL.