Advertisement
Guest User

Untitled

a guest
Jul 28th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #create_resource_without_duplicate
  2. node default {
  3. $hash = {
  4. item1 => { value => '1',
  5. othervalue => 'a',
  6. somevalue => 'jjj' },
  7. item2 => { value => '2',
  8. othervalue => 'b',
  9. somevalue => 'yyy' },
  10. }
  11. $array = keys($hash)
  12. if ! defined( "testKey{${array} : hash => $hash}}" ){
  13. testKey{$array : hash => $hash}
  14. }
  15. }
  16. define doAction($value, $othervalue, $somevalue) {
  17. notify { "Item ${value} ${$othervalue} ${somevalue}": }
  18. }
  19. define testKey($hash){
  20. doAction{"do ${name}" :
  21. value => $hash[$name]['value'],
  22. othervalue => $hash[$name]['othervalue'],
  23. somevalue => $hash[$name]['somevalue'],
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement