You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.md
+30-16Lines changed: 30 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,12 @@
2
2
3
3
A Terraform provider is responsible for understanding API interactions and exposing resources. The Proxmox provider uses the Proxmox API. This provider exposes two resources: [proxmox_vm_qemu](docs/resources/vm_qemu.md) and [proxmox_lxc](docs/resources/lxc.md).
4
4
5
-
## Creating the Proxmox user and role for terraform
5
+
## Creating the Proxmox user and role for terraform
6
6
7
7
The particular privileges required may change but here is a suitable starting point rather than using cluster-wide Administrator rights
8
8
9
9
Log into the Proxmox cluster or host using ssh (or mimic these in the GUI) then:
10
+
10
11
- Create a new role for the future terraform user.
11
12
- Create the user "terraform-prov@pve"
12
13
- Add the TERRAFORM-PROV role to the terraform-prov user
@@ -17,9 +18,9 @@ pveum user add terraform-prov@pve --password <password>
You can enable global debug mode for the provider underliing api client, using the new provider parameter. The default setting is _false_
66
+
67
+
```hcl
68
+
provider "proxmox" {
69
+
pm_debug = true
70
+
}
71
+
```
72
+
62
73
## Argument Reference
63
74
64
75
The following arguments are supported in the provider block:
65
76
66
-
*`pm_api_url` - (Required; or use environment variable `PM_API_URL`) This is the target Proxmox API endpoint.
67
-
*`pm_user` - (Optional; or use environment variable `PM_USER`) The user, remember to include the authentication realm such as myuser@pam or myuser@pve.
68
-
*`pm_password` - (Optional; sensitive; or use environment variable `PM_PASS`) The password.
69
-
*`pm_api_token_id` - (Optional; or use environment variable `PM_API_TOKEN_ID`) This is an [API token](https://pve.proxmox.com/pve-docs/pveum-plain.html) you have previously created for a specific user.
70
-
*`pm_api_token_secret` - (Optional; or use environment variable `PM_API_TOKEN_SECRET`) This is a uuid that is only available when initially creating the token.
71
-
*`pm_otp` - (Optional; or use environment variable `PM_OTP`) The 2FA OTP code.
72
-
*`pm_tls_insecure` - (Optional) Disable TLS verification while connecting to the proxmox server.
*`pm_log_enable` - (Optional; defaults to false) Enable debug logging, see the section below for logging details.
75
-
*`pm_log_levels` - (Optional) A map of log sources and levels.
76
-
*`pm_log_file` - (Optional; defaults to "terraform-plugin-proxmox.log") If logging is enabled, the log file the provider will write logs to.
77
-
*`pm_timeout` - (Optional; defaults to 300) Timeout value (seconds) for proxmox API calls.
77
+
-`pm_api_url` - (Required; or use environment variable `PM_API_URL`) This is the target Proxmox API endpoint.
78
+
-`pm_user` - (Optional; or use environment variable `PM_USER`) The user, remember to include the authentication realm such as myuser@pam or myuser@pve.
79
+
-`pm_password` - (Optional; sensitive; or use environment variable `PM_PASS`) The password.
80
+
-`pm_api_token_id` - (Optional; or use environment variable `PM_API_TOKEN_ID`) This is an [API token](https://pve.proxmox.com/pve-docs/pveum-plain.html) you have previously created for a specific user.
81
+
-`pm_api_token_secret` - (Optional; or use environment variable `PM_API_TOKEN_SECRET`) This is a uuid that is only available when initially creating the token.
82
+
-`pm_otp` - (Optional; or use environment variable `PM_OTP`) The 2FA OTP code.
83
+
-`pm_tls_insecure` - (Optional) Disable TLS verification while connecting to the proxmox server.
-`pm_log_enable` - (Optional; defaults to false) Enable debug logging, see the section below for logging details.
86
+
-`pm_log_levels` - (Optional) A map of log sources and levels.
87
+
-`pm_log_file` - (Optional; defaults to "terraform-plugin-proxmox.log") If logging is enabled, the log file the provider will write logs to.
88
+
-`pm_timeout` - (Optional; defaults to 300) Timeout value (seconds) for proxmox API calls.
89
+
-`pm_debug` - (Optional; defaults to false) Enable verbose output in proxmox-api-go
78
90
79
91
Additionally, one can set the `PM_OTP_PROMPT` environment variable to prompt for OTP 2FA code (if required).
80
92
81
93
## Logging
82
94
83
-
The provider is able to output detailed logs upon request. Note that this feature is intended for development purposes, but could also be used to help investigate bugs. For example: the following code when placed into the provider "proxmox" block will enable loging to the file "terraform-plugin-proxmox.log". All log sources will default to the "debug" level, and any stdout/stderr from sublibraries (proxmox-api-go) will be silenced (set to non-empty string to enable).
95
+
The provider is able to output detailed logs upon request. Note that this feature is intended for development purposes, but could also be used to help investigate bugs. For example: the following code when placed into the provider "proxmox" block will enable loging to the file "terraform-plugin-proxmox.log". All log sources will default to the "debug" level.
96
+
To silence and any stdout/stderr from sublibraries (proxmox-api-go), remove or comment out \_capturelog.
0 commit comments