Created
August 23, 2012 14:49
-
-
Save jbd/3437351 to your computer and use it in GitHub Desktop.
Iteration problem in cfengine
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 => { busers }; | |
} | |
bundle agent busers | |
{ | |
vars: | |
"musers[root][gecos]" string => "System administrator"; | |
"musers[root][uid]" string => "0"; | |
"musers[root][gid]" string => "0"; | |
"musers[root][home]" string => "/root"; | |
"musers[zamboni][gecos]" string => "Diego Zamboni"; | |
"musers[zamboni][uid]" string => "501"; | |
"musers[zamboni][gid]" string => "users"; | |
"musers[zamboni][home]" string => "/home/zamboni"; | |
"users_idx_1" slist => getindices("musers"); | |
"users_idx_2[$(users_idx_1)]" slist => getindices("musers[$(users_idx_1)]"); | |
reports: | |
linux:: | |
"$(users_idx_2[$(users_idx_1)])"; | |
} | |
## output | |
## # cf-agent -K -f ./reglist.cf | |
# R: $(users_idx_2[root]) | |
# R: $(users_idx_2[zamboni]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment