Infra: Ansible E810 ddp/driver
[csit.git] / fdio.infra.terraform / 3n_aws_c5n / main.tf
1 module "deploy" {
2   source                    = "./deploy"
3
4   # Parameters starting with var. can be set using "TF_VAR_*" environment variables
5   # or -var parameter when running "terraform apply", for default values see ./variables.tf
6   testbed_name              = var.testbed_name
7   topology_name             = "3n_aws_c5n"
8   environment_name          = "CSIT-AWS"
9   resources_name_prefix     = "CSIT_3n_aws_c5n"
10
11   # AWS general
12   region                    = var.region
13   avail_zone                = var.avail_zone
14   instance_type             = var.instance_type
15   ami_image                 = var.ami_image
16
17   # AWS Network
18   vpc_cidr_mgmt             = "192.168.0.0/24"
19   vpc_cidr_b                = "192.168.10.0/24"
20   vpc_cidr_c                = "200.0.0.0/24"
21   vpc_cidr_d                = "192.168.20.0/24"
22
23   tg_mgmt_ip                = "192.168.0.10"
24   dut1_mgmt_ip              = "192.168.0.11"
25   dut2_mgmt_ip              = "192.168.0.12"
26
27   tg_if1_ip                 = "192.168.10.254"
28   tg_if2_ip                 = "192.168.20.254"
29   dut1_if1_ip               = "192.168.10.11"
30   dut1_if2_ip               = "200.0.0.101"
31   dut2_if1_ip               = "200.0.0.102"
32   dut2_if2_ip               = "192.168.20.11"
33
34   trex_dummy_cidr_port_0    = "10.0.0.0/24"
35   trex_dummy_cidr_port_1    = "20.0.0.0/24"
36
37   # Ansible
38   ansible_python_executable = "/usr/bin/python3"
39   ansible_file_path         = "../../fdio.infra.ansible/site.yaml"
40   ansible_topology_path     = "../../fdio.infra.ansible/cloud_topology.yaml"
41   ansible_provision_pwd     = "Csit1234"
42
43   # First run
44   # TODO: Remove the testuser creation when added to user_add ansible role
45   first_run_commands        = [
46     "sudo sed -i 's/^PasswordAuthentication/#PasswordAuthentication/' /etc/ssh/sshd_config",
47     "sudo systemctl restart sshd",
48     "sudo useradd --create-home -s /bin/bash provisionuser",
49     "echo 'provisionuser:Csit1234' | sudo chpasswd",
50     "echo 'provisionuser ALL = (ALL) NOPASSWD: ALL' | sudo tee -a /etc/sudoers",
51     "sudo useradd --create-home -s /bin/bash testuser",
52     "echo 'testuser:Csit1234' | sudo chpasswd",
53     "echo 'testuser ALL = (ALL) NOPASSWD: ALL' | sudo tee -a /etc/sudoers"
54   ]
55 }