Skip to content

Instantly share code, notes, and snippets.

Mo Ali AkhterAli

Block or report user

Report or block AkhterAli

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:79b1400892d22d2d61d8
#!/bin/bash
node app.js
cd (path to client)
ionic serve
View gist:bfb43b403ea563fa8aca
minion_watchdog:
cloud.absent:
- tgt: {{ grains['id'] }}
- unless:
- cmd.run: /tmp/uptime_test
require:
- file: /tmp/uptime_test
/tmp/uptime_test:
file.managed:
View gist:ce62d02c11971bb80de0
----------
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
View gist:acbb8540172464eada0d
#!/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']
View gist:ad4ee89726b4bc9a5171
#!/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
View gist:c276f2c0e725e6ead6d6
#!/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
View gist:a62ce524abb482e4aba1
'''
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
View gist:bbeaa27426f3ced63dc8
'''
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
View gist:0fe18520bbd4e50e2600
'''
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__():
'''
View gist:4fcb930ac8f759db9de6
'''
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
You can’t perform that action at this time.