Add check for the state parameter in manifest.

This only allow following cases:
  - present
  - absent
else, it will abort with an error message.
remotes/origin/beta
Matthias Stecher 5 years ago
parent e5d86ffc93
commit a761d4842c
  1. 9
      cdist/conf/type/__cron/manifest

@ -22,3 +22,12 @@ if [ -f "$__object/parameter/raw" ] && [ -f "$__object/parameter/raw_command" ];
echo "ERROR: both raw and raw_command specified" >&2
exit 1
fi
case "$(cat "$__object/parameter/state" 2>/dev/null || echo "present")" in
present) ;;
absent) ;;
*)
echo "ERROR: unkown cron state" >&2
exit 2
esac

Loading…
Cancel
Save