Puppet Class: ipa::install::server
- Defined in:
- manifests/install/server.pp
Overview
IPA server install manifest
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 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 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'manifests/install/server.pp', line 2
class ipa::install::server (
Boolean $allow_zone_overlap = $ipa::allow_zone_overlap,
Boolean $config_replica_ca = $ipa::configure_replica_ca,
Boolean $configure_dns = $ipa::final_configure_dns_server,
Boolean $configure_ntp = $ipa::configure_ntp,
Array[String] $dns_forwarders = $ipa::custom_dns_forwarders,
Boolean $enable_hostname = $ipa::enable_hostname,
Integer $idstart = $ipa::idstart,
Boolean $install_kstart = $ipa::install_kstart,
Boolean $install_ldaputils = $ipa::server_install_ldaputils,
String $ipa_package_name = $ipa::params::ipa_server_package_name,
String $ipa_role = $ipa::ipa_role,
String $ipa_server_name = $ipa::ipa_server_fqdn,
String $kstart_package_name = $ipa::params::kstart_package_name,
String $ldap_package_name = $ipa::params::ldaputils_package_name,
Boolean $make_homedir = $ipa::mkhomedir,
Boolean $set_no_dnssec = $ipa::no_dnssec_validation,
Boolean $set_no_ui_redirect = $ipa::no_ui_redirect,
) {
package{ $ipa_package_name:
ensure => present,
}
if $install_kstart {
package{ $kstart_package_name:
ensure => present,
}
}
if $install_ldaputils {
package { $ldap_package_name:
ensure => present,
}
}
$server_install_cmd_opts_idstart = "--idstart=${idstart}"
if $allow_zone_overlap {
$server_install_cmd_opts_zone_overlap = '--allow-zone-overlap'
} else {
$server_install_cmd_opts_zone_overlap = ''
}
if $set_no_dnssec {
$server_install_cmd_opts_dnssec_validation = '--no-dnssec-validation'
} else {
$server_install_cmd_opts_dnssec_validation = ''
}
if $enable_hostname {
$server_install_cmd_opts_hostname = "--hostname=${ipa_server_name}"
} else {
$server_install_cmd_opts_hostname = ''
}
if $configure_dns {
$server_install_cmd_opts_setup_dns = '--setup-dns'
} else {
$server_install_cmd_opts_setup_dns = ''
}
if $config_replica_ca {
$server_install_cmd_opts_setup_ca = '--setup-ca'
} else {
$server_install_cmd_opts_setup_ca = ''
}
if $configure_ntp {
$server_install_cmd_opts_no_ntp = ''
} else {
$server_install_cmd_opts_no_ntp = '--no-ntp'
}
if $configure_dns {
if size($dns_forwarders) > 0 {
$server_install_cmd_opts_forwarders = join(prefix($dns_forwarders, '--forwarder '), ' ')
}
else {
$server_install_cmd_opts_forwarders = '--no-forwarders'
}
}
else {
$server_install_cmd_opts_forwarders = ''
}
if $set_no_ui_redirect {
$server_install_cmd_opts_no_ui_redirect = '--no-ui-redirect'
} else {
$server_install_cmd_opts_no_ui_redirect = ''
}
if $make_homedir {
$server_install_cmd_opts_mkhomedir = '--mkhomedir'
} else {
$server_install_cmd_opts_mkhomedir = ''
}
# This will install either the master or replica IPA server depending on role.
if $ipa_role == 'master' {
contain ipa::install::server::master
} elsif $ipa_role == 'replica' {
contain ipa::install::server::replica
}
# This will set the SSL protocols to use.
service { 'httpd':
ensure => running,
enable => true,
}
# harden the SSL ciphers and protocols for Apache using the NSS module
$nss_ssl_ciphers = join($ipa::nss_ssl_ciphers, ',')
$nss_ssl_protocols = join($ipa::nss_ssl_protocols, ',')
if $nss_ssl_ciphers != undef and !$nss_ssl_ciphers.empty() {
file_line { 'nss_ssl_cipher':
path => '/etc/httpd/conf.d/nss.conf',
match => '^NSSCipherSuite',
line => "NSSCipherSuite ${nss_ssl_ciphers}",
notify => Service['httpd'],
}
}
if $nss_ssl_protocols != undef and !$nss_ssl_protocols.empty() {
file_line { 'nss_ssl_protocols':
path => '/etc/httpd/conf.d/nss.conf',
match => '^NSSProtocol',
line => "NSSProtocol ${nss_ssl_protocols}",
notify => Service['httpd'],
}
}
# Configure PKI (Dogtag) certificate server
contain ipa::install::server::pki
# Configure directory server parameters.
contain ipa::install::server::dirsrv
## This will restart ipa services if any are detected as stopped after install.
if $facts['ipa_role'] == 'master' or $facts['ipa_role'] == 'replica' {
exec { 'start_ipa_services':
command => 'ipactl restart',
path => ['/bin', '/sbin', '/usr/sbin'],
onlyif => 'grep "STOPPED" <<< $(ipactl status 2>/dev/null)',
logoutput => 'on_failure',
}
}
}
|