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:2f94670f530dc25e3b4f
[DEV root@build22.dev salt-master]# docker run -itd salt-master:latest /bin/bash
bbf3d9b9aa7ab2248cbdc7c1a6d56798d3075f9df449e3941e7f97244b002371
[DEV root@build22.dev salt-master]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bbf3d9b9aa7a salt-master:latest "/bin/bash" 8 seconds ago Up 7 seconds dreamy_banach
9c8da598d4bd salt-master:latest "/bin/sh -c salt-mast" About a minute ago Up About a minute salt4
da8f6540f936 salt-master "/bin/sh -c salt-mast" 2 minutes ago Up 2 minutes salt3
4b311c57b7c8 salt-master "/bin/sh -c salt-mast" 3 minutes ago Up 3 minutes salt2
c3f6286f076c salt-master "/bin/sh -c salt-mast" 14 minutes ago Up 14 minutes salt
ec97c3fcdf1e salt-mi
View gist:79b1400892d22d2d61d8
#!/bin/bash
node app.js
cd (path to client)
ionic serve
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: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: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: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: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: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: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__():
'''
You can’t perform that action at this time.