Puppet Class: rundeck::config

Defined in:
manifests/config.pp

Summary

This class is called from rundeck to manage the configuration.

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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'manifests/config.pp', line 5

class rundeck::config {
  assert_private()

  $_framework_defaults = {
    'rdeck.base'                => '/var/lib/rundeck',
    'framework.server.hostname' => $facts['networking']['hostname'],
    'framework.server.name'     => $facts['networking']['fqdn'],
    'framework.server.port'     => '4440',
    'framework.server.url'      => "http://${facts['networking']['fqdn']}:4440",
    'framework.etc.dir'         => '/etc/rundeck',
    'framework.var.dir'         => '/var/lib/rundeck/var',
    'framework.tmp.dir'         => '/var/lib/rundeck/var/tmp',
    'framework.logs.dir'        => '/var/lib/rundeck/var/logs',
    'framework.libext.dir'      => '/var/lib/rundeck/libext',
    'framework.ssh.keypath'     => '/var/lib/rundeck/.ssh/id_rsa',
    'framework.ssh.user'        => 'rundeck',
    'framework.ssh.timeout'     => '0',
    'rundeck.server.uuid'       => fqdn_uuid($facts['networking']['fqdn']),
  }

  $framework_config = $_framework_defaults + $rundeck::framework_config

  $base_dir       = $framework_config['rdeck.base']
  $properties_dir = $framework_config['framework.etc.dir']

  File {
    owner => $rundeck::user,
    group => $rundeck::group,
  }

  if $rundeck::manage_home {
    file { $base_dir:
      ensure => directory,
      mode   => '0755',
    }
  }

  $framework_config.each |$_key, $_value| {
    if $_key =~ '.dir' {
      file { $_value:
        ensure => directory,
        mode   => '0755',
      }
    }
  }

  file {
    $rundeck::service_logs_dir:
      ensure => directory,
      mode   => '0755',
      ;
    "${properties_dir}/log4j2.properties":
      ensure  => file,
      content => epp($rundeck::log_properties_template),
      require => File[$properties_dir, $rundeck::service_logs_dir],
      ;
  }

  if $rundeck::manage_default_admin_policy {
    rundeck::config::aclpolicyfile { 'admin':
      acl_policies   => $rundeck::admin_policies,
      owner          => $rundeck::user,
      group          => $rundeck::group,
      properties_dir => $properties_dir,
    }
  }

  if $rundeck::manage_default_api_policy {
    rundeck::config::aclpolicyfile { 'apitoken':
      acl_policies   => $rundeck::api_policies,
      owner          => $rundeck::user,
      group          => $rundeck::group,
      properties_dir => $properties_dir,
    }
  }

  if $rundeck::override_template {
    file { "${rundeck::override_dir}/${rundeck::service_name}":
      ensure  => file,
      content => epp($rundeck::override_template),
    }
  }

  contain rundeck::config::jaas_auth
  contain rundeck::config::framework

  file { "${properties_dir}/project.properties":
    ensure => absent,
  }

  file { "${properties_dir}/rundeck-config.properties":
    ensure  => file,
    content => epp($rundeck::config_template),
  }

  if $rundeck::ssl_enabled {
    contain rundeck::config::ssl
  }
}