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
Type Conversion refers to conversion from one type to another. The main idea behind type conversion is to make variable of one type compatible with variable of another type to perform an operation. For example, to find the sum of two variables, one of int type & other of float type.
There are two types of conversion: implicit and explicit. The term for implicit type conversion is coercion. Explicit type conversion in some specific way is known as casting.
Advantages of Type Conversion: This is done to take advantage of certain features of type hierarchies or type representations. It helps to compute expressions containing variables of different data types.
In computer science, type conversion, type casting, type coercion, and type juggling are different ways of changing an expression from one data type to another. An example would be the conversion of an integer value into a floating point value or its textual representation as a string, and vice versa.
Have you tried
value: "{{ item.value |string }}"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With