Puppet Class: gitlab_ci_runner::install

Defined in:
manifests/install.pp

Summary

Manages the package of Gitlab runner

Overview

Parameters:

  • package_name (Any) (defaults to: $gitlab_ci_runner::package_name)
  • package_ensure (Any) (defaults to: $gitlab_ci_runner::package_ensure)


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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'manifests/install.pp', line 5

class gitlab_ci_runner::install (
  $package_name   = $gitlab_ci_runner::package_name,
  $package_ensure = $gitlab_ci_runner::package_ensure,
) {
  assert_private()

  case $gitlab_ci_runner::install_method {
    'repo': {
      package { $package_name:
        ensure => $package_ensure,
      }
    }
    'binary': {
      $_package_ensure = $package_ensure ? {
        'installed' => 'present',
        default  => $package_ensure,
      }
      archive { $gitlab_ci_runner::binary_path:
        ensure  => $_package_ensure,
        source  => $gitlab_ci_runner::binary_source,
        extract => false,
        creates => $gitlab_ci_runner::binary_path,
      }
      file { $gitlab_ci_runner::binary_path:
        ensure => file,
        mode   => '0755',
      }
      if $gitlab_ci_runner::manage_user {
        group { $gitlab_ci_runner::group:
          ensure => present,
        }
        user { $gitlab_ci_runner::user:
          ensure => present,
          gid    => $gitlab_ci_runner::group,
        }
      }
    }
    default: {
      fail("Unsupported install method: ${gitlab_ci_runner::install_method}")
    }
  }
}