Skip to content

Instantly share code, notes, and snippets.

Avatar

Till! till

View GitHub Profile
@till
till / curl
Created Sep 27, 2020
CURL and hostnames
View curl
core@node-001 ~ $ curl --unix-socket /var/run/docker.sock http:/plugins
{"message":"page not found"}
core@node-001 ~ $ curl -V
curl 7.66.0 (x86_64-cros-linux-gnu) libcurl/7.66.0 OpenSSL/1.1.1g zlib/1.2.11
Release-Date: 2019-09-11
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: AsynchDNS GSS-API HTTPS-proxy IPv6 Kerberos Largefile libz NTLM SPNEGO SSL TLS-SRP UnixSockets
@till
till / ignition.json
Created May 27, 2020 — forked from thetechnick/ignition.json
Hetzner Cloud terraform coreos install
View ignition.json
{
"ignition": {
"version": "2.0.0",
"config": {}
},
"storage": {
},
"systemd": {},
"networkd": {},
"passwd": {
@till
till / testinfra.py
Created Nov 10, 2019
Debuggable TestInfra
View testinfra.py
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
def get_docker_services(host):
@till
till / Dockerfile.molecule
Created Nov 10, 2019
Dockerfile for Molecule
View Dockerfile.molecule
FROM quay.io/ansible/molecule:2.22
RUN apk add --update build-base
RUN pip install --upgrade pip
RUN pip install dnspython requests==2.20.1 docker docker-compose hcloud molecule[hetznercloud]
@till
till / docker-compose.yaml
Created Apr 2, 2019
Drone.io's server and agent, with supporting Minio. All with Docker-Compose/Swarm.
View docker-compose.yaml
version: '2'
services:
db:
image: mariadb:10.4
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
View docker-ip-task.yml
---
# assume this is preceeded by the docker_container module above
- name: Get container IP
set_fact:
container_ip: "{{ my_service_status.ansible_facts.docker_container.NetworkSettings.IPAddress }}"
- name: Check container
wait_for:
host: "{{ container_ip }}"
View task.yml
---
- name: Start a service without a port
docker_container:
name: service_without_port
image: whatever
...
register: my_service_status
- name: Save status
set_fact:
View metallb-config-map.yaml
apiVersion: v1
kind: ConfigMap
metadata:
namespace: metallb-system
name: config
data:
config: |
address-pools:
- name: private-network
protocol: layer2
View traefik-logrotate.conf
/var/log/traefik.log
{
compress
create 0640 root root
daily
delaycompress
missingok
notifempty
rotate 5
@till
till / backup-rancher2.x-etcd.md
Created Nov 2, 2018
Backup Single-Node (non-HA) Rancher Server 2.x
View backup-rancher2.x-etcd.md

Rancher 2.x uses etcd to store everything. If you don't know how to backup that, you loose all info on clusters, etc. as you upgrade Rancher Server.

Here's how to get passed that!

Get container ID:

$ docker ps|grep rancher/rancher
You can’t perform that action at this time.