aboutsummaryrefslogtreecommitdiff
path: root/modules/aur/manifests/package.pp
blob: 2fd346e393c5fd510384436b7f788617b7f91284 (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/aura -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/aura -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'")
    }

  }
}