Skip to content

Commit f4b539d

Browse files
committed
feature: Add possibilty to configure no listen_ip.
1 parent e0e9c02 commit f4b539d

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

spec/classes/memcached_spec.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@
9696
:install_dev => true,
9797
:processorcount => 1
9898
},
99+
{
100+
:listen_ip => '',
101+
},
99102
{
100103
:pidfile => false,
101104
},
@@ -172,7 +175,6 @@
172175
)
173176
expected_lines = [
174177
"logfile #{param_hash[:logfile]}",
175-
"-l #{param_hash[:listen_ip]}",
176178
"-p #{param_hash[:tcp_port]}",
177179
"-U #{param_hash[:udp_port]}",
178180
"-u #{param_hash[:user]}",
@@ -188,6 +190,9 @@
188190
else
189191
expected_lines.push("-m 950")
190192
end
193+
if(param_hash[:listen_ip] != '')
194+
expected_lines.push("-l #{param_hash[:listen_ip]}")
195+
end
191196
if(param_hash[:lock_memory])
192197
expected_lines.push("-k")
193198
end

templates/memcached.conf.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ logfile <%= @logfile -%>
3434
# UNIX socket path to listen on
3535
-s <%= @unix_socket %>
3636
<% else -%>
37+
38+
<% if @listen_ip != '' -%>
3739
# IP to listen on
3840
-l <%= @listen_ip %>
41+
<% end -%>
3942

4043
# TCP port to listen on
4144
-p <%= @tcp_port %>

0 commit comments

Comments
 (0)