forked from ungleich-public/cdist
		
	consul: add http check; add new version
This commit is contained in:
		
					parent
					
						
							
								dc66d954d5
							
						
					
				
			
			
				commit
				
					
						5ec8ac90d9
					
				
			
		
					 6 changed files with 22 additions and 5 deletions
				
			
		
							
								
								
									
										1
									
								
								cdist/conf/type/__consul/files/versions/0.8.1/cksum
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								cdist/conf/type/__consul/files/versions/0.8.1/cksum
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1 @@
 | 
				
			||||||
 | 
					283033689 36101209 consul
 | 
				
			||||||
							
								
								
									
										1
									
								
								cdist/conf/type/__consul/files/versions/0.8.1/source
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								cdist/conf/type/__consul/files/versions/0.8.1/source
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1 @@
 | 
				
			||||||
 | 
					https://releases.hashicorp.com/consul/0.8.1/consul_0.8.1_linux_amd64.zip
 | 
				
			||||||
| 
						 | 
					@ -23,7 +23,7 @@
 | 
				
			||||||
os=$(cat "$__global/explorer/os")
 | 
					os=$(cat "$__global/explorer/os")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
case "$os" in
 | 
					case "$os" in
 | 
				
			||||||
   scientific|centos|redhat|ubuntu|debian|archlinux|gentoo)
 | 
					   scientific|centos|redhat|ubuntu|debian|devuan|archlinux|gentoo)
 | 
				
			||||||
      # any linux should work
 | 
					      # any linux should work
 | 
				
			||||||
      :
 | 
					      :
 | 
				
			||||||
   ;;
 | 
					   ;;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -23,7 +23,7 @@
 | 
				
			||||||
os=$(cat "$__global/explorer/os")
 | 
					os=$(cat "$__global/explorer/os")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
case "$os" in
 | 
					case "$os" in
 | 
				
			||||||
   scientific|centos|debian|redhat|ubuntu)
 | 
					   scientific|centos|debian|devuan|redhat|ubuntu)
 | 
				
			||||||
      # whitelist safeguard
 | 
					      # whitelist safeguard
 | 
				
			||||||
      :
 | 
					      :
 | 
				
			||||||
   ;;
 | 
					   ;;
 | 
				
			||||||
| 
						 | 
					@ -215,6 +215,10 @@ case "$os" in
 | 
				
			||||||
        esac
 | 
					        esac
 | 
				
			||||||
    ;;
 | 
					    ;;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    devuan)
 | 
				
			||||||
 | 
					        init_sysvinit debian
 | 
				
			||||||
 | 
					    ;;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ubuntu)
 | 
					    ubuntu)
 | 
				
			||||||
        init_upstart
 | 
					        init_upstart
 | 
				
			||||||
    ;;
 | 
					    ;;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -32,6 +32,10 @@ if [ -f "$__object/parameter/check-script" -a ! -f "$__object/parameter/check-in
 | 
				
			||||||
   echo "When using --check-script you must also define --check-interval" >&2
 | 
					   echo "When using --check-script you must also define --check-interval" >&2
 | 
				
			||||||
   exit 1
 | 
					   exit 1
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					if [ -f "$__object/parameter/check-http" -a ! -f "$__object/parameter/check-interval" ]; then
 | 
				
			||||||
 | 
					   echo "When using --check-http you must also define --check-interval" >&2
 | 
				
			||||||
 | 
					   exit 1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Generate json config file
 | 
					# Generate json config file
 | 
				
			||||||
(
 | 
					(
 | 
				
			||||||
| 
						 | 
					@ -52,6 +56,12 @@ for param in $(ls "$__object/parameter/"); do
 | 
				
			||||||
         printf '         "ttl": "%s"\n' "$(cat "$__object/parameter/check-ttl")"
 | 
					         printf '         "ttl": "%s"\n' "$(cat "$__object/parameter/check-ttl")"
 | 
				
			||||||
         printf '      }\n'
 | 
					         printf '      }\n'
 | 
				
			||||||
      ;;
 | 
					      ;;
 | 
				
			||||||
 | 
					      check-http)
 | 
				
			||||||
 | 
					         printf '     ,"check": {\n'
 | 
				
			||||||
 | 
					         printf '         "http": "%s"\n' "$(cat "$__object/parameter/check-http")"
 | 
				
			||||||
 | 
					         printf '         ,"interval": "%s"\n' "$(cat "$__object/parameter/check-interval")"
 | 
				
			||||||
 | 
					         printf '      }\n'
 | 
				
			||||||
 | 
					      ;;
 | 
				
			||||||
      tag)
 | 
					      tag)
 | 
				
			||||||
         # create json array from newline delimited file
 | 
					         # create json array from newline delimited file
 | 
				
			||||||
         tags="$(awk '{printf "\""$1"\","}' "$__object/parameter/tag")"
 | 
					         tags="$(awk '{printf "\""$1"\","}' "$__object/parameter/tag")"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,3 +1,4 @@
 | 
				
			||||||
 | 
					check-http
 | 
				
			||||||
check-interval
 | 
					check-interval
 | 
				
			||||||
check-script
 | 
					check-script
 | 
				
			||||||
check-ttl
 | 
					check-ttl
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue