__postgres_database: make state parameter optional

This commit is contained in:
nuex 2013-06-17 12:10:19 -04:00
parent 1846175135
commit 90f7ec40fe
4 changed files with 5 additions and 7 deletions

View File

@ -19,7 +19,8 @@
# #
name="$__object_id" 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")" state_is="$(cat "$__object/explorer/state")"
if [ "$state_should" != "$state_is" ]; then if [ "$state_should" != "$state_is" ]; then

View File

@ -13,14 +13,11 @@ DESCRIPTION
This cdist type allows you to create or drop postgres databases. This cdist type allows you to create or drop postgres databases.
REQUIRED PARAMETERS OPTIONAL PARAMETERS
------------------- -------------------
state:: state::
either 'present' or 'absent' either 'present' or 'absent'
OPTIONAL PARAMETERS
-------------------
owner:: owner::
the role owning this database the role owning this database
@ -29,7 +26,7 @@ EXAMPLES
-------- --------
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
__postgres_database mydbname --state present --owner mydbusername __postgres_database mydbname --owner mydbusername
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

View File

@ -1 +1,2 @@
state
owner owner