Skip to content

php extensions priority gets written into ini file with every puppet run which results into a service restart #713

@vmpr

Description

@vmpr

Hi everyone and thanks for the great work on the PHP module!

we have a strange problem with priorities and PHP extensions, For example, I would like to install the pdo extension and it needs to have a prefix 10 instead of the standard 20. It seems fairly easy, to use the "; priority' setting. But now with every puppet run the module adds a new line "; priority = 10" to my .ini file ( /etc/php/8.1/mods-available/pdo.ini ) as a result, puppet restarts the php-fpm every 30 minutes while running, which causes Problems for the application. Does anybody know how to avoid that?

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.34.0
  • Distribution: Debian 11
  • Module version: 10.1.0

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

Our configuration in Hiera:

php::extensions:
  pdo:
    package_name: 'php8.1-common'
    settings:
      '; priority': 10

What are you seeing

every puppet run the module adds another line:

# cat /etc/php/8.1/mods-available/pdo.ini
extension = pdo.so
; priority = 10
; priority = 10
; priority = 10
; priority = 10
; priority = 10
; priority = 10
; priority = 10
; priority = 10
; priority = 10
; priority = 10
; priority = 10
...

and restarts the php-fpm which causes unavailability for the application

Notice: /Stage[main]/Php/Php::Extension[pdo]/Php::Extension::Config[pdo]/Php::Config[pdo]/Php::Config::Setting[/etc/php/8.1/mods-available/pdo.ini: ; priority]/Ini_setting[/etc/php/8.1/mods-available/pdo.ini: ; priority]/ensure: created (corrective)
Info: Php::Extension[pdo]: Scheduling refresh of Service[php8.1-fpm]

Notice: /Stage[main]/Php::Fpm::Service/Service[php8.1-fpm]: Triggered 'refresh' from ...

What behaviour did you expect instead

puppet runs once and writes the .ini file, the next time puppets is running it will not change the .ini file and also not restart php-fpm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions