gpt4 book ai didi

ansible - 如何避免类型转换警告?

转载 作者:行者123 更新时间:2023-12-02 10:48:25 25 4
gpt4 key购买 nike

当我使用dconf module时带循环

- 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"

我收到这样的警告:

[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.

我尝试了所有可能的方法来引用该值,但没有结果

最佳答案

你试过吗

value: "{{ item.value |string }}"

关于ansible - 如何避免类型转换警告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56181810/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com