Skip to content
Snippets Groups Projects
Commit 46411b86 authored by debora.benedetto@hpe.com's avatar debora.benedetto@hpe.com
Browse files

change template vm_name into vm.infrastructural_element_name

parent abc9323c
No related branches found
No related tags found
No related merge requests found
Showing
with 18 additions and 18 deletions
--- ---
input: input:
- instance_ip_nginx-host - instance_ip_vm1
- instance_server_private_key_ssh_key - instance_server_private_key_ssh_key
output: [] output: []
engine: ansible engine: ansible
......
[servers_for_nginx] [servers_for_nginx]
{{ instance_ip_nginx-host }} {{ instance_ip_vm1 }}
[servers_for_nginx:vars] [servers_for_nginx:vars]
ansible_connection=ssh ansible_connection=ssh
......
--- ---
input: input:
- instance_ip_nginx-host - instance_ip_vm1
- instance_server_private_key_ssh_key - instance_server_private_key_ssh_key
output: [] output: []
engine: ansible engine: ansible
......
[servers_for_piacere_monitoring] [servers_for_piacere_monitoring]
{{ instance_ip_nginx-host }} {{ instance_ip_vm1 }}
[servers_for_piacere_monitoring:vars] [servers_for_piacere_monitoring:vars]
ansible_connection=ssh ansible_connection=ssh
......
...@@ -11,6 +11,6 @@ output: ...@@ -11,6 +11,6 @@ output:
- instance_server_public_key_ssh_key - instance_server_public_key_ssh_key
- instance_server_private_key_ssh_key - instance_server_private_key_ssh_key
- instance_ip_nginx-host - instance_ip_vm1
... ...
...@@ -91,14 +91,6 @@ resource "openstack_networking_router_interface_v2" "net1_router_interface" { ...@@ -91,14 +91,6 @@ resource "openstack_networking_router_interface_v2" "net1_router_interface" {
# Create ssh keys
resource "openstack_compute_keypair_v2" "ssh_key" {
name = "user1"
# public_key = "user1"
}
# CREATING SECURITY_GROUP # CREATING SECURITY_GROUP
resource "openstack_compute_secgroup_v2" "icmp" { resource "openstack_compute_secgroup_v2" "icmp" {
...@@ -146,3 +138,11 @@ resource "openstack_compute_secgroup_v2" "ssh" { ...@@ -146,3 +138,11 @@ resource "openstack_compute_secgroup_v2" "ssh" {
} }
# Create ssh keys
resource "openstack_compute_keypair_v2" "ssh_key" {
name = "user1"
# public_key = "user1"
}
...@@ -8,7 +8,7 @@ output "instance_server_private_key_ssh_key" { ...@@ -8,7 +8,7 @@ output "instance_server_private_key_ssh_key" {
value = openstack_compute_keypair_v2.ssh_key.private_key value = openstack_compute_keypair_v2.ssh_key.private_key
} }
output "instance_ip_nginx-host" { output "instance_ip_vm1" {
value = openstack_compute_floatingip_associate_v2.vm1_floating_ip_association.floating_ip value = openstack_compute_floatingip_associate_v2.vm1_floating_ip_association.floating_ip
} }
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#} #}
--- ---
input: input:
- instance_ip_{{ node.vm_name }} - instance_ip_{{ node.infra_element_name }}
- instance_server_private_key_{{ node.credentials }} - instance_server_private_key_{{ node.credentials }}
output: [] output: []
engine: ansible engine: ansible
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#} #}
[{{ "servers_for_" ~ name }}] [{{ "servers_for_" ~ name }}]
{% raw %}{{ instance_ip_{% endraw %}{{ node.vm_name }} {% raw %}}}{% endraw %} {% raw %}{{ instance_ip_{% endraw %}{{ node.infra_element_name }} {% raw %}}}{% endraw %}
[{{ "servers_for_" ~ name }}:vars] [{{ "servers_for_" ~ name }}:vars]
ansible_connection=ssh ansible_connection=ssh
......
...@@ -25,6 +25,6 @@ output: ...@@ -25,6 +25,6 @@ output:
{% for vm in vms %} {% for vm in vms %}
- instance_server_public_key_{{ vm.credentials }} - instance_server_public_key_{{ vm.credentials }}
- instance_server_private_key_{{ vm.credentials }} - instance_server_private_key_{{ vm.credentials }}
- instance_ip_{{ vm.vm_name }} - instance_ip_{{ vm.infra_element_name }}
{% endfor %} {% endfor %}
... ...
...@@ -22,6 +22,6 @@ output "instance_server_private_key_{{ credentials }}" { ...@@ -22,6 +22,6 @@ output "instance_server_private_key_{{ credentials }}" {
value = openstack_compute_keypair_v2.{{ credentials }}.private_key value = openstack_compute_keypair_v2.{{ credentials }}.private_key
} }
output "instance_ip_{{ vm_name }}" { output "instance_ip_{{ infra_element_name }}" {
value = openstack_compute_floatingip_associate_v2.{{ infra_element_name ~ "_floating_ip_association" }}.floating_ip value = openstack_compute_floatingip_associate_v2.{{ infra_element_name ~ "_floating_ip_association" }}.floating_ip
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment