--- - name: Install dependencies ansible.builtin.apt: state: present pkg: - nodejs - postgresql - python3-psycopg2 - name: Add database user become: true become_method: su become_user: postgres no_log: yes community.postgresql.postgresql_user: name: etherpad password: "{{ etherpad_db_password }}" - name: Add database become: true become_method: su become_user: postgres community.postgresql.postgresql_db: name: "{{ etherpad_db_name }}" owner: "{{ etherpad_db_user }}" - name: Add etherpad user ansible.builtin.user: name: etherpad home: /var/lib/etherpad - name: Create log file ansible.builtin.file: path: /var/log/etherpad.log state: touch owner: etherpad group: etherpad mode: 0644 - name: Create source directory ansible.builtin.file: path: /opt/etherpad state: directory owner: etherpad group: etherpad mode: 0755 - name: Clone etherpad source become: yes become_method: su become_user: etherpad ansible.builtin.git: repo: https://github.com/ether/etherpad-lite.git version: master dest: /opt/etherpad accept_hostkey: yes notify: Restart etherpad - name: Install etherpad config ansible.builtin.template: src: settings.json dest: /opt/etherpad/settings.json owner: root group: root mode: 0644 notify: Restart etherpad - name: Install etherpad service ansible.builtin.template: src: etherpad.service dest: /etc/systemd/system/etherpad.service owner: root group: root mode: 0644 notify: Restart etherpad - name: Start etherpad ansible.builtin.systemd: daemon_reload: true name: etherpad state: started enabled: true - name: Install nginx config ansible.builtin.template: src: nginx-site.conf dest: /etc/nginx/sites-enabled/etherpad owner: root group: root mode: 0644 notify: Reload nginx