Try2 to make cdist honor the manifest order,
this implementation has some more lines of code, but no collision with the require variable.
This commit is contained in:
		
					parent
					
						
							
								824381e6ca
							
						
					
				
			
			
				commit
				
					
						61aec12ba1
					
				
			
		
					 2 changed files with 38 additions and 20 deletions
				
			
		| 
						 | 
				
			
			@ -128,18 +128,30 @@ All objects that are created in a type manifest are automatically required
 | 
			
		|||
from the type that is calling them. This is called "autorequirement" in
 | 
			
		||||
cdist jargon.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
EXECUTE_TYPES_IN_CREATION_ORDER is a EXPERIMENTAL FEATURE !
 | 
			
		||||
You can tell cdist to execute all types in the order in which they are created 
 | 
			
		||||
in the manifest by setting require to the special value of 
 | 
			
		||||
"CDIST_HONOR_MANIFEST_ORDER".
 | 
			
		||||
in the manifest by exporting EXECUTE_TYPES_IN_CREATION_ORDER with the value true.
 | 
			
		||||
 | 
			
		||||
--------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
# Tells cdist to execute all types in the order in which they are created ...
 | 
			
		||||
export require="CDIST_HONOR_MANIFEST_ORDER"
 | 
			
		||||
export EXECUTE_TYPES_IN_CREATION_ORDER=true
 | 
			
		||||
__sample_type 1
 | 
			
		||||
__sample_type 2
 | 
			
		||||
require="__some_type_somewhere/id" __sample_type 2
 | 
			
		||||
__example_type 23
 | 
			
		||||
# Now this types are executed in the creation order
 | 
			
		||||
# Now this types are executed in the creation order until the variable is unset
 | 
			
		||||
unset EXECUTE_TYPES_IN_CREATION_ORDER
 | 
			
		||||
# all now following types cdist makes the order ..
 | 
			
		||||
__not_in_order_type 42
 | 
			
		||||
 | 
			
		||||
# how it works :
 | 
			
		||||
# this lines above are translated to:
 | 
			
		||||
__sample_type 1
 | 
			
		||||
require="__some_type_somewhere/id __sample_type/1" __sample_type 2
 | 
			
		||||
require="__sample_type/2" __example_type 23
 | 
			
		||||
__not_in_order_type 42
 | 
			
		||||
 | 
			
		||||
--------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue