ansible/roles/etherpad/tasks/main.yml

64 lines
1.5 KiB
YAML

---
- name: Install Etherpad dependencies
apt:
update_cache: true
name:
- libssl-dev
- pkg-config
- build-essential
- nodejs
register: apt_result
retries: 3
until: apt_result is succeeded
- name: Clone EtherPad
git:
repo: https://github.com/ether/etherpad-lite.git
dest: "/var/www/{{ item.name }}"
version: 1.8.4
loop: "{{ etherpad.instances }}"
become: true
become_user: etherpad
notify: Restart Etherpad
- name: Configure EtherPad
template:
src: etherpad/settings.json.j2
dest: "/var/www/{{ item.name }}/settings.json"
owner: etherpad
group: etherpad
mode: 0600
loop: "{{ etherpad.instances }}"
notify: Restart Etherpad
- name: Install delete_after_delay module
npm:
name: ep_delete_after_delay
path: "/var/www/{{ item.name }}/node_modules"
state: "{% if item.temporary.enabled is defined and item.temporary.enabled %}present{% else %}absent{% endif %}"
loop: "{{ etherpad.instances }}"
become: true
become_user: etherpad
notify: Restart Etherpad
- name: Install EtherPad systemd unit
template:
src: systemd/system/etherpad-lite.service.j2
dest: "/etc/systemd/system/{{ item.name }}.service"
loop: "{{ etherpad.instances }}"
notify: Restart Etherpad
- name: Activate EtherPad service
systemd:
daemon_reload: true
name: "{{ item.name }}"
enabled: true
state: started
loop: "{{ etherpad.instances }}"
- name: Indicate role in motd
template:
src: update-motd.d/05-service.j2
dest: /etc/update-motd.d/05-etherpad
mode: 0755