Showing with 69 additions and 28 deletions.
  1. +13 −0 CHANGELOG.md
  2. +1 −13 REFERENCE.md
  3. +14 −14 manifests/repo/debian.pp
  4. +1 −1 metadata.json
  5. +40 −0 spec/classes/php_repo_debian_spec.rb
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file.
Each new release typically also includes the latest modulesync defaults.
These should not affect the functionality of the module.

## [v8.1.1](https://github.com/voxpupuli/puppet-php/tree/v8.1.1) (2022-08-03)

[Full Changelog](https://github.com/voxpupuli/puppet-php/compare/v8.1.0...v8.1.1)

**Fixed bugs:**

- Why does dotdeb APT wheezy 5.6 repo get installed on Debian 9? [\#458](https://github.com/voxpupuli/puppet-php/issues/458)
- \(\#458\) Remove dotdeb and sury repos overuse on Debian [\#659](https://github.com/voxpupuli/puppet-php/pull/659) ([OlegPS](https://github.com/OlegPS))

**Closed issues:**

- Howto solve package name conflict between apt and pecl [\#579](https://github.com/voxpupuli/puppet-php/issues/579)

## [v8.1.0](https://github.com/voxpupuli/puppet-php/tree/v8.1.0) (2022-07-03)

[Full Changelog](https://github.com/voxpupuli/puppet-php/compare/v8.0.3...v8.1.0)
Expand Down
14 changes: 1 addition & 13 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* [`php::phpunit`](#phpphpunit): Install phpunit, PHP testing framework === Parameters [*source*] Holds URL to the phpunit source file [*path*] Holds path to the phpun
* [`php::phpunit::auto_update`](#phpphpunitauto_update): Install phpunit package manager === Parameters [*max_age*] Defines number of days after which phpunit should be updated [*source*] Hol
* [`php::repo`](#phprepo): Configure package repository
* [`php::repo::debian`](#phprepodebian): Configure debian apt repo === Parameters [*location*] Location of the apt repository [*release*] Release of the apt repository [*repo
* [`php::repo::debian`](#phprepodebian): Configure debian apt repo === Parameters [*location*] Location of the apt repository [*repos*] Apt repository names [*include_src*]
* [`php::repo::redhat`](#phpreporedhat)
* [`php::repo::suse`](#phpreposuse): Configure suse repo === Parameters [*reponame*] Name of the Zypper repository [*baseurl*] Base URL of the Zypper repository
* [`php::repo::ubuntu`](#phprepoubuntu): Configure ubuntu ppa === Parameters [*version*] PHP version to manage (e.g. 5.6)
Expand Down Expand Up @@ -1738,9 +1738,6 @@ Configure debian apt repo
[*location*]
Location of the apt repository

[*release*]
Release of the apt repository

[*repos*]
Apt repository names

Expand All @@ -1761,7 +1758,6 @@ Configure debian apt repo
The following parameters are available in the `php::repo::debian` class:

* [`location`](#location)
* [`release`](#release)
* [`repos`](#repos)
* [`include_src`](#include_src)
* [`key`](#key)
Expand All @@ -1776,14 +1772,6 @@ Data type: `String[1]`

Default value: `'https://packages.dotdeb.org'`

##### <a name="release"></a>`release`

Data type: `String[1]`



Default value: `'wheezy-php56'`

##### <a name="repos"></a>`repos`

Data type: `String[1]`
Expand Down
28 changes: 14 additions & 14 deletions manifests/repo/debian.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
# [*location*]
# Location of the apt repository
#
# [*release*]
# Release of the apt repository
#
# [*repos*]
# Apt repository names
#
Expand All @@ -25,7 +22,6 @@
#
class php::repo::debian (
String[1] $location = 'https://packages.dotdeb.org',
String[1] $release = 'wheezy-php56',
String[1] $repos = 'all',
Boolean $include_src = false,
Hash $key = {
Expand All @@ -37,20 +33,24 @@
) {
assert_private()

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

apt::source { "source_php_${release}":
location => $location,
release => $release,
repos => $repos,
include => {
'src' => $include_src,
'deb' => true,
},
key => $key,
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 $php::globals::php_version in ['7.1','7.2']) {
if ($sury and $facts['os']['release']['major'] in ['9', '10', '11']) {
apt::source { 'source_php_sury':
location => 'https://packages.sury.org/php/',
repos => 'main',
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppet-php",
"version": "8.1.0",
"version": "8.1.1",
"author": "Vox Pupuli",
"summary": "Generic PHP module that supports many platforms",
"license": "MIT",
Expand Down
40 changes: 40 additions & 0 deletions spec/classes/php_repo_debian_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'php::repo::debian', type: :class do
on_supported_os.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end

before do
Puppet::Parser::Functions.newfunction(:my_assert_private, type: :rvalue) do |args|
# Fake assert_private function from stdlib to not fail within this test
end
end

describe 'works without params' do
let(:pre_condition) do
'function assert_private() { return my_assert_private() }'
end

if facts[:os]['name'] == 'Debian'
it { is_expected.to compile.with_all_deps }

case facts[:os]['release']['major']
when '6', '7', '8'
it { is_expected.to contain_apt__source('source_php_dotdeb') }
it { is_expected.not_to contain_apt__source('source_php_sury') }
when '9', '10', '11'
it { is_expected.not_to contain_apt__source('source_php_dotdeb') }
it { is_expected.to contain_apt__source('source_php_sury') }
end
else
it { is_expected.to compile.and_raise_error(%r{class php::repo::debian does not work on OS}) }
end
end
end
end
end