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

Is it possible to ensure the fpm service from hiera? #609

Closed
jamesj2 opened this issue Nov 4, 2020 · 2 comments
Closed

Is it possible to ensure the fpm service from hiera? #609

jamesj2 opened this issue Nov 4, 2020 · 2 comments

Comments

@jamesj2
Copy link

jamesj2 commented Nov 4, 2020

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.5.8
  • Ruby: 2.4.4p296
  • Distribution: docker
  • Module version: 7.1.0

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

Hiera:

php::fpm_service_enable: false
php::fpm_service_ensure: null

Manifest:

include ::php

What are you seeing

Module starts FPM service every puppet run. Unable to unset the ensure parameter for the php fpm service. I use corosync/pacemaker to manage this service and sometimes it's running and sometimes it's not.

What behaviour did you expect instead

FPM service should not start

Output log

Notice: /Stage[main]/Php::Fpm::Service/Service[php74-php-fpm]/ensure: ensure changed 'stopped' to 'running' (corrective)

Any additional information you'd like to impart

The php::fpm_service_enable setting works but the php::fpm_service_ensure always is overwritten with the default of "running".

@kenyon
Copy link
Member

kenyon commented Nov 8, 2020

@jamesj2 null is not one of the options for ensure on services: https://puppet.com/docs/puppet/latest/types/service.html#service-attribute-ensure

You can also set enable to mask to prevent the service from starting, assuming systemd.

@jamesj2
Copy link
Author

jamesj2 commented Nov 9, 2020

I made a fork and used lookup() to use hiera as the default and use the params if it's not present. But your solution would work, I didn't think of that. Thanks!

@jamesj2 jamesj2 closed this as completed Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants