Git Product home page Git Product logo

vyos-vm-images's Introduction

vyos-vm-images

Ansible playbooks to build VyOS VM images.

Requirements

You need a machine with at least 20 GB free space with Debian 10 (bare-metal, virtual, Docker container with --privileged flag). Also, you need to install ansible and python3 packages:

sudo apt update
sudo apt install -y ansible python3

If you want to build an OVA image, you also need ovftool from VMware. It should be downloaded from the VMware site. Also, you need a private key to sign an OVA file. It can be generated with the next command:

openssl req -x509 -nodes -sha256 -days 365 -newkey rsa:1024 -keyout myself.pem -out myself.pem

All other requirements will be installed by ansible-playbook.

Prepare

You need to copy the ISO image with VyOS to /tmp/vyos.iso before running ansible-playbook. Resulting images also will be located inside /tmp/ directory.

Docker

The Dockerfile has all required dependencies.

  1. Download the Dockerfile
wget https://raw.githubusercontent.com/vyos/vyos-vm-images/current/Dockerfile
  1. Build local image with name vyos-vm-images (only if you do not have it)
docker build --tag vyos-vm-images:latest -f ./Dockerfile .
  1. Start and connect to the container:
docker run --rm -it --privileged -v $(pwd):/vm-build -v $(pwd)/images:/images -w /vm-build vyos-vm-images:latest bash
  1. Clone repo
git clone https://github.com/vyos/vyos-vm-images.git && cd vyos-vm-images

Supported Platforms

  • QEMU

    ansible-playbook qemu.yml
    
  • VMware Cloud-init

    ansible-playbook vmware.yml -e vyos_vmware_private_key_path=path_to_private_key
    
  • VMware simple ova

    ansible-playbook vmware.yml -e vyos_vmware_private_key_path=path_to_private_key -e cloud_init=false -e ovf_template=simple
    
  • Microsoft Hyper-V

    ansible-playbook hyperv.yml
    
  • Vagrant libvirt

    ansible-playbook vagrant-libvirt.yml
    

Additional (optional) parameters

  • Path to local ISO image (default: /tmp/vyos.iso):

    -e iso_local=path
    

    Example:

    -e iso_local=/tmp/vyos/custom_image.iso
    
  • Disk size (default: 10GB):

    -e disk_size=size
    

    Example for 2 GB:

    -e disk_size=2
    
  • Enable Cloud-init (default: according to platform):

    -e cloud_init=true
    
  • Configure custom Cloud-init datasources (default: according to platform):

    -e cloud_init_ds=datasources
    

    Example:

    -e cloud_init_ds=NoCloud,ConfigDrive,None
    
  • Install guest agent. It can be qemu, vmware (default: none):

    -e guest_agent=agent
    

    Example:

    -e guest_agent=qemu
    
  • Disable configuration stage modules in Cloud-init. Mostly useful when you are building for non-cloud environments, where Cloud-init meta-data is not available (default: false):

    -e cloud_init_disable_config=true
    
  • Create an archive with files required to PXE boot (default: false):

    -e pxe=true
    
  • Keep default vyos user with password vyos in configuration when building an image with Cloud-init (default: false):

    -e keep_user=true
    
  • Select a type of partition table for a disk image. Supported: mbr, gpt, hybrid (default: hybrid):

    -e parttable_type=hybrid
    
  • Select default console for boot. Supported: kvm, serial (default: depending on platform):

    -e grub_console=serial
    
  • Install custom packages. Can be a list in the files/custom_packages_list.txt file separated by spaces, or deb files inside the files/custom_debs/ directory:

    -e custom_packages=true
    
  • Copy custom files. All files from inside the files/custom_files/ directory will be copied to the target filesystem recursively:

    -e custom_files=true
    
  • Enable DHCP on eth0 (default: false):

    -e enable_dhcp=true
    
  • Enable SSH (default: false):

    -e enable_ssh=true
    
  • Remove login from configuration. Unlike keep_user, this option will completely remove system login from configuration.

    -e without_login=true
    

vyos-vm-images's People

Contributors

andriiandrieiev avatar c-po avatar dhekimian avatar dmbaturin avatar hakwerk avatar higebu avatar kroy-the-rabbit avatar lorenzobiosa avatar nicolas-fort avatar olivierlemasle avatar qxmips avatar sever-sever avatar sfinke0 avatar unicronnl avatar wate avatar zdc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.