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
--- | |
# https://www.consul.io/docs/guides/outage.html | |
# do a rolling restart; be nice to the cluster | |
- hosts: role=control | |
serial: 1 | |
gather_facts: no | |
tasks: | |
- name: set consul maintenance enable | |
command: consul maint -enable -reason "{{ lookup('env', 'USER') }} reset consul peers" |
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/env bash | |
DOCKER_SOCK=${1:-/var/run/docker.sock} | |
THRESHOLD_GB=${THRESHOLD_GB:2} | |
if [ ! -S "${DOCKER_SOCK}" ]; then | |
echo 2>&1 "Docker socket not available at ${DOCKER_SOCK}" | |
exit 1 | |
fi |
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
# .bashrc.docker | |
# get id of last container started | |
docker-last() { docker ps -l -q ;} | |
# http://www.commandlinefu.com/commands/view/15050/attach-to-bash-shell-in-the-last-container-you-started | |
docker-exec() { docker exec -i -t $(docker-last) ${@-bash} ;} | |
# get ip of container with given id (default: last started container) | |
docker-ip() { docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${1-$(docker-last)} ;} |
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/env bash | |
mv /usr/bin/uname /usr/bin/uname-host | |
cat > /usr/bin/uname << EOF | |
#!/usr/bin/env bash | |
HOST_KERNEL=\$(uname-host -r) | |
GUEST_KERNEL=\$(repoquery --qf '%{VERSION}-%{RELEASE}.%{ARCH}' kernel) |
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/env bash | |
command -v bumpversion >/dev/null 2>&1 || { \ | |
echo >&2 "bumpversion is not installed. Install via 'pip install bumpversion'. Aborting."; \ | |
exit 1; \ | |
} | |
bumpversion $@ release | |
bumpversion --no-tag $@ minor |
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/env python | |
from sys import argv | |
from subprocess import check_output, STDOUT | |
TIMEOUT=1 | |
def ping(target): |
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/env bash | |
NFS_SERVER=${NFS_SERVER-192.168.1.1} | |
NFS_SHARE=/nfs | |
NFS_MOUNT=/media/nfs | |
cat >> /etc/fstab << EOF | |
${NFS_SERVER}:${NFS_SHARE} ${NFS_MOUNT} nfs noauto,x-systemd.automount,x-systemd.device-timeout=10,timeo=14 0 0 | |
EOF |
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
[Unit] | |
Description=Logstash | |
Documentation=https://www.elastic.co/products/logstash | |
After=network.target | |
ConditionPathExists=/etc/logstash.conf | |
[Service] | |
ExecStart=/opt/logstash/bin/logstash agent -f /etc/logstash.conf | |
[Install] |
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
# | |
# CentOS RPM Builder | |
# Usage: make build COMPONENT=</path/to/source> | |
# | |
TARGET := $(shell pwd)/target | |
COMPONENT := $(shell pwd)/sources | |
BUILDER := alectolytic/rpmbuilder-centos |
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/env bash | |
# based on instructions provided at | |
# http://www.projectatomic.io/blog/2015/06/running-cockpit-as-a-service/ | |
atomic info fedora/cockpitws | |
atomic install fedora/cockpitws | |
cat > /etc/systemd/system/cockpitws.service << EOF | |
[Unit] |