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

Allow Apache service not to be managed by Puppet #690

Merged
merged 3 commits into from
May 15, 2014

Conversation

arnoudj
Copy link
Contributor

@arnoudj arnoudj commented Apr 1, 2014

Currently Apache can either configured to be 'running' or 'stopped'. In our cluster setup Apache is managed by Pacemaker, so Puppet should not interfere. Setting ensure to 'UNSET' will now set ensure to undef for the Apache service.

Currently Apache can either configured to be 'running' or 'stopped'. In our cluster setup Apache is managed by Pacemaker, so Puppet should not interfere. Setting ensure to 'UNSET' will now set ensure to undef for the Apache service.
@igalic
Copy link
Contributor

igalic commented Apr 2, 2014

why not simply allow to pass service_enabled => undef ? Doesn't that solve the problem?

@arnoudj
Copy link
Contributor Author

arnoudj commented Apr 2, 2014

Nope, that will start the service again:

class { 'apache':
  service_enable       => false,
  service_ensure       => undef,
}
root@control3:~# puppet apply test.pp
notice: /Stage[main]/Apache::Service/Service[httpd]/ensure: ensure changed 'stopped' to 'running'
notice: Finished catalog run in 1.00 seconds

The apache class calls apache::service, which sets a default for service_ensure. So then I pass undef to apache, it gets set to 'running' by apache::service.

class apache::service (
  $service_name   = $::apache::params::service_name,
  $service_enable = true,
  $service_ensure = 'running',
)

@hunner
Copy link
Contributor

hunner commented Apr 2, 2014

@igalic Yeah, having a parameter passed => undef is like not passing the parameter at all, and will use the default value.

@arnoudj I think that pacemaker is a valid configuration (and I would like to get our corosync module up to snuff to work with all of our other modules!).

Could you code this so that running|stopped|true|false are all passed through, and any other value causes it to be undef? This will at least be backwards compatible. Could you also update the README, and add a beaker-rspec and/or rspec-puppet test? Thanks!

…the parameter service_ensure. Any other value wil result in the parameter 'ensure' for the Apache service being set to undef.
@arnoudj
Copy link
Contributor Author

arnoudj commented Apr 3, 2014

Done!

Would love to see the corosync module updated as well.

underscorgan pushed a commit that referenced this pull request May 15, 2014
Allow Apache service not to be managed by Puppet
@underscorgan underscorgan merged commit ef9e6c8 into puppetlabs:master May 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants