Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
node app.js
cd (path to client)
ionic serve
minion_watchdog:
cloud.absent:
- tgt: {{ grains['id'] }}
- unless:
- cmd.run: /tmp/uptime_test
require:
- file: /tmp/uptime_test
/tmp/uptime_test:
file.managed:
----------
ID: minion_watchdog
Function: cloud.absent
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1563, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/dist-packages/salt/states/cloud.py", line 181, in absent
if retcode(unless) == 0:
File "/usr/lib/python2.7/dist-packages/salt/modules/cmdmod.py", line 1099, in retcode
#!/usr/bin/env python
import salt.config
import salt.cloud.CloudClient as client
import salt.loader
__opts__ salt.config.minion_config('/etc/salt/minion')
__grains__ = salt.loader.grains(__opts__)
minion_name = __grains__['id']
#!/usr/bin/env python
'''
This function gathers the grains uptime_minutes and assigns it to uptime_grain, if uptime_grain is more than 7 minutes,
it will destroy the instance given by instance name provided by grains ID.
'''
import salt.config
import salt.cloud.CloudClient as client
import salt.loader
#!/usr/bin/env python
'''
This function gathers the grains uptime_minutes and assigns it to uptime_grain, if uptime_grain is more than 7 minutes,
it will destroy the instance given by instance name provided by grains ID.
'''
import salt.config
import salt.cloud.CloudClient as client
import salt.loader
'''
This function gathers the grains uptime_minutes and assigns it to uptime_grain, if uptime_grain is more than 7 minutes,
it will destroy the instance given by instance name provided by grains ID.
'''
import salt.cloud.CloudClient as client
def __virtual__():
'''
Only for machines running more than 7 minutes
'''
This function gathers the grains uptime_minutes and assigns it to uptime_grain, if uptime_grain is more than 7 minutes,
it will destroy the instance given by instance name provided by grains ID.
'''
import salt.cloud.CloudClient as client
def __virtual__():
'''
Only for machines running more than 7 minutes
'''
This function gathers the grains uptime_minutes and assigns it to uptime_grain, if uptime_grain is more than 7 minutes,
it will destroy the instance given by instance name provided by grains ID.
'''
import salt.cloud.CloudClient as client
def __virtual__():
'''
'''
This function gathers the grains uptime_minutes and assigns it to uptime_grain, if uptime_grain is more than 7 minutes,
it will destroy the instance given by instance name provided by grains ID.
'''
def __virtual__():
'''
Only for machines running more than 7 minutes
'''
# return 'checkhighstate' if __grains__['uptime_minutes'] > 7 else False