The playbook has three host groups: relay, landing, and a localhost play for generating client configs. Trojan variables (trojan_domain, trojan_port, trojan_password, trojan_fallback_port) live in group_vars/landing.yml, scoped only to the landing group. The Surge template on localhost references these variables, but localhost is not in the landing group, so the variables are undefined.
Goals:
localhost play without duplicating valueslanding onlyNon-Goals:
Move trojan variables to group_vars/all.yml
These variables are consumed by two consumers: the landing server role and the localhost template render. group_vars/all.yml is the simplest way to share them. The alternative approaches considered:
vars: inline to the localhost play — would duplicate values already in landing.ymlhostvars[groups['landing'][0]] in the template — works but makes the template harder to read and debuglocalhost to the landing group — semantically wrong, localhost isn't a landing serverMoving to all.yml is the cleanest: single source of truth, no duplication, template stays readable.
landing.yml to avoid polluting unrelated plays