diff options
-rw-r--r-- | modules/package/manifests/yaourt.pp | 21 | ||||
-rw-r--r-- | modules/tozt/manifests/other_packages.pp | 2 |
2 files changed, 18 insertions, 5 deletions
diff --git a/modules/package/manifests/yaourt.pp b/modules/package/manifests/yaourt.pp index 8f86534..e374e84 100644 --- a/modules/package/manifests/yaourt.pp +++ b/modules/package/manifests/yaourt.pp @@ -1,4 +1,4 @@ -define package::yaourt($asdeps=false) { +define package::yaourt($ensure, $asdeps=false) { if $asdeps { $_asdeps = " --asdeps" } @@ -6,8 +6,21 @@ define package::yaourt($asdeps=false) { $_asdeps = "" } - exec { "/usr/bin/yaourt --noconfirm --needed$asdeps $name": - unless => "pacman -Q $name > /dev/null 2>&1", - require => Package::Makepkg["yaourt"]; + case $ensure { + 'installed': { + exec { "/usr/bin/yaourt --noconfirm --needed$asdeps -S $name": + unless => "pacman -Q $name > /dev/null 2>&1", + require => Package::Makepkg["yaourt"]; + } + } + 'absent': { + exec { "/usr/bin/yaourt --noconfirm -Rsn $name": + onlyif => "pacman -Q $name > /dev/null 2>&1", + require => Package::Makepkg["yaourt"]; + } + } + default: { + fail("only 'installed' and 'absent' are supported for 'ensure'") + } } } diff --git a/modules/tozt/manifests/other_packages.pp b/modules/tozt/manifests/other_packages.pp index 2530f56..88f4db0 100644 --- a/modules/tozt/manifests/other_packages.pp +++ b/modules/tozt/manifests/other_packages.pp @@ -42,6 +42,6 @@ class tozt::other_packages { "ipbt", "ttyrec", ]: - ensure => installed, + ensure => installed, } } |