forked from ungleich-public/cdist
		
	[__hostname] Extend os switches with RedHat-derivatives (CentOS, Fedora, RedHat, Scientific)
This commit is contained in:
		
					parent
					
						
							
								d43eb5b22f
							
						
					
				
			
			
				commit
				
					
						77210c349e
					
				
			
		
					 3 changed files with 5 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -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)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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'"
 | 
			
		||||
    ;;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 '=' \
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue