From db312d4add369ad6b0f58e9e9e339ebf80e32b9d Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 26 Oct 2015 16:43:56 -0200 Subject: Adds nginx::config --- manifests/cache.pp | 15 +++++++++------ manifests/config.pp | 10 ++++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 manifests/config.pp diff --git a/manifests/cache.pp b/manifests/cache.pp index bf0b145..640ae0c 100644 --- a/manifests/cache.pp +++ b/manifests/cache.pp @@ -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 index 0000000..7fa4ff4 --- /dev/null +++ b/manifests/config.pp @@ -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'], + } +} -- cgit v1.2.3