ansible/roles/etherpad/tasks/main.yml
2019-04-06 15:19:52 +02:00

83 lines
2.1 KiB
YAML

---
# Install EtherPad dependencies
- name: Install required packages
apt:
update_cache: true
name: curl
state: present
register: apt_result
retries: 3
until: apt_result is succeeded
# Create EtherPad user and group
- include_tasks: 1_user_group.yml
# Download EtherPad
- name: Clone EtherPad project
git:
repo: https://github.com/ether/etherpad-lite.git
dest: /var/local/etherpad/etherpad-lite
version: 1.7.5
become: true
become_user: etherpad
# 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:
src: /var/local/etherpad/etherpad-lite/src
dest: /var/local/etherpad/etherpad-lite/node_modules/ep_etherpad-lite
state: link
become: true
become_user: etherpad
# Installation script bin/installDeps.sh (3)
# TODO --no-save
- name: Install Etherpad dependencies
npm:
path: /var/local/etherpad/etherpad-lite/node_modules/ep_etherpad-lite
become: true
become_user: etherpad
register: npm_result
retries: 3
until: npm_result is succeeded
# Configuration
- name: Configure EtherPad
lineinfile:
dest: /var/local/etherpad/etherpad-lite/settings.json
regexp: '^\s*"{{ item.key }}"'
line: "{{ item.value }}"
with_dict:
title: " \"title\": \"Etherpad Aurore\","
dbType: " \"dbType\" : \"postgres\","
defaultPadText: " \"defaultPadText\" : \"Bienvenue sur l'EtherPad d'Aurore !\\n\\nCe pad est public.\\n\","
lang: " \"lang\": \"fr-fr\""
# Service file
- name: Install EtherPad systemd unit
template:
src: systemd/etherpad-lite.service.j2
dest: /etc/systemd/system/etherpad-lite.service
owner: root
group: root
mode: 0644
# Run
- name: Ensure that EtherPad is started
systemd:
name: etherpad-lite
state: started
enabled: true
daemon_reload: true
# TODO-list
# La configuration de la clé `dbSettings` n'est pas encore automatisé !
# * Configure logs