Commit 61224e85 authored by Fabien Combernous's avatar Fabien Combernous

Merge branch '43-remove-string-facts-like-osfamily' into 'master'

Resolve "remove string facts like $::osfamily"

Closes #43

See merge request !48
parents 036330cf 92f2d5fb
...@@ -6,15 +6,17 @@ ...@@ -6,15 +6,17 @@
define freeipa::helpers::flushcache { define freeipa::helpers::flushcache {
#TODO: nscd should be called on both platforms. #TODO: nscd should be called on both platforms.
if $::osfamily == 'RedHat' { case $facts['os']['family'] {
$ipa_fluch_cache_cmd = "\ 'RedHat': {
$ipa_fluch_cache_cmd = "\
if [ -x /usr/sbin/sss_cache ]; then \ if [ -x /usr/sbin/sss_cache ]; then \
/usr/sbin/sss_cache -UGNA >/dev/null 2>&1 ; \ /usr/sbin/sss_cache -UGNA >/dev/null 2>&1 ; \
else \ else \
/usr/bin/find /var/lib/sss/db -type f -exec rm -f \"{}\" ; ; \ /usr/bin/find /var/lib/sss/db -type f -exec rm -f \"{}\" ; ; \
fi" fi"
} elsif $::osfamily == 'Debian' { }
$ipa_fluch_cache_cmd = "\ 'Debian': {
$ipa_fluch_cache_cmd = "\
if [ -x /usr/sbin/nscd ]; then \ if [ -x /usr/sbin/nscd ]; then \
/usr/sbin/nscd -i passwd -i group -i netgroup -i automount >/dev/null 2>&1 ; \ /usr/sbin/nscd -i passwd -i group -i netgroup -i automount >/dev/null 2>&1 ; \
elif [ -x /usr/sbin/sss_cache ]; then \ elif [ -x /usr/sbin/sss_cache ]; then \
...@@ -22,8 +24,10 @@ elif [ -x /usr/sbin/sss_cache ]; then \ ...@@ -22,8 +24,10 @@ elif [ -x /usr/sbin/sss_cache ]; then \
else \ else \
/usr/bin/find /var/lib/sss/db -type f -exec rm -f \"{}\" ; ; \ /usr/bin/find /var/lib/sss/db -type f -exec rm -f \"{}\" ; ; \
fi" fi"
} else { }
fail('The class freeipa::flushcache is only written for RedHat and Debian.') default: {
fail('The class freeipa::flushcache is only written for RedHat and Debian.')
}
} }
exec { "ipa_flushcache_${title}": exec { "ipa_flushcache_${title}":
......
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