Skip to content

Instantly share code, notes, and snippets.

@martingehrke
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martingehrke/921210c4a7e42e388f8a to your computer and use it in GitHub Desktop.
Save martingehrke/921210c4a7e42e388f8a to your computer and use it in GitHub Desktop.
A lot of our data is outside our main policy, especially json data. This snippet will help manage dirs that need syncing in a central place. Classes are global
#this code has not been tested for minor bugs, but the idea is solid
vars:
"sync_data" data => parsejson('{ "dir1":"class1", "dir2":"class2" }');
"dirs" slist => getindices("sync_data");
files:
"$(dirs)"
create => "true",
copy_from => secure_cp("/base/$(dirs)", "$(sys.policy_hub)"),
if => "$(sync_data[dirs])";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment