Reputation: 75
I'm looking for a way to loop on ansible inventory
inventory
[deployer]
ceph-node0
[mons]
ceph-node0
ceph-node1
ceph-node2
task.yml
- hosts: deployer
become: true
tasks:
- name: create monitor node
command: ceph orch apply mon {{ item.0 }},{{ item.1 }},{{ item.2 }}, {{ itemN }}
with_items:
- "{{ groups['mons'] }}"
I expect results like this with only one execution
ceph orch apply mon ceph-node0,ceph-node1,ceph-node2,..ceph-nodeN
Upvotes: 1
Views: 55