Skip to content

Instantly share code, notes, and snippets.

View scottslowe's full-sized avatar

Scott S. Lowe scottslowe

View GitHub Profile
@scottslowe
scottslowe / heat-json-example.json
Created April 30, 2014 17:22
This OpenStack Heat template creates two instances on a logical network with a logical router attached.
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Sample Heat template that spins up multiple instances and a private network (JSON)",
"Resources" : {
"heat_network_01" : {
"Type" : "OS::Neutron::Net",
"Properties" : {
"name" : "heat-network-01"
}
},
@scottslowe
scottslowe / heat-yaml-example.yml
Created May 1, 2014 16:51
This Heat template, provided in HOT format using YAML, launches a multi-instance topology using a logical network and a logical router with an uplink.
heat_template_version: 2013-05-23
description: >
A simple Heat template that spins up multiple instances and a private network (HOT template in YAML).
resources:
heat_network_01:
type: OS::Neutron::Net
properties:
admin_state_up: true
name: heat-network-01
heat_subnet_01:
@scottslowe
scottslowe / heat-dlr.yml
Created May 29, 2014 05:09
This snippet of a HOT-formatted template could be used by OpenStack Heat to create a distributed logical router.
heat_template_version: 2013-05-23
description: >
A simple Heat template to create a distributed logical router.
resources:
router0:
type: OS::Neutron::Router
properties:
admin_state_up: True
name: distributed-router
value_specs: { distributed: "True" }
@scottslowe
scottslowe / arista-veos.xml
Created August 5, 2014 02:47
This libvirt domain XML can be used to create a KVM guest for running a virtualized instance of Arista EOS (vEOS).
<domain type='kvm'>
<name>veos</name>
<memory unit='KiB'>2097152</memory>
<currentMemory unit='KiB'>2097152</currentMemory>
<vcpu placement='static'>1</vcpu>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-i440fx-1.5'>hvm</type>
@scottslowe
scottslowe / coreos-heat.yaml
Last active August 29, 2015 14:05
This YAML-formatted OpenStack Heat template can be used to deploy and configure CoreOS instances (including configuring an etcd cluster) on OpenStack.
heat_template_version: 2013-05-23
description: >
A simple Heat template to deploy CoreOS into an existing cluster.
parameters:
network_id:
type: string
label: Network ID
description: ID of existing Neutron network to use
default: <ID of Neutron network to which instances should connect>
image_id:
@scottslowe
scottslowe / nginx.service
Created August 19, 2014 16:57
This very simple systemd unit file will launch a Docker container running the Nginx web server.
[Unit]
Description=Nginx web front-end
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
ExecStartPre=/usr/bin/docker pull nginx
ExecStart=/usr/bin/docker run --rm --name nginx -p 80:80 nginx
ExecStop=/usr/bin/docker stop nginx
@scottslowe
scottslowe / nginx.1.service
Last active December 11, 2016 16:45
This systemd unit can be modified slightly (change the filename and the container name) to run multiple Docker containers across hosts in an etcd/fleet cluster.
[Unit]
Description=Nginx web front-end
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
ExecStartPre=/usr/bin/docker pull nginx
ExecStart=/usr/bin/docker run --rm --name nginx-01 -p 80:80 nginx
ExecStop=/usr/bin/docker stop nginx-01
@scottslowe
scottslowe / docker-simple.yml
Created August 22, 2014 22:32
This very simple Heat template will deploy a Nginx container onto an existing Docker host in an OpenStack environment.
heat_template_version: 2013-05-23
description: >
Heat template to deploy Docker containers to an existing host
resources:
nginx-01:
type: DockerInc::Docker::Container
properties:
image: nginx
docker_endpoint: 'tcp://192.168.1.207:2345'
@scottslowe
scottslowe / simple-example-vagrantfile
Created September 12, 2014 17:07
This is an extremely simple Vagrantfile to turn up a single Ubuntu 12.04.4 64-bit VM under VirtualBox.
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Box
config.vm.box = "ubuntu/precise64"
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box"
# Shared folders
config.vm.synced_folder ".", "/vagrant"
@scottslowe
scottslowe / coreos-cloud-config.yml
Last active August 29, 2015 14:07
This Heat template spins up three CoreOS Linux instances, configures them via cloud-init/cloud-config to create an etcd cluster and start both etcd and fleet, and configures Docker to listen on a TCP socket. It requires an existing Neutron network, an existing Glance image for CoreOS, a security group allowing the appropriate traffic, and a disc…
heat_template_version: 2013-05-23
description: >
A Heat template to add CoreOS instances to an existing network and configure them via cloud-init/cloud-config
parameters:
network_id:
type: string
label: Neutron network ID
description: ID of existing Neutron network to use
default: dd6de1d2-735e-4b94-963b-b79aae7bcf1a
image_id: