diff --git a/output_file_example/nginx_openstack/ansible/config.yaml b/output_file_example/nginx_openstack/ansible/config.yaml index 31417c5bec8dc6e439af0aa05dddae529473a0ba..072faf26a97296aeb11aa66838af9905c0fec234 100644 --- a/output_file_example/nginx_openstack/ansible/config.yaml +++ b/output_file_example/nginx_openstack/ansible/config.yaml @@ -1,6 +1,7 @@ --- input: - instance_server_public_key + - instance_ip output: [] engine: ansible ... diff --git a/output_file_example/nginx_openstack/ansible/nginx.play b/output_file_example/nginx_openstack/ansible/nginx.play index 758a689e705a6af5823ea2c5cfb5f1f603f1b2a3..133c03710d5abfbe61632ebab8467299dbf31e70 100644 --- a/output_file_example/nginx_openstack/ansible/nginx.play +++ b/output_file_example/nginx_openstack/ansible/nginx.play @@ -1,5 +1,5 @@ --- -- hosts: 16.0.0.1 +- hosts: "{{instance_server_public_key}}" gather_facts: no become: yes vars: diff --git a/output_file_example/nginx_openstack/terraform/config.yaml b/output_file_example/nginx_openstack/terraform/config.yaml index 77edc6dfdcdd484647221fab5e92ad6e2c491696..3cadda98c5f9e98b9c0d4fb64d16c6402519755e 100644 --- a/output_file_example/nginx_openstack/terraform/config.yaml +++ b/output_file_example/nginx_openstack/terraform/config.yaml @@ -4,4 +4,5 @@ input: [] output: - instance_server_public_key - instance_server_private_key + - instance_ip ... diff --git a/output_file_example/nginx_openstack/terraform/main.tf b/output_file_example/nginx_openstack/terraform/main.tf index 75b5e2350079dfb376ad6d4bcb25e425ba03cd46..6fa10157fe638c18fa5f5ef7a60ccc1e7c69d607 100644 --- a/output_file_example/nginx_openstack/terraform/main.tf +++ b/output_file_example/nginx_openstack/terraform/main.tf @@ -29,8 +29,8 @@ data "openstack_networking_secgroup_v2" "default" { # Create virtual machine resource "openstack_compute_instance_v2" "nginx" { name = "nginx-host" - image_name = "ubuntu-18.04" - flavor_name = "m1.tiny" + image_name = "Ubuntu-Focal-20.04-Daily-2022-04-19" + flavor_name = "ubuntu" key_pair = openstack_compute_keypair_v2.user_key.name network { port = openstack_networking_port_v2.nginx.id diff --git a/output_file_example/nginx_openstack/terraform/output.tf b/output_file_example/nginx_openstack/terraform/output.tf index ec7fc6ad92d2a213feffb9e65f47146b61f6792c..c92ff851903c60eb7dc03051dee5c46ce788372d 100644 --- a/output_file_example/nginx_openstack/terraform/output.tf +++ b/output_file_example/nginx_openstack/terraform/output.tf @@ -4,4 +4,8 @@ output "instance_server_public_key" { output "instance_server_private_key" { value = openstack_compute_keypair_v2.user_key.private_key -} \ No newline at end of file +} + +output "instance_ip" { + value = openstack_compute_floatingip_associate_v2.nginx.floating_ip +}