Skip to content

Instantly share code, notes, and snippets.

View benileo's full-sized avatar

Ben Irving benileo

  • Nelson, BC Canada
  • 10:26 (UTC -07:00)
View GitHub Profile
@benileo
benileo / cloud-init-success.yaml
Created June 11, 2017 18:48
Ansible, cloud init has completed successfully
- name: Ensuring that cloud init has complete.
hosts: "Enter your hosts here"
tasks:
- stat:
path: /var/lib/cloud/instance/boot-finished
register: st
- fail:
msg: "/var/lib/cloud/instance/boot-finished does not exist; Cloud init has not complete"
when: st.stat.exists == False
#cloud-config
#vim: syntax=yaml
manage_etc_hosts: localhost
fqdn: blackberry.alltree.ca
groups:
docker
swap:
#!/bin/bash -ex
AMI_ID=ami-efd0428f
PROFILE=jammin
REGION=us-west-2
USER_DATA=$(mktemp)
TYPE="t2.micro"
DRY_RUN=""
write-mime-multipart --output=$USER_DATA \
@benileo
benileo / bootstrap.sh
Created June 11, 2017 18:32
Bootstrap
#!/bin/bash
# scripts cant be started any other way. IE. not -x or -e
DOCKER_FINGERPRINT="9DC858229FC7DD38854AE2D88D81803C0EBFCD88"
DOCKER_APT_REPOSITORY="https://download.docker.com/linux/ubuntu"
APT_DEPS="awscli mysql-client"
# This is templated from vault.
cat > /home/jammin/.ssh/id_ecdsa <<- EOF
-----BEGIN EC PRIVATE KEY-----
services:
ddagent:
deploy:
mode: global
image: datadog/docker-dd-agent:latest-alpine
environment:
DD_API_KEY_FILE: /run/secrets/dd_api_key
secrets:
- source: dd_api_key
target: dd_api_key
services:
uwsgimti:
deploy:
replicas: 1
placement:
constraints:
- node.hostname == blackberry
environment:
VIRTUAL_HOST: "morethaniron.com,www.morethaniron.com"
version: '3.1'
networks:
snet:
driver: overlay
volumes:
certs:
html:
vhosts:
@benileo
benileo / contributions.go
Last active April 22, 2017 02:57
My github contributions
package main
import (
"encoding/json"
"fmt"
"html/template"
"io/ioutil"
"net/http"
"os"
"sort"
@benileo
benileo / Vagrantfile
Last active March 24, 2017 03:47
Docker swarm setup multiple VMs on localhost using vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
config.vm.define "n1" do |n1|
@benileo
benileo / Vagrantfile
Created March 24, 2017 03:45
Docker swarm setup multiple VMs on localhost using vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
config.vm.define "n1" do |n1|