Skip to content

Commit 0c3e1ff

Browse files
authored
Merge branch 'bpg:main' into Update_Disk_Via_Import
2 parents abe7fbd + 8b9bf62 commit 0c3e1ff

File tree

21 files changed

+774
-21
lines changed

21 files changed

+774
-21
lines changed

.all-contributorsrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,6 +1519,24 @@
15191519
"test",
15201520
"code"
15211521
]
1522+
},
1523+
{
1524+
"login": "JustasUmbrasas",
1525+
"name": "Justas Umbrasas",
1526+
"avatar_url": "https://avatars.githubusercontent.com/u/70886320?v=4",
1527+
"profile": "https://github.com/JustasUmbrasas",
1528+
"contributions": [
1529+
"code"
1530+
]
1531+
},
1532+
{
1533+
"login": "alexhaydock",
1534+
"name": "Alex Haydock",
1535+
"avatar_url": "https://avatars.githubusercontent.com/u/13152214?v=4",
1536+
"profile": "https://github.com/alexhaydock",
1537+
"contributions": [
1538+
"doc"
1539+
]
15221540
}
15231541
],
15241542
"contributorsPerLine": 7,

CONTRIBUTORS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@
214214
</tr>
215215
<tr>
216216
<td align="center" valign="top" width="14.28%"><a href="https://mlit.pro"><img src="https://avatars.githubusercontent.com/u/693906?v=4?s=100" width="100px;" alt="Maciej Lech"/><br /><sub><b>Maciej Lech</b></sub></a><br /><a href="https://github.com/bpg/terraform-provider-proxmox/commits?author=maciej-lech" title="Tests">⚠️</a> <a href="https://github.com/bpg/terraform-provider-proxmox/commits?author=maciej-lech" title="Code">💻</a></td>
217+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/JustasUmbrasas"><img src="https://avatars.githubusercontent.com/u/70886320?v=4?s=100" width="100px;" alt="Justas Umbrasas"/><br /><sub><b>Justas Umbrasas</b></sub></a><br /><a href="https://github.com/bpg/terraform-provider-proxmox/commits?author=JustasUmbrasas" title="Code">💻</a></td>
218+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/alexhaydock"><img src="https://avatars.githubusercontent.com/u/13152214?v=4?s=100" width="100px;" alt="Alex Haydock"/><br /><sub><b>Alex Haydock</b></sub></a><br /><a href="https://github.com/bpg/terraform-provider-proxmox/commits?author=alexhaydock" title="Documentation">📖</a></td>
217219
</tr>
218220
</tbody>
219221
<tfoot>

docs/data-sources/virtual_environment_sdn_vnet.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,24 @@ description: |-
1111

1212
Retrieves information about an existing SDN VNet.
1313

14-
14+
## Example Usage
15+
16+
```terraform
17+
data "proxmox_virtual_environment_sdn_vnet" "example" {
18+
id = "vnet1"
19+
}
20+
21+
output "data_proxmox_virtual_environment_sdn_vnet" {
22+
value = {
23+
id = data.proxmox_virtual_environment_sdn_vnet.example.id
24+
zone = data.proxmox_virtual_environment_sdn_vnet.example.zone
25+
alias = data.proxmox_virtual_environment_sdn_vnet.example.alias
26+
isolate_ports = data.proxmox_virtual_environment_sdn_vnet.example.isolate_ports
27+
tag = data.proxmox_virtual_environment_sdn_vnet.example.tag
28+
vlan_aware = data.proxmox_virtual_environment_sdn_vnet.example.vlan_aware
29+
}
30+
}
31+
```
1532

