Automated changes from linter ;P

This commit is contained in:
Mark Janssen 2024-07-11 20:47:52 +02:00
parent 44b73a216f
commit f7f04e7a41
Signed by: foobar
GPG key ID: D8674D8FC4F69BD2
65 changed files with 392 additions and 324 deletions

View file

@ -1,8 +1,9 @@
---
- import_tasks: ../../common/handlers/main.yaml
- ansible.builtin.import_tasks:
file: ../../common/handlers/main.yaml
- name: restart etherpad
systemd:
ansible.builtin.systemd:
name: etherpad
state: restarted
daemon_reload: true

View file

@ -1,20 +1,23 @@
---
- tags: etherpad
block:
- import_tasks: ../../../snippets/common-nginx.yaml
- ansible.builtin.import_tasks:
file: ../../../snippets/common-nginx.yaml
- name: Install dependencies
apt:
ansible.builtin.apt:
name: [ gpg, postgresql, python3-psycopg2, apt-transport-https ]
- name: Import nodesource signing key
shell: curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg
ansible.builtin.shell:
cmd: curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor
-o /usr/share/keyrings/nodesource.gpg
args:
creates: /usr/share/keyrings/nodesource.gpg
notify: apt update
- name: Install nodesource source list
template:
ansible.builtin.template:
src: nodesource.list
dest: /etc/apt/sources.list.d/nodesource.list
owner: root
@ -23,7 +26,7 @@
notify: apt update
- name: Install nodejs apt preference
template:
ansible.builtin.template:
src: nodejs-apt-pref
dest: /etc/apt/preferences.d/nodejs
owner: root
@ -31,10 +34,10 @@
mode: 0644
notify: apt update
- meta: flush_handlers
- ansible.builtin.meta: flush_handlers
- name: Install nodejs
apt:
ansible.builtin.apt:
name: nodejs
- name: Add database user
@ -42,7 +45,7 @@
become_method: su
become_user: postgres
no_log: yes
postgresql_user:
community.postgresql.postgresql_user:
name: etherpad
password: "{{ etherpad_db_password }}"
@ -50,17 +53,17 @@
become: true
become_method: su
become_user: postgres
postgresql_db:
community.postgresql.postgresql_db:
name: "{{ etherpad_db_name }}"
owner: "{{ etherpad_db_user }}"
- name: Add etherpad user
user:
ansible.builtin.user:
name: etherpad
home: /var/lib/etherpad
- name: Create log file
file:
ansible.builtin.file:
path: /var/log/etherpad.log
state: touch
owner: etherpad
@ -68,7 +71,7 @@
mode: 0644
- name: Create source directory
file:
ansible.builtin.file:
path: /opt/etherpad
state: directory
owner: etherpad
@ -79,7 +82,7 @@
become: yes
become_method: su
become_user: etherpad
git:
ansible.builtin.git:
repo: https://github.com/ether/etherpad-lite.git
version: master
dest: /opt/etherpad
@ -87,7 +90,7 @@
notify: restart etherpad
- name: Install etherpad config
template:
ansible.builtin.template:
src: settings.json
dest: /opt/etherpad/settings.json
owner: root
@ -96,7 +99,7 @@
notify: restart etherpad
- name: Install etherpad service
template:
ansible.builtin.template:
src: etherpad.service
dest: /etc/systemd/system/etherpad.service
owner: root
@ -105,14 +108,14 @@
notify: restart etherpad
- name: Start etherpad
systemd:
ansible.builtin.systemd:
daemon_reload: true
name: etherpad
state: started
enabled: yes
- name: Install nginx config
template:
ansible.builtin.template:
src: nginx-site.conf
dest: /etc/nginx/sites-enabled/etherpad
owner: root
@ -121,7 +124,7 @@
notify: reload nginx
- name: Allow HTTP and HTTPS
iptables:
ansible.builtin.iptables:
chain: INPUT
protocol: tcp
destination_port: "{{ item.port }}"

View file

@ -0,0 +1,3 @@
collections:
- name: community.postgresql
version: 2.3.2