Skip to content

Keyring problem with Debian 13 #758

@herisson80

Description

@herisson80

Hi,
I tried to use php module on a Debian 13 and wa not able to use it because of the apt-key deprecated method.

I've rewrite debian.pp in order to use the new method.
I think dotdeb condition should be deleted because I hope that nobody keep Debian 8 in production :)

Thanks
Bye

# Configure debian apt repo
#
# === Parameters
#
# [*location*]
#   Location of the apt repository
#
# [*repos*]
#   Apt repository names
#
# [*include_src*]
#   Add source source repository  
#
# [*dotdeb*]
#   Enable special dotdeb handling
#
# [*sury*]
#   Enable special sury handling
#
# [*surygpgurl*]
#   Sury GPG key URL
#
class php::repo::debian (
  String[1] $location     = 'https://packages.dotdeb.org',
  String[1] $repos        = 'all',
  String[1] $surygpgurl   = 'https://packages.sury.org/php/apt.gpg',
  Boolean $include_src    = false,

  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 versioncmp($facts['os']['release']['major'], '9') < 1) {
    apt::source { 'source_php_dotdeb':
      location => $location,
      repos    => $repos,
      include  => {
        'src' => $include_src,
        'deb' => true,
      },
      key      => {
        id     => '6572BBEF1B5FF28B28B706837E3F070089DF5277',
        source => 'http://www.dotdeb.org/dotdeb.gpg',
      },
    }
  }

  if ($sury and ((versioncmp($facts['os']['release']['major'], '9') >= 0) and (versioncmp($facts['os']['release']['major'], '13') < 0))) {
    apt::source { 'source_php_sury':
      location => 'https://packages.sury.org/php/',
      repos    => 'main',
      include  => {
        'src' => $include_src,
        'deb' => true,
      },
      key      => {
        id     => '15058500A0235D97F5D10063B188E2B695BD4743',
        source => $surygpgurl,
      },
    }
  } elsif ($sury and versioncmp($facts['os']['release']['major'], '13') >= 0) {
    apt::source { 'source_php_sury':
      comment  => 'Sury APT repository',
      location => 'https://packages.sury.org/php/',
      release  => [$facts['os']['distro']['codename']],
      repos    => ['main'],
      key      => {
        name   => 'sury-keyring.gpg',
        source => $surygpgurl,
      },
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions