aboutsummaryrefslogtreecommitdiff
path: root/modules/aur/manifests
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
parentba2cf1b5d938810077b0fd73844faf432e8e8f9d (diff)
downloadPuppet-7fed35a408b9ec37454169425823785b5fc8978b.tar.gz
Puppet-7fed35a408b9ec37454169425823785b5fc8978b.tar.zst
Puppet-7fed35a408b9ec37454169425823785b5fc8978b.zip
Refactor base installation module
Diffstat (limited to 'modules/aur/manifests')
-rw-r--r--modules/aur/manifests/aura.pp16
-rw-r--r--modules/aur/manifests/init.pp2
-rw-r--r--modules/aur/manifests/package.pp (renamed from modules/aur/manifests/install.pp)6
3 files changed, 12 insertions, 12 deletions
diff --git a/modules/aur/manifests/aura.pp b/modules/aur/manifests/aura.pp
index 2dbcf39..1683cf8 100644
--- a/modules/aur/manifests/aura.pp
+++ b/modules/aur/manifests/aura.pp
@@ -6,12 +6,7 @@ class aur::aura(
6 ensure => "present" 6 ensure => "present"
7 } 7 }
8 8
9 exec { 'pacman-base-devel': 9 ensure_packages(['base-devel'], { 'install_options' => '--needed' })
10 command => '/usr/bin/pacman -Sy base-devel --needed --noconfirm',
11 unless => '/usr/bin/pacman -Qo aura',
12 logoutput => 'on_failure',
13 }
14
15 ensure_packages(['gmp', 'pcre'], { 'install_options' => '--asdeps' }) 10 ensure_packages(['gmp', 'pcre'], { 'install_options' => '--asdeps' })
16 11
17 exec { 'aur::aura': 12 exec { 'aur::aura':
@@ -20,14 +15,15 @@ class aur::aura(
20 command => 'curl -o /tmp/aur.sh aur.sh && chmod +x /tmp/aur.sh && /tmp/aur.sh aura-bin && mv /tmp/aura-bin/aura-bin-*-x86_64.pkg.tar.xz /tmp/aura-bin-x86_64.pkg.tar.xz && rm /tmp/aur.sh && rm -rf /tmp/aura-bin', 15 command => 'curl -o /tmp/aur.sh aur.sh && chmod +x /tmp/aur.sh && /tmp/aur.sh aura-bin && mv /tmp/aura-bin/aura-bin-*-x86_64.pkg.tar.xz /tmp/aura-bin-x86_64.pkg.tar.xz && rm /tmp/aur.sh && rm -rf /tmp/aura-bin',
21 user => "aur-builder", 16 user => "aur-builder",
22 unless => '/usr/bin/pacman -Qo aura', 17 unless => '/usr/bin/pacman -Qo aura',
23 require => Exec['pacman-base-devel'], 18 require => Package['base-devel'],
24 logoutput => 'on_failure', 19 logoutput => 'on_failure',
25 } 20 }
26 21
27 package { 'aura-bin': 22 package { 'aura-bin':
28 ensure => "present", 23 ensure => "present",
29 source => "/tmp/aura-bin-x86_64.pkg.tar.xz", 24 source => "/tmp/aura-bin-x86_64.pkg.tar.xz",
30 notify => Exec['aur::aura::cleanup'] 25 require => Exec['aur::aura'],
26 notify => Exec['aur::aura::cleanup']
31 } 27 }
32 28
33 exec { 'aur::aura::cleanup': 29 exec { 'aur::aura::cleanup':
diff --git a/modules/aur/manifests/init.pp b/modules/aur/manifests/init.pp
index cdf9929..8c3faa1 100644
--- a/modules/aur/manifests/init.pp
+++ b/modules/aur/manifests/init.pp
@@ -1,4 +1,4 @@
1class aur { 1class aur {
2 class { 'aur::aura': } 2 contain 'aur::aura'
3} 3}
4 4
diff --git a/modules/aur/manifests/install.pp b/modules/aur/manifests/package.pp
index 074088e..2fd346e 100644
--- a/modules/aur/manifests/install.pp
+++ b/modules/aur/manifests/package.pp
@@ -1,12 +1,14 @@
1define aur::install ( 1define aur::package (
2 $ensure = 'present', 2 $ensure = 'present',
3) { 3) {
4 4
5 case $ensure { 5 case $ensure {
6 'present': { 6 'present': {
7 exec { "pacman::aur::install::${name}": 7 exec { "pacman::aur::install::${name}":
8 cwd => "/tmp",
8 require => Class[aur::aura], 9 require => Class[aur::aura],
9 command => "/usr/bin/aura -A ${name}", 10 command => "/usr/bin/aura -A ${name}",
11 user => "aur-builder",
10 unless => "/usr/bin/aura -Qk ${name}", 12 unless => "/usr/bin/aura -Qk ${name}",
11 logoutput => 'on_failure', 13 logoutput => 'on_failure',
12 timeout => 1800, 14 timeout => 1800,
@@ -14,8 +16,10 @@ define aur::install (
14 } 16 }
15 'absent': { 17 'absent': {
16 exec { "pacman::aur::remove::${name}": 18 exec { "pacman::aur::remove::${name}":
19 cwd => "/tmp",
17 require => Class[aur::aura], 20 require => Class[aur::aura],
18 command => "/usr/bin/aura -Rs ${name}", 21 command => "/usr/bin/aura -Rs ${name}",
22 user => "aur-builder",
19 onlyif => "/usr/bin/aura -Qi ${name}", 23 onlyif => "/usr/bin/aura -Qi ${name}",
20 logoutput => 'on_failure', 24 logoutput => 'on_failure',
21 } 25 }