Signed-off-by: Maros Mullner <maros.mullner@pantheon.tech>
Change-Id: I7eefdb5db39a0f5328c7f1a0a0a5d57c762cc21c
# Create resource group and resources
resource "azurerm_resource_group" "CSIT" {
# Create resource group and resources
resource "azurerm_resource_group" "CSIT" {
- name = "CSIT_pm"
- location = "North Europe"
+ name = "CSIT"
+ location = "East US"
}
resource "azurerm_virtual_network" "CSIT" {
}
resource "azurerm_virtual_network" "CSIT" {
admin_username = "ubuntu"
}
os_profile_linux_config {
admin_username = "ubuntu"
}
os_profile_linux_config {
- disable_password_authentication = false
+ disable_password_authentication = true
ssh_keys {
path = "/home/ubuntu/.ssh/authorized_keys"
key_data = file("~/.ssh/id_rsa.pub")
ssh_keys {
path = "/home/ubuntu/.ssh/authorized_keys"
key_data = file("~/.ssh/id_rsa.pub")
admin_username = "ubuntu"
}
os_profile_linux_config {
admin_username = "ubuntu"
}
os_profile_linux_config {
- disable_password_authentication = false
+ disable_password_authentication = true
ssh_keys {
path = "/home/ubuntu/.ssh/authorized_keys"
key_data = file("~/.ssh/id_rsa.pub")
ssh_keys {
path = "/home/ubuntu/.ssh/authorized_keys"
key_data = file("~/.ssh/id_rsa.pub")
admin_username = "ubuntu"
}
os_profile_linux_config {
admin_username = "ubuntu"
}
os_profile_linux_config {
- disable_password_authentication = false
+ disable_password_authentication = true
ssh_keys {
path = "/home/ubuntu/.ssh/authorized_keys"
key_data = file("~/.ssh/id_rsa.pub")
ssh_keys {
path = "/home/ubuntu/.ssh/authorized_keys"
key_data = file("~/.ssh/id_rsa.pub")
-eesource "null_resource" "deploy_topology" {
+resource "null_resource" "deploy_topology" {
depends_on = [ azurerm_virtual_machine.tg,
azurerm_network_interface.tg_if1,
azurerm_network_interface.tg_if2,
azurerm_virtual_machine.dut1,
azurerm_network_interface.dut1_if1,
depends_on = [ azurerm_virtual_machine.tg,
azurerm_network_interface.tg_if1,
azurerm_network_interface.tg_if2,
azurerm_virtual_machine.dut1,
azurerm_network_interface.dut1_if1,
- azurerm_network_interface.dut1_if2
+ azurerm_network_interface.dut1_if2,
azurerm_virtual_machine.dut2,
azurerm_network_interface.dut2_if1,
azurerm_network_interface.dut2_if2 ]
azurerm_virtual_machine.dut2,
azurerm_network_interface.dut2_if1,
azurerm_network_interface.dut2_if2 ]
extra_vars = {
ansible_python_interpreter = "/usr/bin/python3"
cloud_topology = "azure"
extra_vars = {
ansible_python_interpreter = "/usr/bin/python3"
cloud_topology = "azure"
- tg_if1_mac = azurerm_network_interface.tg_if1.mac_address
- tg_if2_mac = azurerm_network_interface.tg_if2.mac_address
- dut1_if1_mac = azurerm_network_interface.dut1_if1.mac_address
- dut1_if2_mac = azurerm_network_interface.dut1_if2.mac_address
- dut2_if1_mac = azurerm_network_interface.dut2_if1.mac_address
- dut2_if2_mac = azurerm_network_interface.dut2_if2.mac_address
+ tg_if1_mac = data.azurerm_network_interface.tg_if1.mac_address
+ tg_if2_mac = data.azurerm_network_interface.tg_if2.mac_address
+ dut1_if1_mac = data.azurerm_network_interface.dut1_if1.mac_address
+ dut1_if2_mac = data.azurerm_network_interface.dut1_if2.mac_address
+ dut2_if1_mac = data.azurerm_network_interface.dut2_if1.mac_address
+ dut2_if2_mac = data.azurerm_network_interface.dut2_if2.mac_address
tg_public_ip = data.azurerm_public_ip.tg_public_ip.ip_address
dut1_public_ip = data.azurerm_public_ip.dut1_public_ip.ip_address
dut2_public_ip = data.azurerm_public_ip.dut2_public_ip.ip_address
tg_public_ip = data.azurerm_public_ip.tg_public_ip.ip_address
dut1_public_ip = data.azurerm_public_ip.dut1_public_ip.ip_address
dut2_public_ip = data.azurerm_public_ip.dut2_public_ip.ip_address
+data "azurerm_network_interface" "dut1_if2" {
+ name = "dut1_if2"
+ resource_group_name = azurerm_resource_group.CSIT.name
+ depends_on = [ azurerm_virtual_machine.dut1 ]
+}
+
resource "azurerm_network_interface" "dut2_if1" {
name = "dut2_if1"
location = azurerm_resource_group.CSIT.location
resource "azurerm_network_interface" "dut2_if1" {
name = "dut2_if1"
location = azurerm_resource_group.CSIT.location
+data "azurerm_network_interface" "dut2_if1" {
+ name = "dut2_if1"
+ resource_group_name = azurerm_resource_group.CSIT.name
+ depends_on = [ azurerm_virtual_machine.dut2 ]
+}
+
resource "azurerm_network_interface" "dut1_if1" {
name = "dut1_if1"
location = azurerm_resource_group.CSIT.location
resource "azurerm_network_interface" "dut1_if1" {
name = "dut1_if1"
location = azurerm_resource_group.CSIT.location
+data "azurerm_network_interface" "dut1_if1" {
+ name = "dut1_if1"
+ resource_group_name = azurerm_resource_group.CSIT.name
+ depends_on = [ azurerm_virtual_machine.dut1 ]
+}
+
resource "azurerm_network_interface" "dut2_if2" {
name = "dut2_if2"
location = azurerm_resource_group.CSIT.location
resource "azurerm_network_interface" "dut2_if2" {
name = "dut2_if2"
location = azurerm_resource_group.CSIT.location
+data "azurerm_network_interface" "dut2_if2" {
+ name = "dut2_if2"
+ resource_group_name = azurerm_resource_group.CSIT.name
+ depends_on = [ azurerm_virtual_machine.dut2 ]
+}
+
resource "azurerm_network_interface" "tg_if1" {
name = "tg_if1"
location = azurerm_resource_group.CSIT.location
resource "azurerm_network_interface" "tg_if1" {
name = "tg_if1"
location = azurerm_resource_group.CSIT.location
+data "azurerm_network_interface" "tg_if1" {
+ name = "tg_if1"
+ resource_group_name = azurerm_resource_group.CSIT.name
+ depends_on = [ azurerm_virtual_machine.tg ]
+}
+
resource "azurerm_network_interface" "tg_if2" {
name = "tg_if2"
location = azurerm_resource_group.CSIT.location
resource "azurerm_network_interface" "tg_if2" {
name = "tg_if2"
location = azurerm_resource_group.CSIT.location
+data "azurerm_network_interface" "tg_if2" {
+ name = "tg_if2"
+ resource_group_name = azurerm_resource_group.CSIT.name
+ depends_on = [ azurerm_virtual_machine.tg ]
+}
interfaces:
port1:
# tg_instance/p1 - 40GE port1 on Mellanox NIC.
interfaces:
port1:
# tg_instance/p1 - 40GE port1 on Mellanox NIC.
- mac_address: {{ tg_if1_mac }}
+ mac_address: "{{ tg_if1_mac | lower | replace('-',':') }}"
pci_address: "0002:00:02.0"
link: link1
model: azure-mlx-40g
port2:
# tg_instance/p2 - 40GE port2 on Mellanox NIC.
pci_address: "0002:00:02.0"
link: link1
model: azure-mlx-40g
port2:
# tg_instance/p2 - 40GE port2 on Mellanox NIC.
- mac_address: {{ tg_if2_mac }}
+ mac_address: "{{ tg_if2_mac | lower | replace('-',':') }}"
pci_address: "0003:00:02.0"
link: link2
model: azure-mlx-40g
pci_address: "0003:00:02.0"
link: link2
model: azure-mlx-40g
interfaces:
port1:
# dut1_instance/p1 - 40GE port1 on Mellanox NIC.
interfaces:
port1:
# dut1_instance/p1 - 40GE port1 on Mellanox NIC.
- mac_address: {{ dut1_if1_mac }}
+ mac_address: "{{ dut1_if1_mac | lower | replace('-',':') }}"
pci_address: "0002:00:02.0"
link: link1
model: azure-mlx-40g
port2:
# dut2_instance/p1 - 40GE port2 on Mellanox NIC.
pci_address: "0002:00:02.0"
link: link1
model: azure-mlx-40g
port2:
# dut2_instance/p1 - 40GE port2 on Mellanox NIC.
- mac_address: {{ dut1_if2_mac }}
- pci_address: "0002:00:03.0"
+ mac_address: "{{ dut1_if2_mac | lower | replace('-',':') }}"
+ pci_address: "0003:00:02.0"
link: link21
model: azure-mlx-40g
DUT2:
link: link21
model: azure-mlx-40g
DUT2:
interfaces:
port1:
# dut1_instance/p1 - 40GE port1 on Mellanox NIC.
interfaces:
port1:
# dut1_instance/p1 - 40GE port1 on Mellanox NIC.
- mac_address: {{ dut2_if1_mac }}
+ mac_address: "{{ dut2_if1_mac | lower | replace('-',':') }}"
pci_address: "0002:00:02.0"
link: link21
model: azure-mlx-40g
port2:
# dut2_instance/p1 - 40GE port2 on Mellanox NIC.
pci_address: "0002:00:02.0"
link: link21
model: azure-mlx-40g
port2:
# dut2_instance/p1 - 40GE port2 on Mellanox NIC.
- mac_address: {{ dut2_if2_mac }}
+ mac_address: "{{ dut2_if2_mac | lower | replace('-',':') }}"
pci_address: "0003:00:02.0"
link: link2
model: azure-mlx-40g
pci_address: "0003:00:02.0"
link: link2
model: azure-mlx-40g