Merge "make services persistant across reboots"

This commit is contained in:
Jenkins 2017-05-25 13:07:22 +00:00 committed by Gerrit Code Review
commit b1d214dc69
3 changed files with 13 additions and 4 deletions

View File

@ -42,7 +42,8 @@ fi
# Install basic packages known to be needed
apt-get update && apt-get install -y bridge-utils ifenslave libvirt-bin lvm2 openssh-server python2.7 qemu-kvm ansible virtinst virt-manager \
vlan software-properties-common python-software-properties python-netaddr ntp qemu-utils lxc1 virtualenv
vlan software-properties-common python-software-properties python-netaddr ntp qemu-utils lxc1 virtualenv \
iptables-persistent
if ! grep "^source.*cfg$" /etc/network/interfaces; then
echo 'source /etc/network/interfaces.d/*.cfg' | tee -a /etc/network/interfaces
@ -88,6 +89,11 @@ iptables_filter_rule_add mangle 'POSTROUTING -s 10.0.0.0/24 -o br-dhcp -p udp -m
# To ensure ssh checksum are always correct
iptables_filter_rule_add mangle 'POSTROUTING -p tcp -j CHECKSUM --checksum-fill'
# save the iptables rules
systemctl enable netfilter-persistent
systemctl start netfilter-persistent
invoke-rc.d netfilter-persistent save
# Enable partitioning of the "${DATA_DISK_DEVICE}"
PARTITION_HOST=${PARTITION_HOST:-false}
if [[ "${PARTITION_HOST}" = true ]]; then

View File

@ -30,8 +30,10 @@ ansible-playbook -v -i inventory create_pxeboot_server.yml --extra-vars \
sed -i 's/^INTERFACES.*/INTERFACES="br-dhcp"/g' /etc/default/isc-dhcp-server
# Ensure the services are (re)started
service isc-dhcp-server restart
service atftpd restart
systemctl enable isc-dhcp-server
systemctl enable atftpd
systemctl start isc-dhcp-server
systemctl start atftpd
# Create a xenial sources file for the VMs to download
cp -v templates/xenial-sources.list /var/www/html/xenial-sources.list

View File

@ -251,4 +251,5 @@ with open('haproxy_config.yml') as f:
if isinstance(y, int):
print y
EOL
}
}