Packs, short for package, are organization units that bundle together the various extension points that StackStorm provides. In a pack you can distribute the following:
- actions
- workflows
- rules
- sensors
- triggers
- Python
requirements.txtfiles - Additional content (think Jinja templates, Ansible playbooks, etc)
Packs are just git repos! You can either install them with the URL to the git repo
or by name from the public StackStorm exchange
In this demo we're going to install the rabbitmq pack and configure it so
we can post a message to a Queue from StackStorm.
First, install the rabbitmq pack from the public
StackStorm exchange.
st2 pack install rabbitmqCreate a queue in RabbitMQ where messages will be sent
rabbitmqadmin declare exchange name=demo type=topic durable=false
rabbitmqadmin declare queue name=demoqueue
rabbitmqadmin declare binding source=demo destination=demoqueue routing_key=demokeyst2 run rabbitmq.publish_message host=127.0.0.1 exchange=demo exchange_type=topic routing_key=demokey message="test"Read from the queue to see if our message was delivered:
rabbitmqadmin get queue=demoqueue count=99