#
# Author:: Seth Chisamore <schisamo@opscode.com>
# Cookbook Name:: nagios
# Recipe:: server_package
#
# Copyright 2011, Opscode, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

%w{ 
  nagios3
  nagios-nrpe-plugin
  nagios-images
}.each do |pkg|
  package pkg
end

include_recipe "nagios::client"

#
# Author:: Seth Chisamore <schisamo@opscode.com>
# Cookbook Name:: nagios
# Recipe:: server_package
#
# Copyright 2011, Opscode, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

if platform_family?(debian)

  # 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-repeat}.each do |setting|
    execute "preseed nagiosadmin password" do
      command "echo nagios3-cgi nagios3/#{setting} password #{random_initial_password} | debconf-set-selections"
      not_if 'dpkg -l nagios3'
    end
  end

end

%w{ 
  nagios3
  nagios-nrpe-plugin
  nagios-images
}.each do |pkg|
  package pkg
end

include_recipe "nagios::client"

Fix Nagios server installs via package using a closed out pull request
Fix Nagios server installs via package using a closed out pull request


Former-commit-id: 9d7bb90849b633cb2606f0bd5d4212319a059c6c [formerly bc361734ad782814e369a6a5c317cfc0b08efd0a] [formerly f3bd6eef3d2758750a4016907ef6c5d4c61dc50b [formerly 7bb92f416cd2722bc15879565c0789fe8fd90296]]
Former-commit-id: 59129f1e5be8109f2ba6322f52a32bf4ff85b2a7 [formerly a04ae576ca1aa1bec7ab7d4a60e64c1500039891]
Former-commit-id: 86e6d74734a5828f3f580aa800b0c18848479794