diff --git a/manifests/config.pp b/manifests/config.pp index af05844..3f99dd5 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -209,6 +209,10 @@ class nginx::config( ensure => directory, } + file { $log_dir: + ensure => directory, + } + file {$client_body_temp_path: ensure => directory, owner => $daemon_user, diff --git a/spec/classes/config_spec.rb b/spec/classes/config_spec.rb index ece8734..8fcba48 100644 --- a/spec/classes/config_spec.rb +++ b/spec/classes/config_spec.rb @@ -68,6 +68,12 @@ describe 'nginx::config' do it { is_expected.to contain_file("/var/nginx/proxy_temp").with(:owner => 'nginx')} it { is_expected.to contain_file("/etc/nginx/nginx.conf").with_content %r{^user nginx;}} + it { is_expected.to contain_file("/var/log/nginx").with( + :ensure => 'directory', + :group => 'root', + :mode => '0644' + )} + describe "nginx.conf template content" do [ { @@ -514,6 +520,11 @@ describe 'nginx::config' do 'purge', 'recurse' ])} + it { is_expected.to contain_file('/var/log/nginx').without([ + 'ignore', + 'purge', + 'recurse' + ])} end context "when daemon_user = www-data" do