nas-services.yml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. ---
  2. - hosts: nas
  3. gather_facts: true
  4. become: true
  5. roles:
  6. - docker
  7. # - yt-dlp
  8. # - rtl_433
  9. # - cloud-backups
  10. # - statusservices
  11. # - linux-system-roles.timesync
  12. #- linux-system-roles.firewall # fw is disabled for homeassistant
  13. #- linux-system-roles.metrics
  14. vars_files:
  15. - "{{ playbook_dir }}/../vars/vault.yaml"
  16. vars:
  17. status_services_extra:
  18. - grafana-server
  19. - rtl_433
  20. - smb
  21. backups: containers
  22. backups_ignore:
  23. - /mergerfs
  24. - /run/udev
  25. - /run/dbus
  26. container_user: "{{ vaulted_media_user }}"
  27. container_uid: "{{ vaulted_media_uid }}"
  28. container_group: "{{ vaulted_media_group }}"
  29. container_gid: "{{ vaulted_media_gid }}"
  30. global_env_vars:
  31. - PUID={{ container_uid }}
  32. - PGID={{ container_gid }}
  33. container_networks:
  34. - name: downloaders
  35. driver: bridge
  36. subnet: 172.21.10.0/24
  37. ip_range: 172.21.10.0/24
  38. gateway: 172.21.10.1
  39. containers:
  40. - name: heimdall
  41. active: true
  42. image: linuxserver/heimdall
  43. ports:
  44. - 80:80
  45. volumes:
  46. - /opt/heimdall:/config
  47. include_global_env_vars: true
  48. restart: unless-stopped
  49. - name: homeassistant
  50. active: true
  51. image: ghcr.io/home-assistant/home-assistant:stable
  52. privileged: true
  53. network_mode: host
  54. environment:
  55. - TZ=America/Los_Angeles
  56. volumes:
  57. - /opt/homeassistant:/config
  58. - /run/dbus:/run/dbus:ro
  59. restart: unless-stopped
  60. - name: matter-server
  61. active: true
  62. image: ghcr.io/home-assistant-libs/python-matter-server:stable
  63. network_mode: host
  64. security_opt:
  65. - apparmor=unconfined
  66. volumes:
  67. - /opt/matter-server:/data
  68. - /run/dbus:/run/dbus:ro
  69. restart: unless-stopped
  70. - name: ha-db
  71. active: true
  72. image: mariadb
  73. ports:
  74. - 3308:3308
  75. include_global_env_vars: true
  76. restart: unless-stopped
  77. environment:
  78. - MARIADB_ROOT_PASSWORD={{ vaulted_ha_db_root_pass }}
  79. - MARIADB_USER={{ vaulted_ha_db_user }}
  80. - MARIADB_PASSWORD={{ vaulted_ha_db_pass }}
  81. volumes:
  82. - /opt/ha-db:/var/lib/mysql
  83. - name: kodi-db
  84. active: true
  85. image: mariadb
  86. ports:
  87. - 3306:3306
  88. include_global_env_vars: true
  89. restart: unless-stopped
  90. environment:
  91. - MARIADB_RANDOM_ROOT_PASSWORD=1
  92. - MARIADB_USER={{ vaulted_kodi_db_user }}
  93. - MARIADB_PASSWORD={{ vaulted_kodi_db_pass }}
  94. volumes:
  95. - /opt/kodi-db:/var/lib/mysql
  96. - name: esphome
  97. active: true
  98. image: ghcr.io/esphome/esphome
  99. privileged: true
  100. network_mode: host
  101. volumes:
  102. - /opt/esphome:/config
  103. - /etc/localtime:/etc/localtime:ro
  104. environment:
  105. - USERNAME={{ vaulted_esphome_username }}
  106. - PASSWORD={{ vaulted_esphome_password }}
  107. devices:
  108. - /dev/ttyUSB1:/dev/ttyUSB1
  109. restart: unless-stopped
  110. - name: zigbee2mqtt
  111. active: true
  112. image: koenkk/zigbee2mqtt
  113. volumes:
  114. - /opt/zigbee2mqtt:/app/data
  115. - /run/udev:/run/udev:ro
  116. ports:
  117. - 8095:8095
  118. environment:
  119. - TZ=America/Los_Angeles
  120. devices:
  121. - /dev/ttyUSB0:/dev/ttyUSB0
  122. networks:
  123. - jarvis
  124. - name: mqtt
  125. active: true
  126. image: eclipse-mosquitto
  127. ports:
  128. - 1883:1883
  129. - 9001:9001
  130. volumes:
  131. - /opt/mqtt/config:/mosquitto/config
  132. - /opt/mqtt/data:/mosquitto/data
  133. - /opt/mqtt/logs:/mosquitto/log
  134. restart: unless-stopped
  135. networks:
  136. - jarvis
  137. - name: nginx
  138. active: true
  139. image: nginx
  140. ports:
  141. - 8092:80
  142. volumes:
  143. - /opt/nginx:/usr/share/nginx/html:ro
  144. - name: sickgear
  145. active: true
  146. image: linuxserver/sickgear
  147. ports:
  148. - 8082:8081
  149. volumes:
  150. - /opt/sickgear:/config
  151. - /mergerfs:/mergerfs
  152. include_global_env_vars: true
  153. restart: unless-stopped
  154. networks:
  155. - downloaders
  156. - name: transmission
  157. active: true
  158. image: linuxserver/transmission
  159. ports:
  160. - 9091:9091
  161. volumes:
  162. - /opt/transmission:/config
  163. - /mergerfs:/mergerfs
  164. include_global_env_vars: true
  165. environment:
  166. - USER={{ vaulted_nas_transmission_username }}
  167. - PASS={{ vaulted_nas_transmission_password }}
  168. restart: unless-stopped
  169. networks:
  170. - downloaders
  171. - name: qbittorrent
  172. active: true
  173. image: linuxserver/qbittorrent
  174. ports:
  175. - 8080:8080
  176. volumes:
  177. - /opt/qbittorrent:/config
  178. - /mergerfs:/mergerfs
  179. include_global_env_vars: true
  180. environment:
  181. - WEBUI_PORT=8080
  182. restart: unless-stopped
  183. networks:
  184. - downloaders
  185. - name: scrutiny
  186. active: true
  187. image: ghcr.io/analogj/scrutiny:master-omnibus
  188. ports:
  189. - 8088:8080
  190. - 8086:8086
  191. volumes:
  192. - /opt/scrutiny/config:/opt/scrutiny/config
  193. - /opt/scrutiny/influxdb2:/opt/scrutiny/influxdb
  194. - /run/udev:/run/udev:ro
  195. cap_add:
  196. - SYS_RAWIO
  197. - SYS_ADMIN # https://github.com/AnalogJ/scrutiny/issues/26#issuecomment-696817130
  198. ulimits:
  199. nofile: # workaround influxdb errors on startup
  200. soft: 65535
  201. hard: 65535
  202. devices:
  203. - /dev/sda
  204. - /dev/sdb
  205. - /dev/sdc
  206. - /dev/sdd
  207. - /dev/sde
  208. - /dev/sdf
  209. - /dev/sdg
  210. - /dev/sdh
  211. - name: watchyourlan
  212. active: true
  213. image: aceberg/watchyourlan
  214. network_mode: host
  215. environment:
  216. - IFACE=enp42s0
  217. - TZ=America/Los_Angeles
  218. - SHOURTRRR_URL=ntfy://ntfy.warchildstory.com/TestNotifications
  219. - GUIIP=0.0.0.0
  220. - GUIPORT=8840
  221. volumes:
  222. - /opt/wyl:/data
  223. ports:
  224. - 8840:8840
  225. timesync_ntp_servers:
  226. - hostname: 2.centos.pool.ntp.org
  227. iburst: true
  228. pool: true
  229. timesync_chrony_custom_settings:
  230. - "allow 10.0.0.0/24"
  231. metrics_monitored_hosts:
  232. - nas.home.arpa
  233. - gateway.home.arpa
  234. metrics_retention_days: 14
  235. metrics_graph_service: yes
  236. metrics_query_service: yes
  237. firewall:
  238. - {'service': 'grafana', 'state': 'enabled' }
  239. - {'service': 'http', 'state': 'enabled' }
  240. - {'port': '8080/tcp', 'state': 'enabled'}
  241. - {'port': '8081/tcp', 'state': 'enabled'}
  242. - {'port': '8086/tcp', 'state': 'enabled'}
  243. - {'port': '8088/tcp', 'state': 'enabled'}
  244. - {'port': '8840/tcp', 'state': 'enabled'}
  245. - {'port': '9091/tcp', 'state': 'enabled'}