nas-services.yml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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. - "{{ inventory_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: frigate
  61. active: true
  62. image: ghcr.io/blakeblackshear/frigate:stable
  63. privileged: true
  64. shm_size: 20gb
  65. devices:
  66. - /dev/dri/renderD128:/dev/dri/renderD128
  67. volumes:
  68. - /etc/localtime:/etc/localtime:ro
  69. - /opt/frigate/config:/config
  70. - /mergerfs/public/Videos/frigate:/media/frigate
  71. ports:
  72. - 8971:8971
  73. - 8554:8554 # RTSP feeds
  74. - 8555:8555/tcp # WebRTC over tcp
  75. - 8555:8555/udp # WebRTC over udp
  76. environment:
  77. - FRIGATE_RTSP_PASSWORD: sqordfish
  78. - name: kodi-db
  79. active: true
  80. image: mariadb
  81. ports:
  82. - 3306:3306
  83. include_global_env_vars: true
  84. restart: unless-stopped
  85. environment:
  86. - MARIADB_RANDOM_ROOT_PASSWORD=1
  87. - MARIADB_USER={{ vaulted_kodi_db_user }}
  88. - MARIADB_PASSWORD={{ vaulted_kodi_db_pass }}
  89. volumes:
  90. - /opt/kodi-db:/var/lib/mysql
  91. - name: esphome
  92. active: true
  93. image: ghcr.io/esphome/esphome
  94. privileged: true
  95. network_mode: host
  96. volumes:
  97. - /opt/esphome:/config
  98. - /etc/localtime:/etc/localtime:ro
  99. environment:
  100. - USERNAME={{ vaulted_esphome_username }}
  101. - PASSWORD={{ vaulted_esphome_password }}
  102. devices:
  103. - /dev/ttyUSB1:/dev/ttyUSB1
  104. restart: unless-stopped
  105. - name: zigbee2mqtt
  106. active: true
  107. image: koenkk/zigbee2mqtt
  108. volumes:
  109. - /opt/zigbee2mqtt:/app/data
  110. - /run/udev:/run/udev:ro
  111. ports:
  112. - 8095:8095
  113. environment:
  114. - TZ=America/Los_Angeles
  115. devices:
  116. - /dev/ttyUSB0:/dev/ttyUSB0
  117. networks:
  118. - jarvis
  119. - name: mqtt
  120. active: true
  121. image: eclipse-mosquitto
  122. ports:
  123. - 1883:1883
  124. - 9001:9001
  125. volumes:
  126. - /opt/mqtt/config:/mosquitto/config
  127. - /opt/mqtt/data:/mosquitto/data
  128. - /opt/mqtt/logs:/mosquitto/log
  129. restart: unless-stopped
  130. networks:
  131. - jarvis
  132. - name: nginx
  133. active: true
  134. image: nginx
  135. ports:
  136. - 8092:80
  137. volumes:
  138. - /opt/nginx:/usr/share/nginx/html:ro
  139. - name: sickgear
  140. active: true
  141. image: linuxserver/sickgear
  142. ports:
  143. - 8082:8081
  144. volumes:
  145. - /opt/sickgear:/config
  146. - /mergerfs:/mergerfs
  147. include_global_env_vars: true
  148. restart: unless-stopped
  149. networks:
  150. - downloaders
  151. - name: transmission
  152. active: true
  153. image: linuxserver/transmission
  154. ports:
  155. - 9091:9091
  156. volumes:
  157. - /opt/transmission:/config
  158. - /mergerfs:/mergerfs
  159. include_global_env_vars: true
  160. environment:
  161. - USER={{ vaulted_nas_transmission_username }}
  162. - PASS={{ vaulted_nas_transmission_password }}
  163. restart: unless-stopped
  164. networks:
  165. - downloaders
  166. - name: qbittorrent
  167. active: true
  168. image: linuxserver/qbittorrent
  169. ports:
  170. - 8080:8080
  171. volumes:
  172. - /opt/qbittorrent:/config
  173. - /mergerfs:/mergerfs
  174. include_global_env_vars: true
  175. environment:
  176. - WEBUI_PORT=8080
  177. restart: unless-stopped
  178. networks:
  179. - downloaders
  180. - name: scrutiny
  181. active: true
  182. image: ghcr.io/analogj/scrutiny:master-omnibus
  183. ports:
  184. - 8088:8080
  185. - 8086:8086
  186. volumes:
  187. - /opt/scrutiny/config:/opt/scrutiny/config
  188. - /opt/scrutiny/influxdb2:/opt/scrutiny/influxdb
  189. - /run/udev:/run/udev:ro
  190. cap_add:
  191. - SYS_RAWIO
  192. - SYS_ADMIN # https://github.com/AnalogJ/scrutiny/issues/26#issuecomment-696817130
  193. devices:
  194. - /dev/sda
  195. - /dev/sdb
  196. - /dev/sdc
  197. - /dev/sdd
  198. - /dev/sde
  199. - /dev/sdf
  200. - /dev/sdg
  201. - /dev/sdh
  202. - name: watchyourlan
  203. active: true
  204. image: aceberg/watchyourlan
  205. network_mode: host
  206. environment:
  207. - IFACE=enp42s0
  208. - TZ=America/Los_Angeles
  209. - SHOURTRRR_URL=ntfy://ntfy.warchildstory.com/TestNotifications
  210. - GUIIP=0.0.0.0
  211. - GUIPORT=8840
  212. volumes:
  213. - /opt/wyl:/data
  214. ports:
  215. - 8840:8840
  216. timesync_ntp_servers:
  217. - hostname: 2.centos.pool.ntp.org
  218. iburst: true
  219. pool: true
  220. timesync_chrony_custom_settings:
  221. - "allow 10.0.0.0/24"
  222. metrics_monitored_hosts:
  223. - nas.home.arpa
  224. - gateway.home.arpa
  225. metrics_retention_days: 14
  226. metrics_graph_service: yes
  227. metrics_query_service: yes
  228. firewall:
  229. - {'service': 'grafana', 'state': 'enabled' }
  230. - {'service': 'http', 'state': 'enabled' }
  231. - {'port': '8080/tcp', 'state': 'enabled'}
  232. - {'port': '8081/tcp', 'state': 'enabled'}
  233. - {'port': '8086/tcp', 'state': 'enabled'}
  234. - {'port': '8088/tcp', 'state': 'enabled'}
  235. - {'port': '8840/tcp', 'state': 'enabled'}
  236. - {'port': '9091/tcp', 'state': 'enabled'}