Logic and data separated.
Variables are loaded.
Dynamic configuration files? Templates are your blades – fed by variables.
They support logic.
Loops.
Conditionals.
Ghosts don’t over-complicate.
Clarity keeps templates sharp.
Route To The Dynamics
Templates can live anywhere.
But Ghosts maintain focus and clarity – with modular code: roles.
Roles have fixed directory structure: a place in the /templates dir.
Aging code is still readable. The Operator finds the templates.
No ambiguous paths. No surprises.
Logics – Unstoppable Force Of Data Flow
Ansible variables can take a lot of forms.
Strings.
Lists.
Dictionaries.
Lists of dictionaries.
Templates and Jinja2 evolved to match the pace.
With a YAML list:
ssh_users:
- joe
- jane
- jacob
You can do the loop magic:
{% for user in ssh_users %}
AllowUser {{ user }}
{% endfor %}
Like a sniper – hit them in a row:
AllowUsers {{ ssh_users| join(", ") }}
Cold, tactical list dynamics.
Lists of dictionaries behave too:
local_users:
- user: tom
home: /home/tom
- user: tim
home: /home/tim
- user: tara
home: /home/tara
Loop them like a Ghost:
{% for user in local_users %}
Username: {{ user.user }} with home: {{ user.home }}...
{% endfor %}
Perfect strike with the perfect tool.
Whispers Of The Ghost
Templates are dynamic.
They support logic.
But complexity kills clarity.
The lack of clarity is noise.
Keep your templates sharp.
Keep the signal strong.
You’re the Operator.