The AWS Auto Scaling Goup, configured with a customised Cloud-Init file, sends a notification to an SNS Topic, which in turn passes it onto an SQS queue that the Salt Master is subscribed to. A Reactor watches for the auto scaling events and pre-approves the new minion based on its Auto Scaling group name and instance ID.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import subprocess | |
import shutil | |
from time import time | |
import argparse | |
import codecs | |
import unicodedata | |
from tempfile import gettempdir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Session = New-Object -ComObject "Microsoft.Update.Session" | |
$Searcher = $Session.CreateUpdateSearcher() | |
$Result = $Searcher.Search("IsInstalled = 0 and IsHidden = 0") | |
$Updates = $Result.Updates | |
$Total = $Updates.Count | |
$Critical = @($Updates | Where-Object {$_.MsrcSeverity -eq 'Important' -or $_.MsrcSeverity -eq 'Critical'}).Count | |
if ($Critical -gt 0) { | |
$CheckResult = 'CRITICAL' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# | |
# Save Flash videos on Linux when using Mozilla Firefox | |
# | |
# When watching Flash videos in Mozilla Firefox using the Adobe Flash player a | |
# temporary but "deleted" file is created. This file can still be accessed and | |
# copied somewhere else. This script will find all the temporary video files | |
# and save them to the current directory. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
# Original at http://hempeldesigngroup.com/embedded/stories/debian-squeeze-pxe-netboot-for-virtualbox/ | |
# | |
# ----------------------------------------------------------------------------- | |
# makePxeInstaller.sh - Make a netbootable directory that has all the IDE | |
# and sata drivers needed for a VirtualBox install | |
# | |
# Works in the current directory | |
# ----------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SaltYamlSafeLoader(yaml.SafeLoader, object): | |
def flatten_mapping(self, node): | |
merge = [] | |
index = 0 | |
while index < len(node.value): | |
key_node, value_node = node.value[index] | |
if key_node.tag == u'tag:yaml.org,2002:merge': | |
del node.value[index] | |
if isinstance(value_node, MappingNode): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mem01.xen.local: | |
---------- | |
sample1: | |
127.0.0.1/24/Contact me at | |
sample2: | |
127.0.0.1/24/Contact me at example.com | |
sample3: | |
127.0.0.1/24/Contact me at example.com 127.0.0.1 | |
sample4: | |
${sample5} 24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# 2019-03-22 Updated to be compatible with Salt 2018.3.3 | |
# Import python libs | |
import logging | |
import os.path | |
import time | |
import boto3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reactors: | |
# Run this script every time an abc instance starts | |
- 'salt/minion/abc*/start': | |
- '/srv/salt/reactors/abc/start.sls' | |
# Run this script every time an abc instance returns from a job | |
- 'salt/job/*/ret/abc*': | |
- '/srv/salt/reactors/abc/ret.sls' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Return data to an NSCA server | |
This returner requires the following individual files | |
from the https://github.com/Yelp/send_nsca repo | |
* send_nsca/nagios.py | |
* send_nsca/nsca.py | |
Place those files, and this `__init__.py` file into your | |
state returners directory, e.g.: |
OlderNewer