]> gitweb.fluxo.info Git - puppet-nginx.git/commitdiff
Adds nginx::config
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 26 Oct 2015 18:43:56 +0000 (16:43 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 26 Oct 2015 18:43:56 +0000 (16:43 -0200)
manifests/cache.pp
manifests/config.pp [new file with mode: 0644]

index bf0b14597d93b6b2c9f5483058b0f16ea4b9d41f..640ae0c64e53cc6c4f02f6b3b947062821811161 100644 (file)
@@ -1,13 +1,16 @@
-class nginx::cache {
+class nginx::cache(
+  $ensure => 'present',
+) {
   file { '/var/cache/nginx':
-    ensure => directory,
-    owner  => 'www-data',
-    group  => 'www-data',
-    mode   => '0700',
+    ensure  => directory,
+    owner   => 'www-data',
+    group   => 'www-data',
+    mode    => '0700',
+    require => Service['nginx'],
   }
 
   file { '/etc/nginx/conf.d/cache.conf' :
-    ensure  => present,
+    ensure  => $ensure,
     owner   => 'root',
     group   => 'root',
     mode    => '0644',
diff --git a/manifests/config.pp b/manifests/config.pp
new file mode 100644 (file)
index 0000000..7fa4ff4
--- /dev/null
@@ -0,0 +1,10 @@
+define nginx::config($value, $ensure = 'present') {
+  file { '/etc/nginx/conf.d/${name}.conf' :
+    ensure  => $ensure,
+    owner   => 'root',
+    group   => 'root',
+    mode    => '0644',
+    content => "${value}\n",
+    notify  => Service['nginx'],
+  }
+}