forked from ungleich-public/cdist
__process: make --state optional
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
parent
bc4af64a75
commit
135499f120
4 changed files with 8 additions and 6 deletions
|
@ -25,7 +25,12 @@ else
|
||||||
name="$__object_id"
|
name="$__object_id"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
state_should="$(cat "$__object/parameter/state")"
|
parameter_state="$__object/parameter/state"
|
||||||
|
if [ -f "$_parameter_state" ]; then
|
||||||
|
state_should=(cat "$__object/parameter/state")
|
||||||
|
else
|
||||||
|
state_should="present"
|
||||||
|
fi
|
||||||
|
|
||||||
runs="$(cat "$__object/explorer/runs")"
|
runs="$(cat "$__object/explorer/runs")"
|
||||||
if [ "$runs" ]; then
|
if [ "$runs" ]; then
|
||||||
|
|
|
@ -13,14 +13,11 @@ DESCRIPTION
|
||||||
This cdist type allows you to define the state of a process.
|
This cdist type allows you to define the state of a process.
|
||||||
|
|
||||||
|
|
||||||
REQUIRED PARAMETERS
|
OPTIONAL PARAMETERS
|
||||||
-------------------
|
-------------------
|
||||||
state::
|
state::
|
||||||
Either "present" or "absent", defaults to "present"
|
Either "present" or "absent", defaults to "present"
|
||||||
|
|
||||||
|
|
||||||
OPTIONAL PARAMETERS
|
|
||||||
-------------------
|
|
||||||
name::
|
name::
|
||||||
Process name to match on when using pgrep -f -x.
|
Process name to match on when using pgrep -f -x.
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
name
|
name
|
||||||
stop
|
stop
|
||||||
start
|
start
|
||||||
|
state
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
state
|
|
Loading…
Reference in a new issue