Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PHP 7.1 support on Debian #293

Merged
merged 4 commits into from
Feb 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifests/globals.pp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
}
} else {
case $globals_php_version {
/^7/: {
/^7\.[0-9]/: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what problem is solved by changing the regex?

Copy link
Author

@fstr fstr Jan 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being able to use:
$package_prefix = "php${globals_php_version}-"

Because the package prefix is php7.0- and not php7-
Before that change, the prefix was hardcoded to php7.0-.

$default_config_root = "/etc/php/${globals_php_version}"
$default_fpm_pid_file = "/var/run/php/php${globals_php_version}-fpm.pid"
$fpm_error_log = "/var/log/php${globals_php_version}-fpm.log"
Expand Down
22 changes: 22 additions & 0 deletions manifests/repo/debian.pp
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,26 @@
}
}
}

if ($php::globals::php_version == '7.1') {
# Required packages for PHP 7.1 repository
ensure_packages(['lsb-release', 'ca-certificates'], {'ensure' => 'present'})

# Add PHP 7.1 key + repository
apt::key { 'php::repo::debian-php71':
key => 'DF3D585DB8F0EB658690A554AC0E47584A7A714D',
key_source => 'https://packages.sury.org/php/apt.gpg',
}

::apt::source { 'source_php_71':
location => 'https://packages.sury.org/php/',
release => $::lsbdistcodename,
repos => 'main',
include_src => false,
require => [
Apt::Key['php::repo::debian-php71'],
Package['apt-transport-https', 'lsb-release', 'ca-certificates']
],
}
}
}
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"dependencies": [
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 4.13.1 < 5.0.0"
"version_requirement": ">= 4.16.0 < 5.0.0"
},
{
"name": "puppetlabs/apt",
"version_requirement": ">= 4.1.0 < 5.0.0"
"version_requirement": ">= 4.4.0 < 5.0.0"
},
{
"name": "puppetlabs/inifile",
Expand Down
4 changes: 4 additions & 0 deletions spec/classes/php_repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
facts
end

let :pre_condition do
'include php'
end

describe 'when configuring a package repo' do
case facts[:osfamily]
when 'Debian'
Expand Down