Ask Your Question

Does puppet offers enumeration?

asked 2014-11-03 15:14:25 -0600

jaksky gravatar image


I am using puppet 3.7 and I would like to provide a setting of log level with values: DEBUG, INFO, WARN, ERROR. Those would be best modeled with enumeration data type. Does puppet offer something like that?

Was googling and found various error report but not clear about the usage and syntax etc. Some clarification would be awesome.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-11-04 07:54:14 -0600

llowder gravatar image

In the current DSL, no. The closest thing is you can pass an array into a resource and then create an instance of that resource with each element of the array as the title of the resource.

However, you can create custom functions to do enumeration and there IS enumeration available if you enable the experimental future parser.

edit flag offensive delete link more


Puppet 4 has been released and includes the 'future' parser as the new default. In other words, enumerable are now available.

Martijn Heemels gravatar imageMartijn Heemels ( 2015-05-18 04:23:45 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-11-03 15:14:25 -0600

Seen: 76 times

Last updated: Nov 04 '14