0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 10:33:46 +00:00
Commit Graph

23 Commits

Author SHA1 Message Date
Pavel Boldyrev
49d366e45b
fix(provider): improve known_hosts handling in SSH client (#1918)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2025-04-20 21:14:43 -04:00
renovate[bot]
ce5cc746f9
chore(deps): update golangci/golangci-lint (v2.0.2 → v2.1.2) (#1903)
* chore(deps): update golangci/golangci-lint (v2.0.2 → v2.1.2)

| datasource      | package                | from   | to     |
| --------------- | ---------------------- | ------ | ------ |
| github-releases | golangci/golangci-lint | v2.0.2 | v2.1.2 |

* fix linter errors

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2025-04-16 19:19:18 -04:00
Jordan Garside
18a7f8ec35
fix(provider): handle IPv6 in ssh client (#1558)
fix(vm): handle IPv6 in ssh client

Signed-off-by: Jordan Garside <jordangarside@Jordans-MacBook-Pro.local>
2024-10-01 12:36:11 -04:00
renovate[bot]
356c978ece
chore(deps): update module github.com/golangci/golangci-lint (v1.60.3 → v1.61.0) in /tools (#1527)
* chore(deps): update module github.com/golangci/golangci-lint (v1.60.3 → v1.61.0) in /tools

| datasource | package                           | from    | to      |
| ---------- | --------------------------------- | ------- | ------- |
| go         | github.com/golangci/golangci-lint | v1.60.3 | v1.61.0 |

* disable gosec: G115 linter

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-09-09 20:55:46 -04:00
renovate[bot]
35cbe98d6b
chore(deps): update module github.com/golangci/golangci-lint (v1.60.1 → v1.60.2) in /tools (#1499)
* chore(deps): update module github.com/golangci/golangci-lint (v1.60.1 → v1.60.2) in /tools

| datasource | package                           | from    | to      |
| ---------- | --------------------------------- | ------- | ------- |
| go         | github.com/golangci/golangci-lint | v1.60.1 | v1.60.2 |

* fix linter errors

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-08-22 00:30:20 +00:00
Sven Greb
cc9d0e7131
feat(file): add support to set the file mode (#1478)
* feat(file): Add support to set the file mode

GH-733 [1] implemented basic support for hook scripts, but the authors
"did not manage to find time to work on" [2] also including support to
set the file mode. This small but important feature makes the use of the
`proxmox_virtual_environment_container.hook_script_file_id` [3] and
`virtual_environment_vm.hook_script_file_id` [34] attributes basically
useless when not combined with the manual step of making the uploaded
file executable (manually running `chmod +x /path/to/script` or using
other methods, based on the storage backend). Using the
`hook_script_file_id` on its own also causes all planned and applies
changes in the same execution to not be saved in the state because the
Proxmox VE API responses with a HTTP `500` because the uploaded and
assigned file is not executable.

This pull request implements the missing feature to set the file mode
by adding a new `file_mode` attribute of type `string` where an
octal-formatted value can be passed, e.g. `0700` or only `600`.
Note that the support for the octal prefixes `0o` and `0x` are not
supported to reduced the complexity, even though Go of course support
it, including the used `os.FileMode` type [5].
Changing the file mode also causes the file to be replaced, which is
true for almost any attribute in the `proxmox_virtual_environment_file`
resource, to ensure that the file mode can also be changed after the
initial creation.

[1]: https://github.com/bpg/terraform-provider-proxmox/pull/733
[2]: https://github.com/bpg/terraform-provider-proxmox/pull/733#issuecomment-2096716738
[3]: https://registry.terraform.io/providers/bpg/proxmox/latest/docs/resources/virtual_environment_container#hook_script_file_id
[4]: https://registry.terraform.io/providers/bpg/proxmox/latest/docs/resources/virtual_environment_vm#hook_script_file_id
[5]: https://pkg.go.dev/os#FileMode

Related to GH-570
Related to GH-733

Signed-off-by: Sven Greb <development@svengreb.de>


---------

Signed-off-by: Sven Greb <development@svengreb.de>
2024-08-13 21:28:48 -04:00
Brian
ccf4834c16
feat(provider): add support for ssh-agent on Windows (#1270)
* feat(provider): add support for `ssh-agent` on Windows

Signed-off-by: Brian Karshick <Sparta142@users.noreply.github.com>
2024-05-09 23:00:44 -04:00
Pavel Boldyrev
b63f1b7889
fix(provider): EOF error when closing SSH session (#1113)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-03-11 20:05:11 -04:00
Pavel Boldyrev
27dbcad5cd
chore: minor cleanups and doc updates (#1108)
* Fix some obvious errors, remove dead code
* Add instructions for manually adding public key to authorized_keys file
* Add GitHub context dump step and update testacc workflow condition
---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-03-09 23:20:44 -05:00
renovate[bot]
fbd04ed950
chore(deps): update tools (#1017)
* chore(deps): update tools

| datasource | package                                                       | from    | to      |
| ---------- | ------------------------------------------------------------- | ------- | ------- |
| go         | github.com/golangci/golangci-lint                             | v1.55.2 | v1.56.2 |
| go         | go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp | v0.48.0 | v0.49.0 |

* fix linter errors

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-03-04 21:41:53 -05:00
Pavel Boldyrev
3195b3cdf4
feat(file)!: snippets upload using SSH input stream (#1085)
* feat(file)!: safer snippets upload using SSH input stream
* fixes for acceptance tests on windows
* enable other OS-es for acceptance tests
* update example templates to use api token auth

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-03-02 19:06:59 -05:00
Pavel Boldyrev
2c6d3ad01d
feat(provider): add support for private key authentication for SSH (#1076)
* feat(provider): add support for private key authentication for SSH

Also fix bunch of issues with acceptance tests

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-03-02 11:10:42 -05:00
Fabian Franz
f7f67dbd3d
fix(provider): race condition in~/.ssh path existence check (#1052)
fix: ignore error if path exists

Signed-off-by: Fabian Franz <fabian.franz@sva.de>
Co-authored-by: Fabian Franz <fabian.franz@sva.de>
2024-02-22 22:24:29 -05:00
Pavel Boldyrev
797873b257
fix(vm): multi-line description field is always marked as changed (#1030)
Also, fix acceptance tests

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-02-15 19:33:23 -05:00
Pavel Boldyrev
1f333ea097
fix(vm): error when creating custom disks on PVE with non-default shell (#983)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-01-28 17:13:43 +00:00
Pavel Boldyrev
da1d7804af
feat(provider): add SOCKS5 proxy support for SSH connections (#970)
* feat(provider): add support for SOCKS5 proxy for SSH connection.

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

* fix: linter

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-01-27 20:09:14 +00:00
Pavel Boldyrev
01a8f9779c
fix(vm): regression: sudo: command not found when creating a VM (#966)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-01-26 20:27:25 -05:00
Pavel Boldyrev
9d764e5889
feat(provider): use sudo to execute commands over SSH (#950)
* feat(provider): use `sudo` to execute commands over SSH

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

* fix: simplify everything, use sudo per command

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

* feat: add documentation

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

* minor doc fix

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

* chore: cleanup docs

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-01-21 21:44:12 -05:00
Pavel Boldyrev
d8f82d47b3
chore(tests): Update acceptance tests to PVE 8.1, add docs (#834)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-12-24 07:26:06 -05:00
TheNotary
388ce7ce8d
fix(provider): add informative error around ssh-agent (#620)
* fix(provider): add informative error around ssh-agent
Signed-off-by: TheNotary <799247+TheNotary@users.noreply.github.com>

* fix linter errors

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-10-16 20:00:09 -04:00
Rafał Safin
124cac247c
feat(provider): add optional SSH port param to node in provider ssh block (#520)
* feat: Add optional SSH port param to node in provider ssh block

* fix: minor cleanups

---------

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-09-02 19:43:08 -04:00
Pavel Boldyrev
80c94a5126
feat(v): Add ability to override node IP used for SSH connection (#355)
* feat(v): Add ability to override node IP used for SSH connection

* add documentation
2023-05-31 21:15:48 -04:00
Pavel Boldyrev
1f006aa82b
feat: API client cleanup and refactoring (#323)
* cleanup 1

* continue refactoring

* more refactoring

* move VMs under nodes

* move container and other apis under nodes

* cleanups

* enabled revive.exported linter & add comments to exported stuff

* enable godot linter

* enable wsl linter

* enable thelper linter

* enable govet linter

* cleanup after rebase

* cleanup after rebase

* extract SSH ops into a separate interface

* fix linter error

* move ssh code to its own package

* cleaning up VirtualEnvironmentClient receivers

* on the finish line

* not sure what else I forgot... 🤔

* fix ssh connection and upload

* renaming client interfaces

* final cleanups
2023-05-26 01:32:51 +00:00