SSH Key
@ivoronin
The SSHkey plugin can be used for generating SSH keys for configuring private key authentication.
- Community
Updated 3 weeks ago
- GitHub(opens in new tab)
SSH Key
The SSHkey plugin can be used for generating SSH keys for configuring private key authentication
Installation
To install this plugin, copy and paste this code into your Packer configuration, then run packer init.
packer {
required_plugins {
sshkey = {
source = "github.com/ivoronin/sshkey"
version = "~> 1.4"
}
}
}
Alternatively, you can use packer plugins install to manage installation of this plugin.
$ packer plugins install github.com/ivoronin/sshkey
Components
Data Sources
- sshkey - Data source used to generate SSH keys
Example Usage
packer {
required_plugins {
sshkey = {
version = "~> 1.4"
source = "github.com/ivoronin/sshkey"
}
}
}
data "sshkey" "install" {
}
source "qemu" "install" {
ssh_username = "root"
ssh_private_key_file = data.sshkey.install.private_key_path
ssh_clear_authorized_keys = true
http_content = {
"/preseed.cfg" = templatefile("preseed.cfg.pkrtpl", {
"ssh_public_key" : data.sshkey.install.public_key
})
}
<...>
}
build {
sources = ["source.qemu.install"]
}