nas-services.yml 6.6 KB

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