infra/roles/stable/etherpad/tasks/main.yml

88 lines
1.8 KiB
YAML
Raw Normal View History

2020-09-29 00:13:52 +02:00
---
2020-10-02 20:59:16 +02:00
- name: install etherpad deps
become: yes
2020-10-02 20:59:16 +02:00
apt:
pkg:
2020-11-10 23:14:10 +01:00
- git
- libreoffice-common
- tidy
2020-10-02 20:59:16 +02:00
2020-09-29 00:13:52 +02:00
- name: ensure etherpad user is present
become: yes
2020-09-29 00:13:52 +02:00
user:
name: "etherpad"
home: "/srv/etherpad"
shell: "/bin/bash"
state: present
2020-11-10 23:14:10 +01:00
- name: ensure etherpad is correct version
2020-09-29 00:13:52 +02:00
git:
repo: "https://github.com/ether/etherpad-lite"
dest: "/srv/etherpad/etherpad"
2021-02-10 22:56:05 +01:00
version: "1.8.14"
2020-11-10 23:14:10 +01:00
force: true
2020-09-29 00:13:52 +02:00
become: true
become_user: "etherpad"
register: repository
2020-11-10 23:14:10 +01:00
- name: ensure etherpad init.d is latest
become: yes
2020-09-29 00:13:52 +02:00
template:
2020-11-10 23:14:10 +01:00
src: etherpad.initd.j2
dest: /etc/init.d/etherpad
2020-09-29 00:13:52 +02:00
owner: root
group: root
2020-11-10 23:14:10 +01:00
mode: 0500
2020-09-29 00:13:52 +02:00
- name: copy etherpad settings.json
become: yes
template:
src: settings.json.j2
dest: /srv/etherpad/etherpad/settings.json
owner: etherpad
group: etherpad
mode: 0644
2020-09-29 00:13:52 +02:00
- name: ensure etherpad will start after system is booted
become: yes
2020-09-29 00:13:52 +02:00
service:
name: etherpad
2020-09-29 00:13:52 +02:00
enabled: yes
2020-11-10 23:14:10 +01:00
# - name: install etherpad deps
# become: true
# become_user: etherpad
# shell: /srv/etherpad/etherpad/bin/installDeps.sh
# args:
# chdir: /srv/etherpad/etherpad/
- name: copy custom assets
become: yes
2020-11-10 23:14:10 +01:00
copy:
src: "{{playbook_dir}}/assets/etherpad/{{item.key}}"
dest: "{{item.value}}{{item.key}}"
owner: etherpad
group: etherpad
with_dict: "{{ override_files| default([]) }}"
2020-11-10 23:14:10 +01:00
- name: remove package-lock.json
become: yes
2020-11-10 23:14:10 +01:00
file:
state: absent
path: "/srv/etherpad/etherpad/package-lock.json"
2020-09-29 00:13:52 +02:00
- name: install etherpad plugins
npm:
name: "{{ item }}"
path: "/srv/etherpad/etherpad"
2020-09-29 00:13:52 +02:00
become: true
become_user: etherpad
with_items: "{{ plugins|d() }}"
- name: restart etherpad
become: true
service:
name: etherpad
state: restarted