#!/var/cfengine/bin/cfagent -qvKf # # $Id: copy-edit-test.cf,v 1.1 2006/03/01 04:36:58 jmates Exp $ # # Example copy-edit-template sequence for CFEngine. Create a source file # at /var/tmp/sourcefile (such as this one), then execute this file with # cfagent. # # Variables CFEngine should expand, if this file used as the # source file: # # ${test1} # ${test2} control: any:: actionsequence = ( copy editfiles files ) source_file = ( /var/tmp/sourcefile ) temp_file = ( /var/tmp/temporaryfile ) final_file = ( /var/tmp/finalfile ) # define variables to expand test1 = ( foo ) test2 = ( bar ) copy: any:: # Normally this base file would be copied from a system running # cfservd or from a network share such as AFS: ${source_file} dest=${temp_file} backup=false type=checksum editfiles: any:: { ${final_file} AutoCreate Backup "false" InsertFile "${temp_file} ExpandVariables "true" } files: any:: ${final_file} mode=a+r owner=nobody group=nobody