From b1a1daf9550492570260d3c2f3d64422d1ad6faa Mon Sep 17 00:00:00 2001 From: Johanna Dorothea Reichmann Date: Thu, 28 Oct 2021 17:56:05 +0200 Subject: [PATCH] fix(server): specify value type when configuring settings --- roles/server/tasks/configure-single-setting.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/roles/server/tasks/configure-single-setting.yml b/roles/server/tasks/configure-single-setting.yml index 3f0c7a1..7a2c41a 100644 --- a/roles/server/tasks/configure-single-setting.yml +++ b/roles/server/tasks/configure-single-setting.yml @@ -14,13 +14,23 @@ - name: Set {{ key }} to {{ value }} community.docker.docker_container_exec: container: "{{ nextcloud_container_name }}" - command: "{{ nextcloud_occ_command }} config:{{ type }}:set {{ scope }} {{ entry }} --value={{ value }} -n" + command: "{{ nextcloud_occ_command }} config:{{ type }}:set {{ scope }} {{ entry }} --type={{ value_type }} --value={{ value }} -n" user: "{{ nextcloud_user_info.uid }}" tty: yes when: nextcloud_current_config_entry.stdout != value notify: restart-nextcloud vars: entry_path: "{{ key.split('.') }}" + value_type: >- + {% if value is boolean %} + boolean + {% elsif value is integer %} + integer + {% elsif value is float %} + float + {% else %} + string + {% endif %} type: "{{ entry_path | first }}" scope: "{{ entry_path[1] if entry_path | length > 2 else '' }}" entry: >-