efe24d8a5f
This is a follow-up change to [0] which further implements data objects to be used in the generation of documents in Jinja2. The following additions and changes are made: - Adds helper functions to data objects to filter hosts and networks for ease of use in Jinja2 templates - Adds SiteDocumentData factory function to convert intermediary yaml dictionaries into a SiteDocumentData object with all associated objects - Updates Jinja2 templates to use data objects - Cleans up overly complex looping in Jinja2 - Adds tests for new code in models.py [0] https://review.opendev.org/#/c/662092/ Change-Id: I66ebfeaf5d6ca76b6dee5a2285a74bad8b06b720
18 lines
451 B
Django/Jinja
18 lines
451 B
Django/Jinja
---
|
|
# High-level pegleg site definition file
|
|
schema: pegleg/SiteDefinition/v1
|
|
metadata:
|
|
schema: metadata/Document/v1
|
|
layeringDefinition:
|
|
abstract: false
|
|
layer: site
|
|
# NEWSITE-CHANGEME: Replace with the site name
|
|
name: {{ data.site_info.region_name }}
|
|
storagePolicy: cleartext
|
|
data:
|
|
# The type layer this site will delpoy with. Type layer is found in the
|
|
# aic-clcp-manifests repo.
|
|
site_type: {{ data.site_info.sitetype }}
|
|
...
|
|
|