Puppet Class: ratticdb

Inherits:
::ratticdb::params
Defined in:
manifests/init.pp

Summary

This module installs ratticdb and its dependencies

Overview

Module to install ratticdb

By default, this module will try to install everything that is needed to setup a ratticdb application.

This means that by default Apache httpd and Mysql will be installed

The webserver will take care of redirecting the http traffic to https

Examples:

Declaring the class

include ratticdb

Specifying the url to listen to

class { '::ratticdb':
  url => 'xenial.example.org'
}

Do not install apache, we will handle the webserver elsewhere

class { '::ratticdb':
  apache => false
}

Do not install mysql, we will handle the database elsewhere

class { '::ratticdb':
  mysql => false
}

Parameters:

  • app_folder (Any) (defaults to: '/opt/apps/RatticWeb')

    Specifies where to install ratticdb

  • apache (Any) (defaults to: true)

    Whether to install apache or not

  • mysql (Any) (defaults to: true)

    Whether to install mysql or not

  • url (Any) (defaults to: 'ratticdb.example.org')

    Url to listen to

  • version (Any) (defaults to: '1.3.1')

    ratticdb version to install

  • ldap (Any) (defaults to: false)

    Whether to enable ldap or not

  • ldap_server (Any) (defaults to: 'ldap.example.org')

    Address of the ldap server

  • user_base (Any) (defaults to: 'ou=users,dc=example,dc=com')

    Where the users are located on the ldap server

  • user_filter (Any) (defaults to: '(uid=%(user)s)')

    Which field is used to identify users on the ldap server

  • group_base (Any) (defaults to: 'ou=django,ou=groups,dc=example,dc=com')

    Where the groups are located on the ldap server

  • group_filter (Any) (defaults to: '(objectClass=groupOfNames)')

    Which field is used to identify groups on the ldap server

  • group_type (Any) (defaults to: 'GroupOfNamesType')

    Defines the type of group that ratticdb will read

  • staff (Any) (defaults to: 'cn=staff,ou=groups,dc=example,dc=com')

    Group that is considered ratticdb admin on the ldap server

  • db_name (Any) (defaults to: 'ratticdb')

    Database name that ratticdb will use

  • db_user (Any) (defaults to: 'ratticDbUser')

    Username that ratticdb will use when connecting to db_name

  • db_user_pwd (Any) (defaults to: 'ratticDbUserPassword')

    Password of db_user

  • db_host (Any) (defaults to: 'localhost')

    Host where the database is

  • db_port (Any) (defaults to: '3306')

    Port where the database listens to

  • ssl_cert_path (Any) (defaults to: $::ratticdb::params::ssl_cert_path)

    Path where the the SSL cert is located

  • ssl_cert_key_path (Any) (defaults to: $::ratticdb::params::ssl_cert_key_path)

    Path where the SSL cert key is located

  • ssl_cert (Any) (defaults to: undef)

    SSL certificate that we want to use

  • ssl_key (Any) (defaults to: undef)

    SSL certificate private key

See Also:

Author:

  • Marc Deop <marc@marcdeop.com>



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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'manifests/init.pp', line 57

class ratticdb (
  $app_folder        = '/opt/apps/RatticWeb',
  $apache            = true,
  $mysql             = true,
  $url               = 'ratticdb.example.org',
  $version           = '1.3.1',
  $ldap              = false,
  $ldap_server       = 'ldap.example.org',
  $user_base         = 'ou=users,dc=example,dc=com',
  $user_filter       = '(uid=%(user)s)',
  $group_base        = 'ou=django,ou=groups,dc=example,dc=com',
  $group_filter      = '(objectClass=groupOfNames)',
  $group_type        = 'GroupOfNamesType',
  $staff             = 'cn=staff,ou=groups,dc=example,dc=com',
  $db_name           = 'ratticdb',
  $db_user           = 'ratticDbUser',
  $db_user_pwd       = 'ratticDbUserPassword',
  $db_host           = 'localhost',
  $db_port           = '3306',
  $ssl_cert_path     = $::ratticdb::params::ssl_cert_path,
  $ssl_cert_key_path = $::ratticdb::params::ssl_cert_key_path,
  $ssl_cert          = undef,
  $ssl_key           = undef,
  ) inherits ::ratticdb::params {

  if !is_integer($db_port) {
    fail('db_port must be a valid integer')
  }

  if !is_string($db_user) {
    fail('db_user must be a valid string')
  }

  if !is_string($db_name) {
    fail('db_name must be a valid string')
  }

  if !is_string($db_user_pwd) {
    fail('db_user_pwd must be a valid string')
  }

  if !is_domain_name($db_host) {
    fail('db_host must be a valid domain name')
  }

  if !is_bool($ldap) {
    fail('ldap must be a boolean')
  }

  if !is_domain_name($ldap_server) {
    fail('ldap_server must be a valid domain name')
  }

  if !is_string($user_base) {
    fail('user_base must be a valid string')
  }

  if !is_string($user_filter) {
    fail('user_filter must be a valid string')
  }

  if !is_string($group_base) {
    fail('group_base must be a valid string')
  }

  if !is_string($group_filter) {
    fail('group_filter must be a valid string')
  }

  if !is_string($group_type) {
    fail('group_type must be a valid string')
  }

  if !is_string($staff) {
    fail('staff must be a valid string')
  }

  if !is_domain_name($url) {
    fail('url must be a valid domain name')
  }

  if !is_absolute_path($app_folder) {
    fail('app_folder must be an absolute path')
  }

  if !is_bool($mysql) {
    fail('mysql must be a boolean')
  }

  if !is_bool($apache) {
    fail('apache must be a boolean')
  }

  anchor { 'ratticdb::begin': }
    -> class { 'ratticdb::packages': }
    -> class { 'ratticdb::mysql': }
    -> class { 'ratticdb::setup': }
    -> class { 'ratticdb::apache': }
  -> anchor { 'ratticdb::end': }
}