YaleUniversity / packer-plugin-goss

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

[Feature Request] Add support for usage of required_plugins #58

Closed Lirt closed 8 months ago

Lirt commented 2 years ago

In new packer versions it is possible to define required plugin in packer configuration file. This eliminates need to download the plugin locally and execute manual steps to download, chmod, etc. So this simplify whole process very much and allows users to keep exact dependency version directly in repositories.

When I try to use it I use following config:

packer {
  required_version = ">= 1.7.0, < 1.8"
  required_plugins {
    goss = {
      version = "= 3.1.2"
      source  = "github.com/YaleUniversity/packer-provisioner-goss"
    }
  }
}

But it fails with this error:

$ packer init --upgrade default.pkr.hcl
Error: Invalid plugin type

  on default.pkr.hcl line 43, in packer:
  43:     goss = {
  44:       version = "= 3.0.0"
  45:       source  = "github.com/YaleUniversity/packer-provisioner-goss"
  46:     }

Plugin source "github.com/yaleuniversity/packer-provisioner-goss" has a type
with the prefix "packer-", which isn't allowed because it would be redundant to
name a Packer plugin with that prefix. If you are the author of this plugin,
rename it to not include the prefix.

It looks like the repository has to be renamed in order to allow this feature to work -- source: https://www.packer.io/docs/plugins#source-addresses.

Would it be possible to rename this repository to provide this? I think when renaming github repository, also the old name is preserved and redirected to new repository so this change is not that backwards incompatible.

Here is working example by using my fork https://github.com/Lirt/packer-plugin-goss/releases/tag/v3.1.2:

packer {
    required_version = ">= 1.7.0, < 1.8"
    required_plugins {
        goss = {
        version = "= 3.1.2"
        source  = "github.com/lirt/goss"
        }
    }
}
Lirt commented 2 years ago

Any chance to check this @fishnix ?

Lirt commented 2 years ago

Prerequisite is https://github.com/YaleUniversity/packer-provisioner-goss/pull/59

ahmedwonolo commented 1 year ago

this would be very useful!

mkarroqe commented 1 year ago

Renaming the repo would be very useful, can this change please be made?

FalcoSuessgott commented 8 months ago

This has been solved by #69