Puppet Class: orchestrator::server

Defined in:
modules/orchestrator/manifests/server.pp

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • db_backend (Enum['mysql', 'sqlite'])
  • db_topology_password (String[1])
  • db_topology_username (String[1]) (defaults to: 'orchestrator')
  • db_backend_host (Optional[Stdlib::Host]) (defaults to: undef)
  • db_backend_password (Optional[String[1]]) (defaults to: undef)
  • db_backend_port (Stdlib::Port) (defaults to: 3306)
  • db_backend_username (String[1]) (defaults to: 'orchestrator_srv')
  • db_backend_database (String[1]) (defaults to: 'orchestrator')


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
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
# File 'modules/orchestrator/manifests/server.pp', line 2

class orchestrator::server (
    Enum['mysql', 'sqlite'] $db_backend,
    String[1] $db_topology_password,
    String[1] $db_topology_username = 'orchestrator',
    Optional[Stdlib::Host] $db_backend_host = undef,
    Optional[String[1]] $db_backend_password = undef,
    Stdlib::Port $db_backend_port = 3306,
    String[1] $db_backend_username = 'orchestrator_srv',
    String[1] $db_backend_database = 'orchestrator',
) {
    if $db_backend == 'mysql' {
        if !$db_backend_host {
            fail("\$db_backend_host must be set if \$db_backend is 'mysql'")
        }
        if !$db_backend_password {
            fail("\$db_backend_password must be set if \$db_backend is 'mysql'")
        }
    } elsif $db_backend == 'sqlite' {
        ensure_packages('sqlite3')
    }

    ensure_packages('orchestrator')

    file { '/etc/orchestrator.conf.json':
        ensure  => 'present',
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        content => template('orchestrator/orchestrator.conf.json.erb'),
        notify  => Service['orchestrator'],
    }

    file { '/etc/mysql/orchestrator_srv.cnf':
        ensure  => 'present',
        owner   => 'root',
        group   => 'orchestrator',
        mode    => '0440',
        content => template('orchestrator/orchestrator_srv.cnf.erb'),
        notify  => Service['orchestrator'],
    }

    file { '/etc/mysql/orchestrator_topo.cnf':
        ensure  => 'present',
        owner   => 'root',
        group   => 'orchestrator',
        mode    => '0440',
        content => template('orchestrator/orchestrator_topo.cnf.erb'),
        notify  => Service['orchestrator'],
    }

    service { 'orchestrator':
        ensure  => 'running',
        enable  => true,
        require => [
            Package['orchestrator'],
        ],
    }
}