From 3e0faec15a9e5fe1c9b6d911dcdfa31d57431680 Mon Sep 17 00:00:00 2001 From: pgrondek Date: Wed, 22 Apr 2020 22:56:53 +0200 Subject: [PATCH] Add option for octoprint to restart itself --- octoprint/octoprint.yml | 9 +++++++-- octoprint/sudoers.conf | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 octoprint/sudoers.conf 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