Skip to content

Instantly share code, notes, and snippets.

@jedi4ever
Created September 21, 2012 14:48
Show Gist options
  • Save jedi4ever/3761911 to your computer and use it in GitHub Desktop.
Save jedi4ever/3761911 to your computer and use it in GitHub Desktop.
if platform?(%w{debian ubuntu})
# Nagios package requires to enter the admin password
# We generate it randomly as it's overwritten later in the config templates
random_initial_password = rand(36**16).to_s(36)
%w{adminpassword adminpassword-password}.each do |setting|
execute "preseed nagiosadmin password" do
command "echo nagios3-cgi nagios3/#{setting} password '#{random_initial_password}' | debconf-set-selections"
not_if "dpkg -s nagios3 | grep installed"
end
end
end
%w{.
nagios3
nagios-nrpe-plugin
nagios-images
}.each do |pkg|
package pkg
end
include_recipe "nagios::client"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment