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

MODULES-3838 Pass mod_packages through init.pp to allow overrides #1631

Merged

Conversation

optiz0r
Copy link
Contributor

@optiz0r optiz0r commented Jun 8, 2017

When using the SCL packages on CentOS, package names have a prefix that needs to be overridden. With most other attributes in params.pp, this is possible by overriding variables passed to Class['::apache'], but in the case of mod_packages it's read directly from the params file on use. This is workaroundable by not using the apache::mod::... subclasses can calling apache::mod { 'mod_name' } directly, but there is a compounding problem.
The apache::vhost::auth_kerb parameter is used for for both including the auth_kerb modules (using class syntax rather than include, so cannot be duplicated), and for including config snippets in the generated vhost. It's not possible to make use of the config snippet whilst also needing to amend the package name.

This commit follows the existing style and passes mod_packages through init.pp, and updates all references of apache::params::mod_packages to apache::mod_packages. It's therefore possible to override the package names using something like:

include ::apache::params
class { '::apache':
  mod_packages => merge($::apache::mod_params {
    'auth_kerb' => 'httpd24-mod_auth_kerb',
  }
}

@eputnam
Copy link
Contributor

eputnam commented Jul 19, 2017

@optiz0r thanks for the PR! could you do a quick rebase? also, it'd be good to have some tests and documentation for this as it's a new feature.

@optiz0r optiz0r force-pushed the modules-3838-module-packagename-overrides branch from cc9c4bd to b7e251a Compare July 21, 2017 18:10
@optiz0r
Copy link
Contributor Author

optiz0r commented Jul 21, 2017

Rebase done. I don't have a lot of free cycles, and considering there is no documentation or tests for the apache::params::mod_packages in the first place, there's nothing to update, and the codebase is no worse off by any measure with this commit as-is than it was before.

adds an entry in the README and a usage example as well as a couple of unit tests in apache_spec
@eputnam eputnam force-pushed the modules-3838-module-packagename-overrides branch 3 times, most recently from 52427ff to 8b43d43 Compare July 21, 2017 23:09
@hunner hunner force-pushed the modules-3838-module-packagename-overrides branch 2 times, most recently from ae2500e to f2c909c Compare July 21, 2017 23:17
@hunner hunner force-pushed the modules-3838-module-packagename-overrides branch from f2c909c to 36da2f6 Compare July 21, 2017 23:27
@eputnam eputnam merged commit 40c1ad4 into puppetlabs:master Jul 21, 2017
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.

3 participants