-
-
Notifications
You must be signed in to change notification settings - Fork 232
Closed
Labels
🐛 bugSomething isn't workingSomething isn't working
Description
Describe the bug
According to my understanding proxmox_virtual_environment_apt_standard_repository.example.file_path should point to /etc/apt/sources.list.d/proxmox.sources but it point to /etc/apt/sources.list
alexander@MAC-A43374-FHPWNP9X63:~/Development/homelab/infrastructure$ tofu state show module.pve_basics.proxmox_virtual_environment_apt_standard_repository.example
# module.pve_basics.proxmox_virtual_environment_apt_standard_repository.example:
resource "proxmox_virtual_environment_apt_standard_repository" "example" {
description = "This is the recommended repository for testing and non-production use. Its packages are not as heavily tested and validated as the production ready enterprise repository. You don't need a subscription key to access this repository."
file_path = "/etc/apt/sources.list"
handle = "no-subscription"
id = "apt_standard_repository_pve_no_subscription"
index = 0
name = "No-Subscription"
node = "pve"
status = 1
}
To Reproduce
Steps to reproduce the behavior:
- Create the two resources as below.
- Run
tofu apply. - See error as below.
Please also provide a minimal Terraform configuration that reproduces the issue.
I follow the exmple from bpg/proxmox documentation to manage an APT standard repository of a Proxmox VE node.
resource "proxmox_virtual_environment_apt_standard_repository" "example" {
handle = "no-subscription"
node = "pve"
}
resource "proxmox_virtual_environment_apt_repository" "example" {
enabled = true
file_path = proxmox_virtual_environment_apt_standard_repository.example.file_path
index = proxmox_virtual_environment_apt_standard_repository.example.index
node = proxmox_virtual_environment_apt_standard_repository.example.node
}
and the output of terraform|tofu apply.
alexander@MAC-A43374-FHPWNP9X63:~/Development/homelab/infrastructure$ tofu apply
module.pve_basics.proxmox_virtual_environment_dns.this: Refreshing state... [id=pve_dns]
module.pve_basics.proxmox_virtual_environment_time.this: Refreshing state... [id=pve_time]
module.pve_user_acl["alexander"].proxmox_virtual_environment_user.this: Refreshing state... [id=alexander@pve]
module.ubuntu24.proxmox_virtual_environment_download_file.image: Refreshing state... [id=local:iso/ubuntu-24.04-cloudimg-amd64.img]
module.pve_basics.proxmox_virtual_environment_apt_standard_repository.enterprise: Refreshing state... [id=apt_standard_repository_pve_enterprise]
module.windows11.proxmox_virtual_environment_download_file.image: Refreshing state... [id=local:iso/windows-11-virtio.img]
module.debian12.proxmox_virtual_environment_download_file.image: Refreshing state... [id=local:iso/debian-12-generic-amd64.img]
module.pve_basics.proxmox_virtual_environment_apt_standard_repository.no_subscription: Refreshing state... [id=apt_standard_repository_pve_no_subscription]
module.lxc_ubuntu24.proxmox_virtual_environment_download_file.image: Refreshing state... [id=local:vztmpl/ubuntu-24.04-cloudimg-amd64-20250929.tar.xz]
module.pve_user_acl["alexander"].proxmox_virtual_environment_acl.this: Refreshing state... [id=/?alexander@pve?Administrator]
OpenTofu used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
OpenTofu will perform the following actions:
# module.pve_basics.proxmox_virtual_environment_apt_repository.example will be created
+ resource "proxmox_virtual_environment_apt_repository" "example" {
+ comment = (known after apply)
+ components = (known after apply)
+ enabled = true
+ file_path = (known after apply)
+ file_type = (known after apply)
+ id = (known after apply)
+ index = (known after apply)
+ node = "pve"
+ package_types = (known after apply)
+ suites = (known after apply)
+ uris = (known after apply)
}
# module.pve_basics.proxmox_virtual_environment_apt_standard_repository.example will be created
+ resource "proxmox_virtual_environment_apt_standard_repository" "example" {
+ description = (known after apply)
+ file_path = (known after apply)
+ handle = "no-subscription"
+ id = (known after apply)
+ index = (known after apply)
+ name = (known after apply)
+ node = "pve"
+ status = (known after apply)
}
Plan: 2 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
OpenTofu will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
module.pve_basics.proxmox_virtual_environment_apt_standard_repository.example: Creating...
module.pve_basics.proxmox_virtual_environment_apt_standard_repository.example: Creation complete after 0s [id=apt_standard_repository_pve_no_subscription]
module.pve_basics.proxmox_virtual_environment_apt_repository.example: Creating...
╷
│ Error: Could not modify APT repository in file "/etc/apt/sources.list" at index 0 on node "pve"
│
│ with module.pve_basics.proxmox_virtual_environment_apt_repository.example,
│ on modules/pve_basics/main.tf line 35, in resource "proxmox_virtual_environment_apt_repository" "example":
│ 35: resource "proxmox_virtual_environment_apt_repository" "example" {
│
│ modifying APT repository in file /etc/apt/sources.list at index 0 to activation state true: received an HTTP 500 response - Reason: invalid index - 0
Expected behavior
No error ;-)
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
- Single or clustered Proxmox: single
- Proxmox version: 9.0
- Provider version (ideally it should be the latest version): 0.84.0
- Terraform/OpenTofu version: 1.10.6
- OS (where you run Terraform/OpenTofu from): MacOs Tahoe 26.0.1
Madh93
Metadata
Metadata
Assignees
Labels
🐛 bugSomething isn't workingSomething isn't working
Projects
Status
Done