ReleaseEngineering/PuppetAgain/Modules/config: Difference between revisions
< ReleaseEngineering | PuppetAgain | Modules
(Created page with "This module handles retrieving and access of the site specific config values. == Summary == We handle config variables via puppets <tt>extlookup()</tt> function, which reads da...") |
|||
(38 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
This module handles retrieving and access of the | This module handles retrieving and access of the org specific config values. | ||
= Summary = | |||
Configuration is specified in an org-specific file, <tt>manifests/$org-config.pp</tt>, which is symlinked from <tt>manifests/config.pp</tt>. This file defines a class, "config", which inherits from "config::base", which defines all config variables. The inherited class only needs to define variables whose values must change. | |||
==Usage== | |||
'''in manifests''' | '''in manifests''' | ||
class foo { | class foo { | ||
include config | include config | ||
if ($config::builder_username == | if ($config::builder_username == "") | ||
fail("bad settings") | fail("bad settings") | ||
} | } | ||
Line 27: | Line 15: | ||
'''in templates''' (note use of empty namespace designation) | '''in templates''' (note use of empty namespace designation) | ||
Username is <%= scope.lookupvar('::config::builder_username') %> | |||
: | |||
==Variables == | |||
The available configuration variables are all listed in <tt>modules/config/manifests/base.pp</tt>; refer to that file for the most up-to-date information. | |||
== | ==Functions== | ||
This module also defines the <tt>secret</tt> function; see [[ReleaseEngineering/PuppetAgain/Secrets]]. | |||
; | |||
Latest revision as of 20:18, 7 November 2013
This module handles retrieving and access of the org specific config values.
Summary
Configuration is specified in an org-specific file, manifests/$org-config.pp, which is symlinked from manifests/config.pp. This file defines a class, "config", which inherits from "config::base", which defines all config variables. The inherited class only needs to define variables whose values must change.
Usage
in manifests
class foo { include config if ($config::builder_username == "") fail("bad settings") } }
in templates (note use of empty namespace designation)
Username is <%= scope.lookupvar('::config::builder_username') %>
Variables
The available configuration variables are all listed in modules/config/manifests/base.pp; refer to that file for the most up-to-date information.
Functions
This module also defines the secret function; see ReleaseEngineering/PuppetAgain/Secrets.