Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packer throwing error while provisioning goss during cicd. #47

Closed
ranopriyo-neogy opened this issue Mar 23, 2021 · 1 comment
Closed

Comments

@ranopriyo-neogy
Copy link

ranopriyo-neogy commented Mar 23, 2021

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant