【文件属性】:
文件名称:ansible-filter-get_attr:Ansible过滤器可在字典中的键和值中进行变量替换
文件大小:1KB
文件格式:ZIP
更新时间:2021-05-10 14:19:57
ansible ansible-filters Python
Ansible过滤器:get_attr
该过滤器克服了Ansible在dict键中缺少变量替换的问题。
问题: :
用法
# Just to set some variables
- set_fact :
key1 : " Name "
val1 : " my-name "
key2 : " tier "
val2 : " dev "
# Here we actually use variables
- set_fact :
key_val :
- key : " {{ key1 }} "
val : " {{ val1 }} "
- key : " {{ key2 }} "
val : " {{ val2 }} "
# The filter will actually reorder
【文件预览】:
ansible-filter-get_attr-master
----.gitignore(12B)
----get_attr.py(512B)
----README.md(794B)