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)
 | 
						suse)
 | 
				
			||||||
		[ -f /etc/HOSTNAME ] && cat /etc/HOSTNAME
 | 
							[ -f /etc/HOSTNAME ] && cat /etc/HOSTNAME
 | 
				
			||||||
		;;
 | 
							;;
 | 
				
			||||||
	scientific|centos)
 | 
						centos|fedora|redhat|scientific)
 | 
				
			||||||
		[ -f /etc/sysconfig/network ] && awk -F= '/^HOSTNAME=/ { print $2 }' /etc/sysconfig/network
 | 
							[ -f /etc/sysconfig/network ] && awk -F= '/^HOSTNAME=/ { print $2 }' /etc/sysconfig/network
 | 
				
			||||||
		;;
 | 
							;;
 | 
				
			||||||
	freebsd)
 | 
						freebsd)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -58,12 +58,12 @@ EOF
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Use the good old way to set the hostname. Also if hostnamectl fails.
 | 
					# Use the good old way to set the hostname. Also if hostnamectl fails.
 | 
				
			||||||
case "$os" in
 | 
					case $os in
 | 
				
			||||||
    archlinux|debian|ubuntu|devuan|centos|coreos|alpine)
 | 
					    archlinux|debian|ubuntu|devuan|coreos|alpine)
 | 
				
			||||||
        printf "printf '%%s\\\\n' '$name_should' > /etc/hostname\\n"
 | 
					        printf "printf '%%s\\\\n' '$name_should' > /etc/hostname\\n"
 | 
				
			||||||
        echo "hostname -F /etc/hostname"
 | 
					        echo "hostname -F /etc/hostname"
 | 
				
			||||||
    ;;
 | 
					    ;;
 | 
				
			||||||
    freebsd|openbsd)
 | 
					    centos|fedora|redhat|scientific|freebsd|openbsd)
 | 
				
			||||||
        # NOTE: Writing the hostname to file is done in the manifest.
 | 
					        # NOTE: Writing the hostname to file is done in the manifest.
 | 
				
			||||||
        echo "hostname '$name_should'"
 | 
					        echo "hostname '$name_should'"
 | 
				
			||||||
    ;;
 | 
					    ;;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -46,7 +46,7 @@ case "$os" in
 | 
				
			||||||
        # handled in gencode-remote
 | 
					        # handled in gencode-remote
 | 
				
			||||||
        :
 | 
					        :
 | 
				
			||||||
    ;;
 | 
					    ;;
 | 
				
			||||||
    scientific|centos)
 | 
					    centos|fedora|redhat|scientific)
 | 
				
			||||||
        __key_value sysconfig-hostname \
 | 
					        __key_value sysconfig-hostname \
 | 
				
			||||||
            --file /etc/sysconfig/network \
 | 
					            --file /etc/sysconfig/network \
 | 
				
			||||||
            --delimiter '=' \
 | 
					            --delimiter '=' \
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue