Skip to content
Snippets Groups Projects
Commit b10279c8 authored by Erik Reid's avatar Erik Reid
Browse files

finished moves

parent 03b37e77
No related branches found
No related tags found
No related merge requests found
s3:
access_key: AKIA6DQFYS5WRMJU4FW6
secret_key: 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
region: eu-west-3
bucket: geant-emulation-images
normal_images:
- filename: cEOS-lab-4.28.2.1F.tar
image_name: ceos
image_tag: 4.28.1.1F
vrnetlab_images:
- vm_image: vmx-bundle-18.2R1.9.tgz
integration: vmx
image_name: vrnetlab/vr-vmx
image_tag: 18.2R1.9
nat_user: nat
- name: Inspect a single image
community.docker.docker_image_info:
name: "{{ image.image_name }}:{{ image.image_tag }}"
register: image_exists
- name: Stop if image exists
ansible.builtin.meta: end_play
when: image_exists.images | length > 0
- name: Get VM image
amazon.aws.aws_s3:
aws_access_key: "{{ s3.access_key }}"
aws_secret_key: "{{ s3.secret_key }}"
region: "{{ s3.region }}"
bucket: "{{ s3.bucket }}"
object: "{{ image.vm_image }}"
dest: "$HOME/vrnetlab/{{ image.integration }}/{{ image.vm_image }}"
mode: get
- name: Build/install the docker image
community.general.make:
chdir: "$HOME/vrnetlab/{{ image.integration }}"
- name: Inspect a single image
community.docker.docker_image_info:
name: "{{ image.image_name }}:{{ image.image_tag }}"
register: image_exists
- name: Stop if image exists
ansible.builtin.meta: end_play
when: image_exists.images | length > 0
- name: Get VM images
amazon.aws.aws_s3:
aws_access_key: "{{ s3.access_key }}"
aws_secret_key: "{{ s3.secret_key }}"
region: "{{ s3.region }}"
bucket: "{{ s3.bucket }}"
object: "{{ image.filename }}"
dest: "/tmp/{{ image.filename }}"
mode: get
# - name: Add docker images
# community.docker.docker_image:
# docker_host: "unix:/run/docker.sock"
# name: "{{ item.image_name }}"
# tag: "{{ item.image_tag }}"
# load_path: "/tmp/{{ item.filename }}"
# source: load
# state: present
# loop:
# - filename: cEOS-lab-4.28.2.1F.tar
# image_name: ceos
# image_tag: 4.28.1.1F
- name: Add docker images
# community.docker.docker_image doesn't work in this case
ansible.builtin.shell:
cmd: "docker image import /tmp/{{ image.filename }} {{ image.image_name }}:{{ image.image_tag }}"
- name: Remove downloaded file
ansible.builtin.file:
path: "/tmp/{{ image.filename }}"
state: absent
- name: Install Packages
ansible.builtin.apt:
pkg:
- git
- make
- name: Clone vrnetlab
ansible.builtin.git:
repo: https://github.com/hellt/vrnetlab
version: v0.8.1
dest: $HOME/vrnetlab
- name: Build vrnetlab images
ansible.builtin.include_tasks: build_image.yml
loop: "{{ vrnetlab_images }}"
loop_control:
loop_var: image
- name: Import normal images
ansible.builtin.include_tasks: import_image.yml
loop: "{{ normal_images }}"
loop_control:
loop_var: image
configure
set interfaces ge-0/0/0 unit 0 family inet address 192.168.1.2/24
set interfaces ge-0/0/1 unit 1 family inet address 192.168.1.3/24
set interfaces ge-0/0/2 unit 2 family inet address 192.168.1.4/24
commit
\ No newline at end of file
configure
set interfaces ge-0/0/0 unit 0 family inet address 192.168.2.2/24
set interfaces ge-0/0/1 unit 1 family inet address 192.168.2.3/24
set interfaces ge-0/0/2 unit 2 family inet address 192.168.2.4/24
commit
\ No newline at end of file
name: vr-vmx
topology:
nodes:
vmx1:
kind: vr-vmx
image: vrnetlab/vr-vmx:18.2R1.9
startup-config: vmx1.cfg
vmx2:
kind: vr-vmx
image: vrnetlab/vr-vmx:18.2R1.9
startup-config: vmx2.cfg
links:
- endpoints: ["vmx1:eth1", "vmx2:eth1"]
- name: Copy lab01 project to remote
ansible.builtin.copy:
src: lab01
dest: $HOME
directory_mode: '0755'
mode: '0644'
name: ceosx2
topology:
nodes:
ceos1:
kind: ceos
image: ceos:4.28.1.1F
ceos2:
kind: ceos
image: ceos:4.28.1.1F
links:
- endpoints: ["ceos1:eth1", "ceos2:eth1"]
name: srlceos01
topology:
nodes:
srl:
kind: srl
image: ghcr.io/nokia/srlinux
ceos:
kind: srl
image: ghcr.io/nokia/srlinux
links:
- endpoints: ["srl:e1-1", "ceos:e1-1"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment