Hello
Packer is an automation tool that build VM
After the OS is installed, Packer can run scripts for you.
So the question here is not really “how packer can do this…”
is “how I do I create an script that do..”
So I think the question is more suitable for a Apache Tomcat forum/mailing list more than here.
IF you have questions around how packer can run those scripts.
However from a tool point of view you can test in the meantime with an script lile
installtomcat.sh
#!/usr/bin/env bash
echo “installing and configuring tomcat”
exit 0
Thanks
Alvaro