From 6d1743c83e239806b1b6fb635e184a59a5f28f5a Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Tue, 11 Oct 2022 12:19:46 -0400 Subject: Etherpad starting setup --- pad/tasks/main.yml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ pad/tasks/mariadb.yml | 22 ++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 pad/tasks/main.yml create mode 100644 pad/tasks/mariadb.yml (limited to 'pad/tasks') diff --git a/pad/tasks/main.yml b/pad/tasks/main.yml new file mode 100644 index 0000000..ab15984 --- /dev/null +++ b/pad/tasks/main.yml @@ -0,0 +1,47 @@ +--- +# tasks file for pad +- name: Add nodesource key + apt_key: + url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key + state: present +- name: Add nodesource repository + ansible.builtin.apt_repository: + repo: deb https://deb.nodesource.com/node_13.x buster main + update_cache: yes +- name: Install packages + apt: + update_cache: yes + name: + - sudo + - nodejs + - mariadb-server + - mariadb-client + state: present +- name: Create etherpad user + user: + name: etherpad + home: /home/etherpad + shell: /bin/bash + state: present +- name: Install etherpad + git: + repo: https://github.com/ether/etherpad-lite.git + dest: "{{ etherpad_path }}" + depth: 1 + become: true + become_user: etherpad +- name: Configure etherpad + template: + src: templates/settings.json + dest: "{{ etherpad_path }}/settings.json" +# - name: Install etherpad plugins +# npm: +# name: ep_stats +# path: "{{ etherpad_path }}" +# become: true +# become_user: etherpad +- name: Install dependencies + shell: cd {{ etherpad_path }}; . src/bin/functions.sh; src/bin/installDeps.sh + become: true + become_user: etherpad +- include: mariadb.yml diff --git a/pad/tasks/mariadb.yml b/pad/tasks/mariadb.yml new file mode 100644 index 0000000..7a406c9 --- /dev/null +++ b/pad/tasks/mariadb.yml @@ -0,0 +1,22 @@ +--- +- name: Install MySQL packages + apt: + name: + - mariadb-server + - mariadb-client + - python3-mysqldb +- name: Start MariaDB + service: + name: mysql + state: started +- name: Ensure emacsconf-pad database exists + mysql_db: + name: "{{ etherpad_database_name }}" + collation: utf8mb4_general_ci + state: present +- name: Grant permissions to user + mysql_user: + name: "{{ etherpad_database_user }}" + state: present + priv: "{{ etherpad_database_name }}.*:ALL" + password: "{{ etherpad_database_password }}" -- cgit v1.2.3