1633
<!-- schema generated by tfplugindocs -->
1734
## Schema
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
layout: page
3+
title: proxmox_virtual_environment_sdn_vnets
4+
parent: Data Sources
5+
subcategory: Virtual Environment
6+
description: |-
7+
Retrieves information about all SDN VNets in Proxmox. This data source lists all virtual networks configured in the Software-Defined Networking setup.
8+
---
9+
10+
# Data Source: proxmox_virtual_environment_sdn_vnets
11+
12+
Retrieves information about all SDN VNets in Proxmox. This data source lists all virtual networks configured in the Software-Defined Networking setup.
13+
14+
## Example Usage
15+
16+
```terraform
17+
# List all SDN VNets
18+
data "proxmox_virtual_environment_sdn_vnets" "all" {}
19+
20+
output "data_proxmox_virtual_environment_sdn_vnets_all" {
21+
value = {
22+
vnets = data.proxmox_virtual_environment_sdn_vnets.all.vnets
23+
}
24+
}
25+
```
26+
27+
<!-- schema generated by tfplugindocs -->
28+
## Schema
29+
30+
### Read-Only
31+
32+
- `vnets` (List of Object) List of SDN VNets. (see [below for nested schema](#nestedatt--vnets))
33+
34+
<a id="nestedatt--vnets"></a>
35+
### Nested Schema for `vnets`
36+
37+
Read-Only:
38+
39+
- `alias` (String)
40+
- `id` (String)
41+
- `isolate_ports` (Boolean)
42+
- `tag` (Number)
43+
- `vlan_aware` (Boolean)
44+
- `zone` (String)

docs/index.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ Use the navigation to the left to read about the available resources.
4545
| `PROXMOX_VE_SSH_USERNAME` | SSH username | No |
4646
| `PROXMOX_VE_SSH_PASSWORD` | SSH password | No |
4747
| `PROXMOX_VE_SSH_PRIVATE_KEY` | SSH private key | No |
48+
| `PROXMOX_VE_SSH_AGENT` | Use SSH agent for authentication | No |
49+
| `PROXMOX_VE_SSH_AUTH_SOCK` | SSH agent socket path | No |
50+
| `PROXMOX_VE_SSH_AGENT_FORWARDING` | Enable SSH agent forwarding | No |
51+
| `PROXMOX_VE_SSH_SOCKS5_SERVER` | SOCKS5 proxy server address | No |
52+
| `PROXMOX_VE_SSH_SOCKS5_USERNAME` | SOCKS5 proxy username | No |
53+
| `PROXMOX_VE_SSH_SOCKS5_PASSWORD` | SOCKS5 proxy password | No |
54+
| `PROXMOX_VE_MIN_TLS` | Minimum TLS version | No |
55+
| `PROXMOX_VE_OTP` | One-time password (deprecated) | No |
4856
| `PROXMOX_VE_TMPDIR` | Custom temporary directory | No |
4957

5058
*One of these authentication methods is required
@@ -76,7 +84,7 @@ provider "proxmox" {
7684
## Authentication
7785

7886
The Proxmox provider offers a flexible means of providing credentials for authentication.
79-
Static credentials and pre-authenticated session-ticket can be provided to the `proxmox` block through one of the choices of arguments below, ordered by precedence:
87+
Static credentials and pre-authenticated session ticket can be provided to the `proxmox` block through one of the choices of arguments below, ordered by precedence:
8088

8189
- `api_token`
8290
- `auth_ticket` and `csrf_prevention_token`
@@ -192,20 +200,20 @@ See the [Argument Reference](#argument-reference) section for the supported vari
192200
### API Token Authentication
193201

194202
API Token authentication can be used to authenticate with the Proxmox API without the need to provide a password.
195-
In combination with the `ssh` block and `ssh-agent` support, this allows for a fully password-less authentication.
203+
In combination with the `ssh` block and SSH agent support, this allows for a fully password-less authentication.
196204

197205
You can create an API Token for a user via the Proxmox UI, or via the command line on the Proxmox host or cluster:
198206

199207
- Create a user:
200208

201209
```sh
202-
sudo pveum user add terraform@pve
210+
pveum user add terraform@pve
203211
```
204212

205213
- Create a role for the user (you can skip this step if you want to use any of the existing roles):
206214

207215
```sh
208-
sudo pveum role add Terraform -privs "Realm.AllocateUser, VM.PowerMgmt, VM.GuestAgent.Unrestricted, Sys.Console, Sys.Audit, Sys.AccessNetwork, VM.Config.Cloudinit, VM.Replicate, Pool.Allocate, SDN.Audit, Realm.Allocate, SDN.Use, Mapping.Modify, VM.Config.Memory, VM.GuestAgent.FileSystemMgmt, VM.Allocate, SDN.Allocate, VM.Console, VM.Clone, VM.Backup, Datastore.AllocateTemplate, VM.Snapshot, VM.Config.Network, Sys.Incoming, Sys.Modify, VM.Snapshot.Rollback, VM.Config.Disk, Datastore.Allocate, VM.Config.CPU, VM.Config.CDROM, Group.Allocate, Datastore.Audit, VM.Migrate, VM.GuestAgent.FileWrite, Mapping.Use, Datastore.AllocateSpace, Sys.Syslog, VM.Config.Options, Pool.Audit, User.Modify, VM.Config.HWType, VM.Audit, Sys.PowerMgmt, VM.GuestAgent.Audit, Mapping.Audit, VM.GuestAgent.FileRead, Permissions.Modify"
216+
pveum role add Terraform -privs "Realm.AllocateUser, VM.PowerMgmt, VM.GuestAgent.Unrestricted, Sys.Console, Sys.Audit, Sys.AccessNetwork, VM.Config.Cloudinit, VM.Replicate, Pool.Allocate, SDN.Audit, Realm.Allocate, SDN.Use, Mapping.Modify, VM.Config.Memory, VM.GuestAgent.FileSystemMgmt, VM.Allocate, SDN.Allocate, VM.Console, VM.Clone, VM.Backup, Datastore.AllocateTemplate, VM.Snapshot, VM.Config.Network, Sys.Incoming, Sys.Modify, VM.Snapshot.Rollback, VM.Config.Disk, Datastore.Allocate, VM.Config.CPU, VM.Config.CDROM, Group.Allocate, Datastore.Audit, VM.Migrate, VM.GuestAgent.FileWrite, Mapping.Use, Datastore.AllocateSpace, Sys.Syslog, VM.Config.Options, Pool.Audit, User.Modify, VM.Config.HWType, VM.Audit, Sys.PowerMgmt, VM.GuestAgent.Audit, Mapping.Audit, VM.GuestAgent.FileRead, Permissions.Modify"
209217
```
210218

211219
~> The list of available privileges has been changed in PVE 9.0, and the above list is only an example (and most likely too excessive for most use cases), please review it and adjust to your needs.
@@ -214,15 +222,17 @@ You can create an API Token for a user via the Proxmox UI, or via the command li
214222
- Assign the role to the previously created user:
215223

216224
```sh
217-
sudo pveum aclmod / -user terraform@pve -role Terraform
225+
pveum aclmod / -user terraform@pve -role Terraform
218226
```
219227

220228
- Create an API token for the user:
221229

222230
```sh
223-
sudo pveum user token add terraform@pve provider --privsep=0
231+
pveum user token add terraform@pve provider --privsep=0
224232
```
225233

234+
-> Make sure you copy the token value, as it will not be displayed again.
235+
226236
Refer to the upstream docs as needed for additional details concerning [PVE User Management](https://pve.proxmox.com/wiki/User_Management).
227237

228238
Generating the token will output a table containing the token's ID and secret which are meant to be concatenated into a single string for use with either the `api_token` field of the `provider` block (fine for testing but should be avoided) or sourced from the `PROXMOX_VE_API_TOKEN` environment variable.
@@ -322,7 +332,7 @@ Please refer to the [Argument Reference](#argument-reference) section to view th
322332
### SSH Agent
323333

324334
The provider does not use OS-specific SSH configuration files, such as `~/.ssh/config`.
325-
Instead, it uses the SSH protocol directly, and supports the `SSH_AUTH_SOCK` environment variable (or `agent_socket` argument) to connect to the `ssh-agent`.
335+
Instead, it uses the SSH protocol directly, and supports the `SSH_AUTH_SOCK` environment variable (or `agent_socket` argument) to connect to the SSH agent.
326336
This allows the provider to use the SSH agent configured by the user, and to support multiple SSH agents running on the same machine.
327337
You can find more details on the SSH Agent [here](https://www.digitalocean.com/community/tutorials/ssh-essentials-working-with-ssh-servers-clients-and-keys#adding-your-ssh-keys-to-an-ssh-agent-to-avoid-typing-the-passphrase).
328338
The SSH agent authentication takes precedence over the `private_key` and `password` authentication.
@@ -436,7 +446,7 @@ In the example below, we create a user `terraform` and assign the `sudo` privile
436446
437447
You should be able to connect to the target node and see the output containing `APIVER <number>` on the screen without being prompted for your password.
438448
439-
Alternatively if `pam_ssh_agent_auth` is configured on the target node the SSH Config option `agent_forwarding` may be used to forward the SSH Agent that was used for the connection to the remote server. This can allow `sudo` without a password which validates public ssh key configured for `pam_ssh_agent_auth`.
449+
Alternatively if `pam_ssh_agent_auth` is configured on the target node the SSH Config option `agent_forwarding` may be used to forward the SSH agent that was used for the connection to the remote server. This can allow `sudo` without a password which validates public SSH key configured for `pam_ssh_agent_auth`.
440450
441451
### Node IP address used for SSH connection
442452

docs/resources/virtual_environment_container.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ output "ubuntu_container_public_key" {
160160
- `ipv6` - (Optional) The IPv6 configuration.
161161
- `address` - (Optional) The IPv6 address in CIDR notation
162162
(e.g. fd1c::7334/64). Alternatively, set this
163-
to `dhcp` for autodiscovery.
163+
to `dhcp` for DHCPv6, or `auto` for SLAAC.
164164
- `gateway` - (Optional) The IPv6 gateway (must be omitted
165-
when `dhcp` is used as the address).
165+
when `dhcp` or `auto` are used as the address).
166166
- `user_account` - (Optional) The user account configuration.
167167
- `keys` - (Optional) The SSH keys for the root account.
168168
- `password` - (Optional) The password for the root account.
@@ -225,7 +225,8 @@ output "ubuntu_container_public_key" {
225225
- `opensuse` - openSUSE.
226226
- `ubuntu` - Ubuntu.
227227
- `unmanaged` - Unmanaged.
228-
- `pool_id` - (Optional) The identifier for a pool to assign the container to.
228+
- `pool_id` - (Optional, **Deprecated**) The identifier for a pool to assign the container to.
229+
This field is deprecated and will be removed in a future release. To assign the container to a pool, use the `proxmox_virtual_environment_pool_membership` resource instead.
229230
- `protection` - (Optional) Whether to set the protection flag of the container (defaults to `false`). This will prevent the container itself and its disk for remove/update operations.
230231
- `started` - (Optional) Whether to start the container (defaults to `true`).
231232
- `startup` - (Optional) Defines startup and shutdown behavior of the container.

docs/resources/virtual_environment_vm.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,9 @@ output "ubuntu_vm_public_key" {
390390
- `ipv6` - (Optional) The IPv6 configuration.
391391
- `address` - (Optional) The IPv6 address in CIDR notation
392392
(e.g. fd1c::7334/64). Alternatively, set this
393-
to `dhcp` for autodiscovery.
393+
to `dhcp` for DHCPv6, or `auto` for SLAAC.
394394
- `gateway` - (Optional) The IPv6 gateway (must be omitted
395-
when `dhcp` is used as the address).
395+
when `dhcp` or `auto` are used as the address).
396396
- `user_account` - (Optional) The user account configuration (conflicts
397397
with `user_data_file_id`).
398398
- `keys` - (Optional) The SSH keys.
@@ -503,7 +503,8 @@ output "ubuntu_vm_public_key" {
503503
- `win11` - Windows 11
504504
- `wvista` - Windows Vista.
505505
- `wxp` - Windows XP.
506-
- `pool_id` - (Optional) The identifier for a pool to assign the virtual machine to.
506+
- `pool_id` - (Optional, **Deprecated**) The identifier for a pool to assign the virtual machine to.
507+
This field is deprecated and will be removed in a future release. To assign the VM to a pool, use the `proxmox_virtual_environment_pool_membership` resource instead.
507508
- `protection` - (Optional) Sets the protection flag of the VM. This will disable the remove VM and remove disk operations (defaults to `false`).
508509
- `reboot` - (Optional) Reboot the VM after initial creation (defaults to `false`).
509510
- `reboot_after_update` - (Optional) Reboot the VM after update if needed (defaults to `true`).

example/data_source_virtual_environment_sdn.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ data "proxmox_virtual_environment_sdn_vnet" "test_vnet_1" {
2323
id = proxmox_virtual_environment_sdn_vnet.test_vnet_1.id
2424
}
2525

26+
data "proxmox_virtual_environment_sdn_vnets" "all" {
27+
depends_on = [
28+
proxmox_virtual_environment_sdn_vnet.test_vnet_1,
29+
proxmox_virtual_environment_sdn_vnet.test_vnet_2,
30+
]
31+
}
32+
2633
data "proxmox_virtual_environment_sdn_subnet" "test_subnet_dhcp" {
2734
depends_on = [proxmox_virtual_environment_sdn_subnet.test_subnet_dhcp]
2835
cidr = proxmox_virtual_environment_sdn_subnet.test_subnet_dhcp.cidr
@@ -45,6 +52,10 @@ output "proxmox_virtual_environment_sdn_vnet" {
4552
value = data.proxmox_virtual_environment_sdn_vnet.test_vnet_1
4653
}
4754

55+
output "proxmox_virtual_environment_sdn_vnets" {
56+
value = data.proxmox_virtual_environment_sdn_vnets.all
57+
}
58+
4859
output "proxmox_virtual_environment_sdn_subnet" {
4960
value = data.proxmox_virtual_environment_sdn_subnet.test_subnet_dhcp
5061
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
data "proxmox_virtual_environment_sdn_vnet" "example" {
2+
id = "vnet1"
3+
}
4+
5+
output "data_proxmox_virtual_environment_sdn_vnet" {
6+
value = {
7+
id = data.proxmox_virtual_environment_sdn_vnet.example.id
8+
zone = data.proxmox_virtual_environment_sdn_vnet.example.zone
9+
alias = data.proxmox_virtual_environment_sdn_vnet.example.alias
10+
isolate_ports = data.proxmox_virtual_environment_sdn_vnet.example.isolate_ports
11+
tag = data.proxmox_virtual_environment_sdn_vnet.example.tag
12+
vlan_aware = data.proxmox_virtual_environment_sdn_vnet.example.vlan_aware
13+
}
14+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# List all SDN VNets
2+
data "proxmox_virtual_environment_sdn_vnets" "all" {}
3+
4+
output "data_proxmox_virtual_environment_sdn_vnets_all" {
5+
value = {
6+
vnets = data.proxmox_virtual_environment_sdn_vnets.all.vnets
7+
}
8+
}

0 commit comments

Comments
 (0)