Created
October 25, 2016 01:01
-
-
Save big-samantha/ac7bc151911c5b42d0a46333ac534c77 to your computer and use it in GitHub Desktop.
Control a command with a variable or class parameter in Puppet
This file contains 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
# Run a command saved as a variable: | |
$desired_command = '/bin/ls -ld /etc' | |
exec { 'some arbitrary command': | |
command => $desired_command, | |
} | |
# Run a command inside a class, with a parameter to control the command: | |
class oracle::setup ( | |
$someparam, | |
$desired_command, | |
$someparam, | |
) { | |
# some arbitrary puppet code | |
exec { 'setup command': | |
command => $desired_command, | |
} | |
# some more arbitrary puppet code | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment