Here is a snippet of my JSON file for packer. Pretty much running packer build example.json via adhoc - it works smoothly and builds the AMI out in AWS. When i execute this in my GitLabCI Pipeline, it fails with the following error: Errors validating build 'amazon-ebs'. 2 error(s) occurred:
- playbook_file: config.yml is invalid: stat config.yml: no such file or directory
- Error running "ansible-playbook --version": exec: "ansible-playbook": executable file not found in $PATH ERROR: Job failed: exit code 1
SNIPPET of the code below (JSON from packer).
provisioners": [{
"type": "ansible",
"user": "ubuntu",
"playbook_file": "config.yml",
"ansible_env_vars": [ "ANSIBLE_HOST_KEY_CHECKING=False", "ANSIBLE_SSH_ARGS='-o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s'"]