Skip to content

Commit

Permalink
Ensure ipa-server-dns is installed
Browse files Browse the repository at this point in the history
  • Loading branch information
fn-dis committed Jun 22, 2016
1 parent ee0a7cb commit eb81e24
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
7 changes: 4 additions & 3 deletions manifests/cleanup.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
#
# Cleans up an IPA installation
define ipa::cleanup (
$svrpkg = {},
$clntpkg = {}
$svrpkg = {},
$svrdnspkg = {},
$clntpkg = {}
) {

$pkgrmcmd = $::osfamily ? {
Expand All @@ -21,7 +22,7 @@
if [ -x /usr/sbin/ipa-client-install ]; then /bin/echo | /usr/sbin/ipa-client-install --uninstall --unattended ; fi ;\
if [ -x /usr/sbin/ipa-server-install ]; then /usr/sbin/ipa-server-install --uninstall --unattended ; fi ;\
if [ -d /var/lib/pki-ca ]; then /usr/bin/pkiremove -pki_instance_root=/var/lib -pki_instance_name=pki-ca -force ; fi ;\
if [ -x ${pkgcmd} ]; then ${pkgrmcmd} ${svrpkg} ${clntpkg} krb5-server 389-ds-base 389-ds-base-libs pki-ca pki-util pki-ca certmonger pki-native-tools pki-symkey pki-setup ipa-pki-common-theme pki-selinux ipa-pki-ca-theme ipa-python ; fi ;\
if [ -x ${pkgcmd} ]; then ${pkgrmcmd} ${svrpkg} ${svrdnspkg} ${clntpkg} krb5-server 389-ds-base 389-ds-base-libs pki-ca pki-util pki-ca certmonger pki-native-tools pki-symkey pki-setup ipa-pki-common-theme pki-selinux ipa-pki-ca-theme ipa-python ; fi ;\
if [ -e /etc/openldap/ldap.conf.ipabkp ]; then /bin/cp -f /etc/openldap/ldap.conf.ipabkp /etc/openldap/ldap.conf ; fi ;\
if [ -e /etc/krb5.conf.ipabkp ]; then /bin/cp -f /etc/krb5.conf.ipabkp /etc/krb5.conf ; fi ;\
if [ -e /etc/krb5.keytab ]; then /bin/mv -f /etc/krb5.keytab /etc/krb5.keytab.puppet-ipa.cleanup ; fi ;\
Expand Down
13 changes: 12 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
# $automount = false - Controls the option to configure automounter maps in LDAP.
# $autofs = false - Controls the option to start the autofs service and install the autofs package.
# $svrpkg = 'ipa-server' - IPA server package.
# $svrdnspkg = 'ipa-server-dns' - IPA server DNS package.
# $clntpkg = 'ipa-client' - IPA client package.
# $ldaputils = true - Controls the instalation of the LDAP utilities package.
# $ldaputilspkg = 'openldap-clients' - LDAP utilities package.
Expand Down Expand Up @@ -101,6 +102,7 @@
$automount = false,
$autofs = false,
$svrpkg = 'ipa-server',
$svrdnspkg = 'ipa-server-dns',
$clntpkg = $::osfamily ? {
Debian => 'freeipa-client',
default => 'ipa-client',
Expand All @@ -116,6 +118,14 @@
@package { $ipa::svrpkg:
ensure => installed
}
if $dns == true {
@package { $ipa::svrdnspkg:
ensure => installed,
}
$pkglst=[ $ipa::svrdnspkg,$ipa::svrpkg ]
} else {
$pkglist=[$ipa::svrpkg]
}

@package { $ipa::clntpkg:
ensure => installed
Expand All @@ -142,7 +152,7 @@
@service { 'ipa':
ensure => 'running',
enable => true,
require => Package[$ipa::svrpkg]
require => Package[$pkglist],
}

if $ipa::sssd {
Expand Down Expand Up @@ -233,6 +243,7 @@
if $ipa::master {
class { 'ipa::master':
svrpkg => $ipa::svrpkg,
svrdnspkg => $ipa::svrdnspkg,
dns => $ipa::dns,
forwarders => $ipa::forwarders,
domain => downcase($ipa::domain),
Expand Down
10 changes: 8 additions & 2 deletions manifests/master.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#
class ipa::master (
$svrpkg = {},
$svrdnspkg = {},
$dns = {},
$forwarders = [],
$realm = {},
Expand Down Expand Up @@ -79,8 +80,13 @@
if $::osfamily != 'RedHat' {
fail("Cannot configure an IPA master server on ${::operatingsystem} operating systems. Must be a RedHat-like operating system.")
}
if $dns == true {
$pkglist=[$ipa::master::svrdnspkg,$ipa::master::svrpkg]
} else {
$pkglist=$ipa::master::svrpkg
}

realize Package[$ipa::master::svrpkg]
realize Package[$pkglist]

if $ipa::master::sssd {
realize Package['sssd-common']
Expand Down Expand Up @@ -133,7 +139,7 @@
ntpopt => $ipa::master::ntpopt,
extcaopt => $ipa::master::extcaopt,
idstart => $ipa::master::generated_idstart,
require => Package[$ipa::master::svrpkg]
require => Package[$pkglist],
}

if $extca {
Expand Down

0 comments on commit eb81e24

Please sign in to comment.