mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Implemented dict renderer to resolve assets
This commit is contained in:
@@ -9,3 +9,15 @@ applications:
|
||||
variable_b: {} # Merges with the existing content
|
||||
variable_c: [] # Replaces the default value (use caution with domains)
|
||||
```
|
||||
|
||||
## Placeholder Logic with `<< >>`
|
||||
|
||||
You can reference values from the generated `defaults_applications` dictionary at build time by embedding `<< ... >>` placeholders inside your template. For example:
|
||||
|
||||
```yaml
|
||||
url: "{{ web_protocol }}://<< defaults_applications.web-svc-file.domains.canonical[0] >>/assets"
|
||||
```
|
||||
|
||||
- The `<< ... >>` placeholders are resolved by the [`DictRenderer`](../../../utils/dict_renderer.py) helper class.
|
||||
- The CLI uses the [`DefaultsGenerator`](../../../cli/build/defaults/applications.py) class to merge all role configurations into a single YAML and then calls the renderer to substitute each `<< ... >>` occurrence.
|
||||
- Use the `--verbose` flag on the CLI script to log every replacement step, and rely on the built‑in timeout (default: 10 seconds) to prevent infinite loops.
|
||||
|
Reference in New Issue
Block a user