forked from ungleich-public/cdist
		
	Make state parameter optional for all types, fixes #131
This commit is contained in:
		
					parent
					
						
							
								4cca593071
							
						
					
				
			
			
				commit
				
					
						423001b702
					
				
			
		
					 19 changed files with 15 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -16,7 +16,7 @@ This type is used on *BSD systems to manage the pf firewall's ruleset.
 | 
			
		|||
REQUIRED PARAMETERS
 | 
			
		||||
-------------------
 | 
			
		||||
state::
 | 
			
		||||
   Either "absent" (no ruleset at all) or "present"
 | 
			
		||||
   Either "absent" (no ruleset at all) or "present", defaults to "present".
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
OPTIONAL PARAMETERS
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										1
									
								
								cdist/conf/type/__pf_ruleset/parameter/default/state
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								cdist/conf/type/__pf_ruleset/parameter/default/state
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
present
 | 
			
		||||
| 
						 | 
				
			
			@ -1 +1,2 @@
 | 
			
		|||
source
 | 
			
		||||
state
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,8 +19,7 @@
 | 
			
		|||
#
 | 
			
		||||
 | 
			
		||||
name="$__object_id"
 | 
			
		||||
state_should="present"
 | 
			
		||||
[ -f "$__object/parameter/state" ] && state_should="$(cat "$__object/parameter/state")"
 | 
			
		||||
state_should="$(cat "$__object/parameter/state")"
 | 
			
		||||
state_is="$(cat "$__object/explorer/state")"
 | 
			
		||||
 | 
			
		||||
if [ "$state_should" != "$state_is" ]; then
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,7 +16,7 @@ This cdist type allows you to create or drop postgres databases.
 | 
			
		|||
OPTIONAL PARAMETERS
 | 
			
		||||
-------------------
 | 
			
		||||
state::
 | 
			
		||||
   either 'present' or 'absent'
 | 
			
		||||
   either 'present' or 'absent', defaults to 'present'.
 | 
			
		||||
 | 
			
		||||
owner::
 | 
			
		||||
   the role owning this database
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
present
 | 
			
		||||
| 
						 | 
				
			
			@ -20,8 +20,7 @@
 | 
			
		|||
 | 
			
		||||
name="$__object_id"
 | 
			
		||||
state_is="$(cat "$__object/explorer/state")"
 | 
			
		||||
state_should="present"
 | 
			
		||||
[ -f "$__object/parameter/state" ] && state_should="$(cat "$__object/parameter/state")"
 | 
			
		||||
state_should="$(cat "$__object/parameter/state")"
 | 
			
		||||
 | 
			
		||||
[ "$state_is" = "$state_should" ] && exit 0
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										1
									
								
								cdist/conf/type/__postgres_role/parameter/default/state
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								cdist/conf/type/__postgres_role/parameter/default/state
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
present
 | 
			
		||||
| 
						 | 
				
			
			@ -16,7 +16,7 @@ RVM is the Ruby enVironment Manager for the Ruby programming language.
 | 
			
		|||
REQUIRED PARAMETERS
 | 
			
		||||
-------------------
 | 
			
		||||
state::
 | 
			
		||||
    Either "present" or "absent".
 | 
			
		||||
    Either "present" or "absent", defaults to "present".
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
EXAMPLES
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										1
									
								
								cdist/conf/type/__rvm/parameter/default/state
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								cdist/conf/type/__rvm/parameter/default/state
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
present
 | 
			
		||||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ REQUIRED PARAMETERS
 | 
			
		|||
user::
 | 
			
		||||
    The remote user account to use
 | 
			
		||||
state::
 | 
			
		||||
    Either "present" or "absent".
 | 
			
		||||
    Either "present" or "absent", defaults to "present".
 | 
			
		||||
 | 
			
		||||
BOOLEAN PARAMETERS
 | 
			
		||||
-------------------
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										1
									
								
								cdist/conf/type/__rvm_gemset/parameter/default/state
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								cdist/conf/type/__rvm_gemset/parameter/default/state
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
present
 | 
			
		||||
| 
						 | 
				
			
			@ -1,2 +1 @@
 | 
			
		|||
state
 | 
			
		||||
user
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ REQUIRED PARAMETERS
 | 
			
		|||
user::
 | 
			
		||||
    The remote user account to use
 | 
			
		||||
state::
 | 
			
		||||
    Either "present" or "absent".
 | 
			
		||||
    Either "present" or "absent", defaults to "present".
 | 
			
		||||
 | 
			
		||||
BOOLEAN PARAMETERS
 | 
			
		||||
------------------
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										1
									
								
								cdist/conf/type/__rvm_ruby/parameter/default/state
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								cdist/conf/type/__rvm_ruby/parameter/default/state
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
present
 | 
			
		||||
							
								
								
									
										1
									
								
								cdist/conf/type/__rvm_ruby/parameter/optional
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								cdist/conf/type/__rvm_ruby/parameter/optional
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
state
 | 
			
		||||
| 
						 | 
				
			
			@ -1,2 +1 @@
 | 
			
		|||
state
 | 
			
		||||
user
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue