From f3d1758e217ba87e4d959ca62453ac62ac96b985 Mon Sep 17 00:00:00 2001 From: Christoph Maser Date: Sun, 26 May 2024 21:26:13 +0200 Subject: [PATCH] drop support for Debian 10 there is already breaking changes on master, so next releease will be major test have been broken for a while and will be fixed in https://github.com/voxpupuli/puppet-nginx/pull/1596 --- REFERENCE.md | 2 +- metadata.json | 1 - spec/acceptance/class_spec.rb | 2 +- spec/acceptance/nginx_server_spec.rb | 20 ++++++++++++++++---- spec/classes/nginx_spec.rb | 2 +- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 0a87f517c..2d74ccc2d 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -3080,7 +3080,7 @@ Create a new mapping entry for NGINX nginx::resource::map { 'backend_pool': ensure => present, hostnames => true, - default => 'ny-pool-1, + default => 'ny-pool-1', string => '$http_host', mappings => { '*.nyc.example.com' => 'ny-pool-1', diff --git a/metadata.json b/metadata.json index af73891b7..2d5a4803f 100644 --- a/metadata.json +++ b/metadata.json @@ -27,7 +27,6 @@ { "operatingsystem": "Debian", "operatingsystemrelease": [ - "10", "11" ] }, diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb index 1cb3e09b1..eaf361574 100644 --- a/spec/acceptance/class_spec.rb +++ b/spec/acceptance/class_spec.rb @@ -19,7 +19,7 @@ pkg_cmd = 'dpkg -s nginx | grep ^Maintainer' pkg_remove_cmd = 'apt-get -y purge nginx nginx-common' pkg_match = case fact('operatingsystemmajrelease') - when '10', '11' + when '11' %r{Debian Nginx Maintainers} when '18.04', '20.04', '22.04' %r{Ubuntu Developers} diff --git a/spec/acceptance/nginx_server_spec.rb b/spec/acceptance/nginx_server_spec.rb index 6bbc85c87..1017e227e 100644 --- a/spec/acceptance/nginx_server_spec.rb +++ b/spec/acceptance/nginx_server_spec.rb @@ -11,7 +11,10 @@ class { 'nginx': } ensure => present, www_root => '/var/www/www.puppetlabs.com', } - host { 'www.puppetlabs.com': ip => '127.0.0.1', } + file_line {'mock hosts': + path => '/etc/hosts', + line => '127.0.0.1 www.puppetlabs.com' + } file { ['/var/www','/var/www/www.puppetlabs.com']: ensure => directory } file { '/var/www/www.puppetlabs.com/index.html': ensure => file, content => 'Hello from www\n', } " @@ -65,7 +68,10 @@ class { 'nginx': } ssl_key => '/etc/pki/tls/private/blah.key', www_root => '/var/www/www.puppetlabs.com', } - host { 'www.puppetlabs.com': ip => '127.0.0.1', } + file_line {'mock hosts': + path => '/etc/hosts', + line => '127.0.0.1 www.puppetlabs.com' + } file { ['/var/www','/var/www/www.puppetlabs.com']: ensure => directory } file { '/var/www/www.puppetlabs.com/index.html': ensure => file, content => 'Hello from www\n', } " @@ -131,7 +137,10 @@ class { 'nginx': } ssl_password_file => '/etc/pki/tls/private/crypted.pass', www_root => '/var/www/www.puppetlabs.com', } - host { 'www.puppetlabs.com': ip => '127.0.0.1', } + file_line {'mock hosts': + path => '/etc/hosts', + line => '127.0.0.1 www.puppetlabs.com' + } file { ['/var/www','/var/www/www.puppetlabs.com']: ensure => directory } file { '/var/www/www.puppetlabs.com/index.html': ensure => file, content => 'Hello from www\n', } " @@ -187,7 +196,10 @@ class { 'nginx': } ssl => false, server => ['www.puppetlabs.com'], } - host { 'www.puppetlabs.com': ip => '127.0.0.1', } + file_line {'mock hosts': + path => '/etc/hosts', + line => '127.0.0.1 www.puppetlabs.com' + } file { ['/var/www','/var/www/www.puppetlabs.com','/var/www/letsencrypt','/var/www/letsencrypt/.well-known','/var/www/letsencrypt/.well-known/acme-challenge']: ensure => directory } file { '/var/www/www.puppetlabs.com/index.html': ensure => file, content => 'Hello from www\n', } file { '/var/www/letsencrypt/.well-known/acme-challenge/fb9bd98604be3d0c7d589fcc7561cb41': ensure => file, content => 'LetsEncrypt\n', } diff --git a/spec/classes/nginx_spec.rb b/spec/classes/nginx_spec.rb index 716290775..b0ba21406 100644 --- a/spec/classes/nginx_spec.rb +++ b/spec/classes/nginx_spec.rb @@ -190,7 +190,7 @@ it { is_expected.to contain_package('nginx') } - if (facts.dig(:os, 'name') == 'Debian' && %w[10 11].include?(facts.dig(:os, 'release', 'major'))) || + if (facts.dig(:os, 'name') == 'Debian' && %w[11].include?(facts.dig(:os, 'release', 'major'))) || (facts.dig(:os, 'name') == 'Ubuntu' && %w[bionic focal jammy].include?(facts.dig(:os, 'distro', 'codename'))) it { is_expected.to contain_package('libnginx-mod-http-passenger') } else