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-14 15:25:10 +01:00
example Minor refactoring 2019-12-14 15:25:10 +01:00
proxmox Minor refactoring 2019-12-14 15:25:10 +01:00
.gitignore Latest work 2019-12-08 17:59:05 +01:00
.travis.yml Add .travis.yml 2019-12-13 02:14:21 +01:00
CHANGELOG.md Initial work on file resource 2019-12-12 00:32:09 +01:00
data_source_virtual_environment_datastores_test.go Minor refactoring 2019-12-14 15:25:10 +01:00
data_source_virtual_environment_datastores.go Initial work on file resource 2019-12-12 00:32:09 +01:00
data_source_virtual_environment_group_test.go Minor refactoring 2019-12-14 15:25:10 +01:00
data_source_virtual_environment_group.go Minor refactoring 2019-12-14 15:25:10 +01:00
data_source_virtual_environment_groups_test.go Minor refactoring 2019-12-14 15:25:10 +01:00
data_source_virtual_environment_groups.go Latest work 2019-12-08 23:57:45 +01:00
data_source_virtual_environment_nodes_test.go Minor refactoring 2019-12-14 15:25:10 +01:00
data_source_virtual_environment_nodes.go Added nodes data source 2019-12-11 01:32:12 +01:00
data_source_virtual_environment_pool_test.go Minor refactoring 2019-12-14 15:25:10 +01:00
data_source_virtual_environment_pool.go Minor refactoring 2019-12-14 15:25:10 +01:00
data_source_virtual_environment_pools_test.go Minor refactoring 2019-12-14 15:25:10 +01:00
data_source_virtual_environment_pools.go Initial work on pool resource 2019-12-10 00:12:47 +01:00
data_source_virtual_environment_role_test.go Minor refactoring 2019-12-14 15:25:10 +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 Minor refactoring 2019-12-14 15:25:10 +01:00
data_source_virtual_environment_roles.go Latest work 2019-12-08 23:57:45 +01:00
data_source_virtual_environment_user_test.go Minor refactoring 2019-12-14 15:25:10 +01:00
data_source_virtual_environment_user.go Minor refactoring 2019-12-14 15:25:10 +01:00
data_source_virtual_environment_users_test.go Minor refactoring 2019-12-14 15:25:10 +01:00
data_source_virtual_environment_users.go Initial work on user resource 2019-12-09 22:38:28 +01:00
data_source_virtual_environment_version_test.go Minor refactoring 2019-12-14 15:25:10 +01:00
data_source_virtual_environment_version.go Minor refactoring 2019-12-14 15:25:10 +01:00
go.mod Upgraded to Terraform v0.12.18 2019-12-13 19:54:13 +01:00
go.sum Upgraded to Terraform v0.12.18 2019-12-13 19:54:13 +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 Initial work on user resource 2019-12-09 22:38:28 +01:00
provider_test.go Initial work 2019-12-07 19:58:29 +01:00
provider.go Initial work on file resource 2019-12-12 00:32:09 +01:00
README.md Minor refactoring 2019-12-14 15:25:10 +01:00
resource_virtual_environment_file_test.go Minor refactoring 2019-12-14 15:25:10 +01:00
resource_virtual_environment_file.go Initial support for HTTP/HTTPS sources in file resource 2019-12-13 00:59:17 +01:00
resource_virtual_environment_group_test.go Minor refactoring 2019-12-14 15:25:10 +01:00
resource_virtual_environment_group.go Initial work on ACL support 2019-12-11 00:24:36 +01:00
resource_virtual_environment_pool_test.go Minor refactoring 2019-12-14 15:25:10 +01:00
resource_virtual_environment_pool.go Minor refactoring 2019-12-14 15:25:10 +01:00
resource_virtual_environment_role_test.go Minor refactoring 2019-12-14 15:25:10 +01:00
resource_virtual_environment_role.go Initial work on ACL support 2019-12-11 00:24:36 +01:00
resource_virtual_environment_user_test.go Minor refactoring 2019-12-14 15:25:10 +01:00
resource_virtual_environment_user.go Initial work on ACL support 2019-12-11 00:24:36 +01:00
utils.go Minor refactoring 2019-12-14 15:25:10 +01:00
version.go Initial work 2019-12-07 19:58:29 +01:00

Build Status

Terraform Provider for Proxmox

A Terraform Provider which adds support for Proxmox solutions.

