Skip to content

Commit

Permalink
Rename fields and add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jooola committed Dec 12, 2023
1 parent 9c8bf13 commit 927327d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .web-docs/components/builder/hcloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ builder.
- `server_name` (string) - The name assigned to the server. The Hetzner Cloud
sets the hostname of the machine to this value.

- `server_labels` (map of key/value strings) - Key/value pair labels to
apply to the created server.

- `snapshot_name` (string) - The name of the resulting snapshot that will
appear in your account as image description. Defaults to `packer-{{timestamp}}` (see
[configuration templates](/packer/docs/templates/legacy_json_templates/engine) for more info).
Expand All @@ -87,6 +90,9 @@ builder.
- `user_data_file` (string) - Path to a file that will be used for the user
data when launching the server.

- `ssh_keys_labels` (map of key/value strings) - Key/value pair labels to
apply to the created ssh keys.

- `ssh_keys` (array of strings) - List of SSH keys by name or id to be added
to image on launch.

Expand Down
2 changes: 1 addition & 1 deletion builder/hcloud/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type Config struct {
UserData string `mapstructure:"user_data"`
UserDataFile string `mapstructure:"user_data_file"`
SSHKeys []string `mapstructure:"ssh_keys"`
SSHKeyLabels map[string]string `mapstructure:"sshkey_labels"`
SSHKeysLabels map[string]string `mapstructure:"ssh_keys_labels"`
Networks []int64 `mapstructure:"networks"`

RescueMode string `mapstructure:"rescue"`
Expand Down
4 changes: 2 additions & 2 deletions builder/hcloud/config.hcl2spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion builder/hcloud/step_create_sshkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (s *stepCreateSSHKey) Run(ctx context.Context, state multistep.StateBag) mu
key, _, err := client.SSHKey.Create(ctx, hcloud.SSHKeyCreateOpts{
Name: name,
PublicKey: string(c.Comm.SSHPublicKey),
Labels: c.SSHKeyLabels,
Labels: c.SSHKeysLabels,
})
if err != nil {
err := fmt.Errorf("Error creating temporary SSH key: %s", err)
Expand Down
6 changes: 6 additions & 0 deletions docs/builders/hcloud.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ builder.
- `server_name` (string) - The name assigned to the server. The Hetzner Cloud
sets the hostname of the machine to this value.

- `server_labels` (map of key/value strings) - Key/value pair labels to
apply to the created server.

- `snapshot_name` (string) - The name of the resulting snapshot that will
appear in your account as image description. Defaults to `packer-{{timestamp}}` (see
[configuration templates](/packer/docs/templates/legacy_json_templates/engine) for more info).
Expand All @@ -100,6 +103,9 @@ builder.
- `user_data_file` (string) - Path to a file that will be used for the user
data when launching the server.

- `ssh_keys_labels` (map of key/value strings) - Key/value pair labels to
apply to the created ssh keys.

- `ssh_keys` (array of strings) - List of SSH keys by name or id to be added
to image on launch.

Expand Down

0 comments on commit 927327d

Please sign in to comment.