export __cdist_local_base_dir in cdist-deploy-to for others
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								3ab8f8d964
							
						
					
				
			
			
				commit
				
					
						1ed0b6d474
					
				
			
		
					 3 changed files with 7 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -30,6 +30,9 @@ __cdist_target_host="$1"
 | 
			
		|||
# Make target host available for non-core
 | 
			
		||||
export $__cdist_name_var_target_host="$__cdist_target_host"
 | 
			
		||||
 | 
			
		||||
# Export variables for core, which others do not reset
 | 
			
		||||
export __cdist_local_base_dir
 | 
			
		||||
 | 
			
		||||
################################################################################
 | 
			
		||||
# See cdist-stages(7)
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -41,6 +41,7 @@ if ! $(echo "$destination" | grep -q ^/); then
 | 
			
		|||
fi
 | 
			
		||||
 | 
			
		||||
# Copy source if existing
 | 
			
		||||
# FIXME: directory handling not supported - add recursive flag?
 | 
			
		||||
if [ -f "$__object/parameter/source" ]; then
 | 
			
		||||
   source="$(cat "$__object/parameter/source")"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -59,7 +60,6 @@ if [ -f "$__object/parameter/source" ]; then
 | 
			
		|||
      # Probably describe it in cdist-quickstart...
 | 
			
		||||
      scp "$source" "root@${__target_host}:${destination}"
 | 
			
		||||
   fi
 | 
			
		||||
 | 
			
		||||
# No source? Create empty file/dir
 | 
			
		||||
else
 | 
			
		||||
   case "$type" in
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,6 +22,8 @@
 | 
			
		|||
destination=/etc/issue
 | 
			
		||||
os="$(cat "out/explorer/os")"
 | 
			
		||||
 | 
			
		||||
set -x
 | 
			
		||||
 | 
			
		||||
case "$os" in
 | 
			
		||||
   archlinux)
 | 
			
		||||
      source="$__type/files/archlinux"
 | 
			
		||||
| 
						 | 
				
			
			@ -32,4 +34,4 @@ case "$os" in
 | 
			
		|||
esac
 | 
			
		||||
 | 
			
		||||
# FIXME: replace id with $destination post-1.0
 | 
			
		||||
__file etc-issue --source "$source" --destination "$destination" --type file
 | 
			
		||||
__file "$destination" --source "$source" --type file
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue