51 lines
1.1 KiB
YAML
51 lines
1.1 KiB
YAML
---
|
|
- hosts: all
|
|
become: yes
|
|
|
|
tasks:
|
|
- name: add tootbot user
|
|
user:
|
|
name: tootbot
|
|
create_home: yes
|
|
system: yes
|
|
|
|
- name: create tootbot folder
|
|
file:
|
|
path: /tootbot/
|
|
owner: tootbot
|
|
group: tootbot
|
|
mode: '0755'
|
|
state: directory
|
|
|
|
- name: add all template files
|
|
template: src=templates/run-bot.sh dest=/tootbot/run-bot.sh
|
|
|
|
- name: install dependencies
|
|
apt:
|
|
pkg: ['python3', 'python3-pip', 'python3-setuptools']
|
|
|
|
- name: clone/update git repo
|
|
git:
|
|
repo: 'https://github.com/Nutomic/tootbot.git'
|
|
dest: /tootbot/source/
|
|
|
|
- name: install python requirements
|
|
raw: cd /tootbot/source/ && sudo -H -u tootbot pip3 install -r requirements.txt
|
|
args:
|
|
executable: /bin/bash
|
|
|
|
- name: chown tootbot folder
|
|
file:
|
|
path: /tootbot/
|
|
owner: tootbot
|
|
group: tootbot
|
|
state: directory
|
|
recurse: yes
|
|
|
|
- name: create tootbot crontab
|
|
cron:
|
|
name: "tootbot"
|
|
minute: "*/10"
|
|
user: tootbot
|
|
job: "/tootbot/run-bot.sh >> /tootbot/bot.log 2>&1"
|
|
disabled: no
|