begin to move cdist-cconfig-tree to use internal variables
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								24d28b4a06
							
						
					
				
			
			
				commit
				
					
						14ea35e40f
					
				
			
		
					 1 changed files with 15 additions and 11 deletions
				
			
		| 
						 | 
					@ -18,7 +18,8 @@
 | 
				
			||||||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
 | 
					# along with cdist. If not, see <http://www.gnu.org/licenses/>.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# 
 | 
					# 
 | 
				
			||||||
# Let's build a cconfig tree from a generic configuration (example)
 | 
					# Let's build a cconfig tree from a configuration
 | 
				
			||||||
 | 
					# And save it into the cache tree
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[ $# -eq 1 ] || __cdist_usage "cconf"
 | 
					#[ $# -eq 1 ] || __cdist_usage "cconf"
 | 
				
			||||||
| 
						 | 
					@ -27,15 +28,16 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
set -au
 | 
					set -au
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# all types cdist is aware of
 | 
					cdist_tree_wrapper="$(which cdist_tree_wrapper)"
 | 
				
			||||||
export __cdist_types="file service user"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
cdist_tree_wrapper="cdist_tree_wrapper"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# used to build the tree and other stuff
 | 
					# used to build the tree and other stuff
 | 
				
			||||||
tmpdir=/tmp/cdist-test-hardcoded
 | 
					__cdist_bindir="${__cdist_tmp_dir}/bin"
 | 
				
			||||||
cdist_bindir="${tmpdir}/bin"
 | 
					
 | 
				
			||||||
cdist_confdir="${tmpdir}/conf"
 | 
					# FIXME: create cache/bin dir only once / do that in its
 | 
				
			||||||
 | 
					# own function
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Save output in cache
 | 
				
			||||||
 | 
					__cdist_output="${__cdist_cache_hosts}/${__cdist_target_host}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cdist_type_prefix="__"
 | 
					cdist_type_prefix="__"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -47,7 +49,7 @@ cdist_tree_wrapper_absdir=$(cd ${cdist_tree_wrapper%/*} && pwd -P)
 | 
				
			||||||
cdist_tree_wrapper_abs="$cdist_tree_wrapper_absdir/$cdist_tree_wrapper_name"
 | 
					cdist_tree_wrapper_abs="$cdist_tree_wrapper_absdir/$cdist_tree_wrapper_name"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
rm -rf "${tmpdir}"
 | 
					rm -rf "${__cdist_tmp_dir}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# contains cdist-tree binaries
 | 
					# contains cdist-tree binaries
 | 
				
			||||||
mkdir -p "${cdist_bindir}"
 | 
					mkdir -p "${cdist_bindir}"
 | 
				
			||||||
| 
						 | 
					@ -56,9 +58,11 @@ mkdir -p "${cdist_bindir}"
 | 
				
			||||||
# Create our binaries, will are called from the manifest - temporary
 | 
					# Create our binaries, will are called from the manifest - temporary
 | 
				
			||||||
(
 | 
					(
 | 
				
			||||||
   set -e
 | 
					   set -e
 | 
				
			||||||
   cd "${cdist_bindir}"
 | 
					   cd "${__cdist_type_dir}"
 | 
				
			||||||
   for bin in $__core_types; do
 | 
					   # FIXME: replace with redirect to file + read
 | 
				
			||||||
 | 
					   for bin in *; do
 | 
				
			||||||
      ln -s "${cdist_tree_wrapper_abs}" "${cdist_type_prefix}${bin}"
 | 
					      ln -s "${cdist_tree_wrapper_abs}" "${cdist_type_prefix}${bin}"
 | 
				
			||||||
 | 
					   cd "${cdist_bindir}"
 | 
				
			||||||
   done
 | 
					   done
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue