diff --git a/manifests/globals.pp b/manifests/globals.pp index 7affa455..b254ae88 100644 --- a/manifests/globals.pp +++ b/manifests/globals.pp @@ -35,6 +35,7 @@ 'Debian' => $facts['os']['release']['major'] ? { '10' => '7.3', '11' => '7.4', + '12' => '8.2', default => fail("Unsupported Debian release: ${fact('os.release.major')}"), }, 'Ubuntu' => $facts['os']['release']['major'] ? { diff --git a/manifests/repo/debian.pp b/manifests/repo/debian.pp index 2ba8b1ae..53e4ef4b 100644 --- a/manifests/repo/debian.pp +++ b/manifests/repo/debian.pp @@ -38,7 +38,7 @@ } include 'apt' - if ($dotdeb and $facts['os']['release']['major'] in ['6', '7', '8']) { + if ($dotdeb and versioncmp($facts['os']['release']['major'], '9') < 1) { apt::source { 'source_php_dotdeb': location => $location, repos => $repos, @@ -50,7 +50,7 @@ } } - if ($sury and $facts['os']['release']['major'] in ['9', '10', '11']) { + if ($sury and versioncmp($facts['os']['release']['major'], '9') >= 0) { apt::source { 'source_php_sury': location => 'https://packages.sury.org/php/', repos => 'main', diff --git a/metadata.json b/metadata.json index 4a2d3018..dc76cad4 100644 --- a/metadata.json +++ b/metadata.json @@ -49,7 +49,8 @@ "operatingsystem": "Debian", "operatingsystemrelease": [ "10", - "11" + "11", + "12" ] }, { diff --git a/spec/classes/php_repo_debian_spec.rb b/spec/classes/php_repo_debian_spec.rb index e778ff16..b74e86cb 100644 --- a/spec/classes/php_repo_debian_spec.rb +++ b/spec/classes/php_repo_debian_spec.rb @@ -23,11 +23,10 @@ if facts[:os]['name'] == 'Debian' it { is_expected.to compile.with_all_deps } - case facts[:os]['release']['major'] - when '6', '7', '8' + if facts[:os]['release']['major'].to_i < 9 it { is_expected.to contain_apt__source('source_php_dotdeb') } it { is_expected.not_to contain_apt__source('source_php_sury') } - when '9', '10', '11' + elsif facts[:os]['release']['major'].to_i >= 9 it { is_expected.not_to contain_apt__source('source_php_dotdeb') } it { is_expected.to contain_apt__source('source_php_sury') } end