0
如何使用ansible(v1.9)playbook中的任何文件名爲postgres集羣創建配置文件? 例子:循環中的Ansible循環
postgres:
clusters:
- name: new
configs:
- filename: "someconfig.1"
template: "path.1"
- filename: "someconfig.2"
template: "path.2"
- name: new2
configs:
- filename: "someconfig.1"
template: "path.1"
- filename: "someconfig.2"
template: "path.2"
我想做的事:
- name: Create configs for postgres clusters
template: src={{ item.template }} dest={{ cluster.name }}/{{ item.filename }}
with_items: item.configs
with_items: postgres.clusters as cluster