diff --git a/README.md b/README.md index 2ed9024eb..d3e286051 100644 --- a/README.md +++ b/README.md @@ -216,6 +216,13 @@ Ensure there's a newline at the end of the fragments. - ensure_newline => true - ensure_newline => false +#####`validate_cmd` +Ensure the destination file passes the following validation command. + +######Example +- validate_cmd => '/usr/sbin/apache2 -t -f %' +- validate_cmd => '/usr/sbin/visudo -c -f %' + ####concat::fragment #####`target` diff --git a/manifests/init.pp b/manifests/init.pp index b021e14a4..d0caf2527 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -64,6 +64,7 @@ $replace = true, $order = 'alpha', $ensure_newline = false, + $validate_cmd = undef, $gnu = undef ) { validate_re($ensure, '^present$|^absent$') @@ -173,15 +174,16 @@ } file { $name: - ensure => present, - owner => $owner, - group => $group, - mode => $mode, - replace => $replace, - path => $path, - alias => "concat_${name}", - source => "${fragdir}/${concat_name}", - backup => $backup, + ensure => present, + owner => $owner, + group => $group, + mode => $mode, + replace => $replace, + path => $path, + alias => "concat_${name}", + source => "${fragdir}/${concat_name}", + validate_cmd => $validate_cmd, + backup => $backup, } # remove extra whitespace from string interpolation to make testing easier