Skip to content

Instantly share code, notes, and snippets.

@michaeltchapman
Last active August 29, 2015 14:03
Show Gist options
  • Save michaeltchapman/e2962dae3e650d8187ad to your computer and use it in GitHub Desktop.
Save michaeltchapman/e2962dae3e650d8187ad to your computer and use it in GitHub Desktop.
$my_hash = { 'foo1' => {'user' => 'a', 'pass' => 'p', 'ip' => '1.2.3.4'}, 'foo2' => {'user' => 'b', 'pass' => 'p', 'ip' => '4.5.6.7'}}
create_resources(do_thing, $my_hash)
define do_thing(user, pass, ip) {
exec {'do_something':
command => "ssh -l ${user} ${ip} < ${pass}"
}
}
# ... will create two do_things, foo1 and foo2, with the specified params.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment