PSA regarding Puppet template variables and default values
Inside of a Puppet template, you would think that one of these would work to set a default value for something not explicitly defined in your manifest: my_var ||= ‘some default value’ my_var = ‘some default value’ if my_var.nil? It doesn’t. This will clobber the variable, every time. To understand why this happens, you need to consider two critical pieces of information: The architecture of Puppet is stupidly complicated, which leads to unexpected behaviors all over the place. Because Puppet variables are lazy-loaded, they need to reinvent how variables are accessed in the ERb templating system. The Puppet developers, in … Continue Reading →
Copyright © 2013