Puppet Class: pulp::database

Defined in:
manifests/database.pp

Overview

Set up the pulp database



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
# File 'manifests/database.pp', line 3

class pulp::database {
  if $pulp::manage_db {
    include mongodb::server

    Service['mongodb'] -> Class['pulp::service']
    Service['mongodb'] -> Exec['migrate_pulp_db']
  }

  $pulp::services.each |$service| {
    transition { "stop ${service}":
      resource   => Service[$service],
      attributes => { ensure => 'stopped' },
      prior_to   => Exec['migrate_pulp_db'],
    }

    Exec['migrate_pulp_db'] ~> Service[$service]
  }

  exec { 'migrate_pulp_db':
    command   => 'pulp-manage-db',
    path      => '/bin:/usr/bin',
    logoutput => 'on_failure',
    user      => 'apache',
    timeout   => $pulp::migrate_db_timeout,
    unless    => 'pulp-manage-db --dry-run',
  }
}