A quick start example:
Create a python file actor.py:
from leapp.actor import actorize
@actorize(
name='demo-actor',
description='A demo actor to show the simplicity how to create an actor',
inputs={'a_name': 'String'},
outputs={'a_message', 'String'},
tags=('demo', 'example')
)
def demo_actor_fun(channels):
for message in channels.a_name:
channels.a_message.push({'value': 'Greetings {}'.format(message['value'])})
$ python actor.py --dump-yaml > _actor.yaml
Note: This assumes you have your inputs stored in a inputs.json file
$ cat input.json | python actor.py --leapp-run
Note: This assumes you have your inputs stored in a inputs.json file Important: inputs.json must be the first argument to comply with the ansible non native module contract
$ python actor.py inputs.json --ansible-run