Puppet Class: rundeck::install

Defined in:
manifests/install.pp

Summary

This class is called from rundeck for install.

Overview



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
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'manifests/install.pp', line 5

class rundeck::install {
  assert_private()

  if $rundeck::manage_group {
    group { $rundeck::group:
      ensure => present,
      gid    => $rundeck::group_id,
      system => true,
    }

    if $rundeck::group != 'rundeck' {
      group { 'rundeck':
        ensure => absent,
      }
    }
  }

  if $rundeck::manage_user {
    user { $rundeck::user:
      ensure => present,
      groups => [$rundeck::group],
      uid    => $rundeck::user_id,
      gid    => $rundeck::group_id,
      system => true,
    }

    if $rundeck::user != 'rundeck' {
      user { 'rundeck':
        ensure => absent,
      }
    }
  }

  case $facts['os']['family'] {
    'RedHat': {
      if $rundeck::manage_repo {
        $rundeck::repo_config.each | String $_repo_name, Hash $_attributes| {
          yumrepo { $_repo_name:
            *      => $_attributes,
            before => Package['rundeck'],
          }
        }
      }
    }
    'Debian': {
      if $rundeck::manage_repo {
        $rundeck::repo_config.each | String $_repo_name, Hash $_attributes| {
          apt::source { $_repo_name:
            *      => $_attributes,
            before => Package['rundeck'],
          }
        }
      }

      Class['Apt::Update'] -> Package['rundeck']
    }
    default: {
      err("The osfamily: ${facts['os']['family']} is not supported")
    }
  }

  package { 'rundeck':
    ensure => $rundeck::package_ensure,
    notify => Class['rundeck::service'],
  }
}