Skip to content

Instantly share code, notes, and snippets.

View xiaoruiguo's full-sized avatar

xiaoruiguo xiaoruiguo

View GitHub Profile
@xiaoruiguo
xiaoruiguo / user_variables.yml
Created October 9, 2017 16:11 — forked from trumant/user_variables.yml
OpenStack-Ansible OVS sample user_variables.yml
# Ensure the openvswitch kernel module is loaded
openstack_host_specific_kernel_modules:
- name: "openvswitch"
pattern: "CONFIG_OPENVSWITCH="
group: "network_hosts"
### Neutron specific config
neutron_plugin_type: ml2.ovs
neutron_ml2_drivers_type: "flat,vlan"
@xiaoruiguo
xiaoruiguo / v13_openstack_user_config.yml
Created October 10, 2017 08:35 — forked from shane-c/v13_openstack_user_config.yml
v13_openstack_user_config.yml
---
cidr_networks:
container: 172.29.236.0/22
tunnel: 172.29.240.0/22
storage: 172.29.244.0/22
used_ips:
- "172.29.236.1,172.29.236.255"
- "172.29.240.1,172.29.240.255"
- "172.29.244.1,172.29.244.255"
@xiaoruiguo
xiaoruiguo / br-mgmt.cfg
Created October 12, 2017 12:49 — forked from trumant/br-mgmt.cfg
Sample OpenStack-Ansible /etc/network/interfaces.d/br-mgmt.cfg
# OpenStack Management network bridge
auto br-mgmt
iface br-mgmt inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports eth0
address MANAGEMENT_NETWORK_IP
netmask 255.255.255.0
gateway 192.168.1.1
@xiaoruiguo
xiaoruiguo / playbook.yml
Created October 14, 2017 10:05 — forked from hostmaster/playbook.yml
ansible playbook choose APT or YUM for package installation
- name: Install wget package (Debian based)
  action: apt pkg='wget' state=installed
  only_if: "'$ansible_pkg_mgr' == 'apt'"
 
- name: Install wget package (RedHat based)
  action: yum name='wget' state=installed
  only_if: "'$ansible_pkg_mgr' == 'yum'"
@xiaoruiguo
xiaoruiguo / ubuntu-1404-preseed
Created October 16, 2017 06:02 — forked from scottslowe/ubuntu-1404-preseed
This is a preseed file, written for Ubuntu Server 14.04.2, that provides a fully automated installation (assuming the presence of a PXE boot infrastructure and a local HTTP server to provide the installation files).
# Ubuntu Server automated installation
# by Scott Lowe (scott.lowe@scottlowe.org)
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
d-i netcfg/choose_interface select eth0
d-i netcfg/get_hostname string hostname
d-i netcfg/get_domain string domain.com
d-i netcfg/wireless_wep string
@xiaoruiguo
xiaoruiguo / liberty.ceph.yml
Created October 17, 2017 07:19 — forked from shane-c/liberty.ceph.yml
liberty.ceph.yml
---
mons_hosts:
infra01:
ip: 192.168.88.100
affinity:
ceph_mon_container: 3
osds_hosts:
object01:
ip: 192.168.88.102
@xiaoruiguo
xiaoruiguo / preseed-fragment.seed
Created October 18, 2017 05:34 — forked from lorin/preseed-fragment.seed
Automated partitioning with Ubuntu preseed
# Use LVM for partitioning
d-i partman-auto/method string lvm
# If one of the disks that are going to be automatically partitioned
# contains an old LVM configuration, the user will normally receive a
# warning. Preseed this away
d-i partman-lvm/device_remove_lvm boolean true
# And the same goes for the confirmation to write the lvm partitions.
d-i partman-lvm/confirm boolean true
# DL the src code from http://www.kernel.org/pub/linux/utils/net/iproute2/
# Ubuntu 4.0.0-1:
apt-get install -y libdb4o-cil-dev libdb-dev bison flex build-essential gcc module-init-tools
wget https://www.kernel.org/pub/linux/utils/net/iproute2/iproute2-4.1.1.tar.xz
tar xvf iproute2-4.1.1.tar.xz
cd iproute2-4.1.1
make
# This will build the new `ip` binary in the ip directory.
# Next backup your old ip binary if you want:
@xiaoruiguo
xiaoruiguo / rootfs_ubuntu_16.04_btrfs.md
Created November 1, 2017 00:52 — forked from niflostancu/rootfs_ubuntu_16.04_btrfs.md
Installing Ubuntu 16.04 on btrfs using debootstrap

Installing Ubuntu 16.04 with btrfs using debootstrap

Partition layout

First, create a GPT partition table.

  1. boot partition, label: EFI, flags: boot + ESP; size: 1GB, format to FAT32;
  2. root partition (label: root), must same size on all devices!
  3. swap partition.
@xiaoruiguo
xiaoruiguo / grafana
Created November 3, 2017 05:55 — forked from cloudnull/grafana
grafana influx sensu haproxy lb config
####### Install Grafana + InFluxDB
lxc-create -t download -n grafana -- -d ubuntu -r trusty -a amd64
cat > /var/lib/lxc/grafana/eth1.ini <<EOF
# Create a veth pair within the container
lxc.network.type = veth
# Network device within the container
lxc.network.name = eth1
# Name the veth after the container
lxc.network.veth.pair = grafa_eth1