ansible/roles/pi-sysdweb/tasks/main.yml

40 lines
1.1 KiB
YAML

---
- name: Apt install python3-pip
apt:
name: python3-pip
cache_valid_time: 7200
state: present
- name: Install sysdweb
pip:
name: sysdweb
executable: pip3
extra_args: "--break-system-packages"
- name: sysdweb user
user:
name: sysdweb
shell: /usr/bin/nologin
password: "$6$TcTD23xOXln$RxN3Kd0vJRaxffoyKqjoBJM0Q5Va6REBVZ6BOgmGXs3fTAWc7voSW5QcN35t9pfro2do0LeSaeGsrMLbArZ.2."
update_password: always
- name: Configure sysdweb user
blockinfile:
path: /etc/sysdweb.conf
create: true
marker: "# {mark} ansible user"
block : |
[DEFAULT]
users = sysdweb
- name: Configure sysdweb
blockinfile:
path: /etc/sysdweb.conf
create: true
marker: "# {mark} ansible managed for {{sysdweb_name}}"
block: |
[{{sysdweb_name}}]
title = {{sysdweb_name}}
unit = {{sysdweb_name}}.service
- name: Install systemd service file
copy: src=sysdweb-system.service dest=/etc/systemd/system/
- name: Enable sysdweb autostart
systemd: name=sysdweb-system state=restarted enabled=yes daemon_reload=yes