fix(server): specify value type when configuring settings

This commit is contained in:
transcaffeine 2021-10-28 17:56:05 +02:00
parent 341780731c
commit b1a1daf955
Signed by untrusted user: transcaffeine
GPG Key ID: 03624C433676E465

View File

@ -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: >-