Add option for octoprint to restart itself

This commit is contained in:
pgrondek 2020-04-22 22:56:53 +02:00
parent 22fe99ae4d
commit 3e0faec15a
2 changed files with 10 additions and 2 deletions

View File

@ -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
state: started
- name: enable octoprint to restart itself
copy:
src: sudoers.conf
dest: /etc/sudoers.d/octoprint
mode: 0440

3
octoprint/sudoers.conf Normal file
View File

@ -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