# Puppet Class: php::repo::debian

Defined in:
  manifests/repo/debian.pp

## Overview

Configure debian apt repo

=== Parameters

[location] Location of the apt repository

[release] Release 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

Parameters:

- location (`Any`) (defaults to: `'http://packages.dotdeb.org'`)
- release (`Any`) (defaults to: `'wheezy-php56'`)
- repos (`Any`) (defaults to: `'all'`)
- include_src (`Any`) (defaults to: `false`)
- key (`Any`) (defaults to: `{ 'id' => '6572BBEF1B5FF28B28B706837E3F070089DF5277', 'source' => 'http://www.dotdeb.org/dotdeb.gpg', }`)
- dotdeb (`Any`) (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
    68
    69
    70
    71
    72
    # File 'manifests/repo/debian.pp', line 23

    class php::repo::debian(
      $location     = 'http://packages.dotdeb.org',
      $release      = 'wheezy-php56',
      $repos        = 'all',
      $include_src  = false,
      $key          = {
        'id'     => '6572BBEF1B5FF28B28B706837E3F070089DF5277',
        'source' => 'http://www.dotdeb.org/dotdeb.gpg',
      },
      $dotdeb       = true,
    ) {

      if $caller_module_name != $module_name {
        warning('php::repo::debian is private')
      }

      include '::apt'

      create_resources(::apt::key, { 'php::repo::debian' => {
        id     => $key['id'],
        source => $key['source'],
      }})

      ::apt::source { "source_php_${release}":
        location => $location,
        release  => $release,
        repos    => $repos,
        include  => {
          'src' => $include_src,
          'deb' => true,
        },
        require  => Apt::Key['php::repo::debian'],
      }

      if ($dotdeb) {
        # both repositories are required to work correctly
        # See: http://www.dotdeb.org/instructions/
        if $release == 'wheezy-php56' {
          ::apt::source { 'dotdeb-wheezy':
            location => $location,
            release  => 'wheezy',
            repos    => $repos,
            include  => {
              'src' => $include_src,
              'deb' => true,
            },
          }
        }
      }
    }