Sha256: fc6a59544ea70615e1bfbb1697c60363f3c9356fc0eb3d9ca47dd12c4155e269

Contents?: true

Size: 1.27 KB

Versions: 25

Compression:

Stored size: 1.27 KB

Contents

set -x
set -e

export DEBIAN_FRONTEND="noninteractive"

# Update APT and ensure our required packages are installed
apt-get -y update
<% %w(lxc apparmor bridge-utils debootstrap yum iptables iptables-persistent ntpdate ntp pbzip2).each do |package| -%>
dpkg --status <%= package %> &> /dev/null || apt-get -y install <%= package %>
<% end -%>

# Ensure the default lxc networking services are off
service lxc-net stop || (service lxc-net start ; service lxc-net stop)
echo "manual" | tee /etc/init/lxc-net.override

# Ensure NTP services are enabled and running
service ntp restart || service ntp start

# Enable IPv4 forwarding
sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/' /etc/sysctl.conf
sysctl -w net.ipv4.ip_forward=1

# Install an iptable NAT rule

if ! iptables -t nat -v --list | grep "MASQUERADE"; then
  iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
  iptables-save | tee /etc/iptables/rules.v4
fi

grep 'mount fstype=nfs,' /etc/apparmor.d/abstractions/lxc/container-base || cat <<EOF | tee -a /etc/apparmor.d/abstractions/lxc/container-base
  mount fstype=nfs,
EOF

grep 'mount fstype=rpc_pipefs,' /etc/apparmor.d/abstractions/lxc/container-base || cat <<EOF | tee -a /etc/apparmor.d/abstractions/lxc/container-base
  mount fstype=rpc_pipefs,
EOF

service apparmor reload

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
testlab-1.16.0 lib/testlab/provisioners/templates/raring/provision.erb
testlab-1.15.1 lib/testlab/provisioners/templates/raring/provision.erb
testlab-1.15.0 lib/testlab/provisioners/templates/raring/provision.erb
testlab-1.14.0 lib/testlab/provisioners/templates/raring/provision.erb
testlab-1.13.0 lib/testlab/provisioners/templates/raring/provision.erb
testlab-1.12.0 lib/testlab/provisioners/templates/raring/provision.erb
testlab-1.11.7 lib/testlab/provisioners/templates/raring/provision.erb
testlab-1.11.6 lib/testlab/provisioners/templates/raring/provision.erb
testlab-1.11.5 lib/testlab/provisioners/templates/raring/provision.erb
testlab-1.11.4 lib/testlab/provisioners/templates/raring/provision.erb
testlab-1.11.3 lib/testlab/provisioners/templates/raring/provision.erb
testlab-1.11.2 lib/testlab/provisioners/templates/raring/provision.erb
testlab-1.11.1 lib/testlab/provisioners/templates/raring/provision.erb
testlab-1.11.0 lib/testlab/provisioners/templates/raring/provision.erb
testlab-1.10.0 lib/testlab/provisioners/templates/raring/provision.erb
testlab-1.9.2 lib/testlab/provisioners/templates/raring/provision.erb
testlab-1.9.1 lib/testlab/provisioners/templates/raring/provision.erb
testlab-1.9.0 lib/testlab/provisioners/templates/raring/provision.erb
testlab-1.8.5 lib/testlab/provisioners/templates/raring/provision.erb
testlab-1.8.4 lib/testlab/provisioners/templates/raring/provision.erb