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

build vrnetlab image(s)

parent 726fe69a
No related branches found
No related tags found
No related merge requests found
...@@ -13,8 +13,9 @@ ...@@ -13,8 +13,9 @@
roles: roles:
- kvm - kvm
- containerlab - containerlab
- dev_images
- name: System Setup - name: System Setup
hosts: dev_environments hosts: dev_environments
roles: roles:
- dev_network - dev_networks
- name: update apt cache - name: Update apt cache
apt: ansible.builtin.apt:
update_cache: yes update_cache: true
- 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
...@@ -23,11 +23,3 @@ ...@@ -23,11 +23,3 @@
groups: docker groups: docker
append: true append: true
with_items: "{{ users }}" with_items: "{{ users }}"
- name: Create images
ansible.builtin.include_tasks: import_image.yml
loop: "{{ images }}"
loop_control:
loop_var: image
...@@ -11,6 +11,9 @@ images: ...@@ -11,6 +11,9 @@ images:
- filename: cEOS-lab-4.28.2.1F.tar - filename: cEOS-lab-4.28.2.1F.tar
image_name: ceos image_name: ceos
image_tag: 4.28.1.1F image_tag: 4.28.1.1F
- filename: ubuntu-20.04.tar
image_name: ubuntu
image_tag: 20.04
users: users:
- nat - nat
- name: Working directory
ansible.builtin.file:
path: ceosx2
state: directory
mode: '0755'
- name: Create topology file
ansible.builtin.template:
src: ceosx2.clab.yml.j2
mode: '0644'
dest: ceosx2/ceosx2.clab.yml
- name: Working directory
ansible.builtin.file:
path: vr-vmx
state: directory
mode: '0755'
- name: Create topology file
ansible.builtin.template:
src: vr-vmx.clab.yml.j2
mode: '0644'
dest: vr-vmx/vr-vmx.clab.yml
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 register or to comment