From 88947d45b3a6a8496b568e0880a94afd6553bbed Mon Sep 17 00:00:00 2001 From: Dennis Camera Date: Sat, 16 Nov 2019 14:57:27 +0100 Subject: [PATCH] [__hostname] Add support for Solaris --- cdist/conf/type/__hostname/gencode-remote | 3 +++ cdist/conf/type/__hostname/manifest | 3 +++ 2 files changed, 6 insertions(+) diff --git a/cdist/conf/type/__hostname/gencode-remote b/cdist/conf/type/__hostname/gencode-remote index 4532bacf..f06ee145 100755 --- a/cdist/conf/type/__hostname/gencode-remote +++ b/cdist/conf/type/__hostname/gencode-remote @@ -72,6 +72,9 @@ in macosx) echo "scutil --set HostName '$name_should'" ;; + solaris) + echo "uname -S '$name_should'" + ;; suse) echo 'hostname -F /etc/HOSTNAME' ;; diff --git a/cdist/conf/type/__hostname/manifest b/cdist/conf/type/__hostname/manifest index 31d43264..6b26cada 100755 --- a/cdist/conf/type/__hostname/manifest +++ b/cdist/conf/type/__hostname/manifest @@ -136,6 +136,9 @@ in # and set it as the running hostname on boot. echo "$name_should" | __file /etc/HOSTNAME --source - ;; + solaris) + echo "$name_should" | __file /etc/nodename --source - + ;; suse) # We write into /etc/HOSTNAME for backwards-compatibility. Modern SuSE # has hostnamectl anyway and symlinks /etc/HOSTNAME to /etc/hostname.