YaleUniversity / packer-plugin-goss

Goss Provisioner for Packer
MIT License
136 stars 45 forks source link

Packer throwing error while provisioning goss during cicd. #47

Closed ranopriyo-neogy closed 3 years ago

ranopriyo-neogy commented 3 years ago

When trying to use Goss provision as below in template.json for Packer , I am getting the below error: Any thoughts / suggestions- how to fix it. TIA

Code:


{
  "variables": {
    "aws_access_key": "",
    "aws_secret_key": "",
    "token": ""
  },
  "builders": [
    {
      "type": "amazon-ebs",
      "access_key": "{{user `aws_access_key`}}",
      "secret_key": "{{user `aws_secret_key`}}",
      "token": "{{user `token`}}",
      "region": "us-east-1",
      "source_ami_filter": {
        "filters": {
          "virtualization-type": "hvm",
          "name": "amzn2-ami-hvm-2.0.*.1-x86_64-ebs",
          "root-device-type": "ebs"
        },
        "owners": [
          "amazon"
        ],
        "most_recent": true
      },
      "instance_type": "t2.micro",
      "ssh_username": "{{user `ssh_username`}}",
      "ami_name": "packer-example {{timestamp}}",
    "tags":{
    "Name": "nginx-ami-packer - {{timestamp}}"
    }
    }
  ],
  "provisioners": [
    {
      "type": "shell",
      "script": "nginx.sh" 
    },
    {
      "type": "goss",
      "tests": [
        "goss/goss.yaml"
      ]
    }
  ]
}

Error:

Tor-Ranopriyo-MBP13:packer-ami ranopriyoneogy$ packer build -var-file=vars.json template.json
Error: Failed to initialize build "amazon-ebs"

error initializing provisioner 'goss': Unknown provisioner goss

==> Wait completed after 375 microseconds

==> Builds finished but no artifacts were created.
ranopriyo-neogy commented 3 years ago

Closing this issue - Fixed it by installing correct version of packer-provisioner-goss from https://github.com/YaleUniversity/packer-provisioner-goss/releases/tag/v3.0.2 . Thanks