Skip to content

Instantly share code, notes, and snippets.

@nukemberg
Last active December 27, 2015 00:09
Show Gist options
  • Save nukemberg/7235592 to your computer and use it in GitHub Desktop.
Save nukemberg/7235592 to your computer and use it in GitHub Desktop.
install lsb-release on debian and reload ohai
unless node["lsb"]["codename"]
execute "apt-get-update-lsb" do
command "apt-get update"
action :nothing
# tip: to suppress this running every time, just use the apt cookbook
not_if do
::File.exists?('/var/lib/apt/periodic/update-success-stamp') &&
::File.mtime('/var/lib/apt/periodic/update-success-stamp') > Time.now - 86400*2
end
end.run_action(:run)
package("lsb-release").run_action(:install)
ohai("reload lsb").run_action(:reload)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment