Add swap on host

This commit is contained in:
nemunaire 2024-11-13 08:43:24 +01:00
parent eead51f7b5
commit e8e448d4f4

View File

@ -112,6 +112,12 @@ write_files:
path: /etc/syslog-ng/syslog-ng.conf path: /etc/syslog-ng/syslog-ng.conf
runcmd: 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 # 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\n-A INPUT -p tcp -m state --state NEW -m tcp --dport 8443 -j ACCEPT\n-A INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT\n-A INPUT -p tcp -m state --state NEW -m tcp --dport 2375 -j ACCEPT\n-A INPUT -p tcp -m state --state NEW -m tcp --match multiport --dports 23000:23030 -j ACCEPT' /etc/iptables/rules.v4 - 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\n-A INPUT -p tcp -m state --state NEW -m tcp --dport 8443 -j ACCEPT\n-A INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT\n-A INPUT -p tcp -m state --state NEW -m tcp --dport 2375 -j ACCEPT\n-A INPUT -p tcp -m state --state NEW -m tcp --match multiport --dports 23000:23030 -j ACCEPT' /etc/iptables/rules.v4
- iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --match multiport --dports 23000:23030 -j ACCEPT - iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --match multiport --dports 23000:23030 -j ACCEPT