add mitogen v0.3.0-rc.0 for ansible 2.10 and enhance ansible inventory generated by terraform

This commit is contained in:
Antoine 2021-01-25 00:12:17 +01:00
parent 849e76552f
commit d42cc4fc80
Signed by: antoine
GPG Key ID: 098FB66FC0475E70
5 changed files with 12 additions and 7 deletions

3
applications/ansible.cfg Normal file
View File

@ -0,0 +1,3 @@
[defaults]
strategy_plugins = workspace/lib/python3.9/site-packages/ansible_mitogen/plugins/strategy/
strategy = mitogen_linear

View File

@ -1 +1,2 @@
ansible==2.10.5
git+https://github.com/mitogen-hq/mitogen.git@v0.3.0-rc.0

View File

@ -1,7 +1,7 @@
[all]
100.64.0.113 index=0
100.64.0.251 index=1
100.64.0.114 index=2
100.64.0.124 index=3
compute-0 ansible_host=100.64.0.113 index=0
compute-1 ansible_host=100.64.0.251 index=1
compute-2 ansible_host=100.64.0.114 index=2
compute-3 ansible_host=100.64.0.124 index=3
[all:vars]
ansible_ssh_common_args='-o StrictHostKeyChecking=no'

View File

@ -17,7 +17,8 @@ resource "libvirt_domain" "domains" {
}
network_interface {
network_name = libvirt_network.private_network.name
network_id = libvirt_network.private_network.id
hostname = format("compute-%s", count.index)
}
disk {

View File

@ -53,8 +53,8 @@ resource "local_file" "write_address" {
content = <<-EOT
[all]
%{ for idx, s in libvirt_domain.domains.*.network_interface.0.addresses.0 ~}
${s} index=${idx}
%{ for idx, s in libvirt_domain.domains.*.network_interface.0 ~}
${s.hostname} ansible_host=${s.addresses.0} index=${idx}
%{ endfor ~}
[all:vars]
ansible_ssh_common_args='-o StrictHostKeyChecking=no'