github.com/weaveworks/common@v0.0.0-20230728070032-dd9e68f319d5/tools/provisioning/do/outputs.tf (about)

     1  output "username" {
     2    value = "${var.do_username}"
     3  }
     4  
     5  output "public_ips" {
     6    value = ["${digitalocean_droplet.tf_test_vm.*.ipv4_address}"]
     7  }
     8  
     9  output "hostnames" {
    10    value = "${join("\n", 
    11      "${formatlist("%v.%v.%v", 
    12        digitalocean_droplet.tf_test_vm.*.name, 
    13        digitalocean_droplet.tf_test_vm.*.region, 
    14        var.app
    15      )}"
    16    )}"
    17  }
    18  
    19  # /etc/hosts file for the Droplets:
    20  # N.B.: by default Digital Ocean droplets only have public IPs, but in order to
    21  # be consistent with other providers' recipes, we provide an output to generate
    22  # an /etc/hosts file on the Droplets, even though it is using public IPs only.
    23  output "private_etc_hosts" {
    24    value = "${join("\n", 
    25      "${formatlist("%v %v.%v.%v", 
    26        digitalocean_droplet.tf_test_vm.*.ipv4_address, 
    27        digitalocean_droplet.tf_test_vm.*.name, 
    28        digitalocean_droplet.tf_test_vm.*.region, 
    29        var.app
    30      )}"
    31    )}"
    32  }
    33  
    34  # /etc/hosts file for the client:
    35  output "public_etc_hosts" {
    36    value = "${join("\n", 
    37      "${formatlist("%v %v.%v.%v", 
    38        digitalocean_droplet.tf_test_vm.*.ipv4_address, 
    39        digitalocean_droplet.tf_test_vm.*.name, 
    40        digitalocean_droplet.tf_test_vm.*.region, 
    41        var.app
    42      )}"
    43    )}"
    44  }
    45  
    46  output "ansible_inventory" {
    47    value = "${format("[all]\n%s", join("\n",
    48      "${formatlist("%v private_ip=%v",
    49        digitalocean_droplet.tf_test_vm.*.ipv4_address,
    50        digitalocean_droplet.tf_test_vm.*.ipv4_address
    51      )}"
    52    ))}"
    53  }
    54  
    55  output "private_key_path" {
    56    value = "${var.do_private_key_path}"
    57  }