问题
When I use the dconf module with a loop
- name: dconf | modify settings
dconf:
key: "{{ item.key }}"
value: "{{ item.value }}"
state: present
loop:
- key: "/org/gnome/libgnomekbd/keyboard/layouts"
value: "['us', 'se']"
- key: "/org/cinnamon/panels-height"
value: "['1:40']"
tags: "dconf"
I get such warnings:
[WARNING]: The value ['us', 'se'] (type list) in a string field was converted to "['us', 'se']" (type string). If this does not look like what you expect, quote the entire value to ensure it does not change.
[WARNING]: The value ['1:40'] (type list) in a string field was converted to "['1:40']" (type string). If this does not look like what you expect, quote the entire value to ensure it does not change.
I tried all possible ways to quote the value but without result
回答1:
Have you tried
value: "{{ item.value |string }}"
来源:https://stackoverflow.com/questions/56181810/how-to-avoid-type-conversion-warnings