Created
November 14, 2015 12:05
-
-
Save tzz/81f0f60ea5eb973c4290 to your computer and use it in GitHub Desktop.
Test CFEngine container iteration
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
body common control | |
{ | |
bundlesequence => { "test" }; | |
} | |
bundle agent test | |
{ | |
vars: | |
"users" data => parsejson(' | |
[ | |
{ | |
"name": "support", | |
"description": "Support user", | |
"uid": 1020, | |
"group_primary": 1, | |
"home_dir": "/home/support", | |
"shell": "/bin/bash", | |
"password_hash": "$1$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | |
}, | |
{ | |
"name": "root", | |
"description": "root", | |
"uid": 0, | |
"group_primary": 0, | |
"home_dir": "/root", | |
"shell": "/bin/bash", | |
"password_hash": "$1$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | |
}, | |
"user one", | |
"user two" | |
] | |
'); | |
"uk" slist => getindices(users); | |
reports: | |
"users: $(users)"; | |
"offset $(uk): $(users[$(uk)][name]), $(users[$(uk)][description]), $(users[$(uk)][uid]), $(users[$(uk)][group_primary]), $(users[$(uk)][home_dir]), $(users[$(uk)][shell]), $(users[$(uk)][password_hash])"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment