Merge "make services persistant across reboots"
This commit is contained in:
commit
b1d214dc69
@ -42,7 +42,8 @@ fi
|
|||||||
|
|
||||||
# Install basic packages known to be needed
|
# 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 \
|
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
|
if ! grep "^source.*cfg$" /etc/network/interfaces; then
|
||||||
echo 'source /etc/network/interfaces.d/*.cfg' | tee -a /etc/network/interfaces
|
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
|
# To ensure ssh checksum are always correct
|
||||||
iptables_filter_rule_add mangle 'POSTROUTING -p tcp -j CHECKSUM --checksum-fill'
|
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}"
|
# Enable partitioning of the "${DATA_DISK_DEVICE}"
|
||||||
PARTITION_HOST=${PARTITION_HOST:-false}
|
PARTITION_HOST=${PARTITION_HOST:-false}
|
||||||
if [[ "${PARTITION_HOST}" = true ]]; then
|
if [[ "${PARTITION_HOST}" = true ]]; then
|
||||||
|
@ -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
|
sed -i 's/^INTERFACES.*/INTERFACES="br-dhcp"/g' /etc/default/isc-dhcp-server
|
||||||
|
|
||||||
# Ensure the services are (re)started
|
# Ensure the services are (re)started
|
||||||
service isc-dhcp-server restart
|
systemctl enable isc-dhcp-server
|
||||||
service atftpd restart
|
systemctl enable atftpd
|
||||||
|
systemctl start isc-dhcp-server
|
||||||
|
systemctl start atftpd
|
||||||
|
|
||||||
# Create a xenial sources file for the VMs to download
|
# Create a xenial sources file for the VMs to download
|
||||||
cp -v templates/xenial-sources.list /var/www/html/xenial-sources.list
|
cp -v templates/xenial-sources.list /var/www/html/xenial-sources.list
|
||||||
|
@ -252,3 +252,4 @@ with open('haproxy_config.yml') as f:
|
|||||||
print y
|
print y
|
||||||
EOL
|
EOL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user