octoprint/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Mon, 07 Oct 2024 15:25:37 -0500
changeset 238 bdbc88cb5078
parent 193 fd46c0e68c2c
permissions -rw-r--r--
Lots of updates and fixes for Ubuntu 24.04 Noble.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
193
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     1
---
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     2
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     3
- name: add octoprint user
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     4
  become: yes
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     5
  user: name="octoprint" groups="{{octoprint_groups}}" home="/opt/octoprint" system="yes"
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     6
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     7
- name: pip install octoprint
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     8
  become: yes
238
bdbc88cb5078 Lots of updates and fixes for Ubuntu 24.04 Noble.
Luke Hoersten <luke@hoersten.org>
parents: 193
diff changeset
     9
  pip: name="octoprint" executable="pip3" break_system_packages="true"
193
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    10
  notify: restart octoprint
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    11
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    12
- name: install octoprint systemd service
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    13
  become: yes
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    14
  copy:
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    15
    src: "octoprint.service"
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    16
    dest: "/lib/systemd/system/octoprint.service"
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    17
  notify: restart octoprint
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    18
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    19
- name: ensure octoprint service is started
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    20
  become: yes
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    21
  systemd: name="octoprint.service" enabled="yes"