Whoops. Hit send too early. Continued...
On Tue, Nov 15, 2016 at 11:52 AM, Seth House <
se...@eseth.com> wrote:
> Since your custom `ldevblock.allocate` function is an execution function
Since your custom `ldevblock.allocate` function is an execution
function you should look for the `test` keyword argument that function
is called with instead of looking in __opts__. Or if it makes sense
for your workflow, you might want to create both an execution function
and a state function. The relationship between the two is roughly:
The execution function(s) do all the actual work. The state
function(s) call the execution modules in order to answer the
following questions:
* A pre-check -- does anything need to change?
* A dry-run check -- should I stop early because we're in dry-run mode?
* Alter the local system if things do need to change.
* A post-check -- what did change?
You can see a full example here:
https://docs.saltstack.com/en/latest/ref/states/writing.html#full-state-module-example