aboutsummaryrefslogtreecommitdiff
path: root/modules/aur/manifests/package.pp
blob: 5b55f248bb24eac213b7c82b39401c1824d36b23 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
define aur::package (
  $ensure = 'present',
) {

  case $ensure {
    'present': {
      exec { "pacman::aur::install::${name}":
        cwd       => "/tmp",
        require   => Class[aur::aura],
        command   => "/usr/bin/sudo /usr/bin/aura --noconfirm -A ${name}",
        user      => "aur-builder",
        unless    => "/usr/bin/aura -Qk ${name}",
        logoutput => 'on_failure',
        timeout   => 1800,
      }
    }
    'absent': {
      exec { "pacman::aur::remove::${name}":
        cwd       => "/tmp",
        require   => Class[aur::aura],
        command   => "/usr/bin/sudo /usr/bin/aura --noconfirm -Rs ${name}",
        user      => "aur-builder",
        onlyif    => "/usr/bin/aura -Qi ${name}",
        logoutput => 'on_failure',
      }
    }
    default: {
      fail("Pacman::Aur[${name}] ensure parameter must be either 'present' or 'absent'")
    }

  }
}