core: add interface argument to peer configuration template

This commit is contained in:
Shiz 2022-01-18 22:46:52 +01:00
parent 4665a26098
commit e0a9887a9f
2 changed files with 2 additions and 1 deletions

View File

@ -511,6 +511,7 @@ class WeegeeConnection(WeegeeBase):
template = Template.load(self.context.instance, template_meta.get_name())
config = template_meta.make_config(self.context.instance,
interface=target.interface.item,
connection=self.item,
peers={p.name: p.item for p in peers},
)

View File

@ -193,7 +193,7 @@ AllowedIPs = {{ ((peer.interface.addresses | map(attribute='network') | list) +
PersistentKeepalive = 30
{% endfor -%}
""".strip(),
variables={'connection': WEEGEE_CONNECTION, 'peers': {str: WEEGEE_PEER}},
variables={'interface': WEEGEE_INTERFACE, 'connection': WEEGEE_CONNECTION, 'peers': {str: WEEGEE_PEER}},
)
WEEGEE_CONF_WG = WeegeeTemplate(