puppetlabs / puppetlabs/puppetlabs-apache

Allow the Apache service state to be unmanaged

Open Beginner friendly
#2,633 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

community feature
Dominant language
Puppet
Stars
356
Forks
1.1k
Avg merge
3m
Merged PRs (30d)
1

Description

Describe the Bug

Starting in v8.0.0 with this commit, it is no longer possible to leave the Apache service state explicitly unmanaged. The allowable values for $service_ensure are restricted in that commit to only the values that the Service resource will accept on its ensure parameter. This is passed through to the Apache::Service class's parameter of the same name, which still to this day would accept alternative values for that parameter if it were possible to pass them, and simply result in the service state remaining unmanaged. Because this is an explicit param pass, and because the default value is 'running', it is not possible to override this parameter via Hiera, nor is it possible to override this with a non-value, because e.g. passing undef to the parameter via a resource collector is equivalent to passing no parameter value at all. [Edit: actually this works okay, but it's still gross and kinda makes my skin crawl.] There should be a clean way to use this module to simply configure Apache and leave service state to another tool.

Expected Behavior

Allow the Apache service state to be explicitly unmanaged, so that external tools like Ansible, Bolt, or other service management tooling used in more complex deployments are able to manage the service state, instead.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Attempt to pass any value other than a valid service state to the Apache class's service_ensure parameter (we used 'unmanaged' for this previously)
  2. Apply this configuration to any host
  3. Observe the resulting catalog compilation failures

Environment

  • v8.0.0 or later (issue is still visible in current tip of main) w/ Puppet 7.x or 8.x
  • CentOS 9 (though a quick read of the code shows this would be the case on any platform)
  • Unit tests via PDK 3.3.0

Additional Context

I will try to submit a PR for this soon, but wanted to at least get this issue filed.

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

Start with the Apache class's service_ensure parameter and manifests/service.pp, including the Apache::Service parameter described in the issue. Make the unmanaged state explicitly accepted while preserving the existing running default, then run the module's unit tests with PDK and verify catalog compilation succeeds for an unmanaged service.

Written by the indexing model from the issue text.

Assessment

Tech stack
apache
Domain
devops, infrastructure
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.