-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactoring so that sysconfig changes (including modules) are now don…
…e without using a template; changes are made either via file_line (for sysconfig.pp) or a2enmod (for modules). Refactoring ldap.pp to use a template for future passing of tuning params. Normalizing the validation and enableModule call, too.
- Loading branch information
Showing
5 changed files
with
58 additions
and
300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,37 @@ | ||
class apache2::ldap | ||
( | ||
$ldapStatusAccessIp | ||
) | ||
{ | ||
# | ||
include apache2::params | ||
|
||
validate_string( $ldapStatusAccessIp ) | ||
|
||
# Enable the module | ||
apache2::enableModule{ 'ldap': } | ||
|
||
# Pick the template path we're going to use | ||
$mod_path = get_module_path('apache2') | ||
$specific = "$mod_path/templates/$operatingsystem/$operatingsystemrelease$params::ldapConfigPath.erb" | ||
$default = "$mod_path/templates/default$params::ldapConfigPath.erb" | ||
|
||
# Simply put in the default ldap config file, | ||
# but using the new-style access control configurations | ||
# | ||
file { $params::ldapConfigPath : | ||
ensure => present, | ||
source => "puppet:///modules/apache2${params::statusConfigPath}", | ||
owner => 'root', | ||
group => 'root', | ||
content => inline_template( file( $specific, $default ) ), | ||
notify => $apache2::serviceNotify, | ||
require => Package[ $params::packageName ], | ||
} | ||
|
||
# | ||
# Enable the module | ||
# | ||
apache2::enableModule{ 'ldap': } | ||
# Grant access to given IP | ||
if ( is_string( $ldapStatusAccessIp ) ) { | ||
apache2::grantAccessToIp { 'ldap-status' : | ||
location => '/ldap-status', | ||
ip => $ldapStatusAccessIp, | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.