diff --git a/applications/ansible.cfg b/applications/ansible.cfg new file mode 100644 index 0000000..b65197c --- /dev/null +++ b/applications/ansible.cfg @@ -0,0 +1,3 @@ +[defaults] +strategy_plugins = workspace/lib/python3.9/site-packages/ansible_mitogen/plugins/strategy/ +strategy = mitogen_linear diff --git a/applications/requirements.txt b/applications/requirements.txt index 417a6cf..948a4a3 100644 --- a/applications/requirements.txt +++ b/applications/requirements.txt @@ -1 +1,2 @@ ansible==2.10.5 +git+https://github.com/mitogen-hq/mitogen.git@v0.3.0-rc.0 diff --git a/applications/stack_address.toml b/applications/stack_address.toml index 68f4f75..15d927b 100755 --- a/applications/stack_address.toml +++ b/applications/stack_address.toml @@ -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' diff --git a/stack/computes.tf b/stack/computes.tf index d200b9c..ac04fa4 100644 --- a/stack/computes.tf +++ b/stack/computes.tf @@ -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 { diff --git a/stack/libvirtd.tf b/stack/libvirtd.tf index 28f7e49..cb80128 100644 --- a/stack/libvirtd.tf +++ b/stack/libvirtd.tf @@ -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'