forked from ungleich-public/cdist
__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"
|
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
|
||||||
|
|
|
@ -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
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
state
|
||||||
owner
|
owner
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
state
|
|
Loading…
Reference in a new issue