update etherpad to 1.8.7 and fix permission

This commit is contained in:
les 2021-01-04 18:53:42 +01:00
parent e932842b8d
commit 5b060752fc
4 changed files with 27 additions and 11 deletions

View file

@ -31,6 +31,6 @@
# TEST # TEST
- name: Test - name: Test
hosts: test hosts: test
roles: ['stable/common', 'stable/nginx'] roles: ['stable/common', 'stable/etherpad']
tags: test tags: test
vars_files: vars/frontend.yml vars_files: vars/test.yml

View file

@ -1,5 +0,0 @@
---
- name: restart etherpad
service:
name: etherpad
state: restarted

View file

@ -1,6 +1,7 @@
--- ---
- name: install etherpad deps - name: install etherpad deps
become: yes
apt: apt:
pkg: pkg:
- git - git
@ -8,6 +9,7 @@
- tidy - tidy
- name: ensure etherpad user is present - name: ensure etherpad user is present
become: yes
user: user:
name: "etherpad" name: "etherpad"
home: "/srv/etherpad" home: "/srv/etherpad"
@ -18,13 +20,14 @@
git: git:
repo: "https://github.com/ether/etherpad-lite" repo: "https://github.com/ether/etherpad-lite"
dest: "/srv/etherpad/etherpad" dest: "/srv/etherpad/etherpad"
version: "1.8.6" version: "1.8.7"
force: true force: true
become: true become: true
become_user: "etherpad" become_user: "etherpad"
register: repository register: repository
- name: ensure etherpad init.d is latest - name: ensure etherpad init.d is latest
become: yes
template: template:
src: etherpad.initd.j2 src: etherpad.initd.j2
dest: /etc/init.d/etherpad dest: /etc/init.d/etherpad
@ -33,6 +36,7 @@
mode: 0500 mode: 0500
- name: copy etherpad settings.json - name: copy etherpad settings.json
become: yes
template: template:
src: settings.json.j2 src: settings.json.j2
dest: /srv/etherpad/etherpad/settings.json dest: /srv/etherpad/etherpad/settings.json
@ -41,6 +45,7 @@
mode: 0644 mode: 0644
- name: ensure etherpad will start after system is booted - name: ensure etherpad will start after system is booted
become: yes
service: service:
name: etherpad name: etherpad
enabled: yes enabled: yes
@ -53,19 +58,20 @@
# chdir: /srv/etherpad/etherpad/ # chdir: /srv/etherpad/etherpad/
- name: copy custom assets - name: copy custom assets
become: yes
copy: copy:
src: "{{playbook_dir}}/assets/etherpad/{{item.key}}" src: "{{playbook_dir}}/assets/etherpad/{{item.key}}"
dest: "{{item.value}}{{item.key}}" dest: "{{item.value}}{{item.key}}"
owner: etherpad owner: etherpad
group: etherpad group: etherpad
with_dict: "{{ override_files }}" with_dict: "{{ override_files| default([]) }}"
- name: remove package-lock.json - name: remove package-lock.json
become: yes
file: file:
state: absent state: absent
path: "/srv/etherpad/etherpad/package-lock.json" path: "/srv/etherpad/etherpad/package-lock.json"
- name: install etherpad plugins - name: install etherpad plugins
npm: npm:
name: "{{ item }}" name: "{{ item }}"
@ -73,4 +79,9 @@
become: true become: true
become_user: etherpad become_user: etherpad
with_items: "{{ plugins|d() }}" with_items: "{{ plugins|d() }}"
notify: restart etherpad
- name: restart etherpad
become: true
service:
name: etherpad
state: restarted

10
vars/test.yml Normal file
View file

@ -0,0 +1,10 @@
---
with_certbot: true
with_nginx: true
with_backup: true
certbot_email: info@cisti.org
servers:
- cicles:
server_name: antani.cisti.org
proxy_pass: http://localhost:8001