This file contains hidden or 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 | |
TMPFILE=`/usr/bin/env mktemp` | |
dd count=1 bs=10M if=/dev/urandom of=$TMPFILE > /dev/null 2>&1 && md5sum $TMPFILE | awk '{print $1 }' | |
rm -f $TMPFILE |
This file contains hidden or 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
# ls is an alias for get-childitem. get-childitem also take a -recurse and other | |
# useful params, used to include or exclude file types, etc... | |
ls file*.txt | Where-Object { $_.LastWriteTime -lt (get-date).AddDays(-3)} | |
This file contains hidden or 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
In order to minimize slip-ups, we have a different inventory file for | |
each instance-environment pair, and each inventory uses a different | |
group name as well. Then there are group-vars files for each | |
instance-environment pair that set a variable so the proper playbooks | |
get run. | |
For example, here is how we have the project laid out: | |
site.yml | |
inventory/ | |
main-prod |
This file contains hidden or 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 | |
BASEDIR=`dirname $0`/.. | |
SCRIPT=`basename $0 .sh` | |
cd $BASEDIR | |
CMD=lib/logstash/bin/logstash | |
if [ -f conf/$SCRIPT ]; then | |
exec $CMD -f conf/$SCRIPT | |
fi |