1
在Jinja2模板中循环Ansible变量数组
当Ansible收集有关主机的事实时,例如获取主机的所有坐骑: "ansible_mounts": [ { "block_available": 7800291, "block_size": 4096, "block_total": 8225358, "block_used": 425067, "device": "/dev/mapper/foobar", "fstype": "xfs", "inode_available": 16403366, "inode_total": 16458752, "inode_used": 55386, "mount": "/", "options": "rw,seclabel,relatime,attr2,inode64,noquota", "size_available": 31949991936, "size_total": 33691066368, "uuid": "2ebc82cb-5bc2-4db9-9914-33d65ba350b8" }, { "block_available": 44648, "block_size": 4096, "block_total": 127145, "block_used": 82497, "device": "/dev/sda1", "fstype": "xfs", "inode_available": 255595, "inode_total": 256000, …