diff --git a/cdist/conf/type/__hostname/explorer/hostname_file b/cdist/conf/type/__hostname/explorer/hostname_file index ed28c8a8..6a00aa9f 100755 --- a/cdist/conf/type/__hostname/explorer/hostname_file +++ b/cdist/conf/type/__hostname/explorer/hostname_file @@ -21,6 +21,10 @@ # Retrieve the contents of /etc/hostname # +# Almost any distribution if [ -f /etc/hostname ]; then cat /etc/hostname +# SuSE +elif [ -f /etc/HOSTNAME ]; then + cat /etc/HOSTNAME fi diff --git a/cdist/conf/type/__hostname/gencode-remote b/cdist/conf/type/__hostname/gencode-remote index eec3bc9f..576f80bf 100755 --- a/cdist/conf/type/__hostname/gencode-remote +++ b/cdist/conf/type/__hostname/gencode-remote @@ -28,14 +28,14 @@ fi os=$(cat "$__global/explorer/os") name_running=$(cat "$__global/explorer/hostname") name_config=$(cat "$__object/explorer/hostname_file") -name_sysconfig=$(cat "$__object/explorer/hostname_file") +name_sysconfig=$(cat "$__object/explorer/hostname_sysconfig") has_hostnamectl=$(cat "$__object/explorer/has_hostnamectl") ################################################################################ # If everything is ok -> exit # case "$os" in - archlinux|debian|ubuntu) + archlinux|debian|suse|ubuntu) if [ "$name_config" = "$name_should" -a "$name_running" = "$name_should" ]; then exit 0 fi @@ -45,6 +45,10 @@ case "$os" in exit 0 fi ;; + *) + echo "Unsupported os: $os" >&2 + exit 1 + ;; esac ################################################################################ @@ -63,5 +67,9 @@ else centos) echo "hostname '$name_should'" ;; + suse) + echo "hostname '$name_should'" + echo "printf '%s\n' '$name_should' > /etc/HOSTNAME" + ;; esac fi diff --git a/cdist/conf/type/__hostname/manifest b/cdist/conf/type/__hostname/manifest index b6985c1c..448e56da 100755 --- a/cdist/conf/type/__hostname/manifest +++ b/cdist/conf/type/__hostname/manifest @@ -34,7 +34,7 @@ not_supported() { } case "$os" in - archlinux|debian|ubuntu) + archlinux|debian|suse|ubuntu) # handled in gencode-remote : ;; diff --git a/cdist/conf/type/__locale/manifest b/cdist/conf/type/__locale/manifest index f3d75d59..ac953662 100644 --- a/cdist/conf/type/__locale/manifest +++ b/cdist/conf/type/__locale/manifest @@ -29,6 +29,9 @@ case "$os" in # Debian needs a seperate package __package locales --state present ;; + suse) + : + ;; *) echo "Sorry, do not know how to handle os: $os" >&2 echo "Please edit the type ${__type##*/} to fix this." >&2 diff --git a/docs/changelog b/docs/changelog index c6f9b242..26bc688d 100644 --- a/docs/changelog +++ b/docs/changelog @@ -7,8 +7,9 @@ Changelog 3.1.6: * Type __package_yum: Support retrieving package via URL - * Type __timezone: Support SuSE * Type __hostname: Support SuSE and have CentOS use sysconfig value + * Type __locale: Support SuSE + * Type __timezone: Support SuSE 3.1.5: 2014-05-05 * Type __zypper_repo: Automatically import gpg keys (Daniel Heule)