Skip to content

Instantly share code, notes, and snippets.

Last login: Fri Oct 10 12:45:38 on ttys003
justinhennessy@Justins-MacBook-Pro:~/code/ansible-aws(master) $ traceroute 54.85.205.202
traceroute to 54.85.205.202 (54.85.205.202), 64 hops max, 52 byte packets
1 10.28.0.1 (10.28.0.1) 2.541 ms 3.042 ms 4.498 ms
2 59.167.218.236 (59.167.218.236) 2.021 ms 1.915 ms 1.787 ms
3 pos0-3-0.cor1.bne1.on.ii.net (150.101.180.118) 225.713 ms 225.563 ms 225.516 ms
4 xe-0-0-1.cr1.bne4.on.ii.net (150.101.34.10) 225.626 ms 225.877 ms 225.555 ms
5 ae1.br1.syd4.on.ii.net (150.101.33.18) 288.450 ms 225.471 ms 225.573 ms
6 te0-1-1-2.br2.lax1.on.ii.net (203.16.213.190) 225.730 ms 225.633 ms 225.700 ms
7 te0-1-0.bdr1.iad1.on.ii.net (203.16.213.186) 224.855 ms 225.008 ms 224.974 ms
@justinhennessy
justinhennessy / gist:28e82c2ec05f9081786a
Last active April 29, 2021 23:13
Parsing JSON with Ansible ...

Recently, Everyday Hero has been doing a heap of work around the automation and provisioning of resources with AWS cloud services. This entails working frequently with the AWS API.

A useful filter we have been using in Ansible is taking output from a shell action and turning it into something we can consume via variables.

An example playbook is below:

@justinhennessy
justinhennessy / gist:85a7092c3b32766e7cbe
Last active August 29, 2015 14:07
Using the bastion box ...

SSH config for production bastion box

Host bastion_production
  Hostname bastion.everydayhero.io
  User ubuntu
  IdentityFile ~/.ssh/deis.pem

SSH to the box ssh bastion_production

core@ip-10-21-3-110 ~ $ docker run deis/controller:v0.12.0 cat /app/deis/__init__.py
"""
The Deis main package, including the top-level URLs, Django project
settings, and WSGI setup. Most application domain-specific code lives in
the api, provider, cm, and web Django apps.
"""
from __future__ import absolute_import
__version__ = '0.12.0'
core@ip-10-21-3-110 ~ $ etcdctl ls / --recursive
/deis
/deis/controller
/deis/controller/secretKey
/deis/controller/builderKey
/deis/controller/registrationEnabled
/deis/controller/webEnabled
/deis/controller/protocol
/deis/domains
/deis/registry
ubuntu@ip-10-21-4-188:~$ fleetctl cat deis-controller@1
[Unit]
Description=deis-controller
[email protected]
[email protected]
[Service]
EnvironmentFile=/etc/environment
TimeoutStartSec=20m
ExecStartPre=/bin/sh -c "echo Waiting for deis-logger to start... ; until docker inspect deis-logger >/dev/null 2>&1; do sleep 2; done"
@justinhennessy
justinhennessy / gist:3c4d8fa956935beecd49
Last active August 29, 2015 14:06
The importantce of the inspect and adaption cycle

The importance of the inspect and adaption cycle

Here at Everyday Hero we pride ourselves on our ability as an engineering team to continually improve not only our engineering practices but also our planning, testing, and communication.

Recently we performed an operation on one of our primary databases. This involved creating a new slave database for our backups and other read only services, promoting the current slave to be the primary as it had more resources available to it, then decommission the old master.

Module

# == Class: sdiff
#
# This class adds a wrapper for the diff command puppet uses.
# It introduces the ability to suppress diff output, useful for encrypted data.
#
# This module requires changes to the puppet.conf file that is on the agents,
# suggest under the [main] section.
@justinhennessy
justinhennessy / gist:9404571
Last active August 29, 2015 13:57
cdiff module

Module

# == Class: sdiff
#
# This class adds a wrapper for the diff command puppet uses.
# It introduces the ability to suppress diff output, useful for encrypted data.
#
# This module requires changes to the puppet.conf file that is on the agents,
# suggest under the [main] section.

Should the hiera call be done like this:

apps::cron { 'braintree-initiate_settlement':
     app_name => $app_name,
     app_root => $app_root,
     time => hiera('braintree::cron::initiate_settlement'),
     rake => true,
   }