From 601d814d5dd4c2e227c9036d01485a083804aa4c Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sat, 10 Oct 2020 22:08:21 +0900 Subject: [PATCH] Modify `Nginx` cookbook. --- cookbooks/nginx/attributes.rb | 2 +- cookbooks/nginx/default.rb | 6 +++--- cookbooks/nginx/webadm.rb | 12 +++++++----- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/cookbooks/nginx/attributes.rb b/cookbooks/nginx/attributes.rb index 63a6d0c..d410dd0 100644 --- a/cookbooks/nginx/attributes.rb +++ b/cookbooks/nginx/attributes.rb @@ -3,6 +3,6 @@ # ------------------------------------------- node.reverse_merge!({ 'nginx' => { - 'version' => '1.17.5' + 'version' => '1.19.3' } }) diff --git a/cookbooks/nginx/default.rb b/cookbooks/nginx/default.rb index e38c4f9..fb4e230 100644 --- a/cookbooks/nginx/default.rb +++ b/cookbooks/nginx/default.rb @@ -4,12 +4,12 @@ include_recipe './attributes.rb' # Kernel Parameters: include_recipe './kernel.rb' -# Install Let's Encrypt: -include_recipe './lego.rb' - # Prerequisites for Building nginx: include_recipe './webadm.rb' +# Install Let's Encrypt: +include_recipe './lego.rb' + # Build nginx: include_recipe './build.rb' diff --git a/cookbooks/nginx/webadm.rb b/cookbooks/nginx/webadm.rb index 03fdb5b..65afd74 100644 --- a/cookbooks/nginx/webadm.rb +++ b/cookbooks/nginx/webadm.rb @@ -13,11 +13,13 @@ remote_file '/etc/sudoers.d/webadm' do mode '440' end -# Create `.ssh` directory: -directory '/home/webadm/.ssh' do - owner 'webadm' - group 'webadm' - mode '700' +# Create directories: +%w(/home/webadm/.ssh /home/webadm/repo).each do |d| + directory d do + owner 'webadm' + group 'webadm' + mode '700' + end end # Deploy `~/.ssh/.ssh/authorized_keys`: