puppet php - 为什么某些模块触发了php-fpm

时间:2017-04-20 13:19:45

标签: php puppet fpm

当某些模块触发php-fpm的刷新(服务重启)时,我遇到了问题,即使没有任何改变。 例如:

==> app-server: Notice: /Stage[main]/Php/Php::Extension[igbinary]/Package[php5.6-igbinary]/ensure: ensure changed 'purged' to 'present'
==> app-server: Notice: /Stage[main]/Php/Php::Extension[memcached]/Package[php5.6-memcached]/ensure: ensure changed 'purged' to 'latest'
==> app-server: Info: Php::Extension[memcached]: Scheduling refresh of Service[php5.6-fpm]
==> app-server: Notice: /Stage[main]/Php/Php::Extension[tideways]/Package[php5.6-tideways]/ensure: ensure changed 'purged' to 'present'
==> app-server: Info: Php::Extension[tideways]: Scheduling refresh of Service[php5.6-fpm]
==> app-server: Info: Php::Extension[igbinary]: Scheduling refresh of Service[php5.6-fpm]
==> app-server: Notice: /Stage[main]/Php::Fpm::Service/Service[php5.6-fpm]: Triggered 'refresh' from 3 events

在vagrant / test环境下没关系但是我不希望每次木偶运行都在prod环境中重启fpm服务,所以 有没有办法告诉木偶不重启php-fpm如果没有改变?

提前感谢您的帮助!

P.S。以下是puppet配置的外观:

php::globals::php_version: '5.6'
php::extensions:
xml: {}
curl: {}
json: {}
intl: {}
mbstring: {}
mcrypt: {}
mysql: {}
curl: {}
intl: {}
json: {}
odbc: {}
readline: {}
igbinary: {}
zip: {}
soap: {}
dba: {}
bz2: {}
tideways: {}
memcached: {}
oci8:
  provider: pecl
  ensure: '2.0.12'
pgsql: {}
mcrypt: {}
gd: {}
apcu:
  provider: pecl
  ensure: '4.0.11'
  settings:
    apc.stat: 1
    apc.stat_ctime: 1

1 个答案:

答案 0 :(得分:0)

好吧,看起来我已经找到了为什么会发生这种情况:我有php版本5.6,所以puppet尝试安装前缀为php5.6的软件包,但对于这3个软件包的前缀是 php - ,所以我为memcached,tideways和igbinary添加了package_prefix,现在php-fpm不再重新启动了。

tideways:
    package_prefix: php-
igbinary:
    package_prefix: php-
memcached:
    package_prefix: php-

希望它会帮助别人。

干杯!