Merge pull request #551 from HitLuca/octoprint

Added octoprint application
This commit is contained in:
David Stephens 2022-07-24 10:05:17 +01:00 committed by GitHub
commit 5b9fa8bd9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 69 additions and 0 deletions

View file

@ -61,6 +61,7 @@ If you have a spare domain name you can configure applications to be accessible
* [Netdata](https://my-netdata.io/) - An extremely comprehensive system monitoring solution
* [Nextcloud](https://nextcloud.com/) - A self-hosted Dropbox alternative
* [NZBget](https://nzbget.net/) - The most efficient usenet downloader
* [Octoprint](https://octoprint.org/) - Control and monitor your 3D printer
* [Ombi](https://ombi.io/) - web application that automatically gives your users the ability to request content
* [Organizr](https://organizr.app/) - ORGANIZR aims to be your one stop shop for your Servers Frontend.
* [openHAB](https://www.openhab.org/) - A vendor and technology agnostic open source automation software for your home

View file

@ -0,0 +1,11 @@
# Octoprint
Homepage: [https://octoprint.org/](https://octoprint.org/)
Octoprint is a control and monitoring application for your 3D printer. You can start and stop print jobs, view your webcam feed, move the print head and extruder manually and check your gcode files, all from a single web interface. Octoprint doesn't require modifications on the printer firmware, just make sure your NAS is phisically connected to it with a usb cable.
## Usage
Connect the printer to your NAS, and take note of where the serial interface is mounted (usually it's automounted in `/dev/ttyUSB0`). Set `octoprint_enabled: true` in your `inventories/<your_inventory>/nas.yml` file, as well as the `octoprint_printer_mountpoint` variable if your printer doesn't mount to the default location.
If you want to also have a webcam feed, attach one to your NAS and take note of its mountpoint as well (usually `/dev/video0`). Set `octoprint_enable_webcam: true` and add a `octoprint_webcam_mountpoint` variable if the webcam doesn't mount to the default location.

View file

@ -235,6 +235,11 @@
- nzbget
when: (nzbget_enabled | default(False))
- role: octoprint
tags:
- octoprint
when: (octoprint_enabled | default(False))
- role: organizr
tags:
- organizr

View file

@ -0,0 +1,19 @@
---
octoprint_enabled: false
octoprint_available_externally: false
# directories
octoprint_data_directory: "{{ docker_home }}/octoprint"
# network
octoprint_port: "8095"
octoprint_hostname: "octoprint"
# devices
octoprint_printer_mountpoint: "/dev/ttyUSB0"
octoprint_enable_webcam: false
octoprint_webcam_mountpoint: "/dev/video0"
# specs
octoprint_memory: 1g

View file

@ -0,0 +1,33 @@
---
- name: Create Octoprint Directories
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ octoprint_data_directory }}"
- name: Octoprint Docker Container
docker_container:
name: octoprint
image: octoprint/octoprint
pull: true
volumes:
- "{{ octoprint_data_directory }}:/octoprint:rw"
ports:
- "{{ octoprint_port }}:80"
devices:
- "{{ octoprint_printer_mountpoint }}"
- "{{ octoprint_enable_webcam | ternary(octoprint_webcam_mountpoint, '/dev/null') }}"
restart_policy: unless-stopped
memory: "{{ octoprint_memory }}"
env:
TZ: "{{ ansible_nas_timezone }}"
MJPG_STREAMER_INPUT: "-n -r 1080x1024 -f 30"
ENABLE_MJPG_STREAMER: "true"
labels:
traefik.enable: "{{ octoprint_available_externally | string }}"
traefik.http.routers.octoprint.rule: "Host(`{{ octoprint_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.octoprint.tls.certresolver: "letsencrypt"
traefik.http.routers.octoprint.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.octoprint.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.octoprint.loadbalancer.server.port: "80"