diff --git a/cdist/conf/type/__postgres_database/gencode-remote b/cdist/conf/type/__postgres_database/gencode-remote index c097efce..0ffc842a 100755 --- a/cdist/conf/type/__postgres_database/gencode-remote +++ b/cdist/conf/type/__postgres_database/gencode-remote @@ -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 diff --git a/cdist/conf/type/__postgres_database/man.text b/cdist/conf/type/__postgres_database/man.text index d01ca8f6..88259b6f 100644 --- a/cdist/conf/type/__postgres_database/man.text +++ b/cdist/conf/type/__postgres_database/man.text @@ -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 -------------------------------------------------------------------------------- diff --git a/cdist/conf/type/__postgres_database/parameter/optional b/cdist/conf/type/__postgres_database/parameter/optional index 7ee3bde8..d86b6469 100644 --- a/cdist/conf/type/__postgres_database/parameter/optional +++ b/cdist/conf/type/__postgres_database/parameter/optional @@ -1 +1,2 @@ +state owner diff --git a/cdist/conf/type/__postgres_database/parameter/required b/cdist/conf/type/__postgres_database/parameter/required deleted file mode 100644 index ff72b5c7..00000000 --- a/cdist/conf/type/__postgres_database/parameter/required +++ /dev/null @@ -1 +0,0 @@ -state