Puppet Class: ipa::server

Defined in:
manifests/server.pp

Summary

Manage IPA server install

Overview

Parameters:

  • package_name (Optional[Array[String]]) (defaults to: undef)

    The name of the package(s) to install.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'manifests/server.pp', line 8

class ipa::server (
  Optional[Array[String]] $package_name = undef,
) {
  assert_private()

  if $ipa::ipa_role != 'master' { # if replica or client
    unless $ipa::ipa_master_fqdn {
      fail("When creating a ${ipa::ipa_role} the parameter named ipa_master_fqdn cannot be empty.")
    }
    unless $ipa::admin_password {
      fail("When creating a ${ipa::ipa_role} the parameter named admin_password cannot be empty.")
    }
  }

  if fact('os.family') == 'RedHat' {
    require ipa::server::redhat
  }

  stdlib::ensure_packages($package_name)

  $dns_packages = [
    'ipa-server-dns',
    'bind-dyndb-ldap',
  ]

  if $ipa::final_configure_dns_server {
    stdlib::ensure_packages($dns_packages)
  }

  $server_install_cmd_opts_idstart = "--idstart=${ipa::idstart}"

  $server_install_cmd_opts_idmax = $ipa::idmax ? {
    undef   => '',
    default => "--idmax=${ipa::idmax}"
  }

  if $ipa::allow_zone_overlap {
    $server_install_cmd_opts_zone_overlap = '--allow-zone-overlap'
  } else {
    $server_install_cmd_opts_zone_overlap = ''
  }

  if $ipa::no_dnssec_validation {
    $server_install_cmd_opts_dnssec_validation = '--no-dnssec-validation'
  } else {
    $server_install_cmd_opts_dnssec_validation = ''
  }

  if $ipa::enable_hostname {
    $server_install_cmd_opts_hostname = "--hostname=${ipa::ipa_server_fqdn}"
  } else {
    $server_install_cmd_opts_hostname = ''
  }

  if $ipa::enable_ip_address {
    $server_install_cmd_opts_ip_address = "--ip-address ${ipa::ip_address}"
  } else {
    $server_install_cmd_opts_ip_address = ''
  }

  if $ipa::final_configure_dns_server {
    $server_install_cmd_opts_setup_dns = '--setup-dns'
  } else {
    $server_install_cmd_opts_setup_dns = ''
  }

  if $ipa::configure_replica_ca {
    $server_install_cmd_opts_setup_ca = '--setup-ca'
  } else {
    $server_install_cmd_opts_setup_ca = ''
  }

  if $ipa::configure_ntp {
    $server_install_cmd_opts_no_ntp = ''
  } else {
    $server_install_cmd_opts_no_ntp = '--no-ntp'
  }

  if $ipa::final_configure_dns_server {
    if size($ipa::custom_dns_forwarders) > 0 {
      $server_install_cmd_opts_forwarders = join(
        prefix(
          $ipa::custom_dns_forwarders,
        '--forwarder '),
        ' '
      )
    }
    else {
      $server_install_cmd_opts_forwarders = '--no-forwarders'
    }
  }
  else {
    $server_install_cmd_opts_forwarders = ''
  }

  if $ipa::no_ui_redirect {
    $server_install_cmd_opts_no_ui_redirect = '--no-ui-redirect'
  } else {
    $server_install_cmd_opts_no_ui_redirect = ''
  }

  if $ipa::mkhomedir {
    $server_install_cmd_opts_mkhomedir = '--mkhomedir'
  } else {
    $server_install_cmd_opts_mkhomedir = ''
  }

  if $ipa::ipa_role == 'master' {
    contain 'ipa::server::master'

    Class['ipa::server::master']
    -> Service['ipa']
  } elsif $ipa::ipa_role == 'replica' {
    contain 'ipa::server::replica'

    Class['ipa::server::replica']
    -> Service['ipa']
  }

  include ipa::server::flushcache

  service { 'ipa':
    ensure => running,
    enable => true,
  }
}