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 ansible==2.10.5
git+https://github.com/mitogen-hq/mitogen.git@v0.3.0-rc.0

View File

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

View File

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

View File

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