ansible/octoprint/octoprint.yml
2020-04-26 22:58:26 +02:00

52 lines
1.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
- name: install octoprint
hosts: prusa.lan
become_method: sudo
become_user: root
become: yes
tasks:
- name: install needed tools
apt:
update_cache: yes
pkg:
- python-pip
- python-dev
- python-setuptools
- python-virtualenv
- git
- libyaml-dev
- build-essential
- name: create octoprint account
user:
name: octoprint
comment: Octoprint account
groups: tty,dialout
system: yes
password_lock: yes
home: /home/octoprint
- name: install octoprint software
become_user: octoprint
shell:
chdir: /home/octoprint
cmd: |
virtualenv system-site-packages .
source bin/activate
pip install pip --upgrade
pip install octoprint
args:
executable: /bin/bash
- name: copy systemd service config
copy:
src: octoprint.service
dest: /lib/systemd/system/octoprint.service
- name: enable systemd service
systemd:
name: octoprint
enabled: yes
state: started
- name: enable octoprint to restart itself
copy:
src: sudoers.conf
dest: /etc/sudoers.d/octoprint
mode: 0440