aboutsummaryrefslogtreecommitdiff
path: root/modules/aur/manifests/package.pp
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2017-08-24 02:22:17 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2017-08-29 22:46:14 +0200
commit7fed35a408b9ec37454169425823785b5fc8978b (patch)
tree28371d43ac304f99fb0a5305124858db69ef2137 /modules/aur/manifests/package.pp
parentba2cf1b5d938810077b0fd73844faf432e8e8f9d (diff)
downloadPuppet-7fed35a408b9ec37454169425823785b5fc8978b.tar.gz
Puppet-7fed35a408b9ec37454169425823785b5fc8978b.tar.zst
Puppet-7fed35a408b9ec37454169425823785b5fc8978b.zip
Refactor base installation module
Diffstat (limited to 'modules/aur/manifests/package.pp')
-rw-r--r--modules/aur/manifests/package.pp32
1 files changed, 32 insertions, 0 deletions
diff --git a/modules/aur/manifests/package.pp b/modules/aur/manifests/package.pp
new file mode 100644
index 0000000..2fd346e
--- /dev/null
+++ b/modules/aur/manifests/package.pp
@@ -0,0 +1,32 @@
1define aur::package (
2 $ensure = 'present',
3) {
4
5 case $ensure {
6 'present': {
7 exec { "pacman::aur::install::${name}":
8 cwd => "/tmp",
9 require => Class[aur::aura],
10 command => "/usr/bin/aura -A ${name}",
11 user => "aur-builder",
12 unless => "/usr/bin/aura -Qk ${name}",
13 logoutput => 'on_failure',
14 timeout => 1800,
15 }
16 }
17 'absent': {
18 exec { "pacman::aur::remove::${name}":
19 cwd => "/tmp",
20 require => Class[aur::aura],
21 command => "/usr/bin/aura -Rs ${name}",
22 user => "aur-builder",
23 onlyif => "/usr/bin/aura -Qi ${name}",
24 logoutput => 'on_failure',
25 }
26 }
27 default: {
28 fail("Pacman::Aur[${name}] ensure parameter must be either 'present' or 'absent'")
29 }
30
31 }
32}