init.sls 940 B

123456789101112131415161718192021222324252627282930313233343536
  1. #
  2. # Basic Freifunk 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/roles file with all roles configured on the node,
  11. # one on each line.
  12. /etc/freifunk/roles:
  13. file.managed:
  14. - source: salt://ffinfo/list.tmpl
  15. - template: jinja
  16. list: {{ salt['pillar.get']('nodes:' ~ grains['id'] ~ ':roles', []) }}
  17. # Generate /etc/freifunk/sites file with all sites configured on the node,
  18. # one on each line. Empty if no sites configured.
  19. /etc/freifunk/sites:
  20. file.managed:
  21. - source: salt://ffinfo/list.tmpl
  22. - template: jinja
  23. list: {{ salt['pillar.get']('nodes:' ~ grains['id'] ~ ':sites', []) }}
  24. # Generate /etc/freifunk/status file with the status of this node
  25. {% set status = salt['pillar.get']('nodes:' ~ grains['id'] ~ ':status', 'active') %}
  26. /etc/freifunk/status:
  27. file.managed:
  28. - contents: {{ status }}