-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add Ubuntu 18.04 support #1809
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
Closed
Closed
Add Ubuntu 18.04 support #1809
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c870932
add Ubuntu 18.04 to metadata.json
bastelfreak 766e823
implement apache2-mpm-itk support for Ubuntu 18.04
bastelfreak a10f32e
add libapache2-mod-svn support for Ubuntu 18.04
bastelfreak 3a5d994
add mod-passenger support for Ubuntu 18.04
bastelfreak e111d79
add mod-php support for Ubuntu 18.04
bastelfreak ec55e87
fix mod-fastcgi for Ubuntu 18.04
bastelfreak 1804638
add mod-security2 support for Ubuntu 18.04
bastelfreak 70a25c5
fix mod-suphp for Ubuntu 18.04
bastelfreak 176bb3f
migrate fastcgiserver tests to rspec-puppet-facts
bastelfreak 7397a99
migrate modsec_link spec tests to rspec-puppet-facts
bastelfreak 1bfe062
migrate vhost spec tests to rspec-puppet-facts
bastelfreak 693f7c1
migrate dev spec tests to rspec-puppet-facts
bastelfreak e1f363a
migrate fastcgi spec tests to rspec-puppet-facts
bastelfreak 041836a
disable legacy shared_example
bastelfreak d8f8a81
migrate php spec tests to rspec-puppet-facts
bastelfreak b780d65
migrate suphp spec tests to rspec-puppet-facts
bastelfreak e9b5d42
migrate mod-security spec tests to rspec-puppet-facts
bastelfreak 500d9e1
migrate mod-passenger spec tests to rspec-puppet-facts
bastelfreak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,7 +65,8 @@ | |
"operatingsystem": "Ubuntu", | ||
"operatingsystemrelease": [ | ||
"14.04", | ||
"16.04" | ||
"16.04", | ||
"18.04" | ||
] | ||
} | ||
], | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,28 @@ | |
unless fact('operatingsystem') == 'SLES' && fact('operatingsystemmajrelease') == '12' | ||
describe 'apache::mod::php class' do | ||
context 'default php config' do | ||
if ['16.04', '18.04'].include?(fact('operatingsystemmajrelease')) | ||
# this policy defaults to 101. it prevents newly installed services from starting | ||
# it is useful for containers, it prevents new processes during 'docker build' | ||
# but we actually want to test the services and this should not behave like docker | ||
# but like a normal operating system | ||
|
||
# without this apache fails to start -> installation of mod-php-something fails because it reloads apache to enable the module | ||
# exit codes are documented at https://askubuntu.com/a/365912. Default for docker images is 101 | ||
shell("if [ -a '/usr/sbin/policy-rc.d' ]; then sed -i 's/^exit.*/exit 0/' /usr/sbin/policy-rc.d; fi") | ||
end | ||
if fact('operatingsystemmajrelease') == '18.04' | ||
# apache helper script has a bug which prevents the installation of certain apache modules | ||
# https://bugs.launchpad.net/ubuntu/+source/php7.2/+bug/1771934 | ||
# https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/1782806 | ||
pp1 = "class { 'apache': mpm_module => 'prefork',}" | ||
it 'succeeds in installing apache' do | ||
apply_manifest(pp1, catch_failures: true) | ||
end | ||
it 'fixes the broken apache2 helper from Ubuntu 18.04' do | ||
shell("sed -i 's|a2query -m \"$mpm_$MPM\"|a2query -m \"mpm_$MPM\"|' /usr/share/apache2/apache2-maintscript-helper") | ||
end | ||
end | ||
pp = <<-MANIFEST | ||
class { 'apache': | ||
mpm_module => 'prefork', | ||
|
@@ -36,6 +58,10 @@ class { 'apache::mod::php': } | |
describe file("#{$mod_dir}/php7.0.conf") do | ||
it { is_expected.to contain 'DirectoryIndex index.php' } | ||
end | ||
elsif fact('operatingsystemmajrelease') == '18.04' | ||
describe file("#{$mod_dir}/php7.2.conf") do | ||
it { is_expected.to contain 'DirectoryIndex index.php' } | ||
end | ||
else | ||
describe file("#{$mod_dir}/php5.conf") do | ||
it { is_expected.to contain 'DirectoryIndex index.php' } | ||
|
@@ -120,18 +146,21 @@ class {'apache::mod::php': | |
it 'succeeds in puppeting php' do | ||
apply_manifest(pp, catch_failures: true) | ||
end | ||
if fact('operatingsystem') == 'Ubuntu' && fact('operatingsystemmajrelease') == '16.04' | ||
describe file("#{$mod_dir}/php7.0.conf") do | ||
it { is_expected.to contain '# somecontent' } | ||
end | ||
else | ||
describe file("#{$mod_dir}/php5.conf") do | ||
it { is_expected.to contain '# somecontent' } | ||
end | ||
path = if fact('operatingsystem') == 'Ubuntu' && fact('operatingsystemmajrelease') == '16.04' | ||
"#{$mod_dir}/php7.0.conf" | ||
elsif fact('operatingsystemmajrelease') == '18.04' | ||
"#{$mod_dir}/php7.2.conf" | ||
else | ||
"#{$mod_dir}/php5.conf" | ||
end | ||
describe file(path) do | ||
it { is_expected.to contain '# somecontent' } | ||
end | ||
end | ||
|
||
context 'provide content and template config file' do | ||
# does the following even makes sense? Why do we hardcode the php5 template? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd agree with you, not sure there's much point to this test |
||
# I don't see what we gain from this test | ||
pp = <<-MANIFEST | ||
class {'apache': | ||
mpm_module => 'prefork', | ||
|
@@ -145,14 +174,15 @@ class {'apache::mod::php': | |
apply_manifest(pp, catch_failures: true) | ||
end | ||
|
||
if fact('operatingsystem') == 'Ubuntu' && fact('operatingsystemmajrelease') == '16.04' | ||
describe file("#{$mod_dir}/php7.0.conf") do | ||
it { is_expected.to contain '# somecontent' } | ||
end | ||
else | ||
describe file("#{$mod_dir}/php5.conf") do | ||
it { is_expected.to contain '# somecontent' } | ||
end | ||
path = if fact('operatingsystem') == 'Ubuntu' && fact('operatingsystemmajrelease') == '16.04' | ||
"#{$mod_dir}/php7.0.conf" | ||
elsif fact('operatingsystemmajrelease') == '18.04' | ||
"#{$mod_dir}/php7.2.conf" | ||
else | ||
"#{$mod_dir}/php5.conf" | ||
end | ||
describe file(path) do | ||
it { is_expected.to contain '# somecontent' } | ||
end | ||
end | ||
end | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
These magic numbers feel like a difficult to maintain/easy to break setup. Perhaps it should check for
fact('service_provider') == 'systemd'
instead? You could even do it in a pure puppet block: