I've been trying to automatically add UFW rules to allow SSH access during an installation of 16.04 while using a preseed file. However, none of the documented methods result in port 22 being open after the first boot.
Specifically, I've tried variations of the following lines:
ufw ufw/enable boolean true ufw ufw/allow_custom_ports string 22/tcp ufw ufw/allow_known_ports string 22/tcp ufw ufw/allow_known_ports string SSH
But none of them seemed to make a difference. Additionally, my attempts to add the rule in the post-install section failed as the iptables kernel module is not loaded, resulting in an error.
Is this possible to accomplish within the preseed file? Or should I just give up and enable the firewall on boot with a hack?