forked from davestephens/ansible-nas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |