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
heat_template_version: newton | |
parameters: | |
one: | |
type: string | |
default: one | |
two: | |
type: string | |
default: two |
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
# | |
# Sample vpn file for example.com. | |
# get tls-remote from the configuration source | |
# | |
client | |
dev tun | |
proto tcp | |
remote vpn.example.com 443 | |
ca myca.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
#!/usr/bin/env python | |
"""Print a set of mysql query to flush expired tokens. | |
Splits the deletion in 30 minutes chunks to reduce lock duration on MariaDB. | |
BEWARE: relies on the machine current timestamp to pick the right value for current_date. | |
""" | |
from datetime import datetime | |
from datetime import timedelta | |
from subprocess import check_output |
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 | |
""" | |
Download a stack and recreate the generating source | |
into a given folder. | |
""" | |
from subprocess import Popen, PIPE | |
from shlex import split |
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
require 'yaml' | |
require 'open-uri' | |
def traverse(obj, parent, &blk) | |
case obj | |
when Hash | |
# Forget keys because I don't know what to do with them | |
obj.each {|k,v| traverse(v, k, &blk) } | |
when Array |
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
heat_template_version: newton | |
resources: | |
a_file: | |
type: OS::Heat::SoftwareConfig | |
properties: | |
group: script | |
config: {get_file: "https://google.com/robots.txt"} |
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
- hosts: masters | |
vars: | |
etcd_data: /var/lib/etcd | |
etcd_bak: /var/lib/etcd.{{ansible_date_time.epoch}} | |
tasks: | |
- name: Check etcd process | |
shell: | | |
pgrep -fa etcd | |
- name: Check etcd health |
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
[rpolli@rpolli tmp]$ cat reinit-etcd.sh | |
alias ecc='etcdctl --cert-file=/etc/etcd/peer.crt --key-file=/etc/etcd/peer.key --ca-file=/etc/etcd/ca.crt -C "https://192.168.0.16:2380,https://192.168.0.18:2380,https://192.168.0.17:2380" ' | |
echo "restore backup" | |
rm /var/lib/etcd/member/ -fr | |
tar xf /tmp/etcd-backup.tar.bz --strip-components=3 -C /var/lib/etcd | |
chcon -R --reference /var/lib/etcd_ori_1501018211 /var/lib/etcd | |
chown -R etcd:etcd /var/lib/etcd | |
echo "force restart etcd" |
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
stack_trace(){ | |
openstack stack resource list -n10 \ | |
-c resource_name \ | |
-c resource_status \ | |
-c stack_name \ | |
-c updated_time ${1:-$STACK_NAME} | egrep 'PROG|FAIL' | |
} |
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
heat_template_version: newton | |
parameters: | |
items: | |
type: comma_delimited_list | |
default: | |
- antani-12 | |
- antani-12-openshift-xas31fsad | |
- antani-12-openshift-xas31fsad-foobar |