Created
September 21, 2012 14:48
-
-
Save jedi4ever/3761911 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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