Skip to content

Instantly share code, notes, and snippets.

View LindsayHill's full-sized avatar

Lindsay Hill LindsayHill

View GitHub Profile
@LindsayHill
LindsayHill / st2rulesengine.gelf.json
Created November 30, 2018 22:52
Example GELF JSON log
{
"_index": "logstash-2018.11.30",
"_type": "fluentd",
"_id": "joaFZmcBe07jUK0kwUj4",
"_score": 1,
"_source": {
"version": "1.1",
"level": 6,
"timestamp": 1543613230,
"_trigger_instance": {
version: 1.0
description: >
A sample workflow that demonstrates how to handle rollback and retry on error. In this example,
the workflow will loop until the file /tmp/done exists. A parallel task will wait for some time
before creating the file. When completed, /tmp/done will be deleted.
vars:
- file: /tmp/<% str(random(1000000, 9999999)) %>
2018-02-14 15:10:05,594 paramiko.transport [chan 0] Sesch channel 0 request ok
2018-02-14 15:10:05,597 paramiko.transport [chan 0] Sesch channel 0 request ok
2018-02-14 15:10:05,601 p=7298 u=extreme | 7306 1518649805.60188: Loading TerminalModule 'slxos' from /home/extreme/ansible/lib/ansible/plugins/terminal/slxos.py
2018-02-14 15:10:05,605 p=7298 u=extreme | 7306 1518649805.60551: Loading Cliconf 'slxos' from /home/extreme/ansible/lib/ansible/plugins/cliconf/slxos.py
2018-02-14 15:10:05,605 p=7298 u=extreme | -- receive -> data: ^M
--
2018-02-14 15:10:05,605 p=7298 u=extreme | -- _find_prompt -> response: ^M
--
2018-02-14 15:10:05,669 p=7298 u=extreme | -- receive -> data: ^M
SECURITY WARNING: The default password for at least^M
@LindsayHill
LindsayHill / mistral-jinja-env-var.yaml
Last active February 27, 2017 19:05
Mistral Jinja example
version: '2.0'
examples.mistral-jinja-env-var:
description: A basic workflow that illustrates how to get the workflow's env vars.
type: direct
output:
env: "{{ env() }}"
url: "{{ _.url }}"
tasks:
task1:
vagrant@chatops:~$ st2
action --api-url --auth-url --debug --help policy-type rule-enforcement sensor trigger --version
action-alias --api-version --cacert execution key --print-config run --skip-config trigger-instance webhook
apikey auth --config-file -h policy rule runner trace --url
vagrant@chatops:~$ st2 execution
cancel get -h --help list re-run
vagrant@chatops:~$ st2 execution list
+----------------------------+-----------------------+--------------+-------------------------+------------------------------+-------------------------------+
| id | action.ref | context.user | status | start_timestamp | end_timestamp |
+----------------------------+-----------------------+--------------+----
sudo service st2chatops restart
export HUBOT_NAME=stanley
export HUBOT_SLACK_TOKEN=xoxb-5187818172-I7wLh4oqzhAScwXZtPcHyxCu
# Configure Hubot to use Slack
sed -i "s~# export HUBOT_ADAPTER=slack~export HUBOT_ADAPTER=slack~" /opt/stackstorm/chatops/st2chatops.env
# Set the bot name
sed -i "s~export HUBOT_NAME=hubot~export HUBOT_NAME=${HUBOT_NAME}~" /opt/stackstorm/chatops/st2chatops.env
# Set our Slack token
export ST2_AUTH_TOKEN=`st2 auth -t st2admin -p <CHANGEME>`
curl -sSL https://stackstorm.com/packages/install.sh | bash -s -- --user=st2admin --password=<CHANGEME>