嵌套数据结构可以通过使用键名索引或使用键名- 的点语法进行索引来访问。 when: item not in vars - parent - parent.child2ansible-playbook*************
skipping: [localhost] => (item=parent)
类似于: assert:
that: ansible_host in ucarp_data.hosts=> {"msg": "The conditional check 'ansible_host in ucarp_data.hosts' failed.The error was: error while evaluating conditional (ansible_host i
我正在使用ansible模板来生成配置文件。问题是我在我的模板中有很多条件语句,我想通过使用一个简单的条件选择正确的变量文件来删除这些语句。file and os == 'ubuntu'password='ubuntupasswd'
endif 还有更多这样的东西,我宁愿让模板保持整洁,只需要选择正确的变量文件不是ansible的专家。