Skip to content

Instantly share code, notes, and snippets.

@brokenthumbs
Last active August 29, 2015 13:57
Show Gist options
  • Save brokenthumbs/9691905 to your computer and use it in GitHub Desktop.
Save brokenthumbs/9691905 to your computer and use it in GitHub Desktop.
#!/bin/sh
# modules/your_module/files/hello_world.sh
while getopts f: option
do
case "${option}"
in
f) FOO=${OPTARG};;
esac
done
echo $FOO
node default {
file { "/etc/puppet/scripts":
ensure => directory,
owner => "root",
group => "root",
mode => 700,
} ->
file { "/etc/puppet/scripts/hello_world.sh":
owner => "root",
group => "root",
mode => 700,
source => "puppet:///modules/your_module/hello_world.sh"
} ->
exec { "/etc/puppet/scripts/hello_world.sh -f bar":
user => "root",
logoutput => true,
require => File["/etc/puppet/scripts/hello_world.sh"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment