mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-15 08:30:46 +02:00
35 lines
1.6 KiB
YAML
35 lines
1.6 KiB
YAML
- name: enable {{plugin_key}} nextcloud plugin
|
|
command: "{{nextcloud_docker_exec_occ}} app:enable {{plugin_key}}"
|
|
register: enable_result
|
|
changed_when: enable_result.rc == 0 and ("already enabled" not in enable_result.stdout)
|
|
|
|
- name: Check if {{nextcloud_control_node_plugin_vars_directory}}{{ plugin_key }}.yml exists
|
|
stat:
|
|
path: "{{nextcloud_control_node_plugin_vars_directory}}{{ plugin_key }}.yml"
|
|
delegate_to: localhost
|
|
become: false
|
|
register: plugin_vars_file
|
|
|
|
- name: "Load {{ plugin_key }} configuration variables"
|
|
include_vars:
|
|
file: "{{nextcloud_control_node_plugin_vars_directory}}{{ plugin_key }}.yml"
|
|
when: plugin_vars_file.stat.exists
|
|
|
|
- name: "Set {{ item.configkey }} for {{ item.appid }}"
|
|
loop: "{{ plugin_configuration }}"
|
|
command: >
|
|
{{ nextcloud_docker_exec_occ }} config:app:set {{ item.appid }} {{ item.configkey }} --value '{{ item.configvalue | to_json if item.configvalue is mapping else item.configvalue }}'
|
|
register: config_set_result
|
|
changed_when: (config_set_result.stdout is defined) and ("Config value were not updated" not in config_set_result.stdout)
|
|
when: plugin_vars_file.stat.exists
|
|
|
|
- name: Check if {{nextcloud_control_node_plugin_tasks_directory}}{{ plugin_key }}.yml exists
|
|
stat:
|
|
path: "{{nextcloud_control_node_plugin_tasks_directory}}{{ plugin_key }}.yml"
|
|
delegate_to: localhost
|
|
become: false
|
|
register: plugin_tasks_file
|
|
|
|
- name: "include {{nextcloud_control_node_plugin_tasks_directory}}{{ plugin_key }}.yml"
|
|
include_tasks: "{{nextcloud_control_node_plugin_tasks_directory}}{{ plugin_key }}.yml"
|
|
when: plugin_tasks_file.stat.exists |