diff --git a/cdist/conf/type/__hostname/explorer/persistent_hostname b/cdist/conf/type/__hostname/explorer/persistent_hostname index 8909ebaa..ce71d06a 100755 --- a/cdist/conf/type/__hostname/explorer/persistent_hostname +++ b/cdist/conf/type/__hostname/explorer/persistent_hostname @@ -37,7 +37,7 @@ in suse) [ -f /etc/HOSTNAME ] && cat /etc/HOSTNAME ;; - scientific|centos) + centos|fedora|redhat|scientific) [ -f /etc/sysconfig/network ] && awk -F= '/^HOSTNAME=/ { print $2 }' /etc/sysconfig/network ;; freebsd) diff --git a/cdist/conf/type/__hostname/gencode-remote b/cdist/conf/type/__hostname/gencode-remote index e7f32323..e3f1bee4 100755 --- a/cdist/conf/type/__hostname/gencode-remote +++ b/cdist/conf/type/__hostname/gencode-remote @@ -58,12 +58,12 @@ EOF fi # Use the good old way to set the hostname. Also if hostnamectl fails. -case "$os" in - archlinux|debian|ubuntu|devuan|centos|coreos|alpine) +case $os in + archlinux|debian|ubuntu|devuan|coreos|alpine) printf "printf '%%s\\\\n' '$name_should' > /etc/hostname\\n" echo "hostname -F /etc/hostname" ;; - freebsd|openbsd) + centos|fedora|redhat|scientific|freebsd|openbsd) # NOTE: Writing the hostname to file is done in the manifest. echo "hostname '$name_should'" ;; diff --git a/cdist/conf/type/__hostname/manifest b/cdist/conf/type/__hostname/manifest index b0948d24..ccd11c4e 100755 --- a/cdist/conf/type/__hostname/manifest +++ b/cdist/conf/type/__hostname/manifest @@ -46,7 +46,7 @@ case "$os" in # handled in gencode-remote : ;; - scientific|centos) + centos|fedora|redhat|scientific) __key_value sysconfig-hostname \ --file /etc/sysconfig/network \ --delimiter '=' \