Skip to content

Commit

Permalink
Adaptations to work on RHEL9 (#9)
Browse files Browse the repository at this point in the history
* RHEL9 First version
  • Loading branch information
manegron authored Oct 27, 2023
1 parent d27b798 commit 0c2b6b8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cookbook to install and configure redborder http2k

### Platforms

- Centos 7
- Rocky Linux 9

### Chef

Expand Down
2 changes: 2 additions & 0 deletions packaging/rpm/cookbook-http2k.spec
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ esac
%doc

%changelog
* Fri Sep 22 2023 Miguel Negrón <manegron@redborder.com> - 2.0.0-1
- Remove social
* Fri Jan 07 2022 David Vanhoucke <dvanhoucke@redborder.com> - 1.0.2-1
- change register to consul
* Tue Nov 16 2021 Jordi Hdez <jhernandez@redborder.com> - 1.0.1-1
Expand Down
20 changes: 14 additions & 6 deletions resources/providers/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@
locations_list = new_resource.locations_list

# install package
yum_package "redborder-http2k" do
dnf_package "redborder-http2k" do
action :upgrade
flush_cache [ :before ]
end

user user do
action :create
execute "create_user" do
command "/usr/sbin/useradd #{user}"
ignore_failure true
not_if "getent passwd #{user}"
end

directory logdir do
Expand Down Expand Up @@ -75,6 +77,12 @@
begin
port = new_resource.port

service "nginx" do
service_name "nginx"
supports :status => true, :reload => true, :restart => true, :start => true, :enable => true
action :nothing
end

template "/etc/nginx/conf.d/http2k.conf" do
source "http2k.conf.erb"
owner "nginx"
Expand Down Expand Up @@ -161,7 +169,7 @@
#end

# removing package
#yum_package 'redborder-http2k' do
#dnf_package 'redborder-http2k' do
# action :remove
#end

Expand All @@ -186,7 +194,7 @@
action :nothing
end.run_action(:run)

node.set["http2k"]["registered"] = true
node.normal["http2k"]["registered"] = true
Chef::Log.info("http2k service has been registered to consul")
end
rescue => e
Expand All @@ -202,7 +210,7 @@
action :nothing
end.run_action(:run)

node.set["http2k"]["registered"] = false
node.normal["http2k"]["registered"] = false
Chef::Log.info("http2k service has been deregistered to consul")
end
rescue => e
Expand Down
2 changes: 1 addition & 1 deletion resources/resources/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
attribute :user, :kind_of => String, :default => "http2k"
attribute :group, :kind_of => String, :default => "http2k"
attribute :port, :kind_of => Fixnum, :default => 7980
attribute :kafka_hosts, :kind_of => Array, :default => "kafka.service"
attribute :kafka_hosts, :kind_of => Array, :default => ["kafka.service"]
attribute :proxy_nodes, :kind_of => Object
attribute :ips_nodes, :kind_of => Object
attribute :ipsg_nodes, :kind_of => Object
Expand Down
1 change: 0 additions & 1 deletion resources/templates/default/http2k_config.json.erb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ end
"rb_nmsp": {},
"rb_radius": {},
"rb_state": {},
"rb_social": {},
"rb_monitor": {},
"rb_iot": {},
"rb_vault": {},
Expand Down

0 comments on commit 0c2b6b8

Please sign in to comment.