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

7 Commits

Author SHA1 Message Date
unkinben 7261bf5bbb 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
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.
2026-06-29 23:29:28 +10:00
unkinben 40df65c1e1 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
Add required_providers block so tofu validate works in the module
directory. Fix alignment from tofu fmt.
2026-06-29 23:25:09 +10:00
unkinben 292c0aca5c fix: align config with imported state for zero-drift plan
ci/woodpecker/pr/pre-commit Pipeline failed
ci/woodpecker/pr/plan Pipeline was successful
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.
2026-06-28 23:45:04 +10:00
unkinben 81b28c72b1 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
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.
2026-06-28 23:31:38 +10:00
unkinben fe1219878e fix: align terraform resources with actual provider schema
ci/woodpecker/pr/pre-commit Pipeline failed
ci/woodpecker/pr/plan Pipeline failed
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.
2026-06-28 22:27:40 +10:00
unkinben 117c8e7841 fix: use TF_VAR_sonarr_api_key for terraform variable injection
ci/woodpecker/pr/pre-commit Pipeline failed
ci/woodpecker/pr/plan Pipeline failed
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.
2026-06-28 22:20:16 +10:00
unkinben 75fc7f0930 feat: initial sonarr terraform configuration 2026-06-28 22:12:18 +10:00