Defined Type: ipa::loadbalanceconf

Defined in:
manifests/loadbalanceconf.pp

Overview

Parameters:

  • host (Any) (defaults to: $name)
  • domain (Any) (defaults to: {})
  • ipaservers (Any) (defaults to: [])
  • mkhomedir (Any) (defaults to: {})


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'manifests/loadbalanceconf.pp', line 1

define ipa::loadbalanceconf (
  $host       = $name,
  $domain     = {},
  $ipaservers = [],
  $mkhomedir  = {}
) {

  $dc = prefix([regsubst($domain,'(\.)',',dc=','G')],'dc=')

  $servers = chop(inline_template('<% @ipaservers.each do |ipaserver| -%><%= ipaserver %>,<% end -%>'))

  case $::osfamily {
    'Debian': {
      notify { "Unable to configure load balanced IPA directory services for Debian.": }
    }
    default: {
      $mkhomediropt = $mkhomedir ? {
        true    => '--enablemkhomedir',
        default => ''
      }

      exec { "loadbalanceconf-authconfig-${host}":
        command     => "/usr/sbin/authconfig --nostart --enablesssd --enableldap --ldapserver=${servers} --ldapbasedn=${dc} --krb5kdc=${servers} --krb5adminserver=${servers} ${mkhomediropt} --update",
        logoutput   => "on_failure"
      }<- notify { "Configuring load balanced IPA directory services, please wait.": } ~> Ipa::Flushcache["loadbalanceconf-flushcache-${host}"]
    }
  }

  ipa::flushcache { "loadbalanceconf-flushcache-${host}":
  }
}