diff --git a/manifests/attribute_add.pp b/manifests/attribute_add.pp index 0e7472c..7c81494 100644 --- a/manifests/attribute_add.pp +++ b/manifests/attribute_add.pp @@ -10,7 +10,7 @@ Host <||> -> Exec <| tag == 'chattr_attribute_add' |> Resources <||> -> Exec <| tag == 'chattr_attribute_add' |> - exec { "chattr +i ${name}": + exec { "chattr +${attribute} ${name}": path => '/bin:/usr/bin:/sbin:/usr/sbin', unless => "lsattr ${name} | awk \'{print \$1}\' |grep ${attribute}", tag => 'chattr_attribute_add', diff --git a/manifests/attribute_remove.pp b/manifests/attribute_remove.pp index 9273ae0..5247fad 100644 --- a/manifests/attribute_remove.pp +++ b/manifests/attribute_remove.pp @@ -10,7 +10,7 @@ Exec <| tag == 'chattr_attribute_remove' |> -> Host <||> Exec <| tag == 'chattr_attribute_remove' |> -> Resources <||> - exec { "chattr -i ${name}": + exec { "chattr -${attribute} ${name}": path => '/bin:/usr/bin:/sbin:/usr/sbin', onlyif => "lsattr ${name} | awk \'{print \$1}\' |grep ${attribute}", tag => 'chattr_attribute_remove',