aboutsummaryrefslogtreecommitdiff
path: root/manifests/dpa.pp
blob: d159b367eaf87f9ce3800aae14d2d4122ab80400 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class php::dpa inherits php::repository {
  # Old location
  file { '/etc/apt/trusted.gpg.d/deb.sury.org-php.gpg':
    ensure  => absent,
    owner   => "root",
    group   => "root",
    mode    => "0644",
    source  => 'puppet:///modules/php/deb.sury.org.gpg',
  }

  file { '/etc/apt/keyrings/deb.sury.org-php.gpg':
    ensure  => present,
    owner   => "root",
    group   => "root",
    mode    => "0644",
    source  => 'puppet:///modules/php/deb.sury.org.gpg',
  }

  File['/etc/apt/sources.list.d/php.list'] {
    content => "deb [signed-by=/etc/apt/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ ${::lsbdistcodename} main\n",
    require => File['/etc/apt/keyrings/deb.sury.org-php.gpg'],
  }

  # Pinning
  # Adapted from https://dmvrtx.me/2023/06/php-7.4-on-debian-bookworm/
  file { '/etc/apt/preferences.d/php':
    ensure  => present,
    owner   => "root",
    group   => "root",
    mode    => "0644",
    source  => 'puppet:///modules/php/preferences',
  }
}