Skip to content

Instantly share code, notes, and snippets.

View odyssey4me's full-sized avatar

Jesse Pretorius odyssey4me

  • Red Hat
  • United Kingdom
View GitHub Profile
@odyssey4me
odyssey4me / gist:4c40db99f361e2176345
Created July 6, 2015 18:55
when working with ansible <v2, use this to keep your sanity
# change into the root of your repo
# resurrect the ssh_retry plugin for your sanity
mkdir -p playbooks/plugins/connection_plugins/
wget -O playbooks/plugins/connection_plugins/ssh_retry.py \
https://raw.githubusercontent.com/stackforge/os-ansible-deployment/juno/rpc_deployment/plugins/connection_plugins/ssh_retry.py
sed -i '/lookup_plugins/a \ \
# ssh_retry connection plugin \
connection_plugins = plugins/connection_plugins \
transport = ssh_retry' playbooks/ansible.cfg
# now you can execute your playbooks
@odyssey4me
odyssey4me / .vimrc
Last active January 26, 2016 22:13
" Remove old vi compatibility
set nocompatible
" Enable Syntax Highlighting
filetype on
filetype plugin on
syntax enable
set grepprg=grep\ -nH\ $*
" Use spaces instead of tabs
@odyssey4me
odyssey4me / defaults_main.yml
Last active May 13, 2016 19:19
Proposed rabbitmq defaults and vars
rabbitmq_package_url: "{{ _rabbitmq_package_url }}"
rabbitmq_package_version: "{{ _rabbitmq_package_version }}"
rabbitmq_release_version: "{{ _rabbitmq_release_version }}"
rabbitmq_package_sha256: "{{ _rabbitmq_package_sha256 }}"
rabbitmq_package_path: "{{ _rabbitmq_package_path }}"
@odyssey4me
odyssey4me / openstack_user_config.yml
Last active June 30, 2016 19:03
AZ-based deployment with OSA (just a sketch for now)
---
cidr_networks:
az1_container: 172.29.236.0/23
az1_tunnel: 172.29.238.0/23
az1_storage: 172.29.240.0/23
az2_container: 172.29.242.0/23
az2_tunnel: 172.29.244.0/23
az2_storage: 172.29.246.0/23
used_ips:
- name: Create containers via host target
hosts: localhost
tasks:
- name: Clean up previous tests
lxc_container:
name: "{{ item }}"
state: absent
with_items:
- overlayfs1
@odyssey4me
odyssey4me / 0-setup-hosts.sh
Created July 17, 2016 14:30
Testing the local and remote lxc connection plugins
# Note: This test is executed on Ubuntu Trusty
# do this on localhost (deployment host)
# ensure that there's a local ssh private key
ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa
# now make sure that the public key is in the second host's authorized_keys
# then do a test ssh connection to make sure it works, and to add the host
# to known hosts
@odyssey4me
odyssey4me / 00-setup.sh
Created August 7, 2016 21:42
Ansible lxc_container module: A bug related to logging for LXC containers
#!/bin/bash
apt-get update && \
apt-get purge -y nano && \
apt-get install -y git vim tmux fail2ban \
build-essential python2.7 python-dev \
libssl-dev libffi-dev
apt-get -t trusty-backports install -y lxc lxc-dev
0:
name: Clone the role ansible-role-requirements
tasks:
- {id: 0, name: setup, role: null, time: '0:00:02.475200'}
- {id: 1, name: Remove target directory if required, role: null, time: '0:00:02.591165'}
- {id: 2, name: Clone git repos, role: null, time: '0:01:07.587316'}
time: '0:01:12.653681'
1:
name: localhost
tasks:
@odyssey4me
odyssey4me / dns-config.sh
Last active August 17, 2016 15:50
DNS resolver config producer
#!/bin/bash
INPUTFILE=${INPUTFILE:-'/etc/resolv.conf'}
DEBUG=${DEBUG:-false}
FALLBACK_NAMESERVERS_IPV4='8.8.8.8 8.8.4.4'
FALLBACK_NAMESERVERS_IPV6='2001:4860:4860::8888 2001:4860:4860::8844'
HOST_ADDRESSES_IPV4=$(ip a | awk '/inet / {print $2}' | grep -v '^127\.' | cut -d/ -f1 | paste -d' ' -s)
HOST_ADDRESSES_IPV6=$(ip a | awk '/inet6 / {print $2}' | grep -v '^::' | cut -d/ -f1 | paste -d' ' -s)
HOST_NAMESERVERS_NOLOCAL_IPV4=$(awk '/^nameserver/ {print $2}' ${INPUTFILE} | grep -v '^127\.\|^::' | grep '\.' | paste -d' ' -s)
@odyssey4me
odyssey4me / user_variables.yml
Created August 16, 2016 19:48
OpenStack-Ansible Public SSL endpoint configuration (using haproxy SSL offloading) [newton]
---
#
# Important required settings
#
# configure the SSL certificates for haproxy
# these file paths are on the deployment host
haproxy_user_ssl_cert: /root/test1.pigeonbrawl.net_ssl.crt
haproxy_user_ssl_key: /root/test1.pigeonbrawl.net_ssl.key
haproxy_user_ssl_ca_cert: /root/test1.pigeonbrawl.net_ssl_ca-bundle.pem