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

Fix php::fpm eternal reload for mysqli a simplexml extension #503

Merged
merged 12 commits into from
Feb 12, 2019

Conversation

miranovy
Copy link
Contributor

Pull Request (PR) description

Fix eternal reload for mysqli and simplexml extension.

Package name for mysqli extension is php7.2-mysql. Package name for simlexml extension is php7.2-xml. I can use package_prefix variable, than i add package_name variable with higher priority.

Example of configuration:

class { '::php':
        ensure       => latest,
        manage_repos => false,
        pear         => true,
        composer     => false,
        fpm          => false,
        dev          => false,
        extensions   => {
            bcmath    => {},
            curl      => {},
            gd        => {},
            mbstring  => {},
            simplexml => {
                package_name => 'php7.2-xml',
            },
            mysqli    => {
                package_name => 'php7.2-mysql',
            },
            sqlite3   => {},
        },
    }

This Pull Request (PR) fixes the following issues

Fixes #309
Fixes #497

@bastelfreak bastelfreak added the bug Something isn't working label Jan 21, 2019
manifests/extension.pp Outdated Show resolved Hide resolved
@bastelfreak
Copy link
Member

Hi @miranovy, thank for the bugfix. Can you add an acceptance test for this? We have some examples in https://github.com/voxpupuli/puppet-php/tree/master/spec/acceptance. Let us know if you need some help! We're available in our IRC channel #voxpupuli on freenode and at slack https://slack.puppet.com

@miranovy
Copy link
Contributor Author

Hi @bastelfreak, you mean something like that in phpspec.rb:

...

 case default[:platform]
    when %r{ubuntu-18.04}
      packagename = 'php7.2-fpm'
      simplexmlpackagename = 'php7.2-xml'
    when %r{ubuntu-16.04}
      packagename = 'php7.0-fpm'
      simplexmlpackagename = 'php7.0-xml'
    when %r{ubuntu-14.04}
      packagename = 'php5-fpm'
      simplexmlpackagename = 'php5-xml'
    when %r{el}
      packagename = 'php-fpm'
    when %r{debian-8}
      packagename = 'php5-fpm'
    when %r{debian-9}
      packagename = 'php7.0-fpm'
    end
    describe package(packagename) do
      it { is_expected.to be_installed }
    end

    describe service(packagename) do
      it { is_expected.to be_running }
      it { is_expected.to be_enabled }
    end
  end
  context 'default parameters with extensions' do
    case default[:platform]
    when %r{ubuntu-18.04}, %r{ubuntu-16.04}, %r{ubuntu-14.04}
      it 'works with defaults' do
        pp = <<-EOS
        class{'php':
          extensions => {
            'mysql'    => {},
            'gd'       => {},
            'net-url'  => {
              package_prefix => 'php-',
              settings       => {
                extension => undef
              },
            'simplexml'  => {
              package_name => simplexmlpackagename
            }
          }
        }
        EOS
        # Run it twice and test for idempotency
        apply_manifest(pp, catch_failures: true)
        apply_manifest(pp, catch_changes: true)
      end
    else
      it 'works with defaults' do
        pp = <<-EOS
        class{'php':
          extensions => {
            'mysql'    => {},
            'gd'       => {}
          }
        }
        EOS
        # Run it twice and test for idempotency
        apply_manifest(pp, catch_failures: true)
        apply_manifest(pp, catch_changes: true)
      end
    end
...

@bastelfreak
Copy link
Member

Hi,
yes that looks good.

@bastelfreak
Copy link
Member

@miranovy can you take a look at the failed travis jobs ?

@bastelfreak
Copy link
Member

Can you take a look at the failing travis jobs?

@miranovy
Copy link
Contributor Author

miranovy commented Feb 11, 2019

Can you take a look at the failing travis jobs?

There was duplicity with default xml package for ubuntu (file manifests/dev.pp:47). Still to solve dependence on ubuntu 1404.

@bastelfreak
Copy link
Member

Thanks!

@bastelfreak bastelfreak merged commit 34ffabc into voxpupuli:master Feb 12, 2019
@miranovy
Copy link
Contributor Author

Thanks!

You're welcome. Thank you for merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extension mysqli causes php7-fpm to reload Ubuntu 16 mysql extension so name with packages from ondrej PPA
2 participants