nas-services.yml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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. container_user: "{{ vaulted_media_user }}"
  26. container_uid: "{{ vaulted_media_uid }}"
  27. container_group: "{{ vaulted_media_group }}"
  28. container_gid: "{{ vaulted_media_gid }}"
  29. global_env_vars:
  30. - PUID={{ container_uid }}
  31. - PGID={{ container_gid }}
  32. container_networks:
  33. - name: downloaders
  34. driver: bridge
  35. subnet: 172.21.10.0/24
  36. ip_range: 172.21.10.0/24
  37. gateway: 172.21.10.1
  38. containers:
  39. - name: heimdall
  40. active: true
  41. image: linuxserver/heimdall
  42. ports:
  43. - 80:80
  44. volumes:
  45. - /opt/heimdall:/config
  46. include_global_env_vars: true
  47. restart: unless-stopped
  48. - name: homeassistant
  49. active: true
  50. image: ghcr.io/home-assistant/home-assistant:stable
  51. privileged: true
  52. network_mode: host
  53. environment:
  54. - TZ=America/Los_Angeles
  55. volumes:
  56. - /opt/homeassistant:/config
  57. - /run/dbus:/run/dbus:ro
  58. restart: unless-stopped
  59. - name: kodi-db
  60. active: true
  61. image: mariadb
  62. ports:
  63. - 3306:3306
  64. include_global_env_vars: true
  65. restart: unless-stopped
  66. environment:
  67. - MARIADB_RANDOM_ROOT_PASSWORD=1
  68. - MARIADB_USER={{ vaulted_kodi_db_user }}
  69. - MARIADB_PASSWORD={{ vaulted_kodi_db_pass }}
  70. volumes:
  71. - /opt/kodi-db:/var/lib/mysql
  72. - name: esphome
  73. active: true
  74. image: ghcr.io/esphome/esphome
  75. privileged: true
  76. network_mode: host
  77. volumes:
  78. - /opt/esphome:/config
  79. - /etc/localtime:/etc/localtime:ro
  80. environment:
  81. - USERNAME={{ vaulted_esphome_username }}
  82. - PASSWORD={{ vaulted_esphome_password }}
  83. devices:
  84. - /dev/ttyUSB1:/dev/ttyUSB1
  85. restart: unless-stopped
  86. - name: zigbee2mqtt
  87. active: true
  88. image: koenkk/zigbee2mqtt
  89. volumes:
  90. - /opt/zigbee2mqtt:/app/data
  91. - /run/udev:/run/udev:ro
  92. ports:
  93. - 8095:8095
  94. environment:
  95. - TZ=America/Los_Angeles
  96. devices:
  97. - /dev/ttyUSB0:/dev/ttyUSB0
  98. networks:
  99. - jarvis
  100. - name: mqtt
  101. active: true
  102. image: eclipse-mosquitto
  103. ports:
  104. - 1883:1883
  105. - 9001:9001
  106. volumes:
  107. - /opt/mqtt/config:/mosquitto/config
  108. - /opt/mqtt/data:/mosquitto/data
  109. - /opt/mqtt/logs:/mosquitto/log
  110. restart: unless-stopped
  111. networks:
  112. - jarvis
  113. - name: nginx
  114. active: true
  115. image: nginx
  116. ports:
  117. - 8092:80
  118. volumes:
  119. - /opt/nginx:/usr/share/nginx/html:ro
  120. - name: sickchill
  121. active: true
  122. image: linuxserver/sickchill
  123. ports:
  124. - 8081:8081
  125. volumes:
  126. - /opt/sickchill:/config
  127. - /mergerfs:/mergerfs
  128. include_global_env_vars: true
  129. restart: unless-stopped
  130. networks:
  131. - downloaders
  132. - name: transmission
  133. active: true
  134. image: linuxserver/transmission
  135. ports:
  136. - 9091:9091
  137. volumes:
  138. - /opt/transmission:/config
  139. - /mergerfs:/mergerfs
  140. include_global_env_vars: true
  141. environment:
  142. - USER={{ vaulted_nas_transmission_username }}
  143. - PASS={{ vaulted_nas_transmission_password }}
  144. restart: unless-stopped
  145. networks:
  146. - downloaders
  147. - name: qbittorrent
  148. active: true
  149. image: linuxserver/qbittorrent
  150. ports:
  151. - 8080:8080
  152. volumes:
  153. - /opt/qbittorrent:/config
  154. - /mergerfs:/mergerfs
  155. include_global_env_vars: true
  156. environment:
  157. - WEBUI_PORT=8080
  158. restart: unless-stopped
  159. networks:
  160. - downloaders
  161. - name: scrutiny
  162. active: true
  163. image: ghcr.io/analogj/scrutiny:master-omnibus
  164. ports:
  165. - 8088:8080
  166. - 8086:8086
  167. volumes:
  168. - /opt/scrutiny/config:/opt/scrutiny/config
  169. - /opt/scrutiny/influxdb2:/opt/scrutiny/influxdb
  170. - /run/udev:/run/udev:ro
  171. cap_add:
  172. - SYS_RAWIO
  173. - SYS_ADMIN # https://github.com/AnalogJ/scrutiny/issues/26#issuecomment-696817130
  174. devices:
  175. - /dev/sda
  176. - /dev/sdb
  177. - /dev/sdc
  178. - /dev/sdd
  179. - /dev/sde
  180. - /dev/sdf
  181. - /dev/sdg
  182. - /dev/sdh
  183. - name: watchyourlan
  184. active: true
  185. image: aceberg/watchyourlan
  186. network_mode: host
  187. environment:
  188. - IFACE=enp42s0
  189. - TZ=America/Los_Angeles
  190. - SHOURTRRR_URL=ntfy://ntfy.warchildstory.com/TestNotifications
  191. - GUIIP=0.0.0.0
  192. - GUIPORT=8840
  193. volumes:
  194. - /opt/wyl:/data
  195. ports:
  196. - 8840:8840
  197. timesync_ntp_servers:
  198. - hostname: 2.centos.pool.ntp.org
  199. iburst: true
  200. pool: true
  201. timesync_chrony_custom_settings:
  202. - "allow 10.0.0.0/24"
  203. metrics_monitored_hosts:
  204. - nas.home.arpa
  205. - gateway.home.arpa
  206. metrics_retention_days: 14
  207. metrics_graph_service: yes
  208. metrics_query_service: yes
  209. firewall:
  210. - {'service': 'grafana', 'state': 'enabled' }
  211. - {'service': 'http', 'state': 'enabled' }
  212. - {'port': '8080/tcp', 'state': 'enabled'}
  213. - {'port': '8081/tcp', 'state': 'enabled'}
  214. - {'port': '8086/tcp', 'state': 'enabled'}
  215. - {'port': '8088/tcp', 'state': 'enabled'}
  216. - {'port': '8840/tcp', 'state': 'enabled'}
  217. - {'port': '9091/tcp', 'state': 'enabled'}