Redis recipe

This commit is contained in:
2019-05-27 22:06:21 -04:00
parent f9a2f0aaac
commit 283a04f8d9
3 changed files with 27 additions and 0 deletions

19
recipes/redis.rb Normal file
View File

@ -0,0 +1,19 @@
apt_package 'redis-server'
template '/etc/redis/local.conf' do
source 'redis/local.conf'
end
if node['redis']['unix']['perm']
bash 'append_to_config' do
user 'root'
code <<~EOF
echo "include /etc/redis/local.conf" >> /etc/redis/redis.conf
EOF
not_if 'grep -q "/etc/redis/local.conf" /etc/redis/redis.conf'
end
end
systemd_unit 'redis-server.service' do
action :restart
end