Saltstack Official Home Assistant Formula
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

57 lines
1.2KB

  1. {%- from "home_assistant/map.jinja" import server with context %}
  2. {%- if server.enabled %}
  3. home_assistant_packages:
  4. pkg.installed:
  5. - names: {{ server.pkgs }}
  6. {{ server.dir.base }}:
  7. virtualenv.manage:
  8. - requirements: salt://home_assistant/files/requirements.txt
  9. - require:
  10. - pkg: home_assistant_packages
  11. home_assistant_user:
  12. user.present:
  13. - name: home_assistant
  14. - system: true
  15. - home: {{ server.dir.base }}
  16. - require:
  17. - virtualenv: {{ server.dir.base }}
  18. home_assistant_dir:
  19. file.directory:
  20. - names:
  21. - /etc/home_assistant
  22. - /var/log/home_assistant
  23. - mode: 700
  24. - makedirs: true
  25. - user: home_assistant
  26. - require:
  27. - virtualenv: {{ server.dir.base }}
  28. home_assistant_config:
  29. file.managed:
  30. - name: /etc/home_assistant/configuration.yaml
  31. - source: salt://home_assistant/files/configuration.yaml
  32. - template: jinja
  33. - user: home_assistant
  34. - mode: 600
  35. - require:
  36. - file: home_assistant_dir
  37. {%- if server.known_device is defined %}
  38. home_assistant_know_devices:
  39. file.managed:
  40. - name: /etc/home_assistant/known_devices.yaml
  41. - source: salt://home_assistant/files/known_devices.yaml
  42. - template: jinja
  43. - user: home_assistant
  44. - mode: 600
  45. - require:
  46. - file: home_assistant_dir
  47. {%- endif %}
  48. {%- endif %}