0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 18:42:58 +00:00
Terraform / OpenTofu Provider for Proxmox VE
Go to file
2019-12-08 22:03:54 +01:00
example Latest work 2019-12-08 22:03:54 +01:00
proxmox Latest work 2019-12-08 22:03:54 +01:00
.gitignore Latest work 2019-12-08 17:59:05 +01:00
CHANGELOG.md Latest work 2019-12-08 18:37:39 +01:00
data_source_virtual_environment_group_test.go Latest work 2019-12-08 18:39:55 +01:00
data_source_virtual_environment_group.go Latest work 2019-12-08 22:03:54 +01:00
data_source_virtual_environment_groups_test.go Latest work 2019-12-08 18:39:55 +01:00
data_source_virtual_environment_groups.go Latest work 2019-12-08 22:03:54 +01:00
data_source_virtual_environment_role_test.go Latest work 2019-12-08 18:39:55 +01:00
data_source_virtual_environment_role.go Latest work 2019-12-08 22:03:54 +01:00
data_source_virtual_environment_roles_test.go Latest work 2019-12-08 18:39:55 +01:00
data_source_virtual_environment_roles.go Latest work 2019-12-08 22:03:54 +01:00
data_source_virtual_environment_version_test.go Latest work 2019-12-07 21:15:59 +01:00
data_source_virtual_environment_version.go Latest work 2019-12-07 23:20:59 +01:00
go.mod Latest work 2019-12-07 22:21:53 +01:00
go.sum Latest work 2019-12-07 22:21:53 +01:00
LICENSE Initial work 2019-12-07 19:58:29 +01:00
main.go Initial work 2019-12-07 19:58:29 +01:00
Makefile Latest work 2019-12-08 17:59:05 +01:00
provider_test.go Initial work 2019-12-07 19:58:29 +01:00
provider.go Latest work 2019-12-08 18:37:39 +01:00
README.md Latest work 2019-12-08 18:37:39 +01:00
resource_virtual_environment_group_test.go Latest work 2019-12-08 18:39:55 +01:00
resource_virtual_environment_group.go Latest work 2019-12-08 22:03:54 +01:00
resource_virtual_environment_role_test.go Latest work 2019-12-08 18:39:55 +01:00
resource_virtual_environment_role.go Latest work 2019-12-08 22:03:54 +01:00
version.go Initial work 2019-12-07 19:58:29 +01:00

Terraform Provider for Proxmox

A Terraform Provider which adds support for Proxmox solutions.

Requirements

  • Terraform 0.11+
  • Go 1.12 (to build the provider plugin)

Building the Provider

Clone repository to: $GOPATH/src/github.com/danitso/terraform-provider-proxmox

$ mkdir -p $GOPATH/src/github.com/danitso; cd $GOPATH/src/github.com/danitso
$ git clone git@github.com:danitso/terraform-provider-proxmox

Enter the provider directory, initialize and build the provider

$ cd $GOPATH/src/github.com/danitso/terraform-provider-proxmox
$ make init
$ make build

Using the Provider

If you're building the provider, follow the instructions to install it as a plugin. After placing it into your plugins directory, run terraform init to initialize it.

Configuration

Arguments

  • virtual_environment - (Optional) This is the configuration block for the Proxmox Virtual Environment.
    • endpoint - (Required) The endpoint for the Proxmox Virtual Environment API.
    • insecure - (Optional) Whether to skip the TLS verification step. Defaults to false.
    • password - (Required) The password for the Proxmox Virtual Environment API.
    • username - (Required) The username for the Proxmox Virtual Environment API.

Data Sources

Virtual Environment

Group (proxmox_virtual_environment_group)
Arguments
  • group_id - (Required) The group id.
Attributes
  • comment - The group comment.
  • members - The group members as a list with username@realm entries.
Groups (proxmox_virtual_environment_groups)
Arguments

This data source doesn't accept arguments.

Attributes
  • comments - The group comments.
  • group_ids - The group ids.
Role (proxmox_virtual_environment_role)
Arguments
  • role_id - (Required) The role id.
Attributes
  • privileges - The role privileges.
Roles (proxmox_virtual_environment_roles)
Arguments

This data source doesn't accept arguments.

Attributes
  • privileges - The role privileges.
  • role_ids - The role ids.
  • special - Whether the role is special (built-in).
Version (proxmox_virtual_environment_version)
Arguments

This data source doesn't accept arguments.

Attributes
  • keyboard - The keyboard layout.
  • release - The release number.
  • repository_id - The repository id.
  • version - The version string.

Resources

Virtual Environment

Group (proxmox_virtual_environment_group)
Arguments
  • comment - (Optional) The group comment.
  • group_id - (Required) The group id.
Attributes
  • members - The group members as a list with username@realm entries.
Role (proxmox_virtual_environment_role)
Arguments
  • privileges - (Required) The role privileges.
  • role_id - (Required) The role id.
Attributes

This resource doesn't expose any additional attributes.

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.12+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin to your $PATH.

To compile the provider, run make build. This will build the provider and put the provider binary in the $GOPATH/bin directory.

$ make build
...
$ $GOPATH/bin/terraform-provider-proxmox
...

If you wish to contribute to the provider, the following requirements must be met,

  • All tests must pass using make test
  • The Go code must be formatted using Gofmt
  • Dependencies are installed by make init

Testing the Provider

In order to test the provider, you can simply run make test.

$ make test

Tests are limited to regression tests, ensuring backwards compability.