Puppet Class: deploy

Defined in:
manifests/init.pp

Overview

Parameters:

  • applications (Any) (defaults to: undef)
  • rails (Any) (defaults to: undef)
  • mysql (Any) (defaults to: undef)
  • postgresql (Any) (defaults to: undef)
  • users (Any) (defaults to: undef)
  • mongodb (Any) (defaults to: undef)
  • sites (Any) (defaults to: undef)
  • services (Any) (defaults to: undef)
  • rabbitmq (Any) (defaults to: undef)


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
60
61
62
63
# File 'manifests/init.pp', line 2

class deploy(
  $applications = undef,
  $rails        = undef,
  $mysql        = undef,
  $postgresql   = undef,
  $users        = undef,
  $mongodb      = undef,
  $sites        = undef,
  $services     = undef,
  $rabbitmq     = undef,
) {

  include 'deploy::params'

  $deploy_to = $deploy::params::deploy_to

  if $applications != undef or $rails != undef {
    exec { "/bin/mkdir -p ${deploy_to}":
      creates => $deploy_to
    }

    $defaults = {
      require => Exec["/bin/mkdir -p ${deploy_to}"]
    }

    if $applications != undef {
      create_resources('deploy::application', $applications, $defaults)
    }

    if $rails != undef {
      create_resources('deploy::rails', $rails, $defaults)
    }
  }

  if $mysql != undef {
    create_resources('deploy::mysql', $mysql)
  }

  if $postgresql != undef {
    create_resources('deploy::postgresql', $postgresql)
  }

  if $users != undef {
    create_resources('deploy::user', $users)
  }

  if $mongodb != undef {
    create_resources('deploy::mongodb', $mongodb)
  }

  if $sites != undef {
    create_resources('deploy::nginx::site', $sites)
  }

  if $services != undef {
    create_resources('deploy::runit::service', $services)
  }

  if $rabbitmq != undef {
    create_resources('deploy::rabbitmq', $rabbitmq)
  }
}