forked from ungleich-public/cdist
		
	successfully implement __target_host
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								93253f7fda
							
						
					
				
			
			
				commit
				
					
						3fdb5a2e24
					
				
			
		
					 4 changed files with 10 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -28,7 +28,7 @@ set -eu
 | 
			
		|||
__cdist_target_host="$1"
 | 
			
		||||
 | 
			
		||||
# Make target host available for non-core
 | 
			
		||||
export $__cdist_name_var_target_host=\"\$__cdist_target_host\"
 | 
			
		||||
export $__cdist_name_var_target_host="$__cdist_target_host"
 | 
			
		||||
 | 
			
		||||
################################################################################
 | 
			
		||||
# See cdist-stages(7)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -24,7 +24,7 @@
 | 
			
		|||
 | 
			
		||||
. cdist-config
 | 
			
		||||
[ $# -ge 3 ] || __cdist_usage "<target host> <manifest> <out dir> [manifest arguments]"
 | 
			
		||||
set -u
 | 
			
		||||
set -ux
 | 
			
		||||
 | 
			
		||||
__cdist_target_host="$1"; shift
 | 
			
		||||
__cdist_manifest="$1"; shift
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -43,7 +43,7 @@ __cdist_my_out_dir="$1"; shift
 | 
			
		|||
__cdist_work_dir="$__cdist_remote_base_dir"
 | 
			
		||||
 | 
			
		||||
# Setup environment
 | 
			
		||||
eval export $__cdist_variable_name=\"$__cdist_explorer_dir\"
 | 
			
		||||
export $__cdist_variable_name="$__cdist_explorer_dir"
 | 
			
		||||
cd "${__cdist_work_dir}"
 | 
			
		||||
mkdir -p "$__cdist_my_out_dir"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,12 +2,18 @@
 | 
			
		|||
# This is a sample manifest, but used in real world
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
# This is debug and should not be in a production environment
 | 
			
		||||
echo "Running initial manifest for $__target_host"
 | 
			
		||||
echo "We could access other manifests in $__manifests"
 | 
			
		||||
 | 
			
		||||
set -x
 | 
			
		||||
 | 
			
		||||
# All systems get a file /etc/cdist-managed, so the sysadmin knows
 | 
			
		||||
# who manages the configuration.
 | 
			
		||||
#__file /etc/cdist-managed --type file
 | 
			
		||||
 | 
			
		||||
# All ikqs get a sample file
 | 
			
		||||
case "$__cdist_target_host" in
 | 
			
		||||
case "$__target_host" in
 | 
			
		||||
   localhost)
 | 
			
		||||
      __issue iddoesnotmatterhere
 | 
			
		||||
      __file test --type file --destination /tmp/cdist-testfile
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue