From 967cdc1d0433cd4bc1ff9b157239f5b4eaeef023 Mon Sep 17 00:00:00 2001 From: Miguel Negron Date: Mon, 21 Oct 2024 17:11:17 +0100 Subject: [PATCH 1/4] Calling add nginx conf --- resources/recipes/configure.rb | 10 ++++++---- resources/recipes/prepare_system.rb | 9 +++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/resources/recipes/configure.rb b/resources/recipes/configure.rb index c7ea4ca7..9ba038b7 100644 --- a/resources/recipes/configure.rb +++ b/resources/recipes/configure.rb @@ -288,7 +288,8 @@ end nginx_config 'Configure Nginx Chef' do - if manager_services['nginx'] && manager_services['chef-server'] + if manager_services['nginx'] && node['redborder']['erchef']['hosts'] && !node['redborder']['erchef']['hosts'].empty? + erchef_hosts node['redborder']['erchef']['hosts'] service_name 'erchef' cdomain node['redborder']['cdomain'] action [:configure_certs, :add_erchef] @@ -298,7 +299,7 @@ end nginx_config 'Configure Nginx aioutliers' do - if manager_services['nginx'] && manager_services['rb-aioutliers'] + if manager_services['nginx'] && node['redborder']['rb-aioutliers']['hosts'] && !node['redborder']['rb-aioutliers']['hosts'].empty? service_name 'rb-aioutliers' cdomain node['redborder']['cdomain'] action [:configure_certs, :add_aioutliers] @@ -321,7 +322,7 @@ end webui_config 'Configure Nginx WebUI' do - if manager_services['webui'] && manager_services['nginx'] + if manager_services['nginx'] && node['redborder']['webui']['hosts'] && !node['redborder']['webui']['hosts'].empty? hosts node['redborder']['webui']['hosts'] cdomain node['redborder']['cdomain'] port node['redborder']['webui']['port'] @@ -350,7 +351,8 @@ end http2k_config 'Configure Nginx Http2k' do - if manager_services['http2k'] && manager_services['nginx'] + if manager_services['nginx'] && node['redborder']['http2k']['hosts'] && !node['redborder']['http2k']['hosts'].empty? + hosts node['redborder']['http2k']['hosts'] domain node['redborder']['cdomain'] port node['redborder']['http2k']['port'] action [:configure_certs, :add_http2k_conf_nginx] diff --git a/resources/recipes/prepare_system.rb b/resources/recipes/prepare_system.rb index 19587235..e70b6e7a 100644 --- a/resources/recipes/prepare_system.rb +++ b/resources/recipes/prepare_system.rb @@ -143,6 +143,15 @@ node.default['redborder']['webui']['hosts'] = webui_hosts node.run_state['auth_token'] = get_api_auth_token if File.exist?('/etc/redborder/cluster-installed.txt') +erchef_hosts = node['redborder']['managers_per_services']['chef-server'].map { |z| "#{z}.#{node['redborder']['cdomain']}" if node['redborder']['cdomain'] } +node.default['redborder']['erchef']['hosts'] = erchef_hosts + +http2k_hosts = node['redborder']['managers_per_services']['http2k'].map { |z| "#{z}.#{node['redborder']['cdomain']}" if node['redborder']['cdomain'] } +node.default['redborder']['http2k']['hosts'] = http2k_hosts + +rb_aioutliers_hosts = node['redborder']['managers_per_services']['rb-aioutliers'].map { |z| "#{z}.#{node['redborder']['cdomain']}" if node['redborder']['cdomain'] } +node.default['redborder']['rb-aioutliers']['hosts'] = rb_aioutliers_hosts + # set kafka host index if kafka is enabled in this host if node['redborder']['managers_per_services']['kafka'].include?(node.name) node.default['redborder']['kafka']['host_index'] = node['redborder']['managers_per_services']['kafka'].index(node.name) From 617db93e25f7de871295fd3f41a7d0299934fd75 Mon Sep 17 00:00:00 2001 From: Miguel Negron Date: Mon, 21 Oct 2024 17:17:19 +0100 Subject: [PATCH 2/4] Add outliers --- resources/recipes/configure.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/recipes/configure.rb b/resources/recipes/configure.rb index 9ba038b7..3b14a4c6 100644 --- a/resources/recipes/configure.rb +++ b/resources/recipes/configure.rb @@ -300,6 +300,7 @@ nginx_config 'Configure Nginx aioutliers' do if manager_services['nginx'] && node['redborder']['rb-aioutliers']['hosts'] && !node['redborder']['rb-aioutliers']['hosts'].empty? + aioutliers_hosts node['redborder']['rb-aioutliers']['hosts'] service_name 'rb-aioutliers' cdomain node['redborder']['cdomain'] action [:configure_certs, :add_aioutliers] From a5e7fda466ed5716fd439bf7e3dbf094c709d456 Mon Sep 17 00:00:00 2001 From: David Vanhoucke Date: Tue, 29 Oct 2024 14:55:37 +0000 Subject: [PATCH 3/4] remove files if service disabled --- resources/recipes/configure.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/resources/recipes/configure.rb b/resources/recipes/configure.rb index c26c716d..d2d7bb02 100644 --- a/resources/recipes/configure.rb +++ b/resources/recipes/configure.rb @@ -291,7 +291,6 @@ if manager_services['nginx'] && node['redborder']['erchef']['hosts'] && !node['redborder']['erchef']['hosts'].empty? erchef_hosts node['redborder']['erchef']['hosts'] service_name 'erchef' - cdomain node['redborder']['cdomain'] action [:configure_certs, :add_erchef] else action :nothing @@ -302,8 +301,9 @@ if manager_services['nginx'] && node['redborder']['rb-aioutliers']['hosts'] && !node['redborder']['rb-aioutliers']['hosts'].empty? aioutliers_hosts node['redborder']['rb-aioutliers']['hosts'] service_name 'rb-aioutliers' - cdomain node['redborder']['cdomain'] action [:configure_certs, :add_aioutliers] + elsif manager_services['nginx'] + action :remove_aioutliers else action :nothing end @@ -353,12 +353,14 @@ end end -http2k_config 'Configure Nginx Http2k' do +nginx_config 'Configure Nginx Http2k' do if manager_services['nginx'] && node['redborder']['http2k']['hosts'] && !node['redborder']['http2k']['hosts'].empty? - hosts node['redborder']['http2k']['hosts'] - domain node['redborder']['cdomain'] - port node['redborder']['http2k']['port'] - action [:configure_certs, :add_http2k_conf_nginx] + http2k_hosts node['redborder']['http2k']['hosts'] + http2k_port node['redborder']['http2k']['port'] + service_name 'http2k' + action [:configure_certs, :add_http2k] + elsif manager_services['nginx'] + action :remove_http2k else action :nothing end From ca4a276f6eb24b6eba67ba1c7fe304f007733ff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Negr=C3=B3n?= Date: Wed, 13 Nov 2024 12:51:12 +0000 Subject: [PATCH 4/4] Bump version --- CHANGELOG.md | 12 ++++++++++++ resources/metadata.rb | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0d5482e..3c684f58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,18 @@ cookbook-rb-manager CHANGELOG =============== +## 4.5.0 + + - Miguel Negrón + - [99f02b0] Merge pull request #226 from redBorder/bugfix/#19144_missing_nginx_confd_files + - [917b21b] Merge branch 'development' into bugfix/#19144_missing_nginx_confd_files + - David Vanhoucke + - [a5e7fda] remove files if service disabled + - [06dc4b6] Merge remote-tracking branch 'origin/development' into bugfix/#19144_missing_nginx_confd_files + - Miguel Negron + - [617db93] Add outliers + - [967cdc1] Calling add nginx conf + ## 4.4.7 - Rafael Gomez diff --git a/resources/metadata.rb b/resources/metadata.rb index 394879a0..5b798310 100644 --- a/resources/metadata.rb +++ b/resources/metadata.rb @@ -5,7 +5,7 @@ maintainer_email 'git@redborder.com' license 'AGPL-3.0' description 'Installs/Configures redborder manager' -version '4.4.7' +version '4.5.0' depends 'rb-common' depends 'chef-server'