Skip to content
Snippets Groups Projects
Commit 791ee4ca authored by Manuel Kieweg's avatar Manuel Kieweg
Browse files

split main.tf in multiple files

parent 73368f35
No related branches found
No related tags found
2 merge requests!110Integration test,!90Develop
resource "docker_container" "gosdn" {
depends_on = [
docker_container.ceos]
name = "contoller"
image = docker_image.gosdn.name
restart = "always"
ports {
internal = 55055
external = 5555
}
networks_advanced {
name = docker_network.danet.name
ipv4_address = "172.100.100.10"
}
env = [
"GOSDN_DEBUG=",
"GOSDN_TEST="]
}
# create arista container
# namespace is french cheeses
resource "docker_container" "ceos" {
name = "abondance"
image = docker_image.ceos.name
restart = "always"
networks_advanced {
name = docker_network.danet.name
ipv4_address = "172.100.100.20"
}
command = ["/sbin/init",
"systemd.setenv=INTFTYPE=eth",
"systemd.setenv=ETBA=4",
"systemd.setenv=SKIP_ZEROTOUCH_BARRIER_IN_SYSDBINIT=1",
"systemd.setenv=CEOS=1",
"systemd.setenv=EOS_PLATFORM=ceoslab",
"systemd.setenv=container=docker",
"MGMT_INTF=eth0"]
env = ["INTFTYPE=eth",
"ETBA=4",
"SKIP_ZEROTOUCH_BARRIER_IN_SYSDBINIT=1",
"CEOS=1",
"EOS_PLATFORM=ceoslab",
"container=docker",
"MGMT_INTF=eth0"]
privileged = true
volumes {
host_path = "/usr/local/etc/terraform/arista"
container_path = "/mnt/flash"
}
}
resource "docker_image" "gosdn" {
name = "registry.code.fbi.h-da.de/cocsn/gosdn:develop"
}
resource "docker_image" "ceos" {
name = "registry.code.fbi.h-da.de/cocsn/gosdn/ceos:latest"
}
\ No newline at end of file
...@@ -7,117 +7,3 @@ terraform { ...@@ -7,117 +7,3 @@ terraform {
} }
} }
} }
variable "integration_registry" {
type = string
}
variable "integration_username" {
type = string
}
variable "integration_access_token" {
type = string
}
variable "tls_key" {
type = string
}
variable "tls_cert" {
type = string
}
variable "tls_ca_cert" {
type = string
}
provider "docker" {
host = "tcp://141.100.70.171:2376"
ca_material = var.tls_ca_cert
cert_material = var.tls_cert
key_material = var.tls_key
registry_auth {
address = var.integration_registry
username = var.integration_username
password = var.integration_access_token
}
}
resource "docker_image" "gosdn" {
name = "registry.code.fbi.h-da.de/cocsn/gosdn:develop"
}
resource "docker_image" "ceos" {
name = "registry.code.fbi.h-da.de/cocsn/gosdn/ceos:latest"
}
# Create a new docker network
resource "docker_network" "danet" {
name = "danet"
ipam_config {
subnet = "172.100.100.0/24"
}
}
# create controller container
resource "docker_container" "gosdn" {
depends_on = [
docker_container.ceos]
name = "contoller"
image = docker_image.gosdn.name
restart = "always"
ports {
internal = 55055
external = 5555
}
networks_advanced {
name = docker_network.danet.name
ipv4_address = "172.100.100.10"
}
env = [
"GOSDN_DEBUG=",
"GOSDN_TEST="]
}
# create arista container
# namespace is french cheeses
resource "docker_container" "ceos" {
name = "abondance"
image = docker_image.ceos.name
restart = "always"
networks_advanced {
name = docker_network.danet.name
ipv4_address = "172.100.100.20"
}
command = ["/sbin/init",
"systemd.setenv=INTFTYPE=eth",
"systemd.setenv=ETBA=4",
"systemd.setenv=SKIP_ZEROTOUCH_BARRIER_IN_SYSDBINIT=1",
"systemd.setenv=CEOS=1",
"systemd.setenv=EOS_PLATFORM=ceoslab",
"systemd.setenv=container=docker",
"MGMT_INTF=eth0"]
env = ["INTFTYPE=eth",
"ETBA=4",
"SKIP_ZEROTOUCH_BARRIER_IN_SYSDBINIT=1",
"CEOS=1",
"EOS_PLATFORM=ceoslab",
"container=docker",
"MGMT_INTF=eth0"]
privileged = true
volumes {
host_path = "/usr/local/etc/terraform/arista"
container_path = "/mnt/flash"
}
}
resource "docker_network" "danet" {
name = "danet"
ipam_config {
subnet = "172.100.100.0/24"
}
}
\ No newline at end of file
provider "docker" {
host = "tcp://141.100.70.171:2376"
ca_material = var.tls_ca_cert
cert_material = var.tls_cert
key_material = var.tls_key
registry_auth {
address = var.integration_registry
username = var.integration_username
password = var.integration_access_token
}
}
\ No newline at end of file
variable "integration_registry" {
type = string
}
variable "integration_username" {
type = string
}
variable "integration_access_token" {
type = string
}
variable "tls_key" {
type = string
}
variable "tls_cert" {
type = string
}
variable "tls_ca_cert" {
type = string
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment