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
all: | |
systems: | |
- name: private_ip | |
required: false | |
peer_exposed: true | |
applied_scopes: | |
- host | |
- name: private_fqdn | |
required: false |
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
type: map | |
mapping: | |
name: | |
type: str | |
length: { min: 1, max: 35 } | |
required: yes | |
pattern: /^(?=.*[a-zA-Z])([^\s]+)$/ | |
version: | |
type: str | |
length: { min: 1, max: 35 } |
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 -tt | |
from Composer import Composer | |
import yaml | |
import os | |
from sys import exit | |
if __name__ == '__main__': | |
from optparse import OptionParser |
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
#!/bin/bash | |
# requires root effective permissions | |
if [[ "$(id -u)" -ne 0 ]]; then | |
echo "Error: $0 must execute as root." | |
exit 1 | |
fi | |
# create list of active kernel modules | |
lsmod | awk '$3 > 0 && NR > 1 {print $1}' > module.lst |
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: check if avahi installed | |
command: rpm -q avahi | |
register: avahi_service | |
changed_when: no | |
failed_when: no | |
tags: | |
- dnsmasq | |
- name: disable avahi-daemon |
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
PS1="\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w\n$ \[\033[00m\]" |
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
consul exec whoami | awk '$1 != "==>" && $2 { sub(/^[ \t]+/, ""); print }' |
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
#!/bin/bash | |
PREFIX="centos" | |
STATUS="ACTIVE" | |
INSTANCES="$(nova list | awk -v status="$STATUS" '$6 == status { print $4 }')" | |
for INSTANCE in $INSTANCES; do | |
IMAGE="$(nova show "$INSTANCE" | awk -v prefix=$PREFIX '$2 == "image" && $4 ~ "^"prefix { print $4 }')" | |
echo "$INSTANCE" "$IMAGE" | |
done |
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
docker ps | awk '$1 != "CONTAINER" { n++ }; END { print n+0 }' |
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: test if grub configured for noop i/o scheduler | |
command: egrep -q 'elevator=noop' /boot/grub2/grub.cfg | |
register: grub | |
changed_when: no | |
failed_when: grub_test.rc == 2 | |
- name: configure grub for noop i/o scheduler | |
sudo: yes | |
command: grubby --update-kernel=ALL --args=elevator=noop |