Commit 92f2d5fb authored by Fabien Combernous's avatar Fabien Combernous

use structured fact and case statement

parent 036330cf
......@@ -6,14 +6,16 @@
define freeipa::helpers::flushcache {
#TODO: nscd should be called on both platforms.
if $::osfamily == 'RedHat' {
case $facts['os']['family'] {
'RedHat': {
$ipa_fluch_cache_cmd = "\
if [ -x /usr/sbin/sss_cache ]; then \
/usr/sbin/sss_cache -UGNA >/dev/null 2>&1 ; \
else \
/usr/bin/find /var/lib/sss/db -type f -exec rm -f \"{}\" ; ; \
fi"
} elsif $::osfamily == 'Debian' {
}
'Debian': {
$ipa_fluch_cache_cmd = "\
if [ -x /usr/sbin/nscd ]; then \
/usr/sbin/nscd -i passwd -i group -i netgroup -i automount >/dev/null 2>&1 ; \
......@@ -22,9 +24,11 @@ elif [ -x /usr/sbin/sss_cache ]; then \
else \
/usr/bin/find /var/lib/sss/db -type f -exec rm -f \"{}\" ; ; \
fi"
} else {
}
default: {
fail('The class freeipa::flushcache is only written for RedHat and Debian.')
}
}
exec { "ipa_flushcache_${title}":
command => "/bin/bash -c ${ipa_fluch_cache_cmd}",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment