Skip to content

fix(lidarr): restore download client terraform resources when provider is fixed #4265

@dmfrey

Description

@dmfrey

Background

Lidarr changed its API protocol values from torrent/usenet to TorrentDownloadProtocol/UsenetDownloadProtocol in a recent release. The devopsarr/lidarr Terraform provider v1.13.0 (latest) cannot parse these new values on READ, causing every plan to fail with:

Error: Client Error
  with lidarr_download_client_qbittorrent.qbittorrent
Unable to read download_client_qbittorrent, got error:
TorrentDownloadProtocol is not a valid DownloadProtocol

What was done

infrastructure/terraform/media/lidarr/download-client.tf was updated to use removed { lifecycle { destroy = false } } blocks for both download clients, dropping them from Terraform state without deleting them from Lidarr. The download clients (qBittorrent and NZBGet) remain configured and functional in Lidarr.

What needs to happen

Once devopsarr/terraform-provider-lidarr#255 is resolved and a new provider version is released:

  1. Update main.tf provider version constraint to the fixed version
  2. Restore the resource blocks in download-client.tf:
    resource "lidarr_download_client_qbittorrent" "qbittorrent" {
      name                       = "qBittorrent"
      enable                     = true
      priority                   = 1
      host                       = "qbittorrent.download.svc.cluster.local"
      port                       = 80
      music_category             = "music"
      remove_completed_downloads = true
      remove_failed_downloads    = true
    }
    
    resource "lidarr_download_client_nzbget" "nzbget" {
      enable                     = true
      priority                   = 1
      name                       = "NZBGet"
      host                       = "nzbget.download.svc.cluster.local"
      port                       = 80
      music_category             = "Music"
      remove_completed_downloads = true
      remove_failed_downloads    = true
    }
  3. Remove the removed {} blocks
  4. Re-import the existing resources if needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions