forked from ungleich-public/cdist
		
	Merge branch '__postgres_role-changes' of https://github.com/nuex/cdist
This commit is contained in:
		
				commit
				
					
						1788b343d1
					
				
			
		
					 4 changed files with 10 additions and 12 deletions
				
			
		| 
						 | 
					@ -20,14 +20,15 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
name="$__object_id"
 | 
					name="$__object_id"
 | 
				
			||||||
state_is="$(cat "$__object/explorer/state")"
 | 
					state_is="$(cat "$__object/explorer/state")"
 | 
				
			||||||
state_should="$(cat "$__object/parameter/state")"
 | 
					state_should="present"
 | 
				
			||||||
 | 
					[ -f "$__object/parameter/state" ] && state_should="$(cat "$__object/parameter/state")"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[ "$state_is" = "$state_should" ] && exit 0
 | 
					[ "$state_is" = "$state_should" ] && exit 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
case "$state_should" in
 | 
					case "$state_should" in
 | 
				
			||||||
    present)
 | 
					    present)
 | 
				
			||||||
        if [ -f "$__object/parameter/password" ]; then
 | 
					        if [ -f "$__object/parameter/password" ]; then
 | 
				
			||||||
            password="$(cat "$__object/parameter/$parameter")"
 | 
					            password="$(cat "$__object/parameter/password")"
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
        booleans=""
 | 
					        booleans=""
 | 
				
			||||||
        for boolean in login createdb createrole superuser; do
 | 
					        for boolean in login createdb createrole superuser; do
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,15 +13,12 @@ DESCRIPTION
 | 
				
			||||||
This cdist type allows you to create or drop postgres roles.
 | 
					This cdist type allows you to create or drop postgres roles.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
REQUIRED PARAMETERS
 | 
					OPTIONAL PARAMETERS
 | 
				
			||||||
-------------------
 | 
					-------------------
 | 
				
			||||||
state::
 | 
					state::
 | 
				
			||||||
    Either "present" or "absent", defaults to "present"
 | 
					    Either "present" or "absent", defaults to "present"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					All other parameters map directly to the corresponding postgres createrole
 | 
				
			||||||
OPTIONAL PARAMETERS
 | 
					 | 
				
			||||||
-------------------
 | 
					 | 
				
			||||||
All parameter map directly to the corresponding postgres createrole
 | 
					 | 
				
			||||||
parameters.
 | 
					parameters.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
password::
 | 
					password::
 | 
				
			||||||
| 
						 | 
					@ -41,13 +38,13 @@ EXAMPLES
 | 
				
			||||||
--------
 | 
					--------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--------------------------------------------------------------------------------
 | 
					--------------------------------------------------------------------------------
 | 
				
			||||||
__postgres_role myrole --state present
 | 
					__postgres_role myrole
 | 
				
			||||||
 | 
					
 | 
				
			||||||
__postgres_role myrole --state present --password 'secret'
 | 
					__postgres_role myrole --password 'secret'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
__postgres_role admin --state present --password 'very-secret' --superuser
 | 
					__postgres_role admin --password 'very-secret' --superuser
 | 
				
			||||||
 | 
					
 | 
				
			||||||
__postgres_role dbcustomer --state present --password 'bla' --createdb
 | 
					__postgres_role dbcustomer --password 'bla' --createdb
 | 
				
			||||||
--------------------------------------------------------------------------------
 | 
					--------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1 +1,2 @@
 | 
				
			||||||
 | 
					state
 | 
				
			||||||
password
 | 
					password
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1 +0,0 @@
 | 
				
			||||||
state
 | 
					 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue