Amazon Linux does not have Git installed by default. The first provisioner step makes sure we install it. || true is used for compatibility with Ubuntu-based builder which does not have yum package manager.
Otherwise Amazon Linux will fail with:
==> amazon-linux-ami: Provisioning with shell script: /var/folders/zr/k8_fxx5d1xx56n1m758byg4r0000gn/T/packer-shell218591116
amazon-linux-ami: /tmp/script_3975.sh: line 2: git: command not found
==> amazon-linux-ami: Terminating the source AWS instance...
Amazon Linux does not have Git installed by default. The first provisioner step makes sure we install it.
|| true
is used for compatibility with Ubuntu-based builder which does not haveyum
package manager.Otherwise Amazon Linux will fail with: