__postgres_database: make state parameter optional
This commit is contained in:
		
					parent
					
						
							
								1846175135
							
						
					
				
			
			
				commit
				
					
						90f7ec40fe
					
				
			
		
					 4 changed files with 5 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -19,7 +19,8 @@
 | 
			
		|||
#
 | 
			
		||||
 | 
			
		||||
name="$__object_id"
 | 
			
		||||
state_should="$(cat "$__object/parameter/state")"
 | 
			
		||||
state_should="present"
 | 
			
		||||
[ -f "$__object/parameter/state" ] && state_should="$(cat "$__object/parameter/state")"
 | 
			
		||||
state_is="$(cat "$__object/explorer/state")"
 | 
			
		||||
 | 
			
		||||
if [ "$state_should" != "$state_is" ]; then
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,14 +13,11 @@ DESCRIPTION
 | 
			
		|||
This cdist type allows you to create or drop postgres databases.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
REQUIRED PARAMETERS
 | 
			
		||||
OPTIONAL PARAMETERS
 | 
			
		||||
-------------------
 | 
			
		||||
state::
 | 
			
		||||
   either 'present' or 'absent'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
OPTIONAL PARAMETERS
 | 
			
		||||
-------------------
 | 
			
		||||
owner::
 | 
			
		||||
   the role owning this database
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -29,7 +26,7 @@ EXAMPLES
 | 
			
		|||
--------
 | 
			
		||||
 | 
			
		||||
--------------------------------------------------------------------------------
 | 
			
		||||
__postgres_database mydbname --state present --owner mydbusername
 | 
			
		||||
__postgres_database mydbname --owner mydbusername
 | 
			
		||||
--------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1 +1,2 @@
 | 
			
		|||
state
 | 
			
		||||
owner
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1 +0,0 @@
 | 
			
		|||
state
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue