Skip to content

Commit 5fb6164

Browse files
authored
Merge pull request #519 from smortex/mysql-ubuntu-fix
Do not manage mysql.ini when using Ubuntu repo (and fix CI)
2 parents f20e20d + 4169e15 commit 5fb6164

4 files changed

Lines changed: 28 additions & 21 deletions

File tree

.travis.yml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ matrix:
3838
services: docker
3939
- rvm: 2.5.3
4040
bundler_args: --without development release
41-
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
41+
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
4242
script: bundle exec rspec spec/acceptance/php56_spec.rb
4343
services: docker
4444
- rvm: 2.5.3
4545
bundler_args: --without development release
46-
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
46+
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
4747
script: bundle exec rspec spec/acceptance/php56_spec.rb
4848
services: docker
4949
- rvm: 2.5.3
5050
bundler_args: --without development release
51-
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
51+
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
5252
script: bundle exec rspec spec/acceptance/php56_spec.rb
5353
services: docker
5454
- rvm: 2.5.3
@@ -96,21 +96,6 @@ matrix:
9696
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
9797
script: bundle exec rspec spec/acceptance/php_spec.rb
9898
services: docker
99-
- rvm: 2.5.3
100-
bundler_args: --without development release
101-
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
102-
script: bundle exec rspec spec/acceptance/php_spec.rb
103-
services: docker
104-
- rvm: 2.5.3
105-
bundler_args: --without development release
106-
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
107-
script: bundle exec rspec spec/acceptance/php_spec.rb
108-
services: docker
109-
- rvm: 2.5.3
110-
bundler_args: --without development release
111-
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
112-
script: bundle exec rspec spec/acceptance/php_spec.rb
113-
services: docker
11499
- rvm: 2.5.3
115100
bundler_args: --without development release
116101
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

manifests/extension/config.pp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,16 @@
8989
$final_settings = $full_settings
9090
}
9191

92+
if $facts['os']['name'] == 'Ubuntu' and $zend != true and $name == 'mysql' {
93+
# Do not manage the .ini file if it's mysql. PHP 7.0+ do not have
94+
# mysql.so. If mysql.ini exists and version is 7.0+, then remove it.
95+
$real_ensure = 'absent'
96+
} else {
97+
$real_ensure = $ensure
98+
}
99+
92100
$config_root_ini = pick_default($php::config_root_ini, $php::params::config_root_ini)
93-
if $ensure != 'absent' {
101+
if $real_ensure != 'absent' {
94102
::php::config { $title:
95103
file => "${config_root_ini}/${ini_prefix}${ini_name}.ini",
96104
config => $final_settings,

metadata.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
{
4141
"operatingsystem": "Ubuntu",
4242
"operatingsystemrelease": [
43-
"14.04",
4443
"16.04",
4544
"18.04"
4645
]

spec/defines/extension_spec.rb

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
it { is_expected.to contain_php__config('xdebug').with_config('zend_extension' => '/usr/lib/php5/20100525/xdebug.so') }
188188
end
189189

190-
case facts[:osfamily]
190+
case facts[:os]['name']
191191
when 'Debian'
192192
context 'on Debian' do
193193
let(:title) { 'xdebug' }
@@ -223,6 +223,21 @@
223223
end
224224
end
225225
end
226+
when 'Ubuntu'
227+
context 'on Ubuntu' do
228+
context 'do not setup mysql.ini' do
229+
let(:title) { 'mysql' }
230+
let(:params) do
231+
{
232+
name: 'mysql'
233+
}
234+
end
235+
236+
it do
237+
is_expected.to contain_file("#{etcdir}/mysql.ini").with(ensure: 'absent')
238+
end
239+
end
240+
end
226241
end
227242
end
228243
end

0 commit comments

Comments
 (0)