voxpupuli / voxpupuli/puppet-php

Modules are not re-enabled properly if zend=true

Open
#514 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Puppet
Stars
86
Forks
264
Avg merge
29m
Merged PRs (30d)
1

Description

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.2.0
  • Ruby: 2.5.1p57
  • Distribution: Ubuntu 18.04.1 LTS
  • Module version: 6.0.2

How to reproduce (e.g Puppet code you use)

  1. Install php-extension as zend_extension via configuration (e.g. xdebug)
  class { '::php':
    extensions => {
	  xdebug => {
        package_prefix => 'php-',
        zend => true,
      }
    }
  }
  1. Run puppet

  2. Then remove the linked .ini file manually, e.g.:

rm /etc/php/7.2/cli/conf.d/20-xdebug.ini
  1. re-run puppet - the removed symlink to 20-xdebug.ini is not restored properly, thus the module won't be enabled again

What are you seeing

The extension (xdebug in this case) is installed on the first run - but the modules' .ini configuration file won't be reinstalled when running puppet again.

What behaviour did you expect instead

Symlink to /etc/php/7.2/cli/conf.d/20-xdebug.ini is recreated on next puppet run.

Any additional information you'd like to impart

Possible cause:
https://github.com/voxpupuli/puppet-php/blob/master/manifests/extension/config.pp#L112

String 'extension' is used instead of variable $extension_key defined in:
https://github.com/voxpupuli/puppet-php/blob/master/manifests/extension/config.pp#L64

so the phpquery command will never be executed when $extension_key == 'zend_extension'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open manifests/extension/config.pp around lines 64 and 112 and compare the extension key used by the phpquery condition with the value used for zend extensions. Reproduce the issue by removing the xdebug symlink and rerunning Puppet; done means the symlink is recreated for the zend_extension case.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.