octoprint/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Thu, 23 Feb 2023 17:55:33 -0600
changeset 210 dcdb18c5dc21
parent 193 fd46c0e68c2c
child 238 bdbc88cb5078
permissions -rw-r--r--
Version updates
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
fd46c0e68c2c Initial octoprint role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     9
  pip: name="octoprint" executable="pip3"
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"