Running a script or job across all builders
There are several options to perform tasks in a build environment, ranging from basic scripts to configuration management tools such as Ansible, Puppet, and Chef, among others. There are also troubleshooting provisioners such as breakpoint
, where you tell Packer to pause in case you need to inspect something during a build. First, let’s cover the basics of the shell
provisioner. Most tasks can generally be done with shell actions. Similar to the file
provisioner, there are three main options to specify what you would like to run, as follows:
inline
: Raw list of strings you would like to run as a scriptscript
: Path to a single script you would like to runscripts
: List of paths to scripts you would like to run
Take an example where we would like to update an Ubuntu environment and install an app with apt
. This can be done inline with two lines. Remember that HCL is tolerant of hanging commas in lists such as...