Puppet Class: artifactory::db

Defined in:
manifests/db.pp

Overview

Parameters:

  • db_name (String[1]) (defaults to: $artifactory::db_name)
  • db_port (Stdlib::Port) (defaults to: $artifactory::db_port)
  • db_user (String[1]) (defaults to: $artifactory::db_user)
  • db_password (Variant[ Sensitive[String[1]], String[1] ]) (defaults to: $artifactory::db_password)


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'manifests/db.pp', line 2

class artifactory::db (
  String[1]    $db_name     = $artifactory::db_name,
  Stdlib::Port $db_port     = $artifactory::db_port,
  String[1]    $db_user     = $artifactory::db_user,
  Variant[
    Sensitive[String[1]],
    String[1]
  ]            $db_password = $artifactory::db_password,
) {
  # We only 'include' the main postgresql server class here
  # If any customisation is needed, it should be done in the user's profile code before declaring the artifactory class
  include postgresql::server

  # We can one small bit of sanity checking though...
  unless $postgresql::server::port == $db_port {
    fail("PostgreSQL is configured to listen on ${postgresql::server::port}. This does not match ${db_port}. Please declare `postgresql::server` yourself before including the artifactory module")
  }

  postgresql::server::db { $db_name:
    user     => $db_name,
    owner    => $db_name,
    password => postgresql::postgresql_password($db_name, $db_password),
  }
}