webapps/etherpad > lint

This commit is contained in:
Ludovic Poujol 2024-06-21 10:48:31 +02:00
parent 18c30b72c1
commit c219b37aa6
Signed by: lpoujol
SSH key fingerprint: SHA256:YZbQWfjHONnvIGkFZMs0xRKtqzqGqwtZU+kCOKhZXPA
2 changed files with 15 additions and 10 deletions

View file

@ -4,7 +4,7 @@
- name: Install main system dependencies - name: Install main system dependencies
ansible.builtin.apt: ansible.builtin.apt:
name: "{{ etherpad_system_dep }}" name: "{{ etherpad_system_dep }}"
update_cache: yes update_cache: true
- name: Install pnpm (via npm) - name: Install pnpm (via npm)
ansible.builtin.command: ansible.builtin.command:
@ -15,7 +15,7 @@
path: /usr/local/lib/node_modules/ path: /usr/local/lib/node_modules/
state: directory state: directory
mode: o+rx mode: o+rx
recurse: yes recurse: true
- name: Add UNIX account - name: Add UNIX account
ansible.builtin.user: ansible.builtin.user:
@ -30,7 +30,7 @@
ansible.builtin.mysql_user: ansible.builtin.mysql_user:
name: "{{ etherpad_db_user }}" name: "{{ etherpad_db_user }}"
password: "{{ etherpad_db_password }}" password: "{{ etherpad_db_password }}"
priv: "{{ etherpad_db_name }}.*:{{privileges |default('SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER,CREATE TEMPORARY TABLES')}}" priv: "{{ etherpad_db_name }}.*:{{ privileges | default('SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER,CREATE TEMPORARY TABLES') }}"
update_password: on_create update_password: on_create
- name: Clone etherpad repo (git) - name: Clone etherpad repo (git)
@ -38,7 +38,7 @@
repo: "{{ etherpad_git_url }}" repo: "{{ etherpad_git_url }}"
dest: "~/etherpad-lite/" dest: "~/etherpad-lite/"
version: "{{ etherpad_git_version | default(omit) }}" version: "{{ etherpad_git_version | default(omit) }}"
update: yes update: true
force: true force: true
umask: '0022' umask: '0022'
become_user: "{{ service }}" become_user: "{{ service }}"
@ -72,8 +72,8 @@
- name: Enable systemd unit - name: Enable systemd unit
ansible.builtin.systemd: ansible.builtin.systemd:
name: "{{ service }}.service" name: "{{ service }}.service"
enabled: yes enabled: true
daemon_reload: yes daemon_reload: true
notify: notify:
- restart etherpad - restart etherpad
@ -84,10 +84,11 @@
- name: Check if SSL certificate is present and register result - name: Check if SSL certificate is present and register result
ansible.builtin.stat: ansible.builtin.stat:
path: "/etc/letsencrypt/live/{{ etherpad_domains |first }}/fullchain.pem" path: "/etc/letsencrypt/live/{{ etherpad_domains | first }}/fullchain.pem"
register: ssl register: ssl
- name: Generate certificate only if required (first time) - name: Generate certificate only if required (first time)
when: ssl.stat.exists != true
block: block:
- name: Template vhost without SSL for successfull LE challengce - name: Template vhost without SSL for successfull LE challengce
ansible.builtin.template: ansible.builtin.template:
@ -100,6 +101,7 @@
state: link state: link
notify: notify:
- reload nginx - reload nginx
- name: Flush handlers - name: Flush handlers
ansible.builtin.meta: flush_handlers ansible.builtin.meta: flush_handlers
- name: Make sure /var/lib/letsencrypt exists and has correct permissions - name: Make sure /var/lib/letsencrypt exists and has correct permissions
@ -107,19 +109,22 @@
path: /var/lib/letsencrypt path: /var/lib/letsencrypt
state: directory state: directory
mode: '0755' mode: '0755'
- name: Generate certificate with certbot - name: Generate certificate with certbot
ansible.builtin.command: ansible.builtin.command:
cmd: certbot certonly --webroot --webroot-path /var/lib/letsencrypt --non-interactive --agree-tos --email {{ etherpad_certbot_admin_email }} -d {{ etherpad_domains |first }} cmd: certbot certonly --webroot --webroot-path /var/lib/letsencrypt --non-interactive --agree-tos --email {{ etherpad_certbot_admin_email }} -d {{ etherpad_domains | first }}
- name: Create the ssl dir if needed - name: Create the ssl dir if needed
ansible.builtin.file: ansible.builtin.file:
path: /etc/nginx/ssl path: /etc/nginx/ssl
state: directory state: directory
mode: '0750' mode: '0750'
- name: Template ssl bloc for nginx vhost - name: Template ssl bloc for nginx vhost
ansible.builtin.template: ansible.builtin.template:
src: "ssl.conf.j2" src: "ssl.conf.j2"
dest: "/etc/nginx/ssl/{{ etherpad_domains |first }}.conf" dest: "/etc/nginx/ssl/{{ etherpad_domains |first }}.conf"
when: ssl.stat.exists != true
- name: (Re)check if SSL certificate is present and register result - name: (Re)check if SSL certificate is present and register result
ansible.builtin.stat: ansible.builtin.stat:

View file

@ -17,7 +17,7 @@
repo: "{{ etherpad_git_url }}" repo: "{{ etherpad_git_url }}"
dest: "~/etherpad-lite/" dest: "~/etherpad-lite/"
version: "{{ etherpad_git_version }}" version: "{{ etherpad_git_version }}"
update: yes update: true
force: true force: true
become_user: "{{ service }}" become_user: "{{ service }}"