Skip to content

Commit c152abe

Browse files
committed
Fix repository recipe when lsb-release is missing on Debian
lsb-release is pre-installed on the Debian basebox but wasn't present on our production servers. Ohai uses it to set the node['lsb']['codename'] attribute.
1 parent f502e4c commit c152abe

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

recipes/repository.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,18 @@
2121
when 'fedora', 'rhel'
2222
include_recipe 'yum-atomic'
2323
when 'debian'
24+
package 'lsb-release'
25+
26+
ohai 'reload lsb' do
27+
plugin 'lsb'
28+
action :nothing
29+
subscribes :reload, 'package[lsb-release]', :immediately
30+
end
31+
2432
apt_repository 'ossec' do
2533
uri 'http://ossec.wazuh.com/repos/apt/' + node['platform']
2634
key 'http://ossec.wazuh.com/repos/apt/conf/ossec-key.gpg.key'
27-
distribution node['lsb']['codename']
35+
distribution lazy { node['lsb']['codename'] }
2836
components ['main']
2937
end
3038
end

0 commit comments

Comments
 (0)