Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
sudo apt-get update
sudo apt-get -y install linux-image-extra-$(uname -r)
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\ > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get -y install lxc-docker
---
- name: register a local service to consul through /v1/agent endpoint
hosts: "mesoss.0"
tasks:
consul:
state: present
service_name: test-service
service_port: 8080
---
- debug: msg="{{ marathon_app | to_json }}"
- name: "launch app: {{ marathon_app.id }}"
uri: >
url="{{ marathon_url }}/v2/apps/{{ marathon_app.id }}"
method=PUT
HEADER_Content-Type="application/json"
body='{{ marathon_app | to_json }}'
status_code=200,201
resource "aws_security_group_rule" "allow_all" {
count = "${length(split(",", var.security_group_ids))}"
type = "ingress"
from_port = 0
to_port = 65535
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = "${element(split(",", var.security_group_ids), count.index)}"
variable "allow_egress_all_ids" {
default = {
sg1 = "${aws_security_group.sg1.id}"
sg2 = "${aws_security_group.sg2.id}"
sg3 = "${aws_security_group.sg3.id}"
sg4 = "${aws_security_group.sg4.id}"
}
}
resource "aws_security_group_rule" "allow_egress_all" {
{
"id": "nginx",
"cpus": 0.1,
"mem": 64.0,
"instances": 1,
"container": {
"type": "DOCKER",
"docker": {
"image": "million12/nginx",
"network": "BRIDGE",
{
"id": "python-webapp",
"cmd": "python3 -m http.server 8080",
"cpus": 0.1,
"mem": 64.0,
"instances": 2,
"container": {
"type": "DOCKER",
"docker": {
"image": "python:3",
{
"dataSources" : {
"riemann" : {
"spec" : {
"dataSchema" : {
"dataSource" : "riemann",
"parser" : {
"type" : "string",
"parseSpec" : {
"timestampSpec" : {
@pradeepchhetri
pradeepchhetri / riemann.config
Last active May 30, 2016 18:25
Sample Riemann configuration showing influxdb output
; -*- mode: clojure; -*-
; vim: filetype=clojure
(logging/init {:file "riemann.log" :console true})
(tcp-server {:tls? false
:key "test/data/tls/server.pkcs8"
:cert "test/data/tls/server.crt"
:ca-cert "test/data/tls/demoCA/cacert.pem"})
(logging/init {:file "/var/log/riemann/riemann.log"})
(let [host "0.0.0.0"]
(tcp-server {:host host})
(udp-server {:host host})
(ws-server {:host host}))
(periodically-expire 5)
(def influx {