-
-
Notifications
You must be signed in to change notification settings - Fork 270
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
Conversation
manifests/repo/debian.pp
Outdated
|
||
if ($php::globals::php_version == '7.1') { | ||
# Required packages for PHP 7.1 repository | ||
package { 'apt-transport-https': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do see that this package is required, but this could break others configuration if they defined the package in a profile.
the same for the other packages declared here.
I really would not do business of adding repos. and such packags. If doing the roles/profiles pattern it should be solved in the profile level. For me this module should not try to add repos. but thats my personal opinion. so many things fail if you would run such things in a restricted environment (no internet access, and the policy to use internal repos).
Right now I can't say what to do with these packages. :-/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see conflict potential as well in the packages. So I'm also not sure.
If adding repos is not part of this module, then what's the purpose of this file debian.pp
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not the original author of the module. I think it solves problems he or the users have. ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many modules solve this by having a "manage_repo" parameter in the init class.
You should probably also use ensure_packages to avoid conflicts with existing profiles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never mind, I noticed that this is indeed gated by such a boolean. Should be fine then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use stdlib::ensure_packages for this.
manifests/repo/debian.pp
Outdated
} | ||
|
||
# Add PHP 7.1 key + repository | ||
create_resources(::apt::key, { 'php::repo::debian-php71' => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why using create_resources()
here? why not just plain puppet code?
apt::key { 'php::repo::debian-php71':
key => 'DF3D585DB8F0EB658690A554AC0E47584A7A714D',
key_source => 'https://packages.sury.org/php/apt.gpg',
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. Just copied from above. Can be plain puppet code.
spec/spec_helper.rb
Outdated
@@ -24,8 +24,8 @@ | |||
puppetversion: Puppet.version, | |||
facterversion: Facter.version | |||
} | |||
default_facts.merge!(YAML.load(File.read(File.expand_path('../default_facts.yml', __FILE__)))) if File.exist?(File.expand_path('../default_facts.yml', __FILE__)) | |||
default_facts.merge!(YAML.load(File.read(File.expand_path('../default_module_facts.yml', __FILE__)))) if File.exist?(File.expand_path('../default_module_facts.yml', __FILE__)) | |||
default_facts.merge!(YAML.safe_load(File.read(File.expand_path('../default_facts.yml', __FILE__)))) if File.exist?(File.expand_path('../default_facts.yml', __FILE__)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the safe_load rubocop was decided to be blacklisted. the load should be used.
@@ -76,14 +76,14 @@ | |||
} | |||
} else { | |||
case $globals_php_version { | |||
/^7/: { | |||
/^7\.[0-9]/: { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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-
.
For all those who were waiting for a dotdeb release. |
.rubocop.yml
Outdated
@@ -302,7 +302,7 @@ Style/EmptyLiteral: | |||
Metrics/LineLength: | |||
Enabled: False | |||
|
|||
Style/MethodCallParentheses: | |||
Style/MethodCallWithoutArgsParentheses: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will modulesync overwrite this? @bastelfreak
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jyaworski no, its already in modulesync_config - https://github.com/voxpupuli/modulesync_config/blob/master/moduleroot/.rubocop.yml#L310
Hi @fstr is this still on your plate? Do you need anything from our end? |
This needs a reroll. The fix for package_prefix was already committed in #329 |
use ensure_packages dont wrap apt::key in a useless create_resources
This version automatically installs the apt-transport-https package, which is needed for https mirrors. By using this module in at least this version, we don't need to manage the package on our own.
this is the lowest supported version for ensure_packages
d8ca3fe
to
d063e8d
Compare
I rebased the branch and implemented the changes @Vincent-- mentioned. |
this is a private class, it won't get called directly, only from within the main class. It references variables from the main class, so we need to include it (or move the tests into the testfile for the main class)
d063e8d
to
3c82ae4
Compare
Sorry I don't think this PR is the proper solution. At the end we want dotdeb for wheezy (php 5.6) and sury for jessie and stretch (5.6, 7.0, 7.1 and 7.2 as of now). I'll try to propose a PR in the coming days. |
@jonhattan you are right, we want dotdeb for wheezy and sury for jessie and strech. ping me if you start working on a PR this PR actually break things. it
|
Hi, First of all thanks for great work ;) We used that module for a while, but now we have tried to install PHP 7.1 on Debian 9 , and faced with those errors:
Does it mean, that such combination (PHP7.1 & Debian 9) still not supported by module, or we have to add some custom configuration? For now we just defined desired version this way:
is it enough or not? |
I've added support for PHP 7.1 on Debian (jessie, stretch).
I'm not sure if it's the most elegant way to install the required packages and how to avoid name conflicts.
Feedback is welcome.