Skip to content
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

Dedicated server generic userdata #619

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

bigbigbang
Copy link
Contributor

@bigbigbang bigbigbang commented Apr 17, 2024

Description

To reflect APIV6 changes , we need to update the dedicated server install task resource and installation template:

  • add userMetadata option
  • remove some details option (some already deprecated, some soon)
  • update test with debian12 template

This also deprecate the me/sshKey data and resource (End Of Life soon)
Documentation has been updated to explain how to transmit ssh key
Next release will remove all the deprecated fields and the me sshKey resource and data

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (improve existing resource(s) or datasource(s))
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A: make testacc TESTARGS="-run TestAccDedicatedServerInstall_basic"
  • Test B: make testacc TESTARGS="-run TestAccDedicatedServerInstall_usermetadata"
  • Test C: make testacc TESTARGS="-run TestAccMeInstallationTemplateDataSource_basic"
  • Test D: make testacc TESTARGS="-run TestAccMeInstallationTemplatesDataSource_basic"

Test Configuration:

  • Terraform version: terraform version: Terraform 1.6.6
  • Existing HCL configuration you used:
    a dedicated server (ex for a "byolinux_64" template)
resource "ovh_dedicated_server_install_task" "server_install" {
  service_name      = data.ovh_dedicated_server.server.service_name
  template_name     = "byolinux_64"
  bootid_on_destroy = data.ovh_dedicated_server_boots.rescue.result[0]
  user_metadata {
      key   = "imageURL"
      value = "https://github.com/ashmonger/akution_test/releases/download/0.6-fixCache/deb11k6.qcow2"
    }
  user_metadata {
      key   = "imageType"
      value = "qcow2"
    }
  user_metadata {
      key   = "httpHeaders0Key"
      value = "Authorization"
    }
   user_metadata {
      key   = "httpHeaders0Value"
      value = "Basic bG9naW46cGFzc3dvcmQ="
    }
   user_metadata {
      key   = "imageCheckSumType"
      value = "sha512"
    }
   user_metadata {
      key   = "imageCheckSum"
      value = "047122c9ff4d2a69512212104b06c678f5a9cdb22b75467353613ff87ccd03b57b38967e56d810e61366f9d22d6bd39ac0addf4e00a4c6445112a2416af8f225"
    }
   user_metadata {
      key   = "configDriveUserData"
      value = "#cloud-config\nssh_authorized_keys:\n  - ssh-rsa AAAAB3Nz.................\n\nusers:\n  - name: patient0\n    sudo: ALL=(ALL) NOPASSWD:ALL\n    groups: users, sudo\n    shell: /bin/bash\n    lock_passwd: false\n    ssh_authorized_keys:\n      - ssh-rsa AAAAB3Nz................\ndisable_root: false\npackages:\n  - vim\n  - tree\nfinal_message: The system is finally up, after $UPTIME seconds\n"
    }
   user_metadata {
      key   = "sshKey"
      value = "ssh-rsa AAAAB3Nz..............."
    }
  details {
      custom_hostname = "mytest"
  }
}

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or issues
  • I have added acceptance tests that prove my fix is effective or that my feature works
  • New and existing acceptance tests pass locally with my changes

(& update dedicated_server_install_test with debian12 template
and some doc typo update)
ovh/data_me_ssh_key.go Outdated Show resolved Hide resolved
ovh/data_me_ssh_keys.go Outdated Show resolved Hide resolved
ovh/resource_dedicated_server_install_task.go Show resolved Hide resolved
ovh/resource_dedicated_server_install_task.go Outdated Show resolved Hide resolved
ovh/types_dedicated_server.go Outdated Show resolved Hide resolved
ovh/types_dedicated_server.go Outdated Show resolved Hide resolved
website/docs/d/me_installation_template.html.markdown Outdated Show resolved Hide resolved
website/docs/r/dedicated_server_install_task.html.markdown Outdated Show resolved Hide resolved
website/docs/r/me_ssh_key.html.markdown Outdated Show resolved Hide resolved
@bigbigbang bigbigbang force-pushed the dedicated_server_generic_userdata branch 2 times, most recently from de5bd0e to 93bfa4e Compare April 18, 2024 15:01
remove ovh_me_ssh_key from resource in test
deprecate ovh_me_ssh_key(s) resource and data (endpoint will be EOL)
@bigbigbang bigbigbang force-pushed the dedicated_server_generic_userdata branch from 93bfa4e to 006b53b Compare April 19, 2024 13:23
@amstuta amstuta merged commit 48a08ba into ovh:master Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants