我需要在我的游戏手册中有以下几点:
with_items: "{{ ab36-1E }}"上述操作不起作用,并导致Ansible 2.1和2.2版本中出现错误。
{"failed": true, "msg": "template error while templating string: unexpected char u'E' at 8. String: {{ab36-1E}}"}然而,这是可行的:with_items: "{{ ab361E }}"
{{ab36-1E}}是在YAML文件中定义并在剧本中引用的字典变量。
我想知道是否有一种方法可以在Ansible中使用{{ ab36-1E }},而不是在with_items中使用{{ ab361E }}。
发布于 2016-12-16 00:49:55
不,这是不可能的,也不限于with_items。
是什么使一个有效的变量名
变量名应该是字母、数字和下划线。变量应该总是以字母开头。
https://stackoverflow.com/questions/41175492
复制相似问题