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

Move from params.pp to Hiera data #287

Merged
merged 3 commits into from
Aug 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
openldap::client::package: "openldap"
openldap::client::file: "/etc/openldap/ldap.conf"
openldap::server::confdir: "/etc/openldap/slapd.d"
openldap::server::conffile: "/etc/openldap/slapd.conf"
openldap::server::group: "ldap"
openldap::server::owner: "ldap"
openldap::server::service: "slapd"
openldap::utils::package: ~
openldap::server::escape_ldapi_ifs: false
openldap::server::enable_chown: ~
openldap::server::register_slp: ~
openldap::server::ldap_config_backend: ~
openldap::server::enable_memory_limit: ~
2 changes: 2 additions & 0 deletions data/os/Archlinux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
openldap::server::package: "openldap"
9 changes: 9 additions & 0 deletions data/os/Debian.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
openldap::client::package: "libldap-2.4-2"
openldap::client::file: "/etc/ldap/ldap.conf"
openldap::server::confdir: "/etc/ldap/slapd.d"
openldap::server::conffile: "/etc/ldap/slapd.conf"
openldap::server::group: "openldap"
openldap::server::owner: "openldap"
openldap::server::package: "slapd"
openldap::utils::package: "ldap-utils"
7 changes: 7 additions & 0 deletions data/os/FreeBSD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
openldap::client::package: "openldap-client"
openldap::client::file: "/usr/local/etc/openldap/ldap.conf"
openldap::server::confdir: "/usr/local/etc/openldap/slapd.d"
openldap::server::conffile: "/usr/local/etc/openldap/slapd.conf"
openldap::server::package: "openldap-server"
openldap::server::escape_ldapi_ifs: true
3 changes: 3 additions & 0 deletions data/os/RedHat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openldap::server::package: "openldap-servers"
openldap::utils::package: "openldap-clients"
2 changes: 2 additions & 0 deletions data/os/RedHat/5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
openldap::server::service: "ldap"
8 changes: 8 additions & 0 deletions data/os/Suse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
openldap::client::package: "openldap2-client"
openldap::server::package: "openldap2"
openldap::server::escape_ldapi_ifs: true
openldap::server::enable_chown: true
openldap::server::register_slp: true
openldap::server::ldap_config_backend: "files"
openldap::server::enable_memory_limit: true
16 changes: 16 additions & 0 deletions hiera.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
version: 5

defaults:
datadir: 'data'
data_hash: 'yaml_data'

hierarchy:
- name: 'family/operatingsystemmajrelease'
path: 'os/%{facts.osfamily}/%{facts.operatingsystemmajrelease}.yaml'

- name: 'family'
path: 'os/%{facts.osfamily}.yaml'

- name: 'common'
path: 'common.yaml'
6 changes: 3 additions & 3 deletions manifests/client.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See README.md for details.
class openldap::client (
$package = $openldap::params::client_package,
$file = $openldap::params::client_conffile,
$package,
$file,

# Options
$base = undef,
Expand Down Expand Up @@ -52,7 +52,7 @@

# SUDO Options
$sudoers_base = undef,
) inherits openldap::params {
) {
contain openldap::client::install
contain openldap::client::config
Class['openldap::client::install'] -> Class['openldap::client::config']
Expand Down
96 changes: 0 additions & 96 deletions manifests/params.pp

This file was deleted.

24 changes: 12 additions & 12 deletions manifests/server.pp
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# See README.md for details.
class openldap::server (
$package = $openldap::params::server_package,
$confdir = $openldap::params::server_confdir,
$conffile = $openldap::params::server_conffile,
$service = $openldap::params::server_service,
$package,
$confdir,
$conffile,
$service,
$owner,
$group,
Boolean $escape_ldapi_ifs,
Optional[Boolean] $enable_chown,
Optional[Boolean] $service_hasstatus = undef,
$owner = $openldap::params::server_owner,
$group = $openldap::params::server_group,
$enable = true,
$start = true,
Optional[Stdlib::Absolutepath] $ssl_key = undef,
Expand All @@ -16,19 +18,17 @@
$ldap_ifs = ['/'],
$ldaps_ifs = [],
$ldapi_ifs = ['/'],
Boolean $escape_ldapi_ifs = $openldap::params::escape_ldapi_ifs,
Optional[String] $slapd_params = undef,
Optional[Boolean] $enable_chown = $openldap::params::enable_chown,
Optional[Stdlib::Port] $ldap_port = undef,
Optional[Stdlib::IP::Address] $ldap_address = undef,
Optional[Stdlib::Port] $ldaps_port = undef,
Optional[Stdlib::IP::Address] $ldaps_address = undef,
Optional[Stdlib::Absolutepath] $ldapi_socket_path = undef,
Optional[Boolean] $register_slp = $openldap::params::register_slp,
Optional[Boolean] $register_slp,
Optional[Stdlib::Absolutepath] $krb5_keytab_file = undef,
Optional[String] $ldap_config_backend = $openldap::params::ldap_config_backend,
Optional[Boolean] $enable_memory_limit = $openldap::params::enable_memory_limit,
) inherits openldap::params {
Optional[String] $ldap_config_backend,
Optional[Boolean] $enable_memory_limit,
) {
class { 'openldap::server::install': }
-> class { 'openldap::server::config': }
~> class { 'openldap::server::service': }
Expand Down
4 changes: 2 additions & 2 deletions manifests/utils.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See README.md for details.
class openldap::utils (
$package = $openldap::params::utils_package,
) inherits openldap::params {
$package,
) {
if $package {
package { $package:
ensure => present,
Expand Down