Skip to content

Commit

Permalink
mesh-announce: announce more infos
Browse files Browse the repository at this point in the history
  • Loading branch information
herbetom committed Dec 1, 2020
1 parent f356569 commit d27ac2a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
26 changes: 25 additions & 1 deletion mesh-announce/files/mesh-announce.conf.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{%- set hardware_model = salt['pillar.get']('nodeinfo:hardware:model', '') %}
{%- set contact = salt['pillar.get']('nodeinfo:owner:contact', '') %}
{%- set latitude = salt['pillar.get']('nodeinfo:location:latitude', '') %}
{%- set longitude = salt['pillar.get']('nodeinfo:location:longitude', '') %}

# Default settings
[Defaults]
# Listen port, defaults to 1001
Expand All @@ -7,9 +12,28 @@ MulticastLinkAddress: ff02::2:1001
MulticastSiteAddress: ff05::2:1001
# Default domain type
DomainType: batadv
{%- if hardware_model != "" %}
Hardware-Model: {{ hardware_model }}
{%- endif %}
{%- if contact != "" %}
Contact: {{ contact }}
{%- endif %}
{%- if latitude != "" %}
Latitude: {{ latitude }}
{%- endif %}
{%- if longitude != "" %}
Longitude: {{ longitude }}
{%- endif %}
VPN: {% if not ("roles" in pillar and ('gateway4' in pillar.roles or 'gateway6' in pillar.roles)) %}False{% else %}True{% endif %}

{% for domain in salt['pillar.get']('domains').keys() %}
[{% if domain == "dom0" %}ffrn{% else %}{{ domain }}{% endif %}]
{%- if domain == "dom0" %}
[ffrn]
Hostname: {{ salt['grains.get']('fqdn', '') }}
{%- else %}
[{{ domain }}]
Hostname: {{ domain }}.{{ salt['grains.get']('fqdn', '') }}
{%- endif %}
# Batman interface, mandatory
BatmanInterface: {{ domain }}-bat
# Other listen interfaces
Expand Down
6 changes: 3 additions & 3 deletions mesh-announce/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ mesh-announce:
- file: /etc/mesh-announce/mesh-announce.conf
- file: /etc/systemd/system/mesh-announce.service
https://git.darmstadt.ccc.de/ffda/infra/mesh-announce.git:
https://github.com/Freifunk-Rhein-Neckar/mesh-announce.git:
git.latest:
- target: /opt/mesh-announce
- force_fetch: true
- force_reset: true
- refspec_branch: sudo
- rev: sudo
- refspec_branch: ffrn_dev
- rev: ffrn_dev
- watch_in:
- service: mesh-announce
Expand Down

0 comments on commit d27ac2a

Please sign in to comment.