use local_file for ansible inventory
This commit is contained in:
parent
1920af5bc4
commit
75aeaf38a9
5 changed files with 24 additions and 30 deletions
10
terraform/ansible.tf
Normal file
10
terraform/ansible.tf
Normal file
|
@ -0,0 +1,10 @@
|
|||
resource "local_file" "ansible_inventory" {
|
||||
file_permission = "0644"
|
||||
filename = "${path.module}/../ansible/inventory.ini"
|
||||
content = <<EOT
|
||||
[all]
|
||||
%{for host in yandex_compute_instance.vm~}
|
||||
${trimspace("${host.name} ansible_host=${host.network_interface.0.nat_ip_address}")}
|
||||
%{endfor~}
|
||||
EOT
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue