Quote every template block in the Site vars

The deploy failed on 'YAML parsing failed: missing quotes around a template
block'. vars/hopsngrains.yml had been edited to derive its names from the web
address, but the two derived values were unquoted and YAML reads a leading brace
as a flow mapping, so the file did not parse at all.

The names now derive from a title (the domain) with every interpolation quoted,
which is what nginx-menu did and what makes the file copyable for another Site:
host menu.<title>, container menu-app.<title>, network <container>_net, data
/var/lib/menu-app.<title>. Resolving the vars offline gives exactly the values
the docs promise, including /app/config/hopsngrains.site.json inside the image.

The old edit derived from host, so app_root would have been
/var/lib/menu.hopsngrains.com — the directory the old static menus were served
from.
This commit is contained in:
tanshu committed 2026-09-22 23:36:42 +05:30
1 parent f2d8058456
commit 65b66f712d
1 file changed
+8 -3
+8 -3
View File
@@ -2,10 +2,15 @@
# Hops n Grains. Its name, tagline, icon, categories and menus live on the
# server under app_root and are edited in the admin; config/hopsngrains.site.json
# only seeds the theme. This file says where the Site runs and what it answers.
host: menu.hopsngrains.com
#
# Every value that interpolates a template is quoted: YAML reads a leading `{`
# as a flow mapping, which is the parse error Ansible reports as "missing quotes
# around a template block".
title: hopsngrains.com
host: 'menu.{{ title }}'
docker_container: menu-app.hopsngrains.com
docker_container: 'menu-app.{{ title }}'
docker_network: '{{ docker_container }}_net'
# Everything the app writes — data/ and the untracked site.env.
app_root: /var/lib/menu-app.hopsngrains.com
app_root: '/var/lib/menu-app.{{ title }}'