Your first returner

Go ahead and open up salt/returners/local.py. There's not much in here, but what we're interested in is the returner() function. It's very, very small:

def returner(ret):
    '''
    Print the return data to the terminal to verify functionality
    '''
    print(ret)

In fact, all it does is accept return data as ret, and then print it to the console. It doesn't even attempt any sort of pretty printing; it just dumps it as is.

This is in fact the bare minimum that a returner needs: a returner() function that accepts a dictionary, and then does something with it. Let's go ahead and create our own returner, which stores job information locally in JSON format.

''' Store return data locally in JSON format This file should be saved as salt/returners/local_json.py ...

Get Extending SaltStack now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.