Last active
August 29, 2015 14:04
-
-
Save kornypoet/89dd08dff648fd383744 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # init.pp | |
| # | |
| class foo( | |
| $name = 'bob', | |
| $age = 23, | |
| $occupation = 'self-employed', | |
| $job_description = 'nut scratcher' | |
| ) { | |
| # Do init stuff | |
| } | |
| # | |
| # install.pp | |
| # | |
| class foo::install( | |
| # Inherit defaults from scoped module variables | |
| # While allowing overrides | |
| $occupation = $foo::occupation | |
| ) { | |
| # Do install stuff | |
| # Templates use local variables: just reassign them | |
| $name = $foo::name | |
| file { 'resume': | |
| content => template('foo/resume.erb'), | |
| } | |
| # resume.erb | |
| Name = <%= @name %> | |
| Occupation = <%= @occupation %> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment