This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "vsphere" { | |
user = "${var.vsphere_user}" | |
password = "${var.vsphere_password}" | |
vsphere_server = "${var.vsphere_server}" | |
version = "1.15.0" | |
# If you have a self-signed cert | |
allow_unverified_ssl = true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "vsphere" { | |
user = "${var.vsphere_user}" | |
password = "${var.vsphere_password}" | |
vsphere_server = "${var.vsphere_server}" | |
# If you have a self-signed cert | |
allow_unverified_ssl = true | |
} | |
data "vsphere_datacenter" "dc" { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vsphere_user = "vsphere_user" | |
vsphere_password = "mysupersecretpassword" | |
vsphere_server = "vsphere_ip_or_host_address" | |
vsphere_datacenter = "localhost.localdomain" | |
vsphere_datastore = "datastore1" | |
vsphere_resource_pool = "kubernetes" | |
vsphere_network = "VM Network" | |
vsphere_virtual_machine_template = "k8s-template" | |
vsphere_virtual_machine_name = "terraform-vsphere-clone-test" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "vsphere_user" {} | |
variable "vsphere_password" {} | |
variable "vsphere_server" {} | |
variable "vsphere_datacenter" {} | |
variable "vsphere_datastore" {} | |
variable "vsphere_resource_pool" {} | |
variable "vsphere_network" {} | |
variable "vsphere_virtual_machine_template" {} | |
variable "vsphere_virtual_machine_name" {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data "vsphere_datacenter" "dc" { | |
name = "${var.vsphere_datacenter}" | |
} | |
data "vsphere_datastore" "datastore" { | |
name = "${var.vsphere_datastore}" | |
datacenter_id = data.vsphere_datacenter.dc.id | |
} | |
data "vsphere_resource_pool" "pool" { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "vsphere" { | |
user = var.vsphere_user | |
password = var.vsphere_password | |
vsphere_server = var.vsphere_server | |
# If you have a self-signed cert | |
allow_unverified_ssl = true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
traceroute = """ | |
r2#traceroute 90.0.0.9 source 33.0.0.2 | |
traceroute 90.0.0.9 source 33.0.0.2 | |
Type escape sequence to abort. | |
Tracing the route to 90.0.0.9 | |
VRF info: (vrf in name/id, vrf out name/id) | |
1 10.0.12.1 1 msec 0 msec 0 msec | |
2 15.0.0.5 0 msec 5 msec 4 msec | |
3 57.0.0.7 4 msec 1 msec 4 msec | |
4 79.0.0.9 4 msec * 1 msec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
''' | |
Задание 4.5 | |
Из строк command1 и command2 получить список VLANов, | |
которые есть и в команде command1 и в команде command2. | |
Результатом должен быть список: ['1', '3', '8'] | |
Ограничение: Все задания надо выполнять используя только пройденные темы. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------------------------------------------------------------- | |
NameError Traceback (most recent call last) | |
<ipython-input-2-44d4e36cfb4a> in <module> | |
18 command2 = command2.strip().split() | |
19 command2 = command2[-1].split(',') | |
---> 20 vlans = sorted(list(set(comand1 + command2))) | |
21 print(vlans) | |
22 | |
NameError: name 'comand1' is not defined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Задание 5.2 | |
Запросить у пользователя ввод IP-сети в формате: 10.1.1.0/24 | |
Затем вывести информацию о сети и маске в таком формате: | |
Network: | |
10 1 1 0 | |
00001010 00000001 00000001 00000000 |
NewerOlder