Skip to content

Instantly share code, notes, and snippets.

@nickanderson
Created September 9, 2012 15:02
Show Gist options
  • Save nickanderson/3684884 to your computer and use it in GitHub Desktop.
Save nickanderson/3684884 to your computer and use it in GitHub Desktop.
cf-agent -KIf ./set_array_values_with_list.cf
R: Array: local_array[id1]=value
R: Array: local_array[id2]=value
R: Array: local_array[id3]=value
body common control {
inputs => { "../sketches/CFEngine/stdlib/cfengine_stdlib.cf" };
bundlesequence => { "main" };
}
bundle agent main
{
vars:
"list" slist => {"id1", "id2", "id3"};
"local_array[$(list)]"
string => "value",
policy => "free";
reports:
cfengine::
"Array: local_array[$(list)]=$(local_array[$(list)])";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment