diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-08-09 21:36:00 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-08-09 22:47:39 +0200 |
commit | 919d772aaa9bb6f298b1d0a433b6b32d15c0410f (patch) | |
tree | af48e6b472f40dfa062ea7b0faedc941b56eeaa1 /modules/aur/manifests/install.pp | |
parent | f860f6d2b475fa611af2b6a66ee1c774757b77f4 (diff) | |
download | Puppet-919d772aaa9bb6f298b1d0a433b6b32d15c0410f.tar.gz Puppet-919d772aaa9bb6f298b1d0a433b6b32d15c0410f.tar.zst Puppet-919d772aaa9bb6f298b1d0a433b6b32d15c0410f.zip |
Add aura helper
Diffstat (limited to 'modules/aur/manifests/install.pp')
-rw-r--r-- | modules/aur/manifests/install.pp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/modules/aur/manifests/install.pp b/modules/aur/manifests/install.pp new file mode 100644 index 0000000..074088e --- /dev/null +++ b/modules/aur/manifests/install.pp | |||
@@ -0,0 +1,28 @@ | |||
1 | define aur::install ( | ||
2 | $ensure = 'present', | ||
3 | ) { | ||
4 | |||
5 | case $ensure { | ||
6 | 'present': { | ||
7 | exec { "pacman::aur::install::${name}": | ||
8 | require => Class[aur::aura], | ||
9 | command => "/usr/bin/aura -A ${name}", | ||
10 | unless => "/usr/bin/aura -Qk ${name}", | ||
11 | logoutput => 'on_failure', | ||
12 | timeout => 1800, | ||
13 | } | ||
14 | } | ||
15 | 'absent': { | ||
16 | exec { "pacman::aur::remove::${name}": | ||
17 | require => Class[aur::aura], | ||
18 | command => "/usr/bin/aura -Rs ${name}", | ||
19 | onlyif => "/usr/bin/aura -Qi ${name}", | ||
20 | logoutput => 'on_failure', | ||
21 | } | ||
22 | } | ||
23 | default: { | ||
24 | fail("Pacman::Aur[${name}] ensure parameter must be either 'present' or 'absent'") | ||
25 | } | ||
26 | |||
27 | } | ||
28 | } | ||