我需要ansible检查所有远程IP地址,如果远程系统在特定的子网中,则将文件复制到远程系统。我很难弄清楚如何在when子句中的列表或字典上进行ansible循环。这会抛出语法错误Error was expected string or buffer,因为ansible_all_ipv4_addresses是一个列表或字典,而不是一个字符串: copy: src=auto.direct.10g dest
我将利用Ansible在中提供我的系统,并且该系统有一些手工创建的实例。其中一个实例被命名为测试模块。因此,我将这一行作为任务something: {{ testing-module.private_ip }}放在我的剧本中。我的结果是fatal: [foo] => Unable to look up a name or access an attribute in template string.Make sure your variable name does not cont