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

Release 4.0.1 #64

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
cookbook-rb-proxy CHANGELOG
===============

## 4.0.1

- nilsver
- [c25bd1a] Changed typo
- [a4a0af5] fix rbcli service command

## 4.0.0

- Miguel Negrón
Expand Down
15 changes: 15 additions & 0 deletions resources/libraries/proxy_services.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ def proxy_services
end
end

begin
file_services = JSON.parse(File.read('/etc/redborder/services.json'))
rescue Errno::ENOENT, JSON::ParserError => e
Chef::Log.warn("Error loading services from file: #{e.message}")
file_services = {}
end

systemd_services = node.attributes['redborder']['systemdservices']
systemd_services.each do |service_name, systemd_name|
sys_name = systemd_name.join(',')
if file_services.key?(sys_name)
proxy_services[service_name] = file_services[sys_name]
end
end

proxy_services
end
end
Expand Down
2 changes: 1 addition & 1 deletion resources/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
maintainer_email 'git@redborder.com'
license 'AGPL-3.0'
description 'Installs/Configures redborder proxy'
version '4.0.0'
version '4.0.1'

depends 'rb-common'
depends 'rb-selinux'
Expand Down
18 changes: 10 additions & 8 deletions resources/recipes/prepare_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,15 @@
end

# Build service list for rbcli
services = node['redborder']['services'] || []
systemd_services = node['redborder']['systemdservices'] || []
service_enablement = {}
unless File.exist?('/etc/redborder/services.json')
services = node['redborder']['services'] || []
systemd_services = node['redborder']['systemdservices'] || []
service_enablement = {}

systemd_services.each do |service_name, systemd_name|
service_enablement[systemd_name.first] = services[service_name]
end
systemd_services.each do |service_name, systemd_name|
service_enablement[systemd_name.first] = services[service_name]
end

Chef::Log.info('Saving services enablement into /etc/redborder/services.json')
File.write('/etc/redborder/services.json', JSON.pretty_generate(service_enablement))
Chef::Log.info('Saving services enablement into /etc/redborder/services.json')
File.write('/etc/redborder/services.json', JSON.pretty_generate(service_enablement))
end