Skip to content

Instantly share code, notes, and snippets.

View wgebis's full-sized avatar

Wojciech Gębiś wgebis

  • Nexocode Sp. z o.o.
  • Krakow
View GitHub Profile
resource "mailgun_domain" "example_mailing_domain" {
name = "m.example.com"
spam_action = "disabled"
smtp_password = "strong_password"
}
resource "cloudflare_record" "mail-receiving-dns-entry" {
count = 2
domain = "${cloudflare_zone.my_domain_entry.zone}"
type = "${lookup(mailgun_domain.example_mailing_domain.receiving_records[count.index], "record_type")}"
resource "cloudflare_zone" "my_domain_entry" {
zone = "example.com"
}
resource "cloudflare_zone_settings_override" "my_domain_entry_config" {
name = "${cloudflare_zone.my_domain_entry.zone}"
settings {
tls_1_3 = "on"
}
}
resource "digitalocean_droplet" "my_droplet" {
name = "my_droplet_name"
image = "debian-9-x64"
region = "ams3"
size = "s-1vcpu-1gb"
private_networking = true
monitoring = false
backups = false
resize_disk = true
}
provider "digitalocean" {
token = "DO_TOKEN_GOES_HERE"
}
provider "mailgun" {
api_key = "MAILGUN_API_KEY_GOES_HERE"
}
provider "cloudflare" {
email = "CLOUDFLARE_ACCOUNT_EMAIL"
docker run \
-d \
-p 3000:3000 \
--name=grafana \
-e "GF_SERVER_ROOT_URL=http://grafana.server.name" \
-e "GF_SECURITY_ADMIN_PASSWORD=secret" \
grafana/grafana
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any time series scraped from this config.
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
- job_name: 'default_job'
static_configs:
- targets:
- localhost:9100 # node_exporter
docker run \
--volume=/:/rootfs:ro \
--volume=/var/run:/var/run:ro \
--volume=/sys:/sys:ro \
--volume=/var/lib/docker/:/var/lib/docker:ro \
--volume=/dev/disk/:/dev/disk:ro \
--publish=8080:8080 \
--detach=true \
--name=cadvisor \
google/cadvisor:latest
docker run -p 9090:9090 -v /prometheus-data \
prom/prometheus --config.file=/prometheus-data/prometheus.yml
@wgebis
wgebis / floatip-ocf
Last active March 21, 2018 20:32 — forked from thisismitch/floatip-ocf
FloatIP OCF Agent (for Pacemaker)
#!/bin/bash
meta_data() {
cat <<END
<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="foobar" version="0.1">
<version>0.1</version>
<longdesc lang="en">
floatip ocf resource agent for claiming a specified Floating IP via the DigitalOcean API</longdesc>