Update Doc and Variables
This commit is contained in:
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
25
README.md
Normal file → Executable file
25
README.md
Normal file → Executable file
@@ -76,33 +76,10 @@ Before you begin, ensure you have the following prerequisites installed and conf
|
||||
|
||||
The Terraform configuration will automatically trigger the Ansible playbook install_containerlab.yml after the EC2 instance is up. This playbook configures the instance with the necessary packages and settings, installs ContainerLab, and optionally clones the specified GitHub repository.
|
||||
|
||||
## Network Images Folder and Naming Convention
|
||||
|
||||
### Network Images Folder
|
||||
## Network Images Folder
|
||||
|
||||
The `network_images` folder is intended for Docker images that will be used by ContainerLab. These images should be pre-downloaded and placed in this folder before running the Ansible playbook. During the setup process, the images will be copied to the remote `/tmp` directory of the ContainerLab host and then imported into Docker.
|
||||
|
||||
### Naming Convention for Images
|
||||
|
||||
It's important to follow a specific naming convention for the images to ensure they are correctly imported into Docker. The naming convention is as follows:
|
||||
|
||||
`system_name_without_digit-*-tag.tar.xz`
|
||||
|
||||
- `system_name_without_digit`: This part of the filename should include the system name without any digits and need to be written in lower case. The system name will be converted to lowercase during the import process.
|
||||
- `*`: This is a wildcard segment that can include any characters but should not contain the version or tag information.
|
||||
- `tag`: This part should specify the version or tag of the image. The tag can include both lowercase and uppercase characters and digits.
|
||||
|
||||
#### Example
|
||||
|
||||
Given an image file named `cEOS64-lab-4.30.3M.tar.xz`:
|
||||
|
||||
- `cEOS64` will be the system name. Digits will be removed `ceos`.
|
||||
- `4.30.3M` will be the tag, kept as-is.
|
||||
|
||||
The image will be imported into Docker with the tag `ceos:4.30.3M`.
|
||||
|
||||
Please ensure that all image files in the `network_images` folder conform to this naming convention for the automated process to function correctly.
|
||||
|
||||
## Accessing ContainerLab
|
||||
|
||||
- You can access the ContainerLab instance via SSH using the public IP or the DNS name provided by Route53.
|
||||
|
||||
6
ansible/install_containerlab.yml
Normal file → Executable file
6
ansible/install_containerlab.yml
Normal file → Executable file
@@ -93,9 +93,3 @@
|
||||
with_fileglob:
|
||||
- "../network_images/*"
|
||||
when: inventory_hostname in groups['all']
|
||||
|
||||
- name: Import network image to Docker with specific tag
|
||||
command:
|
||||
cmd: "docker import /tmp/{{ item | basename }} {{ (item | basename | regex_replace('^(\\D+)-.*-(.*)\\.tar\\.xz', '\\1')) | lower }}:{{ item | basename | regex_replace('^(\\D+)-.*-(.*)\\.tar\\.xz', '\\2') }}"
|
||||
loop: "{{ query('fileglob', '../network_images/*.tar.xz') }}"
|
||||
when: inventory_hostname in groups['all']
|
||||
25
network_images/network-images.md
Normal file → Executable file
25
network_images/network-images.md
Normal file → Executable file
@@ -1,29 +1,4 @@
|
||||
# Network images
|
||||
|
||||
## Network Images Folder
|
||||
|
||||
The `network_images` folder is intended for Docker images that will be used by ContainerLab. These images should be pre-downloaded and placed in this folder before running the Ansible playbook. During the setup process, the images will be copied to the remote `/tmp` directory of the ContainerLab host and then imported into Docker.
|
||||
|
||||
## Naming Convention for Images
|
||||
|
||||
It's important to follow a specific naming convention for the images to ensure they are correctly imported into Docker. The naming convention is as follows:
|
||||
|
||||
`system_name_without_digit-*-tag.tar.xz`
|
||||
|
||||
- `system_name_without_digit`: This part of the filename should include the system name without any digits and need to be written in lower case. The system name will be converted to lowercase during the import process.
|
||||
- `*`: This is a wildcard segment that can include any characters but should not contain the version or tag information.
|
||||
- `tag`: This part should specify the version or tag of the image. The tag can include both lowercase and uppercase characters and digits.
|
||||
|
||||
### Example
|
||||
|
||||
Given an image file named `cEOS64-lab-4.30.3M.tar.xz`:
|
||||
|
||||
- `cEOS64` will be the system name. Digits will be removed `ceos`.
|
||||
- `4.30.3M` will be the tag, kept as-is.
|
||||
|
||||
The image will be imported into Docker with the tag `ceos:4.30.3M`.
|
||||
|
||||
Please ensure that all image files in the `network_images` folder conform to this naming convention for the automated process to function correctly.
|
||||
|
||||
Arista cEOS image can be downlaoded at : arista.com
|
||||
`ceos-lab-4.30.3M.tar.xz`
|
||||
|
||||
2
terraform/ec2.tf
Normal file → Executable file
2
terraform/ec2.tf
Normal file → Executable file
@@ -30,7 +30,7 @@ resource "aws_security_group" "netlab_sg" {
|
||||
|
||||
resource "aws_instance" "containerlab_host" {
|
||||
ami = var.AWS_AMI[var.AWS_REGION]
|
||||
instance_type = "t2.xlarge"
|
||||
instance_type = var.INSTANCE_TYPE
|
||||
key_name = var.AWS_KEY_NAME
|
||||
vpc_security_group_ids = [aws_security_group.netlab_sg.id]
|
||||
|
||||
|
||||
0
terraform/outputs.tf
Normal file → Executable file
0
terraform/outputs.tf
Normal file → Executable file
0
terraform/route53-record.tf
Normal file → Executable file
0
terraform/route53-record.tf
Normal file → Executable file
3
terraform/terraform.tfvars.sample
Normal file → Executable file
3
terraform/terraform.tfvars.sample
Normal file → Executable file
@@ -1,2 +1,5 @@
|
||||
AWS_ACCESS_KEY = "YOURACCESSKEY"
|
||||
AWS_SECRET_KEY = "YOURACCESSTOKEN"
|
||||
AWS_KEY_NAME = "AWS_key_name"
|
||||
AWS_KEY_LOCATION = "~/.ssh/aws_key.pem"
|
||||
AWS_R53_ZONE_ID = "R53_ZONE_ID"
|
||||
2
terraform/variables.tf
Normal file → Executable file
2
terraform/variables.tf
Normal file → Executable file
@@ -26,7 +26,7 @@ variable "AWS_AMI" {
|
||||
}
|
||||
}
|
||||
|
||||
variable "instance_type" {
|
||||
variable "INSTANCE_TYPE" {
|
||||
type = string
|
||||
default = "t2.xlarge"
|
||||
}
|
||||
Reference in New Issue
Block a user