I use remote exec to keep my dependencies down. I prefer shell scripts over ansible because I want a sysadmin to be able to easily see what commands are run on the remote system. I work hard to move complexity into my terraform as much as possible so that my scripts are simple. My goal is for my scripts to be a simple list of commands rather than a program.