Saltstack Official Home Assistant Formula
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

59 lines
1.3KB

  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. - system_site_packages: True
  9. - requirements: salt://home_assistant/files/requirements.txt
  10. - python: /usr/bin/python3
  11. - require:
  12. - pkg: home_assistant_packages
  13. home_assistant_user:
  14. user.present:
  15. - name: home_assistant
  16. - system: true
  17. - home: {{ server.dir.base }}
  18. - require:
  19. - virtualenv: {{ server.dir.base }}
  20. home_assistant_dir:
  21. file.directory:
  22. - names:
  23. - /etc/home_assistant
  24. - /var/log/home_assistant
  25. - mode: 700
  26. - makedirs: true
  27. - user: home_assistant
  28. - require:
  29. - virtualenv: {{ server.dir.base }}
  30. home_assistant_config:
  31. file.managed:
  32. - name: /etc/home_assistant/configuration.yaml
  33. - source: salt://home_assistant/files/configuration.yaml
  34. - template: jinja
  35. - user: home_assistant
  36. - mode: 600
  37. - require:
  38. - file: home_assistant_dir
  39. {%- if server.known_device is defined %}
  40. home_assistant_know_devices:
  41. file.managed:
  42. - name: /etc/home_assistant/known_devices.yaml
  43. - source: salt://home_assistant/files/known_devices.yaml
  44. - template: jinja
  45. - user: home_assistant
  46. - mode: 600
  47. - require:
  48. - file: home_assistant_dir
  49. {%- endif %}
  50. {%- endif %}