support for centos

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
remotes/origin/no-dot-cdist
Steven Armstrong 11 years ago
parent 47c17118f6
commit 0fe6b60efc
  1. 35
      cdist/conf/type/__timezone/manifest

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# #
# 2011 Ramon Salvadó (rsalvado at gnuine dot com) # 2011 Ramon Salvadó (rsalvado at gnuine dot com)
# 2012 Steven Armstrong (steven-cdist at armstrong.cc) # 2012-2015 Steven Armstrong (steven-cdist at armstrong.cc)
# 2012 Nico Schottelius (nico-cdist at schottelius.org) # 2012 Nico Schottelius (nico-cdist at schottelius.org)
# #
# This file is part of cdist. # This file is part of cdist.
@ -24,30 +24,35 @@
timezone="$__object_id" timezone="$__object_id"
os=$(cat "$__global/explorer/os") os=$(cat "$__global/explorer/os")
package=""
case "$os" in case "$os" in
archlinux|debian|ubuntu) archlinux|debian|ubuntu)
package=tzdata __package tzdata
export require="__package/tzdata"
;; ;;
suse) suse)
package=timezone __package timezone
export require="__package/timezone"
;; ;;
freebsd) freebsd)
# whitelist
:
;;
centos)
__package tzdata --state present
export require="__package/tzdata"
__key_value ZONE \
--file /etc/sysconfig/clock \
--delimiter '=' \
--value "\"$timezone\""
;; ;;
*) *)
echo "Unsupported OS $os" >&2 echo "Your operating system ($os) is currently not supported by this type (${__type##*/})." >&2
echo "Please contribute an implementation for it if you can." >&2
exit 1 exit 1
;; ;;
esac esac
if [ ! -z "$package" ]; then __link /etc/localtime \
__package "$package" --state present --source "/usr/share/zoneinfo/${timezone}" \
require="__package/$package" __link /etc/localtime \
--source "/usr/share/zoneinfo/${timezone}" \
--type symbolic
fi
__link /etc/localtime \
--source "/usr/share/zoneinfo/${timezone}" \
--type symbolic --type symbolic

Loading…
Cancel
Save