etherpad/tasks/modules.yml
meaz 6dc97b3e9c remove modules (#28)
Add possibility to remove modules

Co-authored-by: muppeth <muppeth@disroot.org>
Reviewed-on: #28
Reviewed-by: muppeth <muppeth@no-reply@disroot.org>
2024-07-13 10:25:38 +02:00

28 lines
No EOL
1.1 KiB
YAML

---
# The following command get the etherpad_plugins_list dictionnary
# selects only the enabled plugins
# then uses filter to get all plugins names in one line, without comas or quotes as needed for npm
- name: '[Modules] - Install modules'
shell:
cmd: "pnpm run install-plugins {{ etherpad_plugins_list| dict2items | selectattr('value', 'eq', 'enabled') | map(attribute='key') |join(',') | replace(\",\", \" \") }}"
args:
chdir: "{{ etherpad_app_dir }}/app"
become: yes
become_user: "{{ etherpad_username }}"
when: etherpad_plugins_list| dict2items | selectattr('value', 'eq', 'enabled') |length > 0
notify:
restart etherpad
tags: modules
- name: '[Modules] - Remove modules'
shell:
cmd: "pnpm run plugins rm {{ etherpad_plugins_list| dict2items | selectattr('value', 'eq', 'removed') | map(attribute='key') |join(',') | replace(\",\", \" \") }}"
args:
chdir: "{{ etherpad_app_dir }}/app"
become: yes
become_user: "{{ etherpad_username }}"
when: etherpad_plugins_list| dict2items | selectattr('value', 'eq', 'removed') |length > 0
notify:
restart etherpad
tags: modules