Puppet Class: icingaweb2::mod::deployment

Defined in:
manifests/mod/deployment.pp

Overview

Class icingaweb2::mod::deployment

Parameters:

  • auth_token (Any)
  • git_repo (Any) (defaults to: 'https://github.com/Thomas-Gelf/icingaweb2-module-deployment.git')
  • git_revision (Any) (defaults to: undef)
  • install_method (Any) (defaults to: 'git')
  • pkg_deps (Any) (defaults to: undef)
  • pkg_ensure (Any) (defaults to: 'present')
  • web_root (Any) (defaults to: $::icingaweb2::params::web_root)


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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'manifests/mod/deployment.pp', line 3

class icingaweb2::mod::deployment (
  $auth_token,
  $git_repo       = 'https://github.com/Thomas-Gelf/icingaweb2-module-deployment.git',
  $git_revision   = undef,
  $install_method = 'git',
  $pkg_deps       = undef,
  $pkg_ensure     = 'present',
  $web_root       = $::icingaweb2::params::web_root,
) {
  require ::icingaweb2

  validate_absolute_path($web_root)
  validate_re($install_method, '^(git|package)$')

  File {
    require => Class['::icingaweb2::config'],
    owner => $::icingaweb2::config_user,
    group => $::icingaweb2::config_group,
    mode  => $::icingaweb2::config_file_mode,
  }

  if $install_method == 'git' {
    if $pkg_deps {
      package { $pkg_deps:
        ensure => $pkg_ensure,
        before => Vcsrepo['deployment'],
      }
    }

    vcsrepo { 'deployment':
      ensure   => present,
      path     => "${web_root}/modules/deployment",
      provider => 'git',
      revision => $git_revision,
      source   => $git_repo,
    }
  }

  file { "${::icingaweb2::config_dir}/modules/deployment":
    ensure => directory,
    mode   => $::icingaweb2::config_dir_mode;
  }

  Ini_Setting {
    ensure  => present,
    require => File["${::icingaweb2::config_dir}/modules/deployment"],
    path    => "${::icingaweb2::config_dir}/modules/deployment/config.ini",
  }

  ini_setting { 'deployment auth token':
    section => 'auth',
    setting => 'token',
    value   => $auth_token,
  }
}