0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 18:42:58 +00:00
Commit Graph

1551 Commits

Author SHA1 Message Date
renovate[bot]
b63c98b13f
chore(deps): update github.com/hashicorp/terraform-plugin-* (#1437)
| datasource | package                                                    | from    | to      |
| ---------- | ---------------------------------------------------------- | ------- | ------- |
| go         | github.com/hashicorp/terraform-plugin-framework            | v1.9.0  | v1.10.0 |
| go         | github.com/hashicorp/terraform-plugin-framework-validators | v0.12.0 | v0.13.0 |
| go         | github.com/hashicorp/terraform-plugin-testing              | v1.8.0  | v1.9.0  |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-10 21:12:12 -04:00
Pavel Boldyrev
b4d4e4f9d4
fix(time): embed timezone data to fix set/get TZ on windows (#1436)
* fix(time): embed timezone data to fix set/get TZ on windows

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-07-10 21:07:40 -04:00
renovate[bot]
0a978e5664
chore(deps): update golang.org/x/exp digest (7f521ea → 46b0784) (#1432)
| datasource | package          | from                               | to                                 |
| ---------- | ---------------- | ---------------------------------- | ---------------------------------- |
| go         | golang.org/x/exp | v0.0.0-20240613232115-7f521ea00fb8 | v0.0.0-20240707233637-46b078467d37 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-08 18:19:40 +00:00
Pavel Boldyrev
d193abd33e
fix(vm): improve reliability of VM create / get operations (#1431)
* fix(vm): improve reliability of VM create / get operations

- Add retries to GET API calls, fix retrying on POST (VM create) API calls.
- Minor fix in acceptance tests

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-07-08 18:17:53 +00:00
bpg-autobot[bot]
fb7047e085
chore(main): release 0.61.0 (#1417)
Co-authored-by: bpg-autobot[bot] <155200059+bpg-autobot[bot]@users.noreply.github.com>
2024-07-05 22:34:03 -04:00
renovate[bot]
6436967903
chore(deps): update module golang.org/x/net (v0.26.0 → v0.27.0) (#1430)
| datasource | package          | from    | to      |
| ---------- | ---------------- | ------- | ------- |
| go         | golang.org/x/net | v0.26.0 | v0.27.0 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-05 22:29:57 -04:00
Pavel Boldyrev
6103e67ae9
fix(repo): fix source.list path validation on Windows (#1429)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-07-05 20:20:34 -04:00
Sven Greb
357f7c70a7
feat(node): implement initial support to manage APT repositories (#1325)
* feat(nodes): Initial support to manage APT repositories

> Summary

This commit implements initial support for managing APT repositories
which is (currently) limited to…

- …adding "standard" repositories to allow to configure it.
- toggling the activation status (enabled/disabled) of any configured
  repository.

+ !WARNING!
+ Note that deleting or modifying a repository in any other way is
+ (sadly) not possible (yet?)!
+ The limited functionality is due to the (current) capabilities of
+ the Proxmox VE APT repository API [1] itself.

>> Why are there two resources for one API entity?

Even though an APT repository should be seen as a single API entity, it
was required to implement standard repositories as dedicated
`proxmox_virtual_environment_apt_standard_repository`. This is because
standard repositories must be configured (added) first to the default
source list files because their activation status can be toggled. This
is handled by the HTTP `PUT` request, but the modifying request is
`POST` which would require two calls within the same Terraform execution
cycle. I tried to implement it in a single resource and it worked out
mostly after some handling some edges cases, but in the end there were
still too many situations an edge cases where it might break due to
Terraform state drifts between states. In the end the dedicated
resources are way cleaner and easier to use without no complexity and
conditional attribute juggling for practitioners.

>> Other "specialties"

Unfortunately the Proxmox VE API responses to HTTP `GET` requests with
four larger arrays which are, more or less, kind of connected to each
other, but they also somehow stand on their own. This means that there
is a `files` array that contains the `repositories` again which again
contains all repositories with their metadata of every source file. On
the other hand available standard repositories are listed in the
`standard-repos` array, but their activation status is only stored when
they have already been added through a `PUT` request. The `infos` array
is more less useless.

So in order to get the required data and store them in the state the
`importFromAPI` methods of the models must loop through all the
deep-nested arrays and act based on specific attributes like a matching
file path, comparing it to the activation status and so on.

In the end the implementation is really stable after testing it with all
possible conditions and state combinations.

@bpg if you'd like me to create a small data logic flow chart to make it
easier to understand some parts of the code let me know. I can make my
local notes "shareable" which I created to not loose track of the logic.

>> What is the way to manage the activation status of a "standard" repository?

Because the two resources are modular and scoped they can be simply
combined to manage an APT "standard" repository, e.g. toggling its
activation status. The following examples are also included in the
documentations.

```hcl
// This resource ensure that the "no-subscription" standard repository
// is added to the source list.
// It represents the `PUT` API request.
resource "proxmox_virtual_environment_apt_standard_repository" "example" {
  handle = "no-subscription"
  node   = "pve"
}

// This resource allows to actually modify the activation status of the
// standard repository as it represents the `POST`.
// Using the values from the dedicated standard repository resource
// makes sure that Terraform correctly resolves dependency order.
resource "proxmox_virtual_environment_apt_repository" "example" {
  enabled   = true
  file_path = proxmox_virtual_environment_apt_standard_repository.example.file_path
  index     = proxmox_virtual_environment_apt_standard_repository.example.index
  node      = proxmox_virtual_environment_apt_standard_repository.example.node
}
```

[1]: https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/apt/repositories

---------

Signed-off-by: Sven Greb <development@svengreb.de>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-07-05 18:48:35 -04:00
renovate[bot]
cf1142e24b
chore(deps): update module go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp (v0.52.0 → v0.53.0) in /tools (#1426)
| datasource | package                                                       | from    | to      |
| ---------- | ------------------------------------------------------------- | ------- | ------- |
| go         | go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp | v0.52.0 | v0.53.0 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-05 16:11:40 -04:00
allcontributors[bot]
0ebc02147f
docs: add konstantin-kornienko as a contributor for code, and ideas (#1428)
* docs: update CONTRIBUTORS.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2024-07-05 16:11:28 -04:00
renovate[bot]
3ad5b0a9e1
chore(deps): update module golang.org/x/crypto (v0.24.0 → v0.25.0) (#1427)
| datasource | package             | from    | to      |
| ---------- | ------------------- | ------- | ------- |
| go         | golang.org/x/crypto | v0.24.0 | v0.25.0 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-05 16:11:18 -04:00
Konstantin Kornienko
65f8ba5bfe
feat(vm): implement filtering in vms data source. (#1423)
* feat(vm): implement filtering in vms data source.

* Additional attributes for vm data source (status, template)

* fix qodana CI job condition

---------

Signed-off-by: Konstantin Kornienko <konstantin.kornienko@gmail.com>
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-07-05 15:52:39 -04:00
renovate[bot]
91a16af747
chore(ci): update jetbrains/qodana-action action (v2024.1.5 → v2024.1.8) (#1425)
| datasource  | package                 | from      | to        |
| ----------- | ----------------------- | --------- | --------- |
| github-tags | JetBrains/qodana-action | v2024.1.5 | v2024.1.8 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-05 15:19:53 +00:00
renovate[bot]
d55f6706a4
chore(deps): update go (1.22.4 → 1.22.5) in /tools (#1421)
| datasource     | package | from   | to     |
| -------------- | ------- | ------ | ------ |
| golang-version | go      | 1.22.4 | 1.22.5 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-02 22:00:08 -04:00
renovate[bot]
a521c60f0c
chore(deps): update go (1.22.4 → 1.22.5) (#1420)
| datasource     | package | from   | to     |
| -------------- | ------- | ------ | ------ |
| golang-version | go      | 1.22.4 | 1.22.5 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-02 21:59:51 -04:00
renovate[bot]
877251c86e
chore(ci): update actions/create-github-app-token action (v1.10.2 → v1.10.3) (#1419)
| datasource  | package                         | from    | to      |
| ----------- | ------------------------------- | ------- | ------- |
| github-tags | actions/create-github-app-token | v1.10.2 | v1.10.3 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-03 01:43:24 +00:00
renovate[bot]
692ea944c3
chore(ci): update actions/create-github-app-token action (v1.10.1 → v1.10.2) (#1416)
| datasource  | package                         | from    | to      |
| ----------- | ------------------------------- | ------- | ------- |
| github-tags | actions/create-github-app-token | v1.10.1 | v1.10.2 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-29 04:48:39 +00:00
allcontributors[bot]
f7d9865f39
docs: add simonebenati as a contributor for bug, and test (#1415)
* docs: update CONTRIBUTORS.md

* docs: update CONTRIBUTORS.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2024-06-28 02:16:45 +00:00
Pavel Boldyrev
a545f20d81
Merge remote-tracking branch 'origin/main' 2024-06-25 01:41:28 -04:00
Pavel Boldyrev
24345e61de
misc: update goreleaser config
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-25 01:41:19 -04:00
bpg-autobot[bot]
19f710f2c4
chore(main): release 0.60.1 (#1397)
Co-authored-by: bpg-autobot[bot] <155200059+bpg-autobot[bot]@users.noreply.github.com>
2024-06-25 01:29:21 -04:00
Pavel Boldyrev
90e1f56441
misc: fix name of the uploaded acc test log file
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-25 01:27:28 -04:00
Pavel Boldyrev
2571978114
misc: fix location of the temp acc test log file on any OS runner
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-25 01:26:21 -04:00
Pavel Boldyrev
86a39f627b
Merge remote-tracking branch 'origin/main' 2024-06-25 01:11:57 -04:00
Pavel Boldyrev
13160a4717
misc: run certain CI jobs only on 'this' repo
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-25 01:11:44 -04:00
allcontributors[bot]
59840a66cc
docs: add lingfish as a contributor for doc (#1410)
* docs: update CONTRIBUTORS.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2024-06-25 05:06:13 +00:00
Jason Lingohr
763654ac8f
fix(docs): Mention alternate valid use of Volid's for containers (#1407)
Signed-off-by: Jason Lingohr <lingfish@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-25 01:05:10 -04:00
Pavel Boldyrev
0324f51304
misc: fix location of the temp acc test log file on windows
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-25 01:00:45 -04:00
Pavel Boldyrev
4f70459c26
chore(code): fix code quality warnings (#1409)
* chore(code): fix code quality warnings

+ re-enable Qodana on PRs

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-25 00:47:50 -04:00
Pavel Boldyrev
27cf34f9b4
misc: fix test logs upload on builds that don't run tests
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-24 23:15:16 -04:00
Pavel Boldyrev
a0d9300f0f
chore: refactor container acc test (#1408)
+ beautify test output on CI

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-24 23:08:59 -04:00
renovate[bot]
c926484249
chore(deps): update module github.com/brianvoe/gofakeit/v7 (v7.0.3 → v7.0.4) (#1405)
| datasource | package                         | from   | to     |
| ---------- | ------------------------------- | ------ | ------ |
| go         | github.com/brianvoe/gofakeit/v7 | v7.0.3 | v7.0.4 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-22 09:57:48 -04:00
Pavel Boldyrev
5d1c8c606d
chore(vm): fix regression after storage devices refactoring (#1399)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-17 03:53:16 +00:00
Pavel Boldyrev
4a8bf8da27
fix(lxc): use default rootfs size (4Gb) prevents creation of mount points (#1398)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-17 03:47:50 +00:00
Pavel Boldyrev
cc7fc63ec1
chore(vm): refactor storage devices handling from/to API (#1394)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-17 01:23:48 +00:00
bpg-autobot[bot]
b7d48f8716
chore(main): release 0.60.0 (#1378)
Co-authored-by: bpg-autobot[bot] <155200059+bpg-autobot[bot]@users.noreply.github.com>
2024-06-13 20:49:52 -04:00
renovate[bot]
f22858ce4e
chore(deps): update golang.org/x/exp digest (fc45aab → 7f521ea) (#1391)
| datasource | package          | from                               | to                                 |
| ---------- | ---------------- | ---------------------------------- | ---------------------------------- |
| go         | golang.org/x/exp | v0.0.0-20240604190554-fc45aab8b7f8 | v0.0.0-20240613232115-7f521ea00fb8 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-13 20:40:37 -04:00
renovate[bot]
fbf41dde93
chore(ci): update actions/checkout action (v4.1.6 → v4.1.7) (#1390)
| datasource  | package          | from   | to     |
| ----------- | ---------------- | ------ | ------ |
| github-tags | actions/checkout | v4.1.6 | v4.1.7 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-13 03:22:04 +00:00
allcontributors[bot]
a3508f555a
docs: add CCreek96 as a contributor for code (#1388)
* docs: update CONTRIBUTORS.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2024-06-12 00:47:39 +00:00
Connor Creek
bc079c0c19
fix(lxc): make container vm_id computed (#1386)
fix(vm): make container vm_id computed

Signed-off-by: Connor Creek <creek.connor@yahoo.com>
2024-06-11 20:45:53 -04:00
Pavel Boldyrev
de349523fe
feat(vm): add support for disk.serial attribute (#1385)
* feat(vm): add support for `disk.serial` attribute

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-11 01:40:03 +00:00
Pavel Boldyrev
cfe1b1cc4b
chore(code): remove goreleaser from /tools (#1384)
chore(code): remove goreleaser from /tools

`goreleaser` from /tools is not used in the build/release, CI is using `goreleaser-action`

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-11 00:58:26 +00:00
Pavel Boldyrev
1eb64a2522
fix(docs): add more details about the usb block in VM (#1382)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-11 00:00:08 +00:00
renovate[bot]
095be69d8d
chore(deps): Update module github.com/goreleaser/goreleaser (v1.26.2 → v2.0.0) in /tools (#1381)
| datasource | package                          | from    | to     |
| ---------- | -------------------------------- | ------- | ------ |
| go         | github.com/goreleaser/goreleaser | v1.26.2 | v2.0.0 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-10 19:00:13 -04:00
renovate[bot]
77f62e1500
chore(ci): update googleapis/release-please-action action (v4.1.1 → v4.1.3) (#1380)
| datasource  | package                          | from   | to     |
| ----------- | -------------------------------- | ------ | ------ |
| github-tags | googleapis/release-please-action | v4.1.1 | v4.1.3 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-10 22:55:41 +00:00
Pavel Boldyrev
7b0040115e
misc: update qodana.yaml
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-10 18:53:24 -04:00
allcontributors[bot]
5edf8cdda9
docs: add chrodrigues as a contributor for doc (#1379)
* docs: update CONTRIBUTORS.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2024-06-10 22:41:04 +00:00
Pavel Boldyrev
77d4c854bd
misc: restore 0.59.1 version in release-please manifest
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-10 18:36:47 -04:00
Charles Rodrigues
63f0cbfd27
fix(docs): update virtual_environment_vm.md (#1377)
Update virtual_environment_vm.md

Signed-off-by: Charles Rodrigues <56375916+chrodrigues@users.noreply.github.com>
2024-06-10 18:06:11 -04:00
Pavel Boldyrev
8892118228
misc: restore 0.59.1 code
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-06-09 23:40:27 -04:00