|
8 | 8 | include 'apt' |
9 | 9 |
|
10 | 10 | if $manage_repos { |
| 11 | + if ($mirror) { |
| 12 | + $key_name = 'mygento_php' |
| 13 | + $location = 'http://apt.cloud.mygento.com/php/' |
| 14 | + $repos = 'php' |
| 15 | + $key_id = '9098D342C5B0C20384FF65D0A2033273125F55CF' |
| 16 | + $key_url = 'http://apt.cloud.mygento.com/public.asc' |
| 17 | + } else { |
| 18 | + $key = 'sury_php' |
| 19 | + $location = 'https://packages.sury.org/php/' |
| 20 | + $repos = 'main' |
| 21 | + $key_id = '15058500A0235D97F5D10063B188E2B695BD4743' |
| 22 | + $key_url = 'https://packages.sury.org/php/apt.gpg' |
| 23 | + } |
| 24 | + $release = $php::params::release |
11 | 25 | case $version { |
12 | | - '7.4', '8.0', '8.1', '8.2', '8.3', '8.4': { |
| 26 | + '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5': { |
13 | 27 | case $facts['os']['distro']['codename'] { |
| 28 | + 'trixie': { |
| 29 | + file { "/etc/apt/sources.list.d/source_php_${release}.list": |
| 30 | + ensure => absent, |
| 31 | + } |
| 32 | + apt::keyring { "${key_name}.asc": |
| 33 | + source => $key_url, |
| 34 | + } -> apt::source { 'php': |
| 35 | + enabled => true, |
| 36 | + source_format => 'sources', |
| 37 | + location => [$location], |
| 38 | + repos => [$repos], |
| 39 | + architecture => [$facts['os']['architecture']], |
| 40 | + keyring => "/etc/apt/keyrings/${key_name}.asc", |
| 41 | + } |
| 42 | + } |
14 | 43 | 'bullseye', 'bookworm': { |
15 | | - $release = $php::params::release |
16 | | - if ($mirror) { |
17 | | - $location = 'http://apt.cloud.mygento.com/php/' |
18 | | - $repos = 'php' |
19 | | - $key = { |
20 | | - 'id' => '9098D342C5B0C20384FF65D0A2033273125F55CF', |
21 | | - 'source' => 'http://apt.cloud.mygento.com/public.asc', |
22 | | - } |
23 | | - } else { |
24 | | - $location = 'https://packages.sury.org/php/' |
25 | | - $repos = 'main' |
26 | | - $key = { |
27 | | - 'id' => '15058500A0235D97F5D10063B188E2B695BD4743', |
28 | | - 'source' => 'https://packages.sury.org/php/apt.gpg', |
29 | | - } |
30 | | - stdlib::ensure_packages(['apt-transport-https'], { 'ensure' => 'present' }) |
| 44 | + create_resources(::apt::key, { 'php::repo' => { |
| 45 | + id => $key_id, source => $key_url, ensure => 'refreshed', |
| 46 | + } }) |
| 47 | + |
| 48 | + ::apt::source { "source_php_${release}": |
| 49 | + location => $location, |
| 50 | + release => $release, |
| 51 | + repos => $repos, |
| 52 | + include => { |
| 53 | + 'src' => false, |
| 54 | + }, |
| 55 | + require => Apt::Key['php::repo'], |
31 | 56 | } |
32 | 57 | } |
33 | 58 | default: { |
|
39 | 64 | fail("Unsupported PHP release: ${version}") |
40 | 65 | } |
41 | 66 | } |
42 | | - |
43 | | - create_resources(::apt::key, { 'php::repo' => { |
44 | | - id => $key['id'], source => $key['source'], ensure => 'refreshed', |
45 | | - } }) |
46 | | - |
47 | | - ::apt::source { "source_php_${release}": |
48 | | - location => $location, |
49 | | - release => $release, |
50 | | - repos => $repos, |
51 | | - include => { |
52 | | - 'src' => false, |
53 | | - }, |
54 | | - require => Apt::Key['php::repo'], |
55 | | - } |
56 | 67 | } |
57 | 68 |
|
58 | 69 | if $newrelic { |
59 | | - apt::source { 'newrelic': |
60 | | - location => 'http://apt.newrelic.com/debian/', |
61 | | - repos => 'non-free', |
62 | | - key => { |
63 | | - id => 'B60A3EC9BC013B9C23790EC8B31B29E5548C16BF', |
64 | | - key => 'https://download.newrelic.com/548C16BF.gpg', |
65 | | - }, |
66 | | - include => { |
67 | | - src => false, |
68 | | - }, |
69 | | - release => 'newrelic', |
| 70 | + case $facts['os']['distro']['codename'] { |
| 71 | + 'bullseye', 'bookworm': { |
| 72 | + apt::source { 'newrelic': |
| 73 | + location => 'http://apt.newrelic.com/debian/', |
| 74 | + repos => 'non-free', |
| 75 | + key => { |
| 76 | + id => 'B60A3EC9BC013B9C23790EC8B31B29E5548C16BF', |
| 77 | + key => 'https://download.newrelic.com/548C16BF.gpg', |
| 78 | + }, |
| 79 | + include => { |
| 80 | + src => false, |
| 81 | + }, |
| 82 | + release => 'newrelic', |
| 83 | + } |
| 84 | + } |
| 85 | + default: { |
| 86 | + apt::keyring { 'newrelic.asc': |
| 87 | + source => 'https://download.newrelic.com/548C16BF.gpg', |
| 88 | + } -> apt::source { 'newrelic': |
| 89 | + enabled => true, |
| 90 | + source_format => 'sources', |
| 91 | + release => 'newrelic', |
| 92 | + location => ['http://apt.newrelic.com/debian/'], |
| 93 | + repos => ['non-free'], |
| 94 | + architecture => [$facts['os']['architecture']], |
| 95 | + keyring => '/etc/apt/keyrings/newrelic.asc', |
| 96 | + } |
| 97 | + } |
70 | 98 | } |
71 | 99 | } |
72 | 100 | } |
0 commit comments