67 lines
1.3 KiB
YAML
67 lines
1.3 KiB
YAML
---
|
|
|
|
- name: Create group
|
|
group:
|
|
name: "{{ moonraker_group }}"
|
|
|
|
- name: Create user
|
|
user:
|
|
name: "{{ moonraker_user }}"
|
|
home: "/home/{{ moonraker_user }}"
|
|
group: "{{ moonraker_group }}"
|
|
append: yes
|
|
groups:
|
|
- video
|
|
- klipper
|
|
|
|
- name: Install dependencies
|
|
apt:
|
|
name:
|
|
- python3-virtualenv
|
|
- python3-dev
|
|
- libopenjp2-7
|
|
- python3-libgpiod
|
|
- curl
|
|
- libcurl4-openssl-dev
|
|
- libssl-dev
|
|
- liblmdb-dev
|
|
- libsodium-dev
|
|
- zlib1g-dev
|
|
- libjpeg-dev
|
|
|
|
- name: Create config directory
|
|
file:
|
|
path: "{{ moonraker_conf_dir }}"
|
|
state: directory
|
|
owner: "{{ moonraker_user }}"
|
|
group: "{{ moonraker_group }}"
|
|
|
|
- name: Copy moonraker config
|
|
template:
|
|
src: moonraker.conf.j2
|
|
dest: "{{ moonraker_conf_dir }}/moonraker.conf"
|
|
become: yes
|
|
become_user: "{{ moonraker_user }}"
|
|
|
|
- name: Clone moonraker src
|
|
git:
|
|
repo: https://github.com/Arksine/moonraker.git
|
|
dest: "{{ moonraker_src_dir }}"
|
|
|
|
- name: Create python virtual environment
|
|
pip:
|
|
requirements: "{{ moonraker_src_dir }}/scripts/moonraker-requirements.txt"
|
|
virtualenv: "{{ moonraker_src_dir }}/venv"
|
|
|
|
- name: Copy systemd service file
|
|
template:
|
|
src: moonraker.service.j2
|
|
dest: /etc/systemd/system/moonraker.service
|
|
|
|
- name: Enable moonraker
|
|
service:
|
|
name: moonraker
|
|
enabled: yes
|
|
|
|
|