--- /dev/null
+define base::alternative ($linkto, $ensure = present) {
+ case $ensure {
+ present: {
+ exec { "/usr/bin/update-alternatives --set ${name} ${linkto}":
+ unless => "[ $(update-alternatives --query ${name} | grep ^Value | awk '{print \$2}') = ${linkto} ]",
+ }
+ }
+ absent: {
+ exec { "/usr/bin/update-alternatives --remove ${name} ${linkto}":
+ unless => "[ $(update-alternatives --query ${name} | grep ^Value | awk '{print \$2}') != ${linkto} ]",
+ }
+ }
+ default: { fail ( "Unknown ensure value: '$ensure'" ) }
+ }
+}
key => 'vm.vfs_cache_pressure',
value => '10',
}
- site::alternative { 'editor':
+ base::alternative { 'editor':
linkto => '/usr/bin/vim.basic',
}
- site::alternative { 'view':
+ base::alternative { 'view':
linkto => '/usr/bin/vim.basic',
}
mailalias { 'samhain-reports':
+++ /dev/null
-define site::alternative ($linkto, $ensure = present) {
- case $ensure {
- present: {
- exec { "/usr/bin/update-alternatives --set ${name} ${linkto}":
- unless => "[ $(update-alternatives --query ${name} | grep ^Value | awk '{print \$2}') = ${linkto} ]",
- }
- }
- absent: {
- exec { "/usr/bin/update-alternatives --remove ${name} ${linkto}":
- unless => "[ $(update-alternatives --query ${name} | grep ^Value | awk '{print \$2}') != ${linkto} ]",
- }
- }
- default: { fail ( "Unknown ensure value: '$ensure'" ) }
- }
-}