]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blob - modules/aur/manifests/aura.pp
Refactor base installation module
[perso/Immae/Projets/Puppet.git] / modules / aur / manifests / aura.pp
1 class aur::aura(
2 ) {
3 user { "aur-builder":
4 name => "aur-builder",
5 system => true,
6 ensure => "present"
7 }
8
9 ensure_packages(['base-devel'], { 'install_options' => '--needed' })
10 ensure_packages(['gmp', 'pcre'], { 'install_options' => '--asdeps' })
11
12 exec { 'aur::aura':
13 cwd => "/tmp",
14 path => "/usr/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',
16 user => "aur-builder",
17 unless => '/usr/bin/pacman -Qo aura',
18 require => Package['base-devel'],
19 logoutput => 'on_failure',
20 }
21
22 package { 'aura-bin':
23 ensure => "present",
24 source => "/tmp/aura-bin-x86_64.pkg.tar.xz",
25 require => Exec['aur::aura'],
26 notify => Exec['aur::aura::cleanup']
27 }
28
29 exec { 'aur::aura::cleanup':
30 path => "/usr/bin/",
31 command => "rm -f /tmp/aura-bin-x86_64.pkg.tar.xz",
32 refreshonly => true
33 }
34 }