Puppet Class: php::repo::debian

Defined in:
manifests/repo/debian.pp

Overview

Configure debian apt repo

Parameters

location

Location of the apt repository

repos

Apt repository names

include_src

Add source source repository

key

Public key in apt::key format

dotdeb

Enable special dotdeb handling

sury

Enable special sury handling

Parameters:

  • location (String[1]) (defaults to: 'https://packages.dotdeb.org')
  • repos (String[1]) (defaults to: 'all')
  • include_src (Boolean) (defaults to: false)
  • key (Hash) (defaults to: { 'id' => '6572BBEF1B5FF28B28B706837E3F070089DF5277', 'source' => 'http://www.dotdeb.org/dotdeb.gpg', })
  • dotdeb (Boolean) (defaults to: true)
  • sury (Boolean) (defaults to: true)


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'manifests/repo/debian.pp', line 23

class php::repo::debian (
  String[1] $location     = 'https://packages.dotdeb.org',
  String[1] $repos        = 'all',
  Boolean $include_src    = false,
  Hash $key               = {
    'id'     => '6572BBEF1B5FF28B28B706837E3F070089DF5277',
    'source' => 'http://www.dotdeb.org/dotdeb.gpg',
  },
  Boolean $dotdeb         = true,
  Boolean $sury           = true,
) {
  assert_private()

  if $facts['os']['name'] != 'Debian' {
    fail("class php::repo::debian does not work on OS ${facts['os']['name']}")
  }
  include 'apt'

  if ($dotdeb and $facts['os']['release']['major'] in ['6', '7', '8']) {
    apt::source { 'source_php_dotdeb':
      location => $location,
      repos    => $repos,
      include  => {
        'src' => $include_src,
        'deb' => true,
      },
      key      => $key,
    }
  }

  if ($sury and $facts['os']['release']['major'] in ['9', '10', '11']) {
    apt::source { 'source_php_sury':
      location => 'https://packages.sury.org/php/',
      repos    => 'main',
      include  => {
        'src' => $include_src,
        'deb' => true,
      },
      key      => {
        id     => '15058500A0235D97F5D10063B188E2B695BD4743',
        source => 'https://packages.sury.org/php/apt.gpg',
      },
    }
  }
}