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 | |
# hubot | |
# chkconfig: 345 20 80 | |
# description: hubot | |
# processname: hubot | |
# REFERENCE: http://werxltd.com/wp/2012/01/05/simple-init-d-script-template/ | |
# This script assumes you have a user called "hubot" on your system and that hubot is installed in /home/hubot |
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
{# loop thru all relevant nodes #} | |
{% for i in ansible_play_batch | sort %} | |
{# set the node name AND node vars #} | |
{% set node_name=i %} | |
{% set node_vars=hostvars[ i ] %} | |
{# define the nagios hostgroup vars associated with this node .. default to linux #} | |
{% if node_vars.nagios_hostgroups is defined %} | |
{% set node_hostgroups="linux," ~ node_vars.nagios_hostgroups %} |
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 | |
# | |
# checks for the number of AWS snapshots and allows alerts when threshold is met | |
# example usage: | |
# ./check_aws_snapshots.sh -w <integer> -c <integer> | |
### | |
### USES ANSIBLE to put AWS KEYs as VARS | |
### USES ANSIBLE to define NAGIOS REGION | |
### | |
### REQUIRES AWS CLI : https://aws.amazon.com/cli/ |
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 | |
# | |
# checks for the number of AWS AMIs and allows alerts when threshold is met | |
# example usage: | |
# ./check_aws_amis.sh -w <integer> -c <integer> | |
### | |
### USES ANSIBLE to put AWS KEYs as VARS | |
### USES ANSIBLE to define NAGIOS REGION | |
### | |
### REQUIRES AWS CLI : https://aws.amazon.com/cli/ |
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
{{!-- | |
# these are comments .. they will not be displayed | |
# i often put what the object looks like in here so i don't forget | |
{ | |
line1: ..., | |
arr1: [...], | |
obj1: { | |
obj: ... |
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
// Commands: | |
// hubot handlebar me - example of how to use handlebars | |
const logger = require("winston"); | |
const handlebars = require("handlebars"); | |
const fs = require("fs"); | |
module.exports = function(robot) { | |
// this is the controller | |
robot.respond(/handlebar me/i, function(message) { |
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
// Commands: | |
// hubot hello - replies with "world"! | |
const logger = require("winston"); | |
module.exports = function(robot) { | |
robot.respond(/hello$/i, { id: "hello" }, function(message) { | |
message.send("world!"); | |
logger.log("info", "i like to log stuff!", { yourObject: "some random data" }); | |
}); |
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
--- | |
# my custom variable file that defines where my roles and playbooks are | |
# both directories are siblings of the inventories file | |
# inventory_dir is a VAR provided to us by Ansible | |
# .... http://docs.ansible.com/ansible/playbooks_variables.html#magic-variables-and-how-to-access-information-about-other-hosts | |
roles_dir: "{{ inventory_dir | regex_replace('inventories$', 'roles') }}" | |
playbooks_dir: "{{ inventory_dir | regex_replace('inventories$', 'playbooks') }}" |
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
--- | |
# just a simple example of me using my bootstrap.yml file and re-using an action role | |
# this is nice because: 1) i can put my roles where i want to, and 2) it allows me to be as DRY as i want to be | |
- hosts: localhost | |
connection: local | |
gather_facts: False | |
become: False | |
vars_files: |