Puppet Class: razor::server

Defined in:
manifests/server.pp

Overview



1
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
64
65
66
67
# File 'manifests/server.pp', line 1

class razor::server {
  $url  = 'http://links.puppetlabs.com/razor-server-latest.zip'
  $dest = '/opt/razor'

  # Put the archive into place, if needed.
  exec { "install razor binary distribution to ${dest}":
    provider => shell,
    command  => template('razor/install-zip.sh.erb'),
    path     => '/bin:/usr/bin:/usr/local/bin:/opt/bin',
    creates  => "${dest}/bin/razor-admin",
    require  => [Package[curl], Package[unzip]],
    notify   => Exec["deploy razor to torquebox"]
  }

  exec { "deploy razor if it was undeployed":
    provider => shell,
    unless   => "test -f ${razor::torquebox::dest}/jboss/standalone/deployments/razor-knob.yml",
    # This is actually "notify if the file does not exist" :)
    command  => ":",
    notify   => Exec["deploy razor to torquebox"],
    require  => Exec["install razor binary distribution to ${dest}"]
  }

  # deploy razor, if required.
  exec { "deploy razor to torquebox":
    command     => "${razor::torquebox::dest}/jruby/bin/torquebox deploy --env production",
    cwd         => $dest,
    environment => [
      "TORQUEBOX_HOME=${razor::torquebox::dest}",
      "JBOSS_HOME=${razor::torquebox::dest}/jboss",
      "JRUBY_HOME=${razor::torquebox::dest}/jruby"
    ],
    path        => "${razor::torquebox::dest}/jruby/bin:/bin:/usr/bin:/usr/local/bin",
    require     => Exec["install razor binary distribution to ${dest}"],
    refreshonly => true
  }

  file { "${dest}/bin/razor-binary-wrapper":
    ensure  => file, owner => root, group => root, mode => 0755,
    content => template('razor/razor-binary-wrapper.erb'),
    require => Exec["install razor binary distribution to ${dest}"]
  }

  file { "/usr/local/bin/razor-admin":
    ensure => link, target => "${dest}/bin/razor-binary-wrapper"
  }

  # Work around what seems very much like a bug in the package...
  file { "${dest}/bin/razor-admin":
    mode    => 0755,
    require => Exec["install razor binary distribution to ${dest}"]
  }

  file { "/var/lib/razor":
    ensure => directory, owner => razor-server, group => razor-server, mode => 0775,
    require => Exec["install razor binary distribution to ${dest}"]
  }

  file { "/var/lib/razor/repo-store":
    ensure => directory, owner => razor-server, group => razor-server, mode => 0775
  }

  file { "${dest}/log":
    ensure => directory, owner => razor-server, group => razor-server, mode => 0775,
    require => Exec["install razor binary distribution to ${dest}"]
  }
}