По мотивам https://github.com/sandipb/zap-examples/tree/master/src/customlogger
The script takes the host addresses as arguments, and opens the split panel and connects to each host.
This file contains hidden or 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
################################### | |
# Create port | |
################################### | |
resource "openstack_networking_port_v2" "port_2" { | |
name = "node-eth0" | |
network_id = openstack_networking_network_v2.network_1.id | |
fixed_ip { | |
subnet_id = openstack_networking_subnet_v2.subnet_1.id |
This file contains hidden or 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
resource "openstack_networking_port_v2" "port" { | |
count = "${var.server_count}" | |
name = "node-${count.index}-eth0" | |
... | |
} | |
resource "openstack_blockstorage_volume_v3" "volume" { | |
count = "${var.server_count}" | |
name = "volume-for-node-${count.index}" | |
... | |
} |
variable "server_count" {
default = 1
}
resource "openstack_networking_port_v2" "port_1" {
name = "node-${count.index}-eth0"
count = var.server_count
This file contains hidden or 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
################################### | |
# Create port | |
################################### | |
resource "openstack_networking_port_v2" "port_1" { | |
name = "node-eth0" | |
network_id = var.network_id | |
fixed_ip { | |
subnet_id = var.subnet_id |
This file contains hidden or 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
resource "openstack_compute_flavor_v2" "flavor-node" { | |
name = "node.${var.project_id}-${random_string.random_name_1.result}" | |
ram = var.ram | |
vcpus = "1" | |
disk = "0" | |
is_public = "false" | |
} | |
This file contains hidden or 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
bash-5.0# openstack image list --public | |
+--------------------------------------+--------------------------------------------+--------+ | |
| ID | Name | Status | | |
+--------------------------------------+--------------------------------------------+--------+ | |
| 4bf30993-828a-4468-9c8f-5a97ebe09f7d | CentOS 7 64-bit | active | | |
| dede8b0e-9297-4a65-8f5a-32e82a4e0b27 | CentOS 7 Minimal 64-bit | active | | |
| ed14e2ad-3fad-40ea-8979-ea4ae8d805be | CentOS 8 64-bit | active | | |
| 88c8d109-164e-4d6f-a1a4-64fafefeb09f | CoreOS | active | | |
| 8be6ff81-21e1-464c-a343-c6e2ab4226c9 | Debian 10 (Buster) 64-bit | active | | |
| 2d548634-9a42-4497-b849-48bfa32e66db | Debian 9 (Stretch) 64-bit | active | |
This file contains hidden or 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
################################### | |
# Configure the OpenStack Provider | |
################################### | |
provider "openstack" { | |
domain_name = "${var.domain_name}" | |
tenant_id = "${var.project_id}" | |
user_name = "${var.user_name}" | |
password = "${var.user_password}" | |
auth_url = "https://api.selvpc.ru/identity/v3" | |
region = "${var.region}" |
NewerOlder