# generate inventory file for Ansible resource "local_file" "ansible_inventory" { content = templatefile( "hosts.j2", { cephmons = {for key, value in lxd_instance.ceph-mon : value.name => value.ipv4_address } cephosds = {for key, value in lxd_instance.ceph-osd : value.name => value.ipv4_address } jumphost = var.ansible_jumphost } ) filename = "../data/inventory" }