init.sls 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #
  2. # Basic system related information
  3. #
  4. /etc/freifunk:
  5. file.directory:
  6. - user: root
  7. - group: root
  8. - mode: 755
  9. - makedirs: True
  10. # Generate /etc/freifunk/role file with main role the node has configured in NetBox
  11. /etc/freifunk/role:
  12. file.managed:
  13. - contents: {{ salt['pillar.get']('node:role', "") }}
  14. # Generate /etc/freifunk/roles file with all roles configured on the node,
  15. # one on each line.
  16. /etc/freifunk/roles:
  17. file.managed:
  18. - source: salt://ffinfo/list.tmpl
  19. - template: jinja
  20. list: {{ salt['pillar.get']('node:roles', []) }}
  21. # Generate /etc/freifunk/sites file with all sites configured on the node,
  22. # one on each line. Empty if no sites configured.
  23. /etc/freifunk/sites:
  24. file.managed:
  25. - source: salt://ffinfo/list.tmpl
  26. - template: jinja
  27. list: {{ salt['pillar.get']('node:sites', []) }}
  28. # Generate /etc/freifunk/status file with the status of this node
  29. {% set status = salt['pillar.get']('node:status', 'UNKNOWN') %}
  30. /etc/freifunk/status:
  31. file.managed:
  32. - contents: {{ status }}