mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-08-23 03:48:35 +00:00
chore(docs): update README.md, add note about OpenTofu support (#943)
chore(docs): update README.md, note about OpenTofu support Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
parent
d4832b3d59
commit
b926c57a53
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@ -7,6 +7,7 @@
|
|||||||
"proxmoxtf",
|
"proxmoxtf",
|
||||||
"qcow",
|
"qcow",
|
||||||
"rootfs",
|
"rootfs",
|
||||||
|
"signoff",
|
||||||
"tflog",
|
"tflog",
|
||||||
"unmanaged",
|
"unmanaged",
|
||||||
"virtio",
|
"virtio",
|
||||||
|
21
Makefile
21
Makefile
@ -1,15 +1,22 @@
|
|||||||
GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor)
|
|
||||||
NAME=terraform-provider-proxmox
|
NAME=terraform-provider-proxmox
|
||||||
TARGETS=darwin linux windows
|
TARGETS=darwin linux windows
|
||||||
TERRAFORM_PLUGIN_EXTENSION=
|
TERRAFORM_PLUGIN_EXTENSION=
|
||||||
VERSION=0.44.0# x-release-please-version
|
VERSION=0.44.0# x-release-please-version
|
||||||
|
|
||||||
|
# check if opentofu is installed and use it if it is,
|
||||||
|
# otherwise use terraform
|
||||||
|
ifeq ($(shell tofu -version 2>/dev/null),)
|
||||||
|
TERRAFORM_EXECUTABLE=terraform
|
||||||
|
else
|
||||||
|
TERRAFORM_EXECUTABLE=tofu
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
TERRAFORM_PLATFORM=windows_amd64
|
TERRAFORM_PLATFORM=windows_amd64
|
||||||
TERRAFORM_PLUGIN_CACHE_DIRECTORY=$$(cygpath -u "$(shell pwd -P)")/cache/plugins
|
TERRAFORM_PLUGIN_CACHE_DIRECTORY=$$(cygpath -u "$(shell pwd -P)")/cache/plugins
|
||||||
TERRAFORM_PLUGIN_EXTENSION=.exe
|
TERRAFORM_PLUGIN_EXTENSION=.exe
|
||||||
else
|
else
|
||||||
TERRAFORM_PLATFORM=$$(terraform -version | awk 'FNR == 2 {print $$2}')
|
TERRAFORM_PLATFORM=$$($(TERRAFORM_EXECUTABLE) -version | awk 'FNR == 2 {print $$2}')
|
||||||
TERRAFORM_PLUGIN_CACHE_DIRECTORY=$(shell pwd -P)/cache/plugins
|
TERRAFORM_PLUGIN_CACHE_DIRECTORY=$(shell pwd -P)/cache/plugins
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -40,7 +47,7 @@ example-apply:
|
|||||||
&& export TF_DISABLE_CHECKPOINT="true" \
|
&& export TF_DISABLE_CHECKPOINT="true" \
|
||||||
&& export TF_PLUGIN_CACHE_DIR="$(TERRAFORM_PLUGIN_CACHE_DIRECTORY)" \
|
&& export TF_PLUGIN_CACHE_DIR="$(TERRAFORM_PLUGIN_CACHE_DIRECTORY)" \
|
||||||
&& cd ./example \
|
&& cd ./example \
|
||||||
&& terraform apply -auto-approve
|
&& $(TERRAFORM_EXECUTABLE) apply -auto-approve
|
||||||
|
|
||||||
.PHONY: example-build
|
.PHONY: example-build
|
||||||
example-build:
|
example-build:
|
||||||
@ -54,7 +61,7 @@ example-destroy:
|
|||||||
&& export TF_DISABLE_CHECKPOINT="true" \
|
&& export TF_DISABLE_CHECKPOINT="true" \
|
||||||
&& export TF_PLUGIN_CACHE_DIR="$(TERRAFORM_PLUGIN_CACHE_DIRECTORY)" \
|
&& export TF_PLUGIN_CACHE_DIR="$(TERRAFORM_PLUGIN_CACHE_DIRECTORY)" \
|
||||||
&& cd ./example \
|
&& cd ./example \
|
||||||
&& terraform destroy -auto-approve
|
&& $(TERRAFORM_EXECUTABLE) destroy -auto-approve
|
||||||
|
|
||||||
.PHONY: example-init
|
.PHONY: example-init
|
||||||
example-init:
|
example-init:
|
||||||
@ -63,7 +70,7 @@ example-init:
|
|||||||
&& export TF_PLUGIN_CACHE_DIR="$(TERRAFORM_PLUGIN_CACHE_DIRECTORY)" \
|
&& export TF_PLUGIN_CACHE_DIR="$(TERRAFORM_PLUGIN_CACHE_DIRECTORY)" \
|
||||||
&& cd ./example \
|
&& cd ./example \
|
||||||
&& rm -f .terraform.lock.hcl \
|
&& rm -f .terraform.lock.hcl \
|
||||||
&& terraform init
|
&& $(TERRAFORM_EXECUTABLE) init
|
||||||
|
|
||||||
.PHONY: example-plan
|
.PHONY: example-plan
|
||||||
example-plan:
|
example-plan:
|
||||||
@ -71,11 +78,11 @@ example-plan:
|
|||||||
&& export TF_DISABLE_CHECKPOINT="true" \
|
&& export TF_DISABLE_CHECKPOINT="true" \
|
||||||
&& export TF_PLUGIN_CACHE_DIR="$(TERRAFORM_PLUGIN_CACHE_DIRECTORY)" \
|
&& export TF_PLUGIN_CACHE_DIR="$(TERRAFORM_PLUGIN_CACHE_DIRECTORY)" \
|
||||||
&& cd ./example \
|
&& cd ./example \
|
||||||
&& terraform plan
|
&& $(TERRAFORM_EXECUTABLE) plan
|
||||||
|
|
||||||
.PHONY: fmt
|
.PHONY: fmt
|
||||||
fmt:
|
fmt:
|
||||||
gofmt -s -w $(GOFMT_FILES)
|
gofmt -s -w $$(find . -name '*.go')
|
||||||
|
|
||||||
.PHONY: init
|
.PHONY: init
|
||||||
init:
|
init:
|
||||||
|
56
README.md
56
README.md
@ -9,32 +9,28 @@
|
|||||||
[](https://www.conventionalcommits.org/en/v1.0.0/)
|
[](https://www.conventionalcommits.org/en/v1.0.0/)
|
||||||
[](https://www.buymeacoffee.com/bpgca)
|
[](https://www.buymeacoffee.com/bpgca)
|
||||||
|
|
||||||
A Terraform Provider which adds support for Proxmox solutions.
|
A Terraform / OpenTofu Provider which adds support for Proxmox solutions.
|
||||||
|
|
||||||
This repository is a fork
|
This repository is a fork of <https://github.com/danitso/terraform-provider-proxmox> which is no longer maintained.
|
||||||
of <https://github.com/danitso/terraform-provider-proxmox>
|
|
||||||
which is no longer maintained.
|
|
||||||
|
|
||||||
## Compatibility promise
|
## Compatibility promise
|
||||||
|
|
||||||
This provider is compatible with the latest version of Proxmox VE (currently
|
This provider is compatible with the latest version of Proxmox VE (currently 8.0).
|
||||||
8.0). While it may work with older 7.x versions, it is not guaranteed to do so.
|
While it may work with older 7.x versions, it is not guaranteed to do so.
|
||||||
|
|
||||||
While provider is on version 0.x, it is not guaranteed to be backwards
|
While provider is on version 0.x, it is not guaranteed to be backwards compatible with all previous minor versions.
|
||||||
compatible with all previous minor versions. However, we will try to keep the
|
However, we will try to keep the backwards compatibility between provider versions as much as possible.
|
||||||
backwards compatibility between provider versions as much as possible.
|
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- [Proxmox Virtual Environment](https://www.proxmox.com/en/proxmox-virtual-environment/) 8.x
|
- [Proxmox Virtual Environment](https://www.proxmox.com/en/proxmox-virtual-environment/) 8.x
|
||||||
- TLS 1.3 for the Proxmox API endpoint
|
- TLS 1.3 for the Proxmox API endpoint (legacy TLS 1.2 is optionally supported)
|
||||||
- [Terraform](https://www.terraform.io/downloads.html) 1.4+
|
- [Terraform](https://www.terraform.io/downloads.html) 1.5.x+ or [OpenTofu](https://opentofu.org) 1.6.x
|
||||||
- [Go](https://golang.org/doc/install) 1.21 (to build the provider plugin)
|
- [Go](https://golang.org/doc/install) 1.21 (to build the provider plugin)
|
||||||
|
|
||||||
## Using the provider
|
## Using the provider
|
||||||
|
|
||||||
You can find the latest release and its documentation in
|
You can find the latest release and its documentation in the [Terraform Registry](https://registry.terraform.io/providers/bpg/proxmox/latest).
|
||||||
the [Terraform Registry](https://registry.terraform.io/providers/bpg/proxmox/latest).
|
|
||||||
|
|
||||||
## Testing the provider
|
## Testing the provider
|
||||||
|
|
||||||
@ -46,17 +42,14 @@ make test
|
|||||||
|
|
||||||
Tests are limited to regression tests, ensuring backwards compatibility.
|
Tests are limited to regression tests, ensuring backwards compatibility.
|
||||||
|
|
||||||
A limited number of acceptance tests are available in the `proxmoxtf/test` directory, mostly
|
A limited number of acceptance tests are available in the `proxmoxtf/test` directory, mostly for "new" functionality implemented using the Terraform Provider Framework.
|
||||||
for "new" functionality implemented using the Terraform Provider Framework. These tests
|
These tests are not run by default, as they require a Proxmox VE environment to be available.
|
||||||
are not run by default, as they require a Proxmox VE environment to be available.
|
They can be run using `make testacc`, the Proxmox connection can be configured using environment variables, see provider documentation for details.
|
||||||
They can be run using `make testacc`, the Proxmox connection can be configured using
|
|
||||||
environment variables, see provider documentation for details.
|
|
||||||
|
|
||||||
## Deploying the example resources
|
## Deploying the example resources
|
||||||
|
|
||||||
There are number of TF examples in the `example` directory, which can be used
|
There are number of TF examples in the `example` directory, which can be used to deploy a Container, VM, or other Proxmox resources on your test Proxmox environment.
|
||||||
to deploy a Container, VM, or other Proxmox resources on your test Proxmox
|
The following assumptions are made about the test environment:
|
||||||
environment. The following assumptions are made about the test environment:
|
|
||||||
|
|
||||||
- It has one node named `pve`
|
- It has one node named `pve`
|
||||||
- The node has local storages named `local` and `local-lvm`
|
- The node has local storages named `local` and `local-lvm`
|
||||||
@ -72,28 +65,23 @@ virtual_environment_endpoint = "https://<your-cluster-endpoint>:8006/"
|
|||||||
|
|
||||||
Then run `make example` to deploy the example resources.
|
Then run `make example` to deploy the example resources.
|
||||||
|
|
||||||
If you don't have free proxmox cluster to play with, there is dedicated [how-to tutorial](howtos/setup-proxmox-for-make-example/README.md) how to setup Proxmox inside VM and run `make example` on it.
|
If you don't have free proxmox cluster to play with, there is dedicated [how-to tutorial](howtos/setup-proxmox-for-tests/README.md) how to setup Proxmox inside VM and run `make example` on it.
|
||||||
|
|
||||||
## Future work
|
## Future work
|
||||||
|
|
||||||
The provider is using
|
The provider is using the [Terraform SDKv2](https://developer.hashicorp.com/terraform/plugin/sdkv2), which is considered legacy and is in maintenance mode.
|
||||||
the [Terraform SDKv2](https://developer.hashicorp.com/terraform/plugin/sdkv2),
|
The work has started to migrate the provider to the new [Terraform Plugin Framework](https://www.terraform.io/docs/extend/plugin-sdk.html), with aim to release it as a new major version **1.0**.
|
||||||
which is considered legacy and is in maintenance mode.
|
|
||||||
The work has started to migrate the provider to the
|
|
||||||
new [Terraform Plugin Framework](https://www.terraform.io/docs/extend/plugin-sdk.html),
|
|
||||||
with aim to release it as a new major version **1.0**.
|
|
||||||
|
|
||||||
## Known issues
|
## Known issues
|
||||||
|
|
||||||
### Disk images cannot be imported by non-PAM accounts
|
### Disk images cannot be imported by non-PAM accounts
|
||||||
|
|
||||||
Due to limitations in the Proxmox VE API, certain actions need to be performed
|
Due to limitations in the Proxmox VE API, certain actions need to be performed using SSH. This requires the use of a PAM account (standard Linux account).
|
||||||
using SSH. This requires the use of a PAM account (standard Linux account).
|
|
||||||
|
|
||||||
### Disk images from VMware cannot be uploaded or imported
|
### Disk images from VMware cannot be uploaded or imported
|
||||||
|
|
||||||
Proxmox VE is not currently supporting VMware disk images directly. However, you
|
Proxmox VE is not currently supporting VMware disk images directly.
|
||||||
can still use them as disk images by using this workaround:
|
However, you can still use them as disk images by using this workaround:
|
||||||
|
|
||||||
```hcl
|
```hcl
|
||||||
resource "proxmox_virtual_environment_file" "vmdk_disk_image" {
|
resource "proxmox_virtual_environment_file" "vmdk_disk_image" {
|
||||||
@ -125,8 +113,8 @@ resource "proxmox_virtual_environment_vm" "example" {
|
|||||||
|
|
||||||
### Snippets cannot be uploaded by non-PAM accounts
|
### Snippets cannot be uploaded by non-PAM accounts
|
||||||
|
|
||||||
Due to limitations in the Proxmox VE API, certain files need to be uploaded
|
Due to limitations in the Proxmox VE API, certain files (snippets, backups) need to be uploaded using SFTP.
|
||||||
using SFTP. This requires the use of a PAM account (standard Linux account).
|
This requires the use of a PAM account (standard Linux account).
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user