2019-02-05 08:35:45 +01:00
|
|
|
---
|
2019-03-12 17:56:12 +01:00
|
|
|
# Install EtherPad dependencies
|
|
|
|
- name: Install required packages
|
|
|
|
apt:
|
|
|
|
update_cache: true
|
2019-03-23 19:25:04 +01:00
|
|
|
name: curl
|
|
|
|
state: present
|
2019-03-12 17:56:12 +01:00
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
2019-02-05 08:35:45 +01:00
|
|
|
|
|
|
|
# Create EtherPad user and group
|
|
|
|
- include_tasks: 1_user_group.yml
|
|
|
|
|
|
|
|
# Download EtherPad
|
|
|
|
- name: Clone EtherPad project
|
|
|
|
git:
|
2019-02-19 10:49:18 +01:00
|
|
|
repo: https://github.com/ether/etherpad-lite.git
|
|
|
|
dest: /var/local/etherpad/etherpad-lite
|
2019-03-12 16:34:35 +01:00
|
|
|
version: 1.7.5
|
2019-02-05 08:35:45 +01:00
|
|
|
become: true
|
|
|
|
become_user: etherpad
|
|
|
|
|
2019-03-12 16:34:35 +01:00
|
|
|
# Installation script bin/installDeps.sh (1)
|
|
|
|
- name: Create node_modules directory
|
|
|
|
file:
|
|
|
|
path: /var/local/etherpad/etherpad-lite/node_modules
|
|
|
|
state: directory
|
|
|
|
become: true
|
|
|
|
become_user: etherpad
|
|
|
|
|
|
|
|
# Installation script bin/installDeps.sh (2)
|
|
|
|
- name: Create symbolic link to EtherPad src
|
|
|
|
file:
|
2019-03-12 16:56:01 +01:00
|
|
|
src: /var/local/etherpad/etherpad-lite/src
|
|
|
|
dest: /var/local/etherpad/etherpad-lite/node_modules/ep_etherpad-lite
|
|
|
|
state: link
|
2019-03-12 16:34:35 +01:00
|
|
|
become: true
|
|
|
|
become_user: etherpad
|
|
|
|
|
|
|
|
# Installation script bin/installDeps.sh (3)
|
|
|
|
# TODO --no-save
|
2019-02-05 08:35:45 +01:00
|
|
|
- name: Install Etherpad dependencies
|
2019-03-12 16:34:35 +01:00
|
|
|
npm:
|
|
|
|
path: /var/local/etherpad/etherpad-lite/node_modules/ep_etherpad-lite
|
2019-02-05 08:35:45 +01:00
|
|
|
become: true
|
|
|
|
become_user: etherpad
|
2019-03-12 16:56:01 +01:00
|
|
|
register: npm_result
|
|
|
|
retries: 3
|
|
|
|
until: npm_result is succeeded
|
2019-02-05 08:35:45 +01:00
|
|
|
|
|
|
|
# Configuration
|
|
|
|
- name: Configure EtherPad
|
|
|
|
lineinfile:
|
2019-02-19 10:49:18 +01:00
|
|
|
dest: /var/local/etherpad/etherpad-lite/settings.json
|
2019-02-05 08:35:45 +01:00
|
|
|
regexp: '^\s*"{{ item.key }}"'
|
|
|
|
line: "{{ item.value }}"
|
|
|
|
with_dict:
|
|
|
|
title: " \"title\": \"Etherpad Aurore\","
|
|
|
|
dbType: " \"dbType\" : \"postgres\","
|
2019-03-11 18:15:17 +01:00
|
|
|
defaultPadText: " \"defaultPadText\" : \"Bienvenue sur l'EtherPad d'Aurore !\\n\\nCe pad est public.\\n\","
|
2019-02-05 08:35:45 +01:00
|
|
|
lang: " \"lang\": \"fr-fr\""
|
|
|
|
|
|
|
|
# Service file
|
|
|
|
- name: Install EtherPad systemd unit
|
|
|
|
template:
|
2019-02-19 10:49:18 +01:00
|
|
|
src: systemd/etherpad-lite.service.j2
|
|
|
|
dest: /etc/systemd/system/etherpad-lite.service
|
2019-02-05 08:35:45 +01:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
notify: Reload systemd daemons
|
|
|
|
|
|
|
|
# Run
|
|
|
|
- name: Ensure that EtherPad is started
|
|
|
|
service:
|
|
|
|
name: etherpad-lite
|
|
|
|
state: started
|
2019-03-12 17:22:39 +01:00
|
|
|
enabled: true
|
2019-02-05 08:35:45 +01:00
|
|
|
|
|
|
|
# TODO-list
|
2019-03-12 17:22:39 +01:00
|
|
|
# La configuration de la clé `dbSettings` n'est pas encore automatisé !
|
|
|
|
# * Configure logs
|