Skip to content

Instantly share code, notes, and snippets.

@jlgreer
Created April 23, 2012 18:28
Show Gist options
  • Save jlgreer/2472899 to your computer and use it in GitHub Desktop.
Save jlgreer/2472899 to your computer and use it in GitHub Desktop.
# Testing version - not yet part of library
bundle agent template_std_flipclass(file, prefix, fileserver, mode, owner, group, class) {
files:
"$(file).template"
copy_from => copy_std("$(prefix)$(file).template",
"$(fileserver)", "false", "timestamp"),
perms => mode_owner_group("$(mode)", "$(owner)", "$(group)"),
action => actionsettings_fix_inform("inform");
"$(file)"
perms => mode_owner_group("$(mode)", "$(owner)", "$(group)"),
create => "true",
edit_line => expand_variables("$(file).template"),
# Using the full-featured body here because we need to empty the file
# client-side first.
classes => if_repaired("$(class)"),
edit_defaults => editsettings("timestamp", "true", "50K"),
action => actionsettings_fix_inform("inform");
}
@filler
Copy link

filler commented Apr 24, 2012

derp. this seems to work. tested on a non-erroring bundle. ;)

rdj:dcsunix silkey$ svn di ../../inputs/common/library.cf 
Index: ../../inputs/common/library.cf
===================================================================
--- ../../inputs/common/library.cf  (revision 51)
+++ ../../inputs/common/library.cf  (working copy)
@@ -849,7 +849,28 @@
     action        => actionsettings_fix_inform("inform");

 }
+# Testing version - not yet part of library
+bundle agent template_std_flipclass(file, prefix, fileserver, mode, owner, group, class) {

+files:
+
+  "$(file).template"
+    copy_from    => copy_std("$(prefix)$(file).template",
+      "$(fileserver)", "false", "timestamp"),
+    perms        => mode_owner_group("$(mode)", "$(owner)", "$(group)"),
+    action       => actionsettings_fix_inform("inform");
+
+  "$(file)"
+    perms         => mode_owner_group("$(mode)", "$(owner)", "$(group)"),
+    create        => "true",
+    edit_line     => expand_variables("$(file).template"),
+    # Using the full-featured body here because we need to empty the file
+    # client-side first.
+    classes       => if_repaired("$(class)"),
+    edit_defaults => editsettings("timestamp", "true", "50K"),
+    action        => actionsettings_fix_inform("inform");
+
+}
 ################################################################################
 #
 # Package management bodies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment