replica.pp 1.61 KB
Newer Older
1
# 
2
# @summary Installs freeipa server as replica
3
#
4 5
# @example
#   include freeipa::install::server::replica
6
class freeipa::install::server::replica {
7
  $replica_install_cmd = "/usr/sbin/ipa-replica-install \
8 9
  --principal=${freeipa::principal_usedto_joindomain} \
  --admin-password='${freeipa::password_usedto_joindomain}' \
10
  ${freeipa::install::server::server_install_cmd_opts_hostname} \
11
  --realm=${freeipa::realm} \
12 13 14 15 16 17 18
  --domain=${freeipa::domain} \
  --server=${freeipa::ipa_master_fqdn} \
  ${freeipa::install::server::server_install_cmd_opts_setup_dns} \
  ${freeipa::install::server::server_install_cmd_opts_forwarders} \
  ${freeipa::install::server::server_install_cmd_opts_ip_address} \
  ${freeipa::install::server::server_install_cmd_opts_no_ntp} \
  ${freeipa::install::server::server_install_cmd_opts_no_ui_redirect} \
19 20 21 22 23 24 25
  --unattended"

  # TODO: config-show and grep for IPA\ masters
  file { '/etc/ipa/primary':
    ensure  => 'file',
    content => 'Added by IPA Puppet module. Designates primary master. Do not remove.',
  }
26
  -> exec { "server_install_${freeipa::ipa_server_fqdn}":
27 28 29 30 31
    command   => $replica_install_cmd,
    timeout   => 0,
    unless    => '/usr/sbin/ipactl status >/dev/null 2>&1',
    creates   => '/etc/ipa/default.conf',
    logoutput => 'on_failure',
32
    notify    => Freeipa::Helpers::Flushcache["server_${freeipa::ipa_server_fqdn}"],
33 34 35 36 37 38
    before    => Service['sssd'],
  }
  -> cron { 'k5start_root':
    command => '/usr/bin/k5start -f /etc/krb5.keytab -U -o root -k /tmp/krb5cc_0 > /dev/null 2>&1',
    user    => 'root',
    minute  => '*/1',
39
    require => Package[$freeipa::kstart_package_name],
40 41 42
  }

}