Last active
March 14, 2019 13:21
-
-
Save alex-harvey-z3q/8d258549873c91795d5622b82986c772 to your computer and use it in GitHub Desktop.
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
Just fixing the syntax issues in: | |
class profile::sec::sec_model { | |
hiera_hash('users').each |String $user, Hash $user_hash| { | |
$user_hash.each |String $attr, String $value| { | |
user { "$user": | |
"${attr}" => "${value}" | |
} | |
} | |
} | |
} | |
I would end up with: | |
class profile::sec::sec_model { | |
lookup('users').each |String $user, Hash $user_hash| { | |
user { $user: * => $user_hash } | |
} | |
} | |
Noting: | |
- hiera_hash is deprecated, use lookup | |
- you had a redundant inner loop that didn't really make sense | |
- I think you imagined the code was going to be "eval"ed although Puppet has no eval |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment