diff --git a/octoprint/octoprint.yml b/octoprint/octoprint.yml index 447b25a..977e0bf 100644 --- a/octoprint/octoprint.yml +++ b/octoprint/octoprint.yml @@ -1,6 +1,6 @@ --- - name: install octoprint - hosts: prusa + hosts: prusa.lan become_method: sudo become_user: root become: yes @@ -44,4 +44,9 @@ systemd: name: octoprint enabled: yes - state: started \ No newline at end of file + state: started + - name: enable octoprint to restart itself + copy: + src: sudoers.conf + dest: /etc/sudoers.d/octoprint + mode: 0440 \ No newline at end of file diff --git a/octoprint/sudoers.conf b/octoprint/sudoers.conf new file mode 100644 index 0000000..95c5caf --- /dev/null +++ b/octoprint/sudoers.conf @@ -0,0 +1,3 @@ +octoprint ALL= NOPASSWD: /bin/systemctl start octoprint.service +octoprint ALL= NOPASSWD: /bin/systemctl stop octoprint.service +octoprint ALL= NOPASSWD: /bin/systemctl restart octoprint.service \ No newline at end of file