Signed-off-by: Marco Attia <54147992+Vaneixus@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>
* fix(provider): fix for datastore does not support content type "dump"
Signed-off-by: cgeopapa <cgeocodgod@gmail.com>
* fix: move ContentType override further in the flow
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* fix: update docs
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
---------
Signed-off-by: cgeopapa <cgeocodgod@gmail.com>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* chore(deps): update module github.com/golangci/golangci-lint (v1.62.2 → v1.63.4) in /tools
| datasource | package | from | to |
| ---------- | --------------------------------- | ------- | ------- |
| go | github.com/golangci/golangci-lint | v1.62.2 | v1.63.4 |
* chore(deps): remove golang.org/x/exp dependency and update imports to use slices package
- Removed the golang.org/x/exp dependency from go.mod and go.sum.
- Updated imports in proxmox/api/client.go, proxmoxtf/datasource/vms.go, and proxmoxtf/resource/file.go to use the slices package instead of golang.org/x/exp/slices.
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>
* 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>
* 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>
* 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>
cleaning up and refactoring the VM code, add some acceptance tests around disks, few minor bugfixes
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* fix(file): use `sudo` for snippets upload
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* fix: linter
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* fix: no more rm -rf
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
---------
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
fix: display warning if directory is not found
Signed-off-by: DanielHabenicht <daniel-habenicht@outlook.de>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* feat(provider): configure temp directory
Resource 'proxmox_virtual_environment_file' often requires lot of disk
space in /tmp, which can be space-limited.
Instead of requiring to set TMPDIR environment variable before running
terraform, make it a provider configuration option.
Signed-off-by: Oto Petřík <oto.petrik@gmail.com>
* fix: lint error, align names in the `client` struct
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
---------
Signed-off-by: Oto Petřík <oto.petrik@gmail.com>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* fix(api): set min TLS version 1.3, secure HTTP-only cookie
* remove `all-tests-passed` job
---------
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* chore: add file test
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* add file updated test, file_name / ID is getting changed :/
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* more tests, refactor file's read, more consistency in the attributes
TODO: need to check backward compatibility
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* fix error message, enable import test
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* more tests
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* more tests for owerwrite, update docs
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* fix tests on CI
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
---------
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* feat(file): FORMAT CHANGE: update **import id**, so it matches the resource's format: `<node_name>/<datastore_id>:<content_type>/<file>`
* better example
* feat(provider): ensure upload of ISO/VSTMPL completes before starting VM and add timeout to config for this
* remove `ForceNew: true` for the timeout attribute
* minor docs update
---------
Co-authored-by: dandaolrian <dandaolrian@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
* add import support for a lot of resources
* fix lints
* set user_id after importing
(cherry picked from commit c3d09ed00f6e1d7b0bb3ab01a1fc5c81510aa2e1)
* add tests, fix empty ID
* add import docs
* fix lint
* 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
* refactoring existing cluster / firewall API for better composition
* add basic security groups API
fix linter errors
* add rules API
* fix after renaming resourceVirtualEnvironmentClusterIPSet
* fix linter errors
* make linter happy
* even more refactoring
* tidy up datasources
* in refactoring spree
* update examples
* fix firewall resource/datasource & client error handling
* add ipset(s) datasource
* update docs
* add security group resource with rules
* docs
* fix security group update, TODO: rule update
* fix after rebase
* add rule update, extract common rule schema, refactor group
* fix linter errors
* bump linter for ci
* make alias and ipset reusable
* make security group reusable
* refactor datasources
* add security group datasources
* fix linter errors
* update docs
TODO: documentation for group datasources
* add sg docs, update doc index
* minor cleanup
* fix examples & tests
* stub for firewall-level options and rules
* extract firewall interface
* add firewall options and rules on the cluster level
TODO: issues with rule list management
* refactor all resources format AGAIN, now more flat, without complex subresources
* sort out hierarchy of APIs and remove duplication in API wrappers
* bring back security group
* finally, working rules
* restore cluster firewall option
* add containers support
* add options
* move rules back under security group, update docs
* fix vm_id / container_id attrs
* add examples
* cleanup
* more cleanup
Release-As: 0.17.0-rc1