diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2019-07-30 22:51:20 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2019-07-30 22:51:20 +0200 |
commit | 66b2e316ef588cfde9c9662bfc1de57a0e4f494d (patch) | |
tree | 5f2877df32c7e63d93870b18de2dab1263ccb70f /terraform/ansible/inventory | |
parent | d0104a31198e542b81e540a3abe1ad34d2272873 (diff) | |
download | k8s-sandbox-66b2e316ef588cfde9c9662bfc1de57a0e4f494d.tar.gz k8s-sandbox-66b2e316ef588cfde9c9662bfc1de57a0e4f494d.tar.bz2 k8s-sandbox-66b2e316ef588cfde9c9662bfc1de57a0e4f494d.tar.xz k8s-sandbox-66b2e316ef588cfde9c9662bfc1de57a0e4f494d.zip |
Diffstat (limited to 'terraform/ansible/inventory')
-rwxr-xr-x | terraform/ansible/inventory | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/terraform/ansible/inventory b/terraform/ansible/inventory index 880397a..f3d4239 100755 --- a/terraform/ansible/inventory +++ b/terraform/ansible/inventory @@ -3,21 +3,26 @@ read -r -d '' script <<'EOF' to_entries|map({(.key|tostring):.value.value})|add as $input | -$input.k8s_node_names|to_entries|map({(.value):{ - ansible_host:$input.k8s_node_public_ips[.key], - private_ip:$input.k8s_node_private_ips[.key]} - }) as $nodes | - { ansible_host:$input.k8s_master_ip.public_ip, private_ip:$input.k8s_master_ip.private_ip, } as $master | +$input.k8s_node_names|to_entries|map({(.value):{ + ansible_host:$input.k8s_node_private_ips[.key], + private_ip:$input.k8s_node_private_ips[.key], + }) as $nodes | + {_meta:{ hostvars:([{"k8s-master": $master}]+$nodes|add)}, all:(["k8s-master"] + ($input.k8s_node_names)), k8s:(["k8s-master"] + ($input.k8s_node_names)), - "k8s-nodes":$input.k8s_node_names, + "k8s-nodes":{ + "hosts": $input.k8s_node_names, + "vars": { + "ansible_ssh_common_args": (["-J ", $input.k8s_master_ip.public_ip]|add) + } + } } EOF |