Add swap on host

This commit is contained in:
nemunaire 2024-11-13 08:44:38 +01:00
parent 93404eab2d
commit d582f7ae62

View File

@ -317,6 +317,12 @@ write_files:
permissions: 0o755
runcmd:
- dd if=/dev/zero of=/swap count=2M status=progress
- chmod 0600 /swap
- mkswap /swap
- echo "/swap none swap sw 0 0" >> /etc/fstab
- swapon -a
# Allow traffic in IPv4
- sed -i '/-A INPUT -j REJECT/i-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT\n-A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT' /etc/iptables/rules.v4
- iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT