Skip to content

Dedicated server generic userdata #619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 6 additions & 31 deletions ovh/data_me_installation_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ func dataSourceMeInstallationTemplate() *schema.Resource {

// computed
"default_language": {
Type: schema.TypeString,
Computed: true,
Description: "The default language of this template",
Type: schema.TypeString,
Computed: true,
Deprecated: "This field will be removed from the API, please use `userMetadata` instead.",
},
"customization": {
Type: schema.TypeList,
Expand All @@ -44,15 +44,10 @@ func dataSourceMeInstallationTemplate() *schema.Resource {
Computed: true,
Description: "indicate the string returned by your postinstall customisation script on successful execution. Advice: your script should return a unique validation string in case of succes. A good example is 'loh1Xee7eo OK OK OK UGh8Ang1Gu'",
},
"rating": {
Type: schema.TypeInt,
Deprecated: "field is not used anymore",
Computed: true,
},
"ssh_key_name": {
Type: schema.TypeString,
Computed: true,
Description: "Name of the ssh key that should be installed. Password login will be disabled",
Type: schema.TypeString,
Computed: true,
Deprecated: "This field will be removed from the API, please use `userMetadata` instead.",
},
},
},
Expand Down Expand Up @@ -160,11 +155,6 @@ func dataSourceMeInstallationTemplate() *schema.Resource {
Type: schema.TypeString,
},
},
"beta": {
Type: schema.TypeBool,
Computed: true,
Description: "This distribution is new and, although tested and functional, may still display odd behaviour",
},
"bit_format": {
Type: schema.TypeInt,
Computed: true,
Expand All @@ -175,11 +165,6 @@ func dataSourceMeInstallationTemplate() *schema.Resource {
Computed: true,
Description: "Category of this template (informative only). (basic, customer, hosting, other, readyToUse, virtualisation)",
},
"deprecated": {
Type: schema.TypeBool,
Computed: true,
Description: "is this distribution deprecated",
},
"description": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -208,21 +193,11 @@ func dataSourceMeInstallationTemplate() *schema.Resource {
Type: schema.TypeString,
},
},
"last_modification": {
Type: schema.TypeString,
Computed: true,
Description: "Date of last modification of the base image",
},
"lvm_ready": {
Type: schema.TypeBool,
Computed: true,
Description: "This distribution supports Logical Volumes (Linux LVM)",
},
"supports_sql_server": {
Type: schema.TypeBool,
Computed: true,
Description: "This distribution supports the microsoft SQL server",
},
},
}
}
Expand Down
3 changes: 1 addition & 2 deletions ovh/data_me_installation_template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ data "ovh_me_installation_template" "template" {
`
const testAccMeInstallationTemplateDatasourceConfig_Basic = `
resource "ovh_me_installation_template" "template" {
base_template_name = "centos7_64"
base_template_name = "debian12_64"
template_name = "%s"
default_language = "en"
}

data "ovh_me_installation_template" "template" {
Expand Down
6 changes: 2 additions & 4 deletions ovh/data_me_installation_templates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,15 @@ func TestAccMeInstallationTemplatesDataSource_basic(t *testing.T) {

const testAccMeInstallationTemplatesDatasourceConfig_presetup = `
resource "ovh_me_installation_template" "template" {
base_template_name = "centos7_64"
base_template_name = "debian12_64"
template_name = "%s"
default_language = "en"
}
`

const testAccMeInstallationTemplatesDatasourceConfig_Basic = `
resource "ovh_me_installation_template" "template" {
base_template_name = "centos7_64"
base_template_name = "debian12_64"
template_name = "%s"
default_language = "en"
}

data "ovh_me_installation_templates" "templates" {}
Expand Down
4 changes: 2 additions & 2 deletions ovh/data_me_ssh_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import (

func dataSourceMeSshKey() *schema.Resource {
return &schema.Resource{
Read: dataSourceMeSshKeyRead,
Read: dataSourceMeSshKeyRead,
DeprecationMessage: "[DEPRECATED] SSH key names '/me/sshKey' will be deprecated soon",
Schema: map[string]*schema.Schema{
"key_name": {
Type: schema.TypeString,
Expand All @@ -33,7 +34,6 @@ func dataSourceMeSshKeyRead(d *schema.ResourceData, meta interface{}) error {
config := meta.(*Config)

sshKey := &MeSshKeyResponse{}

keyName := d.Get("key_name").(string)
err := config.OVHClient.Get(
fmt.Sprintf("/me/sshKey/%s", keyName),
Expand Down
3 changes: 2 additions & 1 deletion ovh/data_me_ssh_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import (

func dataSourceMeSshKeys() *schema.Resource {
return &schema.Resource{
Read: dataSourceMeSshKeysRead,
Read: dataSourceMeSshKeysRead,
DeprecationMessage: "[DEPRECATED] SSH key names '/me/sshKey' will be deprecated soon",
Schema: map[string]*schema.Schema{
"names": {
Type: schema.TypeSet,
Expand Down
3 changes: 1 addition & 2 deletions ovh/import_me_installation_template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ func TestAccMeInstallationTemplate_importBasic(t *testing.T) {
{
ResourceName: "ovh_me_installation_template.template",
ImportState: true,
ImportStateId: fmt.Sprintf("centos7_64/%s", installationTemplate),
ImportStateId: fmt.Sprintf("debian12_64/%s", installationTemplate),
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{
"remove_default_partition_schemes",
"customization.0.rating",
},
},
},
Expand Down
36 changes: 0 additions & 36 deletions ovh/import_me_ssh_key_test.go

This file was deleted.

46 changes: 27 additions & 19 deletions ovh/resource_dedicated_server_install_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,17 @@ func resourceDedicatedServerInstallTask() *schema.Resource {
ForceNew: true,
Description: "",
},
"install_sql_server": {
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
Description: "",
},
"language": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Description: "language",
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Deprecated: "This field is deprecated and will be removed in a future release",
},
"use_spla": {
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
Deprecated: "This field is deprecated and will be removed in a future release",
},
"no_raid": {
Type: schema.TypeBool,
Expand All @@ -105,17 +105,25 @@ func resourceDedicatedServerInstallTask() *schema.Resource {
ForceNew: true,
Description: "",
},
"ssh_key_name": {
},
},
},
"user_metadata": {
Type: schema.TypeList,
Optional: true,
ForceNew: true,
MaxItems: 128,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"key": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Description: "Name of the ssh key that should be installed. Password login will be disabled",
Description: "The key for the user_metadata",
Required: true,
},
"use_spla": {
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
Description: "",
"value": {
Type: schema.TypeString,
Description: "The value for the user_metadata",
Required: true,
},
},
},
Expand Down
Loading