forked from ungleich-public/cdist
		
	fix some issues in cdist-config, transfer parameters
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								dcb9900afc
							
						
					
				
			
			
				commit
				
					
						8d774ff152
					
				
			
		
					 2 changed files with 25 additions and 11 deletions
				
			
		| 
						 | 
					@ -183,24 +183,34 @@ __cdist_object_id_from_object()
 | 
				
			||||||
   echo "${1#*/}"
 | 
					   echo "${1#*/}"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
__cdist_object_param_dir()
 | 
					__cdist_object_dir()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
   echo "${__cdist_object_base_dir}/$1/$__cdist_name_parameter}"
 | 
					   echo "${__cdist_object_base_dir}/$1"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
__cdist_object_type_explorer_dir()
 | 
					__cdist_remote_object_dir()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
   echo "${__cdist_object_base_dir}/$1/${__cdist_name_explorer}"
 | 
					   echo "${__cdist_remote_out_object_base_dir}/$1"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
__cdist_remote_object_type_explorer_dir()
 | 
					__cdist_object_parameter_dir()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
   echo "${__cdist_remote_out_object_base_dir}/$1/${__cdist_name_explorer}"
 | 
					   echo "$(__cdist_object_dir "$1")/${__cdist_name_parameter}"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
__cdist_remote_object_parameter_dir()
 | 
					__cdist_remote_object_parameter_dir()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
   echo "${__cdist_remote_out_object_base_dir}/$1/${__cdist_name_parameter}"
 | 
					   echo "$(__cdist_remote_object_dir "$1")/${__cdist_name_parameter}"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					__cdist_object_type_explorer_dir()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					   echo "$(__cdist_object_dir "$1")/${__cdist_name_explorer}"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					__cdist_remote_object_type_explorer_dir()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					   echo "$(__cdist_remote_object_dir "$1")/${__cdist_name_explorer}"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Find objects, remove ./ and /MARKER
 | 
					# Find objects, remove ./ and /MARKER
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -75,17 +75,21 @@ while [ $# -gt 0 ]; do
 | 
				
			||||||
   __object_id="$(__cdist_object_id_from_object "$__object")"
 | 
					   __object_id="$(__cdist_object_id_from_object "$__object")"
 | 
				
			||||||
   __cdist_type="$(__cdist_type_from_object "$__object")"
 | 
					   __cdist_type="$(__cdist_type_from_object "$__object")"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   # Always copy object parameters (looks weired if done only for the ones with explorer)
 | 
					 | 
				
			||||||
   # Really always?
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
   # Check if type of object has >= 1 explorer
 | 
					   # Check if type of object has >= 1 explorer
 | 
				
			||||||
   has_explorer="$(__cdist_type_has_explorer "$__cdist_type")"
 | 
					   has_explorer="$(__cdist_type_has_explorer "$__cdist_type")"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   # If so, run explorers on remote side
 | 
					   # If so, run explorers on remote side
 | 
				
			||||||
   if [ "$has_explorer" ]; then
 | 
					   if [ "$has_explorer" ]; then
 | 
				
			||||||
      echo "Running explorers for $__object ..."
 | 
					      echo "Running explorers for $__object ..."
 | 
				
			||||||
 | 
					      # Copy object parameters
 | 
				
			||||||
 | 
					      cdist-dir push "$__cdist_target_host"                       \
 | 
				
			||||||
 | 
					         "$(__cdist_object_parameter_dir "$__object")"            \
 | 
				
			||||||
 | 
					         "$(__cdist_remote_object_parameter_dir "$__object")"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      # Execute explorers
 | 
				
			||||||
      cdist-run-remote "$__cdist_target_host"                     \
 | 
					      cdist-run-remote "$__cdist_target_host"                     \
 | 
				
			||||||
         "__object=\"$__object\" __object_id=\"$__object_id\""    \
 | 
					         "__object=\"$(__cdist_remote_object_dir "$__object")\""   \
 | 
				
			||||||
 | 
					         "__object_id=\"$__object_id\""                           \
 | 
				
			||||||
         cdist-remote-explorer-run                                \
 | 
					         cdist-remote-explorer-run                                \
 | 
				
			||||||
         "$__cdist_name_var_type_explorer"                        \
 | 
					         "$__cdist_name_var_type_explorer"                        \
 | 
				
			||||||
         "$(__cdist_remote_type_explorer_dir "$__cdist_type")"    \
 | 
					         "$(__cdist_remote_type_explorer_dir "$__cdist_type")"    \
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue