Skip to content

Instantly share code, notes, and snippets.

@zzamboni
Created November 14, 2012 16:06
Show Gist options
  • Select an option

  • Save zzamboni/4072995 to your computer and use it in GitHub Desktop.

Select an option

Save zzamboni/4072995 to your computer and use it in GitHub Desktop.

Revisions

  1. zzamboni revised this gist Nov 14, 2012. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -6,9 +6,8 @@
    classes:
    "should_exist_$(cindex[$(index)])" expression => "any";
    files:
    "/$(dir)/$(files)"
    create => "true",
    ifvarclass => "should_exist_$(cindex[$(files)])";
    "/$(dir)/$(index)"
    create => "true";
    "/$(dir)/$(files)"
    delete => tidy,
    ifvarclass => "!should_exist_$(cindex[$(files)])";
  2. zzamboni created this gist Nov 14, 2012.
    14 changes: 14 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    vars:
    "dir" string => "/etc/apache2/modules-enabled";
    "index" slist => getindices("array");
    "cindex[$(index)]" string => canonify("$(index)");
    "files" slist => lsdir("$(dir)", ".*", "false");
    classes:
    "should_exist_$(cindex[$(index)])" expression => "any";
    files:
    "/$(dir)/$(files)"
    create => "true",
    ifvarclass => "should_exist_$(cindex[$(files)])";
    "/$(dir)/$(files)"
    delete => tidy,
    ifvarclass => "!should_exist_$(cindex[$(files)])";