Skip to content

Instantly share code, notes, and snippets.

@raek
Created December 15, 2021 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raek/251b82fa83dab5b3aedb1c00504f8f44 to your computer and use it in GitHub Desktop.
Save raek/251b82fa83dab5b3aedb1c00504f8f44 to your computer and use it in GitHub Desktop.
---
- name: Install Pladder
hosts: all
tasks:
- name: Install system dependencies
become: yes
apt:
pkg:
- build-essential
- pkg-config
- git
- python3
- python3-venv
- python3-pip
- python3-wheel
- python3-gi
- libsystemd-dev
- name: Enable linger for user
become: yes
copy:
dest: "/var/lib/systemd/linger/{{ ansible_user }}"
force: no
content: ""
- name: Install Pladder in an virtual environment
pip:
name: "pladder[systemd] @ git+https://github.com/raek/pladder.git"
virtualenv: "{{ ansible_env.HOME }}/.cache/pladder-venv"
virtualenv_command: /usr/bin/python3 -m venv
virtualenv_site_packages: yes
- name: Install systemd unit files
command:
cmd: "{{ ansible_env.HOME }}/.cache/pladder-venv/bin/pladder-systemd update-unit-files"
creates: "{{ ansible_env.HOME }}/.config/systemd/user/pladder-*"
- name: Enable and start pladder bot service
systemd:
scope: user
daemon_reload: yes
unit: pladder-bot.service
enabled: yes
state: started
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment