Move EtherPad to Docker

pull/1/head
Alexandre Iooss 5 years ago
parent b488007578
commit 044e8af3aa
No known key found for this signature in database
GPG Key ID: 6C79278F3FCDCC02

@ -14,7 +14,6 @@ services-bdd.adm.auro.re
phabricator.adm.auro.re
wiki.adm.auro.re
www.adm.auro.re
pad.adm.auro.re
proxy.adm.auro.re
matrix-services.adm.auro.re

@ -1,6 +1,6 @@
---
# This is a special playbook to create a new VM !
- hosts: pad.adm.auro.re # Host with python-proxmoxer and python-requests
- hosts: proxy.adm.auro.re # Host with python-proxmoxer and python-requests
become: false # We do not need root as we use Proxmox API
vars:

@ -1,26 +0,0 @@
---
# Security #1
- name: Create EtherPad system group
group:
name: etherpad
system: true
state: present
# Security #2
- name: Create EtherPad user
user:
name: etherpad
group: etherpad
home: /var/local/etherpad
comment: EtherPad
system: true
state: present
# Security #3
- name: Secure Etherpad home directory
file:
path: /var/local/etherpad
state: directory
owner: etherpad
group: etherpad
mode: 0750

@ -1,83 +0,0 @@
---
# 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

@ -1,5 +0,0 @@
# {{ ansible_managed }}
Package: node* libuv1*
Pin: release a=stretch-backports
Pin-Priority: 600

@ -1,17 +0,0 @@
# {{ ansible_managed }}
[Unit]
Description=Etherpad-lite, the collaborative editor.
After=syslog.target network-online.target mysql.service postgresql.service
Conflicts=shutdown.target
[Service]
Type=simple
User=etherpad
Group=etherpad
WorkingDirectory=/var/local/etherpad/etherpad-lite
ExecStart=/usr/bin/nodejs /var/local/etherpad/etherpad-lite/node_modules/ep_etherpad-lite/node/server.js
Restart=always
[Install]
WantedBy=multi-user.target

@ -9,13 +9,6 @@
roles:
- passbolt
# Install EtherPad on EtherPad containers
- hosts: pad.adm.auro.re
roles:
- debian-backports
- nodejs
- etherpad
# Install DokuWiki on the wiki TEST container
# When it will be operational, horus-wikitest will replace horus-wiki
- hosts: horus-wikitest
@ -32,9 +25,6 @@
- name: intranet
from: intranet.auro.re
to: re2o-server.adm.auro.re
- name: pad
from: pad.auro.re
to: pad.adm.auro.re:9001
- name: phabricator
from: phabricator.auro.re
to: phabricator.adm.auro.re
@ -59,5 +49,11 @@
- name: privatebin
from: privatebin.auro.re
to: docker-ovh.adm.auro.re:8083
- name: pad
from: pad.auro.re
to: docker-ovh.adm.auro.re:8084
- name: cas
from: cas.auro.re
to: docker-ovh.adm.auro.re:8085
roles:
- nginx-reverse-proxy

Loading…
Cancel
Save