summaryrefslogtreecommitdiff
path: root/manifests/base.pp
blob: bb13860e1d73907c5021b50caa8bbf9d90affd87 (plain)
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
# Base class
class nginx::base {
  # Setup packages
  package { "nginx": ensure => installed, }

  # Config folders, see http://projects.reductivelabs.com/issues/86
  file { [ "/etc/nginx", "/etc/nginx/sites-available", "/etc/nginx/sites-enabled" ]:
    ensure  => directory,
    owner   => "root",
    group   => "root",
  }

  service { "nginx":
    enable     => true,
    ensure     => running,
    hasrestart => true,
    require    => [ Package["nginx"], File['/var/cache/nginx'] ],
  }

  # Main configuration
  # TODO: we're managing the default config. Remove this block after a while.
  file { "/etc/nginx/nginx.conf":
    content => template("nginx/nginx.conf.erb"),
    owner   => "root",
    group   => "root",
    mode    => 0644,
    ensure  => present,
    notify  => Service["nginx"],
  }
}