linode / packer-plugin-linode Goto Github PK
View Code? Open in Web Editor NEWPacker plugin for Linode Builder
Home Page: https://developer.hashicorp.com/packer/integrations/linode/linode
License: Mozilla Public License 2.0
Packer plugin for Linode Builder
Home Page: https://developer.hashicorp.com/packer/integrations/linode/linode
License: Mozilla Public License 2.0
Hi, your friend Packer maintainer here!
I am opening this issue as a follow-up to the github.com/zclconf/go-cty breaking change issue we opened on Packer Plugin SDK last year. With this upcoming release, we are starting to tackle phase 2 of this issue, with some changes compared to the original plan.
We are not going to migrate to go-plugin now, and instead introduced a way for Packer to toggle between the use of Gob or Protobuf/msgpack for all its over-the-wire communication. This change does not apply to communicators, which will continue to use gob for over-the-wire communication.
With the alpha we released last week, Packer now behaves like the following:
"protocol_version":"v2"
attribute in the returned describe
output for a plugin binary."protocol_version":"v2"
attribute is not present, Packer will fallback into compatibility mode and use Gob for communication between Packer and plugins."protocol_version":"v2"
, Protobuf/msgpack will be used for communication between Packer and plugins.This behavior can be disabled with a PACKER_FORCE_GOB
environment variable, allowing for an escape hatch if a build is blocked because of a bug in that new code that handles protobuf/msgpack serialization.
This change should be as transparent as possible for you as plugin developers, and for our users. There will however be one change to make in the plugin's code, namely updating the SDK to the upcoming 0.6.0 release. The release date of 0.6.0 has not yet been determined.
Right now, the code that manages this protobuf/msgpack logic is stored in a grpc_base
branch. Apologies for the name, it is not representative of the objective anymore.
Before we can consider releasing this version of Packer, and a version of the SDK, we'd love to get help from you.
As we move to support both protocols, we need you to perform a couple tests with your plugin to ensure we maintain compatibility for your supported configurations.
We've prepared a series of steps that we'd like you to run on your code, alongside Packer 1.12.0-alpha1, which you can get from our releases page.
Once you have Packer 1.12.0-alpha1 setup, we'd ask that try the following scenarios on templates of your choice.
Ideally, these tests should be run in a plugin directory that is not your normal one, to avoid Packer discovering plugins that force it to go into compatibility (i.e. Gob) mode.
In this scenario, you should expect Packer to use Gob for serialization, as the latest plugin is not (by our assumption) compatible with protobuf/msgpack yet. This is the baseline test, to ensure Packer 1.12.0 still works with your plugin.
If you do not have one, this will also help you get a base working template that relies solely on your plugin and, maybe, Packer's embedded components.
Note: this point is crucial as none of the existing plugin releases support both serialization formats, and so will mandate Packer to run in compatibility mode.
This scenario will require you to bump your dependency on the packer-plugin-sdk to use grpc_base
instead of a current release.
You can do this with the following commands for example:
$ go get -v github.com/hashicorp/packer-plugin-sdk@grpc_base && go mod tidy
When this is done, you can compile the plugin, and install it in your test plugin directory.
$ PACKER_PLUGIN_PATH=<test-plugin directory> packer plugins install --path compiled-plugin-binary github.com/org/name
This will need to be the highest compatible version with your plugin in order for Packer to prioritize it, and use protobuf/msgpack for communication.
In order to know for sure if Packer used protobuf for communication, you can take a peek at the verbose logs, where you should encounter a log that points to this.
$ PACKER_PLUGIN_PATH=<test-plugin directory> PACKER_LOG=1 packer build <template> 2>&1 | grep 'Using protobuf for communication with plugins'
This sample command should highlight that Packer uses the expected protocol for communicating. If the build uses Gob, this means that the logic failed, and we may need to do some troubleshooting to understand what happened. In this case please let us know by responding to this issue, and we'll be in contact to sort this out.
PACKER_FORCE_GOB=1
.As a follow-up to scenario 2, we want to ensure that the code handling the logic for switching protocols works if a fallback is requested by a user.
The overall process is similar, the only difference you can expect is that the grep
returns nothing instead of the line in the logs that reports protobuf being used.
$ PACKER_PLUGIN_PATH=<test-plugin directory> PACKER_FORCE_GOB=1 PACKER_LOG=1 packer build <template> 2>&1 | grep 'Using protobuf for communication with plugins'
This one is more of a sanity test that ensures your plugin remains compatible with older versions of Packer. If you haven't already please download the latest official Packer 1.11.2 release from the releases page. We expect this one to succeed at all times, but we'd like to be as sure as we can before we release ๐
This is overall a small update to Packer core, and hopefully a small enough change that it will be easy to roll into your codebase, which paves the way for us to later remove our dependency on @nywilken's go-cty fork down the road.
We are aiming to release this in the coming months, and we're hoping we can squash as many bugs as we can before then so this doesn't impact real-life user workflows.
Thank you for your continued support!
v1.10.2
v1.4.1
Tag which contains an equal sign are not being accepted as a valid character. Adding it via the API or web interface works without any issues.
Looks like the limitation comes from this regex -
packer-plugin-linode/builder/linode/config.go
Line 160 in 5d07271
source "linode" "example" {
image = "linode/ubuntu22.04"
image_description = "This image was created using Packer."
image_label = "test-image-${local.timestamp}"
instance_label = "temp-packer-debian-10"
instance_type = "g6-nanode-1"
linode_token = "${var.linode_api_token}"
region = "nl-ams"
ssh_username = "root"
instance_tags = ["foo=bar"]
}
Error returned
Add a tag which contains = sign
source "linode" "example" {
image = "linode/ubuntu22.04"
image_description = "This image was created using Packer."
image_label = "test-image-${local.timestamp}"
instance_label = "temp-packer-debian-10"
instance_type = "g6-nanode-1"
linode_token = "${var.linode_api_token}"
region = "nl-ams"
ssh_username = "root"
instance_tags = ["foo=bar"]
}
Error: 1 error(s) occurred:
* invalid tag: foo=bar
on linode.pkr.hcl line 1:
(source code not available)
I tried to set the ssh_private_key_file
to make sure I can use the same SSH key after setting up a Linode with NixOS. First I tried using https://www.packer.io/docs/datasources/sshkey, then I tried using my own private key but they both fail.
Build 'linode.example' errored after 838 milliseconds 558 microseconds: Error creating Linode: [400] [authorized_keys] SSH Key 1 key-type must be ssh-dss, ssh-rsa, ecdsa-sha2-nistp, or ssh-ed25519.
Use the linode example config, this still works:
locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }
source "linode" "example" {
image = "linode/debian9"
image_description = "My Private Image"
image_label = "private-image-${local.timestamp}"
instance_label = "temporary-linode-${local.timestamp}"
instance_type = "g6-nanode-1"
linode_token = "YOUR API TOKEN"
region = "us-east"
ssh_username = "root"
}
build {
sources = ["source.linode.example"]
}
Now add any private key using the ssh_private_key_file
option, as stated in the docs. Provisioning now fails.
Packer v1.7.3
packer-plugin-linode_v1.0.0_x5.0_darwin_amd64
packer {
required_plugins {
linode = {
version = ">= 0.0.1"
source = "github.com/hashicorp/linode"
}
sshkey = {
version = ">= 0.1.0"
source = "github.com/ivoronin/sshkey"
}
}
}
locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }
variable "linode_token" {
type = string
sensitive = true
}
source "linode" "example" {
image = "linode/debian9"
image_description = "NixOS"
image_label = "nixos-${local.timestamp}"
instance_label = "packer-build-${local.timestamp}"
instance_type = "g6-standard-2"
linode_token = var.linode_token
region = "us-east"
ssh_username = "root"
ssh_private_key_file = data.sshkey.install.private_key_path
}
data "sshkey" "install" {}
build {
sources = ["source.linode.example"]
}
running from MacOS (but via nix), trying to install NixOS with NIXOS_LUSTRATE on a debian 9 base.
2021/07/20 18:03:20 [INFO] Packer version: 1.7.3 [go1.16.6 darwin amd64]
2021/07/20 18:03:20 [TRACE] discovering plugins in /nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin
2021/07/20 18:03:20 [TRACE] discovering plugins in /Users/jelle/.packer.d/plugins
2021/07/20 18:03:20 [TRACE] discovering plugins in .
2021/07/20 18:03:20 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2021/07/20 18:03:20 [INFO] PACKER_CONFIG env var set; attempting to open config file: /Users/jelle/.packerconfig
2021/07/20 18:03:20 [WARN] Config file doesn't exist: /Users/jelle/.packerconfig
2021/07/20 18:03:20 [INFO] Setting cache directory: /Users/jelle/dev/projects/peertube-saas/nixos-packer/packer_cache
2021/07/20 18:03:20 [TRACE] init: plugingetter.ListInstallationsOptions{FromFolders:[]string{"/nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin/packer", ".", "/Users/jelle/.packer.d/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"darwin", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc000086480)}}}}
2021/07/20 18:03:20 [TRACE] listing potential installations for "github.com/hashicorp/linode" that match ">= 0.0.1". plugingetter.ListInstallationsOptions{FromFolders:[]string{"/nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin/packer", ".", "/Users/jelle/.packer.d/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"darwin", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc000086480)}}}}
2021/07/20 18:03:20 [TRACE] for plugin github.com/hashicorp/linode found 1 matching installation(s)
2021/07/20 18:03:20 [TRACE] listing potential installations for "github.com/ivoronin/sshkey" that match ">= 0.1.0". plugingetter.ListInstallationsOptions{FromFolders:[]string{"/nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin/packer", ".", "/Users/jelle/.packer.d/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"darwin", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc000086480)}}}}
2021/07/20 18:03:20 [TRACE] for plugin github.com/ivoronin/sshkey found 1 matching installation(s)
2021/07/20 18:03:20 [INFO] (telemetry) Finalizing.
2021/07/20 18:03:20 waiting for all plugin processes to complete...
2021/07/20 18:03:21 [INFO] Packer version: 1.7.3 [go1.16.6 darwin amd64]
2021/07/20 18:03:21 [TRACE] discovering plugins in /nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin
2021/07/20 18:03:21 [TRACE] discovering plugins in /Users/jelle/.packer.d/plugins
2021/07/20 18:03:21 [TRACE] discovering plugins in .
2021/07/20 18:03:21 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2021/07/20 18:03:21 [INFO] PACKER_CONFIG env var set; attempting to open config file: /Users/jelle/.packerconfig
2021/07/20 18:03:21 [WARN] Config file doesn't exist: /Users/jelle/.packerconfig
2021/07/20 18:03:21 [INFO] Setting cache directory: /Users/jelle/.cache/packer
2021/07/20 18:03:21 [TRACE] listing potential installations for "github.com/hashicorp/linode" that match ">= 0.0.1". plugingetter.ListInstallationsOptions{FromFolders:[]string{"/nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin/packer", ".", "/Users/jelle/.packer.d/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"darwin", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc000086600)}}}}
2021/07/20 18:03:21 [TRACE] Found the following "github.com/hashicorp/linode" installations: [{/Users/jelle/.packer.d/plugins/github.com/hashicorp/linode/packer-plugin-linode_v1.0.0_x5.0_darwin_amd64 v1.0.0}]
2021/07/20 18:03:21 [INFO] found external [-packer-default-plugin-name-] builders from linode plugin
2021/07/20 18:03:21 [TRACE] listing potential installations for "github.com/ivoronin/sshkey" that match ">= 0.1.0". plugingetter.ListInstallationsOptions{FromFolders:[]string{"/nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin/packer", ".", "/Users/jelle/.packer.d/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"darwin", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc000086600)}}}}
2021/07/20 18:03:21 [TRACE] Found the following "github.com/ivoronin/sshkey" installations: [{/Users/jelle/.packer.d/plugins/github.com/ivoronin/sshkey/packer-plugin-sshkey_v0.1.0_x5.0_darwin_amd64 v0.1.0}]
2021/07/20 18:03:21 found external [-packer-default-plugin-name-] datasource from sshkey plugin
2021/07/20 18:03:21 [TRACE] validateValue: not active for linode_token, so skipping
2021/07/20 18:03:21 [TRACE] validateValue: not active for nixos_version, so skipping
2021/07/20 18:03:21 [TRACE] Starting external plugin /Users/jelle/.packer.d/plugins/github.com/ivoronin/sshkey/packer-plugin-sshkey_v0.1.0_x5.0_darwin_amd64 start datasource -packer-default-plugin-name-
2021/07/20 18:03:21 Starting plugin: /Users/jelle/.packer.d/plugins/github.com/ivoronin/sshkey/packer-plugin-sshkey_v0.1.0_x5.0_darwin_amd64 []string{"/Users/jelle/.packer.d/plugins/github.com/ivoronin/sshkey/packer-plugin-sshkey_v0.1.0_x5.0_darwin_amd64", "start", "datasource", "-packer-default-plugin-name-"}
2021/07/20 18:03:21 Waiting for RPC address for: /Users/jelle/.packer.d/plugins/github.com/ivoronin/sshkey/packer-plugin-sshkey_v0.1.0_x5.0_darwin_amd64
2021/07/20 18:03:21 packer-plugin-sshkey_v0.1.0_x5.0_darwin_amd64 plugin: 2021/07/20 18:03:21 Plugin address: unix /tmp/packer-plugin602722078
2021/07/20 18:03:21 packer-plugin-sshkey_v0.1.0_x5.0_darwin_amd64 plugin: 2021/07/20 18:03:21 Waiting for connection...
2021/07/20 18:03:21 Received unix RPC address for /Users/jelle/.packer.d/plugins/github.com/ivoronin/sshkey/packer-plugin-sshkey_v0.1.0_x5.0_darwin_amd64: addr is /tmp/packer-plugin602722078
2021/07/20 18:03:21 packer-plugin-sshkey_v0.1.0_x5.0_darwin_amd64 plugin: 2021/07/20 18:03:21 Serving a plugin connection...
2021/07/20 18:03:21 packer-plugin-sshkey_v0.1.0_x5.0_darwin_amd64 plugin: 2021/07/20 18:03:21 [TRACE] starting datasource -packer-default-plugin-name-
2021/07/20 18:03:21 [TRACE] Starting external plugin /Users/jelle/.packer.d/plugins/github.com/hashicorp/linode/packer-plugin-linode_v1.0.0_x5.0_darwin_amd64 start builder -packer-default-plugin-name-
2021/07/20 18:03:21 Starting plugin: /Users/jelle/.packer.d/plugins/github.com/hashicorp/linode/packer-plugin-linode_v1.0.0_x5.0_darwin_amd64 []string{"/Users/jelle/.packer.d/plugins/github.com/hashicorp/linode/packer-plugin-linode_v1.0.0_x5.0_darwin_amd64", "start", "builder", "-packer-default-plugin-name-"}
2021/07/20 18:03:21 Waiting for RPC address for: /Users/jelle/.packer.d/plugins/github.com/hashicorp/linode/packer-plugin-linode_v1.0.0_x5.0_darwin_amd64
2021/07/20 18:03:21 packer-plugin-linode_v1.0.0_x5.0_darwin_amd64 plugin: 2021/07/20 18:03:21 Plugin address: unix /tmp/packer-plugin264359411
2021/07/20 18:03:21 Received unix RPC address for /Users/jelle/.packer.d/plugins/github.com/hashicorp/linode/packer-plugin-linode_v1.0.0_x5.0_darwin_amd64: addr is /tmp/packer-plugin264359411
2021/07/20 18:03:21 packer-plugin-linode_v1.0.0_x5.0_darwin_amd64 plugin: 2021/07/20 18:03:21 Waiting for connection...
2021/07/20 18:03:21 packer-plugin-linode_v1.0.0_x5.0_darwin_amd64 plugin: 2021/07/20 18:03:21 Serving a plugin connection...
2021/07/20 18:03:21 packer-plugin-linode_v1.0.0_x5.0_darwin_amd64 plugin: 2021/07/20 18:03:21 [TRACE] starting builder -packer-default-plugin-name-
2021/07/20 18:03:21 [TRACE] Starting internal plugin packer-provisioner-file
2021/07/20 18:03:21 Starting plugin: /nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin/packer []string{"/nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin/packer", "plugin", "packer-provisioner-file"}
2021/07/20 18:03:21 Waiting for RPC address for: /nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin/packer
2021/07/20 18:03:21 packer-provisioner-file plugin: [INFO] Packer version: 1.7.3 [go1.16.6 darwin amd64]
2021/07/20 18:03:21 packer-provisioner-file plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2021/07/20 18:03:21 packer-provisioner-file plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /Users/jelle/.packerconfig
2021/07/20 18:03:21 packer-provisioner-file plugin: [WARN] Config file doesn't exist: /Users/jelle/.packerconfig
2021/07/20 18:03:21 packer-provisioner-file plugin: [INFO] Setting cache directory: /Users/jelle/.cache/packer
2021/07/20 18:03:21 packer-provisioner-file plugin: args: []string{"packer-provisioner-file"}
2021/07/20 18:03:21 Received unix RPC address for /nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin/packer: addr is /tmp/packer-plugin479551696
2021/07/20 18:03:21 packer-provisioner-file plugin: Plugin address: unix /tmp/packer-plugin479551696
2021/07/20 18:03:21 packer-provisioner-file plugin: Waiting for connection...
2021/07/20 18:03:21 packer-provisioner-file plugin: Serving a plugin connection...
2021/07/20 18:03:21 [TRACE] Starting internal plugin packer-provisioner-shell
2021/07/20 18:03:21 Starting plugin: /nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin/packer []string{"/nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin/packer", "plugin", "packer-provisioner-shell"}
2021/07/20 18:03:21 Waiting for RPC address for: /nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin/packer
2021/07/20 18:03:22 packer-provisioner-shell plugin: [INFO] Packer version: 1.7.3 [go1.16.6 darwin amd64]
2021/07/20 18:03:22 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2021/07/20 18:03:22 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /Users/jelle/.packerconfig
2021/07/20 18:03:22 packer-provisioner-shell plugin: [WARN] Config file doesn't exist: /Users/jelle/.packerconfig
2021/07/20 18:03:22 packer-provisioner-shell plugin: [INFO] Setting cache directory: /Users/jelle/.cache/packer
2021/07/20 18:03:22 packer-provisioner-shell plugin: args: []string{"packer-provisioner-shell"}
2021/07/20 18:03:22 Received unix RPC address for /nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin/packer: addr is /tmp/packer-plugin202666409
2021/07/20 18:03:22 packer-provisioner-shell plugin: Plugin address: unix /tmp/packer-plugin202666409
2021/07/20 18:03:22 packer-provisioner-shell plugin: Waiting for connection...
2021/07/20 18:03:22 packer-provisioner-shell plugin: Serving a plugin connection...
2021/07/20 18:03:22 [TRACE] Starting internal plugin packer-provisioner-shell
2021/07/20 18:03:22 Starting plugin: /nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin/packer []string{"/nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin/packer", "plugin", "packer-provisioner-shell"}
2021/07/20 18:03:22 Waiting for RPC address for: /nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin/packer
2021/07/20 18:03:22 packer-provisioner-shell plugin: [INFO] Packer version: 1.7.3 [go1.16.6 darwin amd64]
2021/07/20 18:03:22 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2021/07/20 18:03:22 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /Users/jelle/.packerconfig
2021/07/20 18:03:22 packer-provisioner-shell plugin: [WARN] Config file doesn't exist: /Users/jelle/.packerconfig
2021/07/20 18:03:22 packer-provisioner-shell plugin: [INFO] Setting cache directory: /Users/jelle/.cache/packer
2021/07/20 18:03:22 packer-provisioner-shell plugin: args: []string{"packer-provisioner-shell"}
2021/07/20 18:03:22 packer-provisioner-shell plugin: Plugin address: unix /tmp/packer-plugin507125290
2021/07/20 18:03:22 packer-provisioner-shell plugin: Waiting for connection...
2021/07/20 18:03:22 Received unix RPC address for /nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin/packer: addr is /tmp/packer-plugin507125290
2021/07/20 18:03:22 packer-provisioner-shell plugin: Serving a plugin connection...
2021/07/20 18:03:22 Build debug mode: false
2021/07/20 18:03:22 Force build: false
2021/07/20 18:03:22 On error:
linode.example: output will be in this color.
2021/07/20 18:03:22 Waiting on builds to complete...
2021/07/20 18:03:22 Starting build run: linode.example
2021/07/20 18:03:22 Running builder:
2021/07/20 18:03:22 [INFO] (telemetry) Starting builder
==> linode.example: Running builder ...
==> linode.example: Using existing SSH private key
==> linode.example: Creating Linode...
==> linode.example: Error creating Linode: [400] [authorized_keys] SSH Key 1 key-type must be ssh-dss, ssh-rsa, ecdsa-sha2-nistp, or ssh-ed25519.
2021/07/20 18:03:23 [INFO] (telemetry) ending
==> Wait completed after 840 milliseconds 984 microseconds
2021/07/20 18:03:23 machine readable: error-count []string{"1"}
Build 'linode.example' errored after 838 milliseconds 558 microseconds: Error creating Linode: [400] [authorized_keys] SSH Key 1 key-type must be ssh-dss, ssh-rsa, ecdsa-sha2-nistp, or ssh-ed25519.
==> Some builds didn't complete successfully and had errors:
2021/07/20 18:03:23 machine readable: linode.example,error []string{"Error creating Linode: [400] [authorized_keys] SSH Key 1 key-type must be ssh-dss, ssh-rsa, ecdsa-sha2-nistp, or ssh-ed25519."}
==> Builds finished but no artifacts were created.
==> Wait completed after 840 milliseconds 984 microseconds
==> Some builds didn't complete successfully and had errors:
--> linode.example: Error creating Linode: [400] [authorized_keys] SSH Key 1 key-type must be ssh-dss, ssh-rsa, ecdsa-sha2-nistp, or ssh-ed25519.
2021/07/20 18:03:23 [INFO] (telemetry) Finalizing.
==> Builds finished but no artifacts were created.
2021/07/20 18:03:23 waiting for all plugin processes to complete...
2021/07/20 18:03:23 /Users/jelle/.packer.d/plugins/github.com/ivoronin/sshkey/packer-plugin-sshkey_v0.1.0_x5.0_darwin_amd64: plugin process exited
2021/07/20 18:03:23 /Users/jelle/.packer.d/plugins/github.com/hashicorp/linode/packer-plugin-linode_v1.0.0_x5.0_darwin_amd64: plugin process exited
2021/07/20 18:03:23 /nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin/packer: plugin process exited
2021/07/20 18:03:23 /nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin/packer: plugin process exited
2021/07/20 18:03:23 /nix/store/qn5pnsn5dchqbsy20ajzjpaqqk9hwzlc-packer-1.7.3/bin/packer: plugin process exited
v1.10.2
v1.4.1
VM tags are not applied to the VM when building using Packer.
source "linode" "example" {
image = "linode/ubuntu22.04"
image_description = "This image was created using Packer."
image_label = "test-image-${local.timestamp}"
instance_label = "temp-packer-debian-10"
instance_type = "g6-nanode-1"
linode_token = "${var.linode_api_token}"
region = "nl-ams"
ssh_username = "root"
instance_tags = ["foo"]
}
Command output:
packer build .
linode.example: output will be in this color.
==> linode.example: Running builder ...
==> linode.example: Creating temporary SSH key for instance...
==> linode.example: Creating Linode...
==> linode.example: Using SSH communicator to connect: 172.233.51.105
==> linode.example: Waiting for SSH to become available...
==> linode.example: Connected to SSH!
==> linode.example: Provisioning with shell script: /tmp/packer-shell3435650164
linode.example: Adding file to Docker Container
==> linode.example: Shutting down Linode...
==> linode.example: Creating image...
Build is done successfully, but tags are not being applied to the VM (screenshot attached)
Specify VM tags using "instance_tags"
source "linode" "example" {
image = "linode/ubuntu22.04"
image_description = "This image was created using Packer."
image_label = "test-image-${local.timestamp}"
instance_label = "temp-packer-debian-10"
instance_type = "g6-nanode-1"
linode_token = "${var.linode_api_token}"
region = "nl-ams"
ssh_username = "root"
instance_tags = ["foo"]
}
No error output. Tags are not being applied.
I'm using private ips for the Linodes that I launch with Terraform, and it would be nice to be able to configure that for the Linode that Packer sets up.
I am building Consul servers with Packer, and I am using the private IPs for communication, this works fine for Linodes that have private_ip = true
(through Terraform), but Consul throws errors if there is no private IP attached.
During my Packer build of my Consul images I run a sanity check: /usr/local/bin/consul validate /etc/consul.d/consul.json
however this fails with this error:
==> linode: Config validation failed: No private IPv4 address found
If I could configure the linode to have private networking enabled I could catch configuration mistakes early.
It appears the linode/linodego had an accidental v1.0.0 release which was picked up by this project. See: linode/linodego@fb6add3
I think because of this, we won't see any of the updates in v0.26.1 or newer and latest is currently v0.28.1.
v1.9.4
v1.1.3
When building an image using plugin greater than 1.0.5 its failing using an existing token created a few years ago, i would expect the image to build successfully.
I am setting linode_token with a valid token that works in v1.0.5 if I go > than this version it fails
The behaviour I'm seeing is as follows
==> linode.test-game-server: Failed to create event poller: failed to run pretask: failed to list events: [401] Your OAuth token is not authorized to use this endpoint.
==> linode.test-game-server: Provisioning step had errors: Running the cleanup provisioner, if present...
Build 'linode.test-game-server' errored after 4 minutes 16 seconds: Failed to create event poller: failed to run pretask: failed to list events: [401] Your OAuth token is not authorized to use this endpoint.
Create an old api token on linode interface
==> linode.test-game-server: Failed to create event poller: failed to run pretask: failed to list events: [401] Your OAuth token is not authorized to use this endpoint.
==> linode.test-game-server: Provisioning step had errors: Running the cleanup provisioner, if present...
Build 'linode.test-game-server' errored after 4 minutes 16 seconds: Failed to create event poller: failed to run pretask: failed to list events: [401] Your OAuth token is not authorized to use this endpoint.
Hi Guys,
I can't see a template for a feature / enhancement (I think it's broken according to github). So I'm sorry it's not following your expected format.
Description:
Please can we add the ability to set the instance config during packer initalization. When we are building packer images we are wanting to use GRUB2 as we would like to boot with your kernels during imaging, rather than Linode's. However, the Linode Packer integration does not allow you to set config specific variables.
As a result, we have to have a shell provisioner which runs before ansible, shuts down the instance and then reboots it. Instead, it would be much cleaner if we can get some (or all) of the linode config so that once it's booted we can get straight to work.
Use Case:
We build images, and run them, using the OS Kernel, not Linode's. This allows us to set it from boot instead of it being a post step. This is our last discrepency between Linode and AWS Image Building, which allows us to ensure that all image building works with both systems!
Thoughts:
I'm not sure if it would be best to make the config option a dictionary / object and just pass it straight through to the Linode API so it's always up to date, or if it's best to have specific config keys you would want to pass through.
You would need to launch the machine with it being powered off, change the config, and then power it on. Rather than trying to change the config once it had booted.
Many Thanks,
Tom Franklin.
I'm receiving a build error on clean builds where linodego v1.0.0 doesn't exist. The current latest tag of this is v0.28.5. I'm not sure how that works but does it build for anyone else? This line was updated 2 months ago.
https://github.com/hashicorp/packer-plugin-linode/blob/v0.0.2/go.mod#L10
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.