Skip to content

Commit d6e209b

Browse files
authored
Merge pull request #53 from serverscom/add-userdata-to-dedicated-reinstall
Add UserData to dedicated server OS reinstall input
2 parents df6ab37 + b5a3d95 commit d6e209b

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

pkg/hosts_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ func TestHostsReinstallOperatingSystemForDedicatedServer(t *testing.T) {
465465
osUbuntuServerID := int64(1)
466466
rootFilesystem := "ext4"
467467
raidLevel := 0
468+
userData := "#cloud-config\npackages:\n - nginx\n"
468469

469470
input := OperatingSystemReinstallInput{
470471
Hostname: "new-hostname",
@@ -482,6 +483,7 @@ func TestHostsReinstallOperatingSystemForDedicatedServer(t *testing.T) {
482483
},
483484
OperatingSystemID: &osUbuntuServerID,
484485
SSHKeyFingerprints: []string{"48:81:0c:43:99:12:71:5e:ba:fd:e7:2f:20:d7:95:e8"},
486+
UserData: &userData,
485487
}
486488

487489
ctx := context.TODO()

pkg/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,7 @@ type OperatingSystemReinstallInput struct {
701701
Drives OperatingSystemReinstallDrivesInput `json:"drives"`
702702
OperatingSystemID *int64 `json:"operating_system_id,omitempty"`
703703
SSHKeyFingerprints []string `json:"ssh_key_fingerprints,omitempty"`
704+
UserData *string `json:"user_data,omitempty"`
704705
}
705706

706707
// OperatingSystemReinstallInput represents os reinstallation input

0 commit comments

Comments
 (0)