This file contains hidden or 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
from contextlib import contextmanager | |
@contextmanager | |
def wrapper(): | |
print 'enter' | |
yield | |
print 'exit' | |
def main(): |
This file contains hidden or 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
[[local|localrc]] | |
ADMIN_PASSWORD=openstack | |
MYSQL_PASSWORD=stackdb | |
RABBIT_PASSWORD=stackqueue | |
SERVICE_PASSWORD=$ADMIN_PASSWORD | |
HOST_IP=$(ip addr show dev br-eth0 | awk '/ inet / { print $2 }' | head -1 | sed 's#/.*##g') | |
SERVICE_TOKEN=tokentoken | |
RECLONE=yes | |
DEST=/opt/stack/ | |
SERVICE_DIR=${DEST}/status |
This file contains hidden or 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 | |
sudo apt-get install debconf-utils -y | |
sudo debconf-get-selections | grep ${PACKAGE_NAME} > ${PACKAGE_NAME}.preseed | |
sudo debconf-set-selections ${PACKAGE_NAME}.preseed |
This file contains hidden or 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 | |
SUITE=${1:trusty} | |
sudo debootstrap ${SUITE} ${SUITE} | |
sed "s/suite/${SUITE}/g" sources.list | sudo tee ${SUITE}/etc/apt/sources.list | |
sudo tar -C ${SUITE} -c . | sudo docker import - ${SUITE} |
This file contains hidden or 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: set hostname | |
hostname: name={{inventory_hostname}} | |
- name: set hostname to hosts | |
lineinfile: dest=/etc/hosts regexp='.*127.0.1.1.*' line='127.0.1.1 {{inventory_hostname}}' state=present |
This file contains hidden or 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 | |
qemu-img create -b ${base_img_file_path} -f qcow2 ${new_img_file_path} |
This file contains hidden or 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 | |
wget http://releases.ubuntu.com/14.04/ubuntu-14.04-server-amd64.iso -O ubuntu-14.04-server-amd64.iso | |
qemu-img create -f qcow2 ubuntu.img 40G | |
virt-install --name ubuntu --ram=1024 --vcpus=1 --os-type=linux --hvm --virt-type=kvm --disk=ubuntu.img,format=qcow2,bus=virtio --cdrom=ubuntu-14.04-server-amd64.iso --vnc --vncport=5911 --vnclisten=127.0.0.1 --network=bridge:brex --keymap=ja |
This file contains hidden or 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 | |
mkdir host_vars | |
mkdir group_vars | |
mkdir -p roles/common/files | |
mkdir -p roles/common/handlers | |
mkdir -p roles/common/meta | |
mkdir -p roles/common/tasks | |
mkdir -p roles/common/templates |
This file contains hidden or 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 | |
sudo apt-get insltall golang | |
mkdir ~/go | |
export GOPATH=~/go | |
export PATH=${PATH};${GOPATH}/bin |
This file contains hidden or 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 | |
# this requires super user | |
cd /var/lib/docker/execdriver/native/${container_id} | |
nsinit exec /bin/bash |