我想做以下事情:
- lineinfile:
dest: "file{{ item }}.properties"
line: "port: {{ port_list[item - 1] }}"
with_sequence: start=1 end={{ nb_process }}
我有 port_list 变量,其中包含要插入每个属性文件的端口。我有以下错误作为回报:
unsupported operand type(s) for -: 'unicode' and 'int'
任何的想法 ?我也试过
line: "port: {{ port_list[(item - 1)|int] }}"
至今没有成功。