Icinga / chef-icinga2

Icinga 2 Chef Cookbook
https://supermarket.chef.io/cookbooks/icinga2
Apache License 2.0
41 stars 55 forks source link

issue in server_os_packages.rb #319

Open uyo1787 opened 6 years ago

uyo1787 commented 6 years ago

I'm using "icinga2::server" recipe at ubuntu 16.04 and get

Recipe: icinga2::server_os_packages
  * apt_package[icinga2_packages] action install

    ================================================================================
    Error executing action `install` on resource 'apt_package[icinga2_packages]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '100'
    ---- Begin output of apt-get -q -y install libgd2-xpm-dev libjpeg62=1:6b2-2 libpng12-dev=1.2.54-1ubuntu1 imagemagick=8:6.8.9.9-7ubuntu5.9 php7.0-imagick php-pear=1:1.10.5+submodules+notgz-1+ubuntu16.04.1+deb.sury.org+1 php7.0-xmlrpc=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 php7.0-xsl=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 php7.0-mysql=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 php-soap=1:7.1+55+ubuntu16.04.1+deb.sury.org+1 php7.0-gd=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 php7.0-ldap=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 php7.0-pgsql=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 php7.0-intl=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 ----
    STDOUT: Reading package lists...
    Building dependency tree...
    Reading state information...
    Package libgd2-xpm-dev is a virtual package provided by:
      libgd-dev 2.1.1-4ubuntu0.16.04.8 [Not candidate version]
      libgd-dev 2.1.1-4build2 [Not candidate version]
    STDERR: E: Package 'libgd2-xpm-dev' has no installation candidate
    ---- End output of apt-get -q -y install libgd2-xpm-dev libjpeg62=1:6b2-2 libpng12-dev=1.2.54-1ubuntu1 imagemagick=8:6.8.9.9-7ubuntu5.9 php7.0-imagick php-pear=1:1.10.5+submodules+notgz-1+ubuntu16.04.1+deb.sury.org+1 php7.0-xmlrpc=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 php7.0-xsl=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 php7.0-mysql=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 php-soap=1:7.1+55+ubuntu16.04.1+deb.sury.org+1 php7.0-gd=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 php7.0-ldap=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 php7.0-pgsql=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 php7.0-intl=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 ----
    Ran apt-get -q -y install libgd2-xpm-dev libjpeg62=1:6b2-2 libpng12-dev=1.2.54-1ubuntu1 imagemagick=8:6.8.9.9-7ubuntu5.9 php7.0-imagick php-pear=1:1.10.5+submodules+notgz-1+ubuntu16.04.1+deb.sury.org+1 php7.0-xmlrpc=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 php7.0-xsl=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 php7.0-mysql=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 php-soap=1:7.1+55+ubuntu16.04.1+deb.sury.org+1 php7.0-gd=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 php7.0-ldap=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 php7.0-pgsql=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 php7.0-intl=7.0.26-2+ubuntu16.04.1+deb.sury.org+2 returned 100

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/icinga2/recipes/server_os_packages.rb

     61: package 'icinga2_packages' do
     62:   package_name os_packages
     63:   action :install
     64: end

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/icinga2/recipes/server_os_packages.rb:61:in `from_file'

    apt_package("icinga2_packages") do
      package_name ["g++", "mailutils", "php7.0", "php7.0-cli", "php7.0-fpm", "build-essential", "libgd2-xpm-dev", "libjpeg62", "libpng12-0", "libpng12-dev", "libapache2-mod-php7.0", "imagemagick", "php7.0-imagick", "php-pear", "php7.0-xmlrpc", "php7.0-xsl", "php7.0-mysql", "php-soap", "php7.0-gd", "php7.0-ldap", "php7.0-pgsql", "php7.0-intl"]
      action [:install]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      declared_type :package
      cookbook_name "icinga2"
      recipe_name "server_os_packages"
    end

    Platform:
    ---------
    x86_64-linux

"icinga2": "~> 3.0.1"

vills commented 6 years ago

Something changed in 'ondrej' ppa. For 16.04 'libgd2-xpm-dev' should be replaced by 'libgd-dev' (comes from same ondrej ppa).

uyo1787 commented 6 years ago

@vills is it possible replace it in 3.0.2 release? Otherwise I need to update my version to 4.0.0 where I don't see any 'os_packages' for 16.04.

vills commented 6 years ago

In 4.0.0 those 'os_packages' where moved to 'icingaweb2' cookbook. About upgrade in 3.0.2 - @vkhatri ?

uyo1787 commented 6 years ago

@vills thanks for your response. I'm trying now latest v4.0.0. Looks like package installation completed.

uyo1787 commented 6 years ago

Finally installed it for 16.04. Some of my cookbooks recipes from v2.x.x are not working anymore. I mean this one for example:

default['mynode']['icinga2']['plugins']['packages'] = %w( nagios-plugins-mysql nagios-plugins-dns nagios-plugins-nrpe nagios-plugins-oracle nagios-plugins-http nagios-plugins-tcp nagios-plugins-smtp)
...
node['mynode']['icinga2']['plugins']['packages'].each do |plugin|
  package plugin
end

And since 'os_packages' where moved to 'icingaweb2' cookbook for me there is no option to enable web UI at 16.04.

Neither 3.0.1 no 4.0.0 is not working fro 16.04. Could someone give me a hint how to fix it?

vkhatri commented 6 years ago

Not sure about the plugins packages reference, plugins are not installed by the icinga2 cookbooks.

What do you mean by Neither 3.0.1 nor 4.0.0 is working for 16.04? Could you share the chef-client run error output and the expected behavior? So that I can take a look at it.

uyo1787 commented 6 years ago

the main issue for v3.0.1 is is present above:

Package libgd2-xpm-dev is a virtual package provided by:
      libgd-dev 2.1.1-4ubuntu0.16.04.8 [Not candidate version]
      libgd-dev 2.1.1-4build2 [Not candidate version]

and as mentioned by @vills it should be replaced by 'libgd-dev'.

for v4.0.0 the same issue comes after:

include_recipe 'icingaweb2::default'

For me now only v4.0.0 is working but without 'icingaweb2'

vkhatri commented 6 years ago

Thank you, will look into it.