Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Debian 10 support #674

Merged
merged 3 commits into from
Apr 22, 2020
Merged

Add Debian 10 support #674

merged 3 commits into from
Apr 22, 2020

Conversation

bastelfreak
Copy link
Member

Pull Request (PR) description

This Pull Request (PR) fixes the following issues

@bastelfreak bastelfreak added the enhancement New feature or request label Apr 13, 2020
@bastelfreak bastelfreak self-assigned this Apr 13, 2020
@bastelfreak
Copy link
Member Author

since the acceptance tests otherwise take ages, I tested the fix from @ekohl here.

.travis.yml Show resolved Hide resolved
@ekohl
Copy link
Member

ekohl commented Apr 14, 2020

#676 may help to make it easier to manage.

@bastelfreak bastelfreak force-pushed the debian10 branch 3 times, most recently from 0765382 to df40e8f Compare April 14, 2020 16:20
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general it's fine to treat the major versions as strings and not convert them to integers.

spec/acceptance/agent_spec.rb Outdated Show resolved Hide resolved
spec/acceptance/agent_spec.rb Outdated Show resolved Hide resolved
spec/acceptance/agent_spec.rb Show resolved Hide resolved
Comment on lines 127 to 128


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Gemfile Outdated
@@ -68,4 +71,6 @@ end
ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 6.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
gem 'puppet', puppetversion, :require => false, :groups => [:test]

gem 'irb'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug

Gemfile Outdated
@@ -68,4 +71,6 @@ end
ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 6.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
gem 'puppet', puppetversion, :require => false, :groups => [:test]

gem 'irb'
gem 'beaker-vagrant'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be in voxpupuli-acceptance

Gemfile Outdated
@@ -19,6 +19,9 @@ group :test do
gem 'zabbixapi', :require => false
end

gem 'rspec-puppet-facts', :git => 'https://github.com/ekohl/rspec-puppet-facts', :branch => 'find-facter-version'
gem 'facterdb', :git => 'https://github.com/camptocamp/facterdb', :branch => 'master'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer not to rely on git branches unless really needed. Perhaps link to the commit/pr that we need to be released?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.3.0 was released so this can be removed.

@@ -11,10 +13,11 @@ def agent_supported(version)
describe "zabbix::agent class with zabbix_version #{version}", if: agent_supported(version) do
it 'works idempotently with no errors' do
pp = <<-EOS
include apt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is including apt needed? It shouldn't be. There's this:

if ($manage_apt) {
# We would like to provide the repos with https urls instead of http
# this requires the apt-transport-https package, but we don't want to manage
# that package here. That should be handled in a profile :(
# somebody should implement https here but make it optional
include apt
}

However, there's also https://github.com/puppetlabs/puppetlabs-apt/blob/04b6a898f8e6f733e1b4f62d3c1a1c631b10253c/manifests/source.pp#L71

I don't see why the repo class shouldn't unconditionally include it. It's not a literal class statement so it shouldn't be an issue. However, it defaults to true anyway so this should be redundant.

Suggested change
include apt

(repeated comment)

@@ -1,7 +1,7 @@
require 'spec_helper_acceptance'
require 'serverspec_type_zabbixapi'

describe 'zabbix_application type' do
describe 'zabbix_application type', unless: default[:platform] =~ %r{debian-10-amd64} do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than skipping, should we just not set the zabbix_version and use the default in this test suite (repeated in multiple files)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sadly that won't work. the custom types use the zabbixapi rubygem and that currently only supports older zabbix versions

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#623 suggests this can work if we update it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to get this merged and work on #623 afterwards

@bastelfreak bastelfreak force-pushed the debian10 branch 4 times, most recently from 2c416ca to 2a506eb Compare April 16, 2020 19:12
@@ -38,7 +38,15 @@ class { 'zabbix':
# setup zabbix. Apache module isn't idempotent and requires a second run
it 'works with no error on the first apply' do
# Cleanup old database
shell('/opt/puppetlabs/bin/puppet resource service zabbix-server ensure=stopped; /opt/puppetlabs/bin/puppet resource package zabbix-server-pgsql ensure=purged; rm -f /etc/zabbix/.*done; su - postgres -c "psql -c \'drop database if exists zabbix_server;\'"')
cleanup_script = <<-SHELL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we extract this somewhere to avoid the repetition?

@bastelfreak bastelfreak force-pushed the debian10 branch 2 times, most recently from eece623 to d122a27 Compare April 19, 2020 21:53
@bastelfreak
Copy link
Member Author

bastelfreak commented Apr 21, 2020

@baurmatt any idea how we can get the tests working on CentOS 7 / any idea why they don't fail on master?
During the tests, agent_spec.rb installs zabbix 4.4, which works. afterwards server_spec.rb gets loaded which installs 3.4: https://travis-ci.org/github/voxpupuli/puppet-zabbix/jobs/677866025#L8857

Somehow the cache is messed up and yum wants to install the 4.4 version of the zabbix server:
https://travis-ci.org/github/voxpupuli/puppet-zabbix/jobs/677866025#L8887

  • I'm not sure why this is happening now
  • It even happens with the shell('yum clean all') if fact('os.family') == 'RedHat' snippet that's also executed:
centos7-64-1 20:23:33$ yum clean all
  Loaded plugins: fastestmirror, ovl
  Cleaning repos: Zabbix_7_x86_64 Zabbix_nonsupported_7_x86_64 base extras puppet5
                : updates
  Cleaning up list of fastest mirrors
centos7-64-1 executed in 0.21 seconds
  • Why does master pass??

@bastelfreak
Copy link
Member Author

after adding way more yum cleanup statements, it turned green \o/

@bastelfreak bastelfreak merged commit 8f411bf into voxpupuli:master Apr 22, 2020
@bastelfreak bastelfreak deleted the debian10 branch April 22, 2020 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants