This file contains 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
#!/usr/bin/python | |
""" | |
Script to migrate marathon tasks from the host going for maintenance | |
optional arguments: | |
-h, --help show this help message and exit | |
--url URL Marathon URL (http://marathon.example.com) | |
--hosts HOSTS Hosts going to go for maintenance |
This file contains 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
(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 { |
This file contains 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
; -*- 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"}) |
This file contains 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
{ | |
"dataSources" : { | |
"riemann" : { | |
"spec" : { | |
"dataSchema" : { | |
"dataSource" : "riemann", | |
"parser" : { | |
"type" : "string", | |
"parseSpec" : { | |
"timestampSpec" : { |
This file contains 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
{ | |
"id": "python-webapp", | |
"cmd": "python3 -m http.server 8080", | |
"cpus": 0.1, | |
"mem": 64.0, | |
"instances": 2, | |
"container": { | |
"type": "DOCKER", | |
"docker": { | |
"image": "python:3", |
This file contains 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
{ | |
"id": "nginx", | |
"cpus": 0.1, | |
"mem": 64.0, | |
"instances": 1, | |
"container": { | |
"type": "DOCKER", | |
"docker": { | |
"image": "million12/nginx", | |
"network": "BRIDGE", |
This file contains 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
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" { |
This file contains 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
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)}" |
This file contains 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
--- | |
- 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 |
This file contains 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
--- | |
- 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 |