salt icon indicating copy to clipboard operation
salt copied to clipboard

Allow logging in state files

Open masonhugus opened this issue 13 years ago • 2 comments

While currently possible to template pillar data using defaults, there is no mechanism to log or prevent state compilation when a value is not set. An example might be for a Postgres install, forcing the admin to provide a pillar value for username/password before allowing the state file to compile. Could have different levels for warning vs prevent compiling.

This could be as simple as creating a salt state that does nothing but logging/error handling.

masonhugus avatar Feb 22 '13 16:02 masonhugus

Thanks for bringing this up! I'm adding this to the Approved for future release milestone.

UtahDave avatar Feb 25 '13 22:02 UtahDave

I think this can be done by passing in pillar data on the command line and using {{ pillar['mykey'] }} in the sls file so that if mykey doesn't exist state compilation will fail.

I'm going to close this issue. Please comment if more work needs to be done and we can reopen.

Thanks!

UtahDave avatar May 17 '17 22:05 UtahDave