chore: initial import from KNEL/PFVCluster@041d311 [#769]
Split per O&M lane work order. Full history: KNEL/PFVCluster. https://projects.knownelement.com/issues/769#note-4152
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
# install-dhcp.sh — installs isc-dhcp-server + Webmin on a netinfra node.
|
||||
# Does NOT start the DHCP service. Run on the target node itself.
|
||||
set -e
|
||||
|
||||
echo "=== Installing isc-dhcp-server ==="
|
||||
apt-get update -qq
|
||||
apt-get install -y isc-dhcp-server
|
||||
|
||||
echo "=== Installing Webmin ==="
|
||||
if ! dpkg -l | grep -q '^ii.*webmin'; then
|
||||
curl -fsSL https://raw.githubusercontent.com/webmin/webmin/master/webmin-setup-repo.sh -o /tmp/webmin-setup.sh
|
||||
sh /tmp/webmin-setup.sh -f
|
||||
rm -f /tmp/webmin-setup.sh
|
||||
apt-get install -y webmin
|
||||
else
|
||||
echo "Webmin already installed"
|
||||
fi
|
||||
|
||||
echo "=== Writing /etc/default/isc-dhcp-server ==="
|
||||
cat > /etc/default/isc-dhcp-server <<'EOF'
|
||||
# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)
|
||||
INTERFACESv4="ens18"
|
||||
INTERFACESv6=""
|
||||
EOF
|
||||
|
||||
echo "=== Stopping DHCP service (should not serve yet) ==="
|
||||
systemctl stop isc-dhcp-server 2>/dev/null || true
|
||||
systemctl disable isc-dhcp-server 2>/dev/null || true
|
||||
|
||||
echo "=== Done. DHCP installed but NOT started. ==="
|
||||
Reference in New Issue
Block a user