From f1222698550f6475069e75d7e8b65ca49ef57cd0 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Mon, 6 May 2024 17:09:18 +0900 Subject: [PATCH] Accumulative changes for `nginc` recipe. --- cookbooks/nginx/attributes.rb | 7 ++++--- cookbooks/nginx/build.rb | 2 +- cookbooks/nginx/default.rb | 11 +++++++---- cookbooks/nginx/webadm.rb | 23 ++++++++++++----------- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/cookbooks/nginx/attributes.rb b/cookbooks/nginx/attributes.rb index c12428c..e7e413f 100644 --- a/cookbooks/nginx/attributes.rb +++ b/cookbooks/nginx/attributes.rb @@ -3,8 +3,9 @@ # ------------------------------------------- node.reverse_merge!({ 'nginx' => { - 'version' => '1.25.0', - 'skip_lego' => 'true', - 'skip_webadm' => 'true' + 'version' => '1.26.0', + 'skip_lego' => true, + 'skip_webadm' => false, + 'skip_deploy_conf' => true } }) diff --git a/cookbooks/nginx/build.rb b/cookbooks/nginx/build.rb index d316ccb..9c3be07 100644 --- a/cookbooks/nginx/build.rb +++ b/cookbooks/nginx/build.rb @@ -78,7 +78,7 @@ directory MODULEDIR do end # Build starts here: -execute "#{NGINXBUILD} -d working -v #{version} -c configure.sh -zlib -pcre -libressl -libresslversion 3.8.0" do +execute "#{NGINXBUILD} -d working -v #{version} -c configure.sh -zlib -pcre -libressl -libresslversion 3.9.1" do cwd WORKDIR user USER diff --git a/cookbooks/nginx/default.rb b/cookbooks/nginx/default.rb index eb36bd5..f2197b4 100644 --- a/cookbooks/nginx/default.rb +++ b/cookbooks/nginx/default.rb @@ -35,6 +35,13 @@ end # Prerequisites for Building nginx: if !node['nginx']['skip_webadm'] include_recipe './webadm.rb' +end + +# Build nginx: +include_recipe './build.rb' + +# Check whether to deploy the nginx confings: +if !node['nginx']['skip_deploy_conf'] include_recipe '../blog/default.rb' include_recipe '../everun/default.rb' end @@ -44,9 +51,5 @@ if !node['nginx']['skip_lego'] include_recipe './lego.rb' end -# Build nginx: -include_recipe './build.rb' - # Setup nginx: include_recipe './setup.rb' - diff --git a/cookbooks/nginx/webadm.rb b/cookbooks/nginx/webadm.rb index e8336ca..334bc6b 100644 --- a/cookbooks/nginx/webadm.rb +++ b/cookbooks/nginx/webadm.rb @@ -47,17 +47,18 @@ end end # Create `repo` directory: -git '/home/webadm/repo/nginx-config' do - user 'webadm' - repository 'https://github.com/kazu634/nginx-config.git' -end +if !node['nginx']['skip_deploy_conf'] + git '/home/webadm/repo/nginx-config' do + user 'webadm' + repository 'https://github.com/kazu634/nginx-config.git' + end -execute '/home/webadm/repo/nginx-config/deploy.sh' do - user 'root' - cwd '/home/webadm/repo/nginx-config/' -end + execute '/home/webadm/repo/nginx-config/deploy.sh' do + user 'root' + cwd '/home/webadm/repo/nginx-config/' + end -service 'consul-template' do - action :restart + service 'consul-template' do + action :restart + end end -