Skip to content

Commit

Permalink
Add memcached servers to webui
Browse files Browse the repository at this point in the history
  • Loading branch information
malvads committed Jun 21, 2024
1 parent 07b6dae commit 4edc69c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions resources/providers/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
cdomain = new_resource.cdomain
s3_local_storage = new_resource.s3_local_storage
elasticache_hosts = new_resource.elasticache_hosts

memcached_servers = new_resource.memcached_servers
http_workers = [[10 * node['cpu']['total'].to_i, (memory_kb / (3 * 1024 * 1024)).floor ].min, 1].max.to_i

# INSTALLATION
Expand Down Expand Up @@ -308,7 +308,7 @@
mode '0644'
retries 2
cookbook 'webui'
variables(elasticache_hosts: elasticache_hosts)
variables(elasticache_hosts: elasticache_hosts, memcached_servers: memcached_servers)
notifies :restart, 'service[webui]', :delayed
end

Expand Down
1 change: 1 addition & 0 deletions resources/resources/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
attribute :group, kind_of: String, default: 'webui'
attribute :port, kind_of: Integer, default: 8001
attribute :hosts, kind_of: Array, default: ['localhost']
attribute :memcached_servers, kind_of: Array, default: ['localhost']
attribute :hostname, kind_of: String
attribute :cdomain, kind_of: String, default: 'redborder.cluster'
attribute :web_dir, kind_of: String, default: '/var/www/rb-rails'
Expand Down
4 changes: 3 additions & 1 deletion resources/templates/default/memcached_config.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<%= x %>:
servers:
<% if @elasticache_hosts.nil? %>
- "memcached.service:11211"
<% @memcached_servers.each do |host| %>
- "<%= "#{host}.node:11211" %>"
<% end %>
<% else %>
- "<% @elasticache_hosts.map {|host| host} %>"
<% end %>
Expand Down

0 comments on commit 4edc69c

Please sign in to comment.