feat: initial sonarr terraform configuration #1

Merged
benvin merged 7 commits from feat/initial-config into main 2026-06-29 23:36:11 +10:00
Owner

Context

Bring Sonarr TV automation under Terraform management using the devopsarr/sonarr provider. This enables declarative, version-controlled configuration of Sonarr's custom formats, quality profiles, download clients, indexers, notifications, and root folders.

Changes

  • Add Terragrunt project structure with Consul backend and Vault-integrated Makefile
  • Add Woodpecker CI pipelines for pre-commit, plan, and apply
  • Add 19 custom format configs (codec, resolution, size, source, release group, HDR)
  • Add 3 quality profiles (SD_OLD_SHOWS, BestQuality_1080p, BestQuality_2160p)
  • Add NZBGet download client config
  • Add 2 Newznab indexers (NZBgeek direct, NZBgeek via Prowlarr)
  • Add Jellyfin notification config
  • Add default delay profile
  • Add /shared/media/tvseries root folder
## Context Bring Sonarr TV automation under Terraform management using the devopsarr/sonarr provider. This enables declarative, version-controlled configuration of Sonarr's custom formats, quality profiles, download clients, indexers, notifications, and root folders. ## Changes - Add Terragrunt project structure with Consul backend and Vault-integrated Makefile - Add Woodpecker CI pipelines for pre-commit, plan, and apply - Add 19 custom format configs (codec, resolution, size, source, release group, HDR) - Add 3 quality profiles (SD_OLD_SHOWS, BestQuality_1080p, BestQuality_2160p) - Add NZBGet download client config - Add 2 Newznab indexers (NZBgeek direct, NZBgeek via Prowlarr) - Add Jellyfin notification config - Add default delay profile - Add /shared/media/tvseries root folder
unkinben added 1 commit 2026-06-28 22:15:18 +10:00
unkinben added 1 commit 2026-06-28 22:20:18 +10:00
fix: use TF_VAR_sonarr_api_key for terraform variable injection
ci/woodpecker/pr/pre-commit Pipeline failed
ci/woodpecker/pr/plan Pipeline failed
117c8e7841
The generated backend.tf defines a terraform variable, so the Makefile
must export the API key as TF_VAR_sonarr_api_key rather than SONARR_API_KEY.
unkinben added 1 commit 2026-06-28 22:27:41 +10:00
fix: align terraform resources with actual provider schema
ci/woodpecker/pr/pre-commit Pipeline failed
ci/woodpecker/pr/plan Pipeline failed
fe1219878e
Use nested attribute assignment instead of dynamic blocks for
specifications, quality_groups, and format_items. Remove unsupported
season_search_maximum_single_episode_age from indexer configs. Flatten
custom format specifications to use value/min/max directly.
unkinben added 1 commit 2026-06-28 23:31:55 +10:00
fix: use data source for size custom formats to work around provider set key bug
ci/woodpecker/pr/pre-commit Pipeline failed
ci/woodpecker/pr/plan Pipeline was successful
81b28c72b1
The devopsarr sonarr provider cannot handle float min/max values in
SizeSpecification as set element keys. Remove size custom formats from
terraform management and look up their IDs via a data source instead.
Also change variable types from map(any) to any to allow heterogeneous
quality profile structures.
unkinben added 1 commit 2026-06-28 23:45:12 +10:00
fix: align config with imported state for zero-drift plan
ci/woodpecker/pr/pre-commit Pipeline failed
ci/woodpecker/pr/plan Pipeline was successful
292c0aca5c
Reorder quality_groups to match provider state (highest quality first),
use correct group structure (omit id/name for single-quality entries),
add lifecycle ignore_changes for sensitive fields (api_key, password),
support explicit name override via YAML for display name mismatches,
and add min_upgrade_format_score attribute.
unkinben added 1 commit 2026-06-29 23:25:10 +10:00
fix: add versions.tf and fix tofu fmt for pre-commit
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline failed
40df65c1e1
Add required_providers block so tofu validate works in the module
directory. Fix alignment from tofu fmt.
unkinben added 1 commit 2026-06-29 23:29:33 +10:00
fix: remove versions.tf and exclude modules from validate/tflint
ci/woodpecker/pr/plan Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
7261bf5bbb
The versions.tf conflicts with terragrunt's generated backend.tf which
already has required_providers. Exclude modules/ from tofu-validate and
tflint pre-commit hooks since they can't init without the full terragrunt
context.
benvin merged commit 4bc968449b into main 2026-06-29 23:36:11 +10:00
Sign in to join this conversation.