Best practice for adding ImageMagick and GhostScript

I am attempting to install a plugin that generates thumbnails off of uploaded PDF’s. The server then requires ImageMagick and GhostScript. I was wondering what would be the best way to install these dependencies within the Trellis workflow aside from SSHing into the VM and installing them manually.

Trellis is just Ansible and this is exactly what Ansible does. You’d just add some simple tasks to install both those packages. Trellis’ source code contains a huge number of tasks like this. There’s probably even pre-made playbooks for those software packages. Just google ansible <package name>.