diff --git a/docs/changelog.md b/docs/changelog.md index dad234a..0674e36 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,11 @@ # Changelog +## \[7.0.9] +### Fixed +* Fixes: + * Fixed SSH provisioning issue for existing node pools when `AppendRKEProvisionUserData` is false + * SSH user configuration is now always added to cloud-init when RKE provisioning is involved, ensuring proper SSH access for both new and existing node pools + ## \[7.0.8] ### Fixed * Fixes: diff --git a/ionos_create_machine.go b/ionos_create_machine.go index 6b63aa8..b6a9dbf 100644 --- a/ionos_create_machine.go +++ b/ionos_create_machine.go @@ -89,7 +89,10 @@ func (d *Driver) GetFinalUserData() (userdata string, err error) { d.CloudInit = ud } - if d.SSHUser != "root" || d.SSHInCloudInit { + // Always add SSH user configuration when RKE provisioning is involved + // This ensures SSH access works for both new and existing node pools + needsSSHUser := d.SSHUser != "root" || d.SSHInCloudInit || d.RKEProvisionUserData != "" + if needsSSHUser { d.CloudInit, err = d.addSSHUserToYaml() if err != nil { return "", err diff --git a/ionos_create_machine_test.go b/ionos_create_machine_test.go index b5a4115..5176ac2 100644 --- a/ionos_create_machine_test.go +++ b/ionos_create_machine_test.go @@ -60,6 +60,14 @@ packages: runcmd: - sh user_script.sh - sh /etc/rke.sh +users: + - create_groups: false + lock_passwd: true + name: root + no_user_group: true + ssh_authorized_keys: + - "" + sudo: ALL=(ALL) NOPASSWD:ALL write_files: - content: some user content path: /etc/user_script.sh @@ -106,6 +114,14 @@ write_files: hostname: test-host runcmd: - sh /etc/rke.sh +users: + - create_groups: false + lock_passwd: true + name: root + no_user_group: true + ssh_authorized_keys: + - "" + sudo: ALL=(ALL) NOPASSWD:ALL write_files: - content: some install content path: /etc/rke.sh @@ -150,6 +166,14 @@ packages: - somepackage runcmd: - sh user_script.sh +users: + - create_groups: false + lock_passwd: true + name: root + no_user_group: true + ssh_authorized_keys: + - "" + sudo: ALL=(ALL) NOPASSWD:ALL write_files: - content: some user content path: /etc/user_script.sh