From 044e8af3aa520ae20083ff002e898e359ebd4f39 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Fri, 26 Jul 2019 08:50:07 +0200 Subject: [PATCH] Move EtherPad to Docker --- hosts | 1 - proxmox.yml | 2 +- roles/etherpad/tasks/1_user_group.yml | 26 ------ roles/etherpad/tasks/main.yml | 83 ------------------- roles/etherpad/templates/apt/nodejs.j2 | 5 -- .../systemd/etherpad-lite.service.j2 | 17 ---- services_web.yml | 16 ++-- 7 files changed, 7 insertions(+), 143 deletions(-) delete mode 100644 roles/etherpad/tasks/1_user_group.yml delete mode 100644 roles/etherpad/tasks/main.yml delete mode 100644 roles/etherpad/templates/apt/nodejs.j2 delete mode 100644 roles/etherpad/templates/systemd/etherpad-lite.service.j2 diff --git a/hosts b/hosts index e640cb1..cff737b 100644 --- a/hosts +++ b/hosts @@ -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 diff --git a/proxmox.yml b/proxmox.yml index 9617e0f..ca122ba 100644 --- a/proxmox.yml +++ b/proxmox.yml @@ -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: diff --git a/roles/etherpad/tasks/1_user_group.yml b/roles/etherpad/tasks/1_user_group.yml deleted file mode 100644 index 01c74ff..0000000 --- a/roles/etherpad/tasks/1_user_group.yml +++ /dev/null @@ -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 diff --git a/roles/etherpad/tasks/main.yml b/roles/etherpad/tasks/main.yml deleted file mode 100644 index 454b4bd..0000000 --- a/roles/etherpad/tasks/main.yml +++ /dev/null @@ -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 diff --git a/roles/etherpad/templates/apt/nodejs.j2 b/roles/etherpad/templates/apt/nodejs.j2 deleted file mode 100644 index 65e5110..0000000 --- a/roles/etherpad/templates/apt/nodejs.j2 +++ /dev/null @@ -1,5 +0,0 @@ -# {{ ansible_managed }} - -Package: node* libuv1* -Pin: release a=stretch-backports -Pin-Priority: 600 diff --git a/roles/etherpad/templates/systemd/etherpad-lite.service.j2 b/roles/etherpad/templates/systemd/etherpad-lite.service.j2 deleted file mode 100644 index fcaf95d..0000000 --- a/roles/etherpad/templates/systemd/etherpad-lite.service.j2 +++ /dev/null @@ -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 diff --git a/services_web.yml b/services_web.yml index 6063837..e6e135f 100644 --- a/services_web.yml +++ b/services_web.yml @@ -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