Skip to content

Commit

Permalink
Merge pull request #519 from smortex/mysql-ubuntu-fix
Browse files Browse the repository at this point in the history
Do not manage mysql.ini when using Ubuntu repo (and fix CI)
  • Loading branch information
Dan33l committed May 29, 2019
2 parents f20e20d + 4169e15 commit 5fb6164
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 21 deletions.
21 changes: 3 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ matrix:
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1404-64 BEAKER_HYPERVISOR=docker CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1804-64 BEAKER_HYPERVISOR=docker CHECK=beaker
script: bundle exec rspec spec/acceptance/php56_spec.rb
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1404-64 BEAKER_HYPERVISOR=docker CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1804-64 BEAKER_HYPERVISOR=docker CHECK=beaker
script: bundle exec rspec spec/acceptance/php56_spec.rb
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=ubuntu1404-64 BEAKER_HYPERVISOR=docker CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=ubuntu1804-64 BEAKER_HYPERVISOR=docker CHECK=beaker
script: bundle exec rspec spec/acceptance/php56_spec.rb
services: docker
- rvm: 2.5.3
Expand Down Expand Up @@ -96,21 +96,6 @@ matrix:
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=ubuntu1604-64 BEAKER_HYPERVISOR=docker CHECK=beaker
script: bundle exec rspec spec/acceptance/php_spec.rb
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1404-64 BEAKER_HYPERVISOR=docker CHECK=beaker
script: bundle exec rspec spec/acceptance/php_spec.rb
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1404-64 BEAKER_HYPERVISOR=docker CHECK=beaker
script: bundle exec rspec spec/acceptance/php_spec.rb
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=ubuntu1404-64 BEAKER_HYPERVISOR=docker CHECK=beaker
script: bundle exec rspec spec/acceptance/php_spec.rb
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos7-64 BEAKER_HYPERVISOR=docker CHECK=beaker
Expand Down
10 changes: 9 additions & 1 deletion manifests/extension/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,16 @@
$final_settings = $full_settings
}

if $facts['os']['name'] == 'Ubuntu' and $zend != true and $name == 'mysql' {
# Do not manage the .ini file if it's mysql. PHP 7.0+ do not have
# mysql.so. If mysql.ini exists and version is 7.0+, then remove it.
$real_ensure = 'absent'
} else {
$real_ensure = $ensure
}

$config_root_ini = pick_default($php::config_root_ini, $php::params::config_root_ini)
if $ensure != 'absent' {
if $real_ensure != 'absent' {
::php::config { $title:
file => "${config_root_ini}/${ini_prefix}${ini_name}.ini",
config => $final_settings,
Expand Down
1 change: 0 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"14.04",
"16.04",
"18.04"
]
Expand Down
17 changes: 16 additions & 1 deletion spec/defines/extension_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
it { is_expected.to contain_php__config('xdebug').with_config('zend_extension' => '/usr/lib/php5/20100525/xdebug.so') }
end

case facts[:osfamily]
case facts[:os]['name']
when 'Debian'
context 'on Debian' do
let(:title) { 'xdebug' }
Expand Down Expand Up @@ -223,6 +223,21 @@
end
end
end
when 'Ubuntu'
context 'on Ubuntu' do
context 'do not setup mysql.ini' do
let(:title) { 'mysql' }
let(:params) do
{
name: 'mysql'
}
end

it do
is_expected.to contain_file("#{etcdir}/mysql.ini").with(ensure: 'absent')
end
end
end
end
end
end
Expand Down

0 comments on commit 5fb6164

Please sign in to comment.