diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2017-08-24 02:22:17 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2017-08-29 22:46:14 +0200 |
commit | 7fed35a408b9ec37454169425823785b5fc8978b (patch) | |
tree | 28371d43ac304f99fb0a5305124858db69ef2137 /modules/aur/manifests/package.pp | |
parent | ba2cf1b5d938810077b0fd73844faf432e8e8f9d (diff) | |
download | Puppet-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.pp | 32 |
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 @@ | |||
1 | define 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 | } | ||