nas-services.yml 6.3 KB

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