Requirements

  • Terraform 0.11+
  • Go 1.13 (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

Datastores (proxmox_virtual_environment_datastores)
Arguments
  • node_name - (Required) A node name
Attributes
  • active - Whether the datastore is active
  • content_types - The allowed content types
  • datastore_ids - The datastore ids
  • enabled - Whether the datastore is enabled
  • shared - Whether the datastore is shared
  • space_available - The available space in bytes
  • space_total - The total space in bytes
  • space_used - The used space in bytes
  • types - The storage types
Group (proxmox_virtual_environment_group)
Arguments
  • group_id - (Required) The group id
Attributes
  • acl - The access control list
    • path - The path
    • propagate - Whether to propagate to child paths
    • role_id - The role id
  • 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
Nodes (proxmox_virtual_environment_nodes)
Arguments

This data source doesn't accept arguments.

Attributes
  • cpu_count - The CPU count for each node
  • cpu_utilization - The CPU utilization on each node
  • memory_available - The memory available on each node
  • memory_used - The memory used on each node
  • names - The node names
  • online - Whether a node is online
  • ssl_fingerprints - The SSL fingerprint for each node
  • support_levels - The support level for each node
  • uptime - The uptime in seconds for each node
Pool (proxmox_virtual_environment_pool)
Arguments
  • pool_id - (Required) The pool id
Attributes
  • comment - The pool comment
  • members - The pool members
    • datastore_id - The datastore id
    • id - The member id
    • node_name - The node name
    • type - The member type
    • vm_id - The virtual machine id
Pools (proxmox_virtual_environment_pools)
Arguments

This data source doesn't accept arguments.

Attributes
  • pool_ids - The pool 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)
User (proxmox_virtual_environment_user)
Arguments
  • user_id - (Required) The user id.
Attributes
  • acl - The access control list
    • path - The path
    • propagate - Whether to propagate to child paths
    • role_id - The role id
  • comment - The user comment
  • email - The user's email address
  • enabled - Whether the user account is enabled
  • expiration_date - The user account's expiration date
  • first_name - The user's first name
  • groups - The user's groups
  • keys - The user's keys
  • last_name - The user's last name
Users (proxmox_virtual_environment_user)
Arguments

This data source doesn't accept arguments.

Attributes
  • comments - The user comments
  • emails - The users' email addresses
  • enabled - Whether a user account is enabled
  • expiration_dates - The user accounts' expiration dates
  • first_names - The users' first names
  • groups - The users' groups
  • keys - The users' keys
  • last_names - The users' last names
  • user_ids - The user ids
Version (proxmox_virtual_environment_version)
Arguments

This data source doesn't accept arguments.

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

Resources

Virtual Environment

File (proxmox_virtual_environment_file)
Arguments
  • datastore_id - (Required) The datastore id
  • node_name - (Required) The node name
  • override_file_name - (Optional) The file name to use in the datastore (leave undefined to use source file name)
  • source - (Required) A path to a local file or a URL
  • template - (Required) Whether this is a container template (vztmpl instead of iso)
Attributes
  • file_name - The datastore file name
Group (proxmox_virtual_environment_group)
Arguments
  • acl - (Optional) The access control list (multiple blocks supported)
    • path - The path
    • propagate - Whether to propagate to child paths
    • role_id - The role id
  • comment - (Optional) The group comment
  • group_id - (Required) The group id
Attributes
  • members - The group members as a list with username@realm entries
Pool (proxmox_virtual_environment_pool)
Arguments
  • comment - (Optional) The pool comment
  • pool_id - (Required) The pool id
Attributes
  • members - The pool members
    • datastore_id - The datastore id
    • id - The member id
    • node_name - The node name
    • type - The member type
    • vm_id - The virtual machine id
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.

User (proxmox_virtual_environment_user)
Arguments
  • acl - (Optional) The access control list (multiple blocks supported)
    • path - The path
    • propagate - Whether to propagate to child paths
    • role_id - The role id
  • comment - (Optional) The user comment
  • email - (Optional) The user's email address
  • enabled - (Optional) Whether the user account is enabled
  • expiration_date - (Optional) The user account's expiration date
  • first_name - (Optional) The user's first name
  • groups - (Optional) The user's groups
  • keys - (Optional) The user's keys
  • last_name - (Optional) The user's last name
  • password - (Required) The user's password
  • user_id - (Required) The user 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.13+ 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.