add mitogen v0.3.0-rc.0 for ansible 2.10 and enhance ansible inventory generated by terraform
This commit is contained in:
parent
849e76552f
commit
d42cc4fc80
3
applications/ansible.cfg
Normal file
3
applications/ansible.cfg
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[defaults]
|
||||||
|
strategy_plugins = workspace/lib/python3.9/site-packages/ansible_mitogen/plugins/strategy/
|
||||||
|
strategy = mitogen_linear
|
@ -1 +1,2 @@
|
|||||||
ansible==2.10.5
|
ansible==2.10.5
|
||||||
|
git+https://github.com/mitogen-hq/mitogen.git@v0.3.0-rc.0
|
||||||
|
@ -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'
|
||||||
|
@ -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 {
|
||||||
|
@ -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'
|
||||||
|
Loading…
Reference in New Issue
Block a user