Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/#19144 missing nginx confd files #226

Merged
merged 5 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions resources/recipes/configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -297,20 +297,22 @@
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]
else
action :nothing
end
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?
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
Expand All @@ -332,7 +334,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']
Expand Down Expand Up @@ -360,11 +362,14 @@
end
end

http2k_config 'Configure Nginx Http2k' do
if manager_services['http2k'] && manager_services['nginx']
domain node['redborder']['cdomain']
port node['redborder']['http2k']['port']
action [:configure_certs, :add_http2k_conf_nginx]
nginx_config 'Configure Nginx Http2k' do
if manager_services['nginx'] && node['redborder']['http2k']['hosts'] && !node['redborder']['http2k']['hosts'].empty?
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
Expand Down
9 changes: 9 additions & 0 deletions resources/recipes/prepare_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,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)
Expand Down
Loading