├── files
├── custom_debs
│ └── .gitkeep
├── custom_files
│ └── .gitkeep
├── custom_packages_list.txt
└── resolv.conf
├── ansible.cfg
├── roles
├── release
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── vmware
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ ├── vars
│ │ └── main.yml
│ ├── tasks
│ │ └── main.yml
│ └── templates
│ │ └── vyos_vmware_image.ovf.j2
├── create-disk
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── create-iso
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── download-iso
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── get-version
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── hyperv-vhd
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── install-grub
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ ├── templates
│ │ └── boot
│ │ │ └── grub
│ │ │ └── grub.cfg.j2
│ └── tasks
│ │ └── main.yml
├── mount-iso
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── qemu-qcow2
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── qemu-raw
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── unmount-all
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── unmount-pre
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── compress-image
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── copy-custom-files
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── copy-iso-content
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── extract-image
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── install-config
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ ├── defaults
│ │ └── main.yml
│ ├── tasks
│ │ └── main.yml
│ └── templates
│ │ └── config.boot.j2
├── install-grub-v2
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ ├── files
│ │ └── vyos_unattended_installer.py
│ └── tasks
│ │ └── main.yml
├── install-image
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── install-packages
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── mount-root-fs
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── install-cloud-init
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ ├── templates
│ │ └── 90_dpkg.cfg.j2
│ ├── files
│ │ └── 90_disable_config_stage.cfg
│ └── tasks
│ │ └── main.yml
├── install-grub-wrapper
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── install-guest-agent
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── setup-root-partition
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── vagrant-libvirt-box
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ ├── files
│ │ ├── metadata.json
│ │ └── Vagrantfile
│ ├── vars
│ │ └── main.yml
│ └── tasks
│ │ └── main.yml
├── install-cloud-init-wrapper
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── install-custom-packages
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── install-guest-agent-wrapper
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── install-persistence-conf
│ ├── files
│ │ └── persistence.conf
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── install-custom-packages-wrapper
│ ├── tests
│ │ ├── inventory
│ │ └── test.yml
│ └── tasks
│ │ └── main.yml
├── fstrim
│ └── tasks
│ │ └── main.yml
├── meta
│ └── main.yml
├── cleanup-ending
│ └── tasks
│ │ └── main.yml
├── install-open-vmdk
│ └── tasks
│ │ └── main.yml
├── release-vagrant-box
│ └── tasks
│ │ └── main.yml
└── create-pxe-archive
│ └── tasks
│ └── main.yml
├── .gitignore
├── hosts
├── vagrant-libvirt.yml
├── group_vars
└── all.yml
├── hyperv.yml
├── Dockerfile
├── templates
└── debian.list.j2
├── raw.yml
├── vmware.yml
├── qemu.yml
├── README.md
└── CONTRIBUTING.md
/files/custom_debs/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/files/custom_files/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/files/custom_packages_list.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/files/resolv.conf:
--------------------------------------------------------------------------------
1 | nameserver 1.1.1.1
--------------------------------------------------------------------------------
/ansible.cfg:
--------------------------------------------------------------------------------
1 | [defaults]
2 | inventory = hosts
3 |
--------------------------------------------------------------------------------
/roles/release/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/vmware/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/create-disk/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/create-iso/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/download-iso/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/get-version/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/hyperv-vhd/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/install-grub/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/mount-iso/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/qemu-qcow2/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/qemu-raw/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/unmount-all/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/unmount-pre/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/compress-image/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/copy-custom-files/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/copy-iso-content/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/extract-image/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/install-config/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/install-grub-v2/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/install-image/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/install-packages/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/mount-root-fs/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/install-cloud-init/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/install-grub-wrapper/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/install-guest-agent/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/setup-root-partition/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/vagrant-libvirt-box/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/install-cloud-init-wrapper/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/install-custom-packages/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/install-guest-agent-wrapper/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/install-persistence-conf/files/persistence.conf:
--------------------------------------------------------------------------------
1 | / union
2 |
--------------------------------------------------------------------------------
/roles/install-persistence-conf/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/install-custom-packages-wrapper/tests/inventory:
--------------------------------------------------------------------------------
1 | localhost
2 |
3 |
--------------------------------------------------------------------------------
/roles/install-config/defaults/main.yml:
--------------------------------------------------------------------------------
1 | ---
2 | enable_dhcp: False
3 | enable_ssh: False
4 |
--------------------------------------------------------------------------------
/roles/release/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - release
5 |
--------------------------------------------------------------------------------
/roles/vmware/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - vmware-ova
5 |
--------------------------------------------------------------------------------
/roles/create-disk/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - create-disk
5 |
--------------------------------------------------------------------------------
/roles/get-version/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - get-version
5 |
--------------------------------------------------------------------------------
/roles/hyperv-vhd/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - hyperv-vhd
5 |
--------------------------------------------------------------------------------
/roles/mount-iso/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - mount-iso
5 |
--------------------------------------------------------------------------------
/roles/unmount-all/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - unmount-all
5 |
--------------------------------------------------------------------------------
/roles/unmount-pre/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - unmount-pre
5 |
--------------------------------------------------------------------------------
/roles/compress-image/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - install-image
5 |
--------------------------------------------------------------------------------
/roles/copy-iso-content/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - mount-iso
5 |
--------------------------------------------------------------------------------
/roles/create-iso/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - install-image
5 |
--------------------------------------------------------------------------------
/roles/download-iso/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - download-iso
5 |
--------------------------------------------------------------------------------
/roles/extract-image/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - install-image
5 |
--------------------------------------------------------------------------------
/roles/install-grub/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - install-grub
5 |
--------------------------------------------------------------------------------
/roles/install-image/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - install-image
5 |
--------------------------------------------------------------------------------
/roles/mount-root-fs/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - mount-root-fs
5 |
--------------------------------------------------------------------------------
/roles/install-config/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - install-config
5 |
--------------------------------------------------------------------------------
/roles/install-grub-v2/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - install-grub-v2
5 |
--------------------------------------------------------------------------------
/roles/copy-custom-files/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - copy-custom-files
5 |
--------------------------------------------------------------------------------
/roles/install-cloud-init/templates/90_dpkg.cfg.j2:
--------------------------------------------------------------------------------
1 | datasource_list: [ {{ cloud_init_ds_list|join(', ') }} ]
2 |
--------------------------------------------------------------------------------
/roles/install-cloud-init/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - install-cloud-init
5 |
--------------------------------------------------------------------------------
/roles/install-grub-wrapper/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - install-grub-wrapper
5 |
--------------------------------------------------------------------------------
/roles/install-guest-agent/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - install-guest-agent
5 |
--------------------------------------------------------------------------------
/roles/qemu-qcow2/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | remote_user: root
4 | roles:
5 | - qemu-qcow2
--------------------------------------------------------------------------------
/roles/qemu-raw/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | remote_user: root
4 | roles:
5 | - qemu-raw
6 |
--------------------------------------------------------------------------------
/roles/vagrant-libvirt-box/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - vagrant-libvirt-box
5 |
--------------------------------------------------------------------------------
/roles/install-cloud-init/files/90_disable_config_stage.cfg:
--------------------------------------------------------------------------------
1 | # Disable all config-stage modules
2 | cloud_config_modules:
3 |
--------------------------------------------------------------------------------
/roles/install-custom-packages/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - install-custom-packages
5 |
--------------------------------------------------------------------------------
/roles/install-cloud-init-wrapper/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - install-cloud-init-wrapper
5 |
--------------------------------------------------------------------------------
/roles/install-packages/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | remote_user: root
4 | roles:
5 | - install-packages
--------------------------------------------------------------------------------
/roles/install-persistence-conf/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - install-persistence-conf
5 |
--------------------------------------------------------------------------------
/roles/install-guest-agent-wrapper/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - install-guest-agent-wrapper
5 |
--------------------------------------------------------------------------------
/roles/install-custom-packages-wrapper/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | roles:
4 | - install-custom-packages-wrapper
5 |
--------------------------------------------------------------------------------
/roles/setup-root-partition/tests/test.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: localhost
3 | remote_user: root
4 | roles:
5 | - setup-root-partition
--------------------------------------------------------------------------------
/roles/qemu-raw/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: set raw image to the correct name
2 | command: mv "{{ vyos_raw_img }}" "{{ vyos_qemu_raw_img }}"
3 |
--------------------------------------------------------------------------------
/roles/vagrant-libvirt-box/files/metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "provider" : "libvirt",
3 | "format" : "qcow2",
4 | "virtual_size" : 10
5 | }
6 |
--------------------------------------------------------------------------------
/roles/create-disk/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Create the target disk image
2 | command: qemu-img create -f raw "{{ vyos_raw_img }}" "{{ vyos_disk_size }}"G
3 |
--------------------------------------------------------------------------------
/roles/qemu-qcow2/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Convert raw to qcow2
2 | command: qemu-img convert -f raw "{{ vyos_raw_img }}" -O qcow2 -c "{{ vyos_qemu_img }}"
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Ansible
2 | *.retry
3 | *.log
4 |
5 | # images
6 | *.img
7 | *.qcow2
8 | *.ova
9 | *.vhd
10 | *.box
11 |
12 | # Python
13 | .python-version
14 |
--------------------------------------------------------------------------------
/roles/copy-iso-content/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: copy iso files
2 | become: true
3 | synchronize:
4 | src: "/mnt/cdrom/"
5 | dest: "/tmp/live-{{ vyos_version }}"
6 |
--------------------------------------------------------------------------------
/hosts:
--------------------------------------------------------------------------------
1 | [local]
2 | localhost
3 |
4 | [qemu]
5 | localhost
6 |
7 | [vmware]
8 | localhost
9 |
10 | [hyperv]
11 | localhost
12 |
13 | [vagrant_libvirt]
14 | localhost
15 |
--------------------------------------------------------------------------------
/roles/fstrim/tasks/main.yml:
--------------------------------------------------------------------------------
1 | # Trim filesystems to minimize resulted image
2 | - name: Trim {{ vyos_write_root }}
3 | become: true
4 | command: fstrim {{ vyos_write_root }}
5 |
--------------------------------------------------------------------------------
/roles/install-guest-agent-wrapper/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Check if we need to install VM guest agents
2 | include_role:
3 | name: install-guest-agent
4 | when: guest_agent is defined
5 |
--------------------------------------------------------------------------------
/roles/hyperv-vhd/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Convert raw to "{{ vyos_format }}"
2 | command: qemu-img convert -f raw "{{ vyos_raw_img }}" -O "{{ vyos_format }}" -o subformat=dynamic "{{ vyos_hyperv_img }}"
3 |
--------------------------------------------------------------------------------
/roles/install-custom-packages-wrapper/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Check if we need to install custom packages
2 | include_role:
3 | name: install-custom-packages
4 | when: custom_packages is defined
5 |
--------------------------------------------------------------------------------
/roles/download-iso/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Download VyOS ISO release
2 | get_url:
3 | url: "{{ vyos_iso_url }}"
4 | dest: "{{ vyos_iso_local }}"
5 | force: no
6 | when: not vyos_iso_local is exists
7 |
--------------------------------------------------------------------------------
/roles/install-persistence-conf/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Create the persistence config
2 | become: true
3 | copy:
4 | src: files/persistence.conf
5 | dest: "{{ vyos_write_root }}/persistence.conf"
6 | mode: 0644
7 |
--------------------------------------------------------------------------------
/roles/meta/main.yml:
--------------------------------------------------------------------------------
1 | ---
2 | galaxy_info:
3 | author:
4 | description: vyos community
5 | company: vyos,sentium
6 | license: GPLv2
7 | min_ansible_version: 2.8
8 | galaxy_tags: []
9 | dependencies: []
10 |
--------------------------------------------------------------------------------
/roles/extract-image/tasks/main.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Extract squashfs image from ISO to root partition
3 | become: true
4 | command: unsquashfs -d {{ vyos_install_root }} {{ vyos_squashfs_image }}
5 | args:
6 | creates: "{{ vyos_install_root }}"
7 |
--------------------------------------------------------------------------------
/roles/copy-custom-files/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Copy custom files to the system, preserving paths
2 | become: true
3 | copy:
4 | src: "files/custom_files/"
5 | dest: "{{ vyos_install_root }}"
6 | force: true
7 | when: custom_files is defined
8 |
--------------------------------------------------------------------------------
/roles/release/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Release image
2 | become: false
3 | copy:
4 | src: "{{ vyos_output_img }}"
5 | dest: "{{ vyos_images_dir }}/vyos-{{ vyos_version }}-{{ vyos_platform | lower }}.{{ vyos_format }}"
6 | when: vyos_images_dir is defined
7 |
--------------------------------------------------------------------------------
/roles/vmware/vars/main.yml:
--------------------------------------------------------------------------------
1 | vyos_vmware_ovf: /tmp/vyos_vmware_image.ovf
2 | vyos_vmware_tmp_vmdk: /tmp/vyos_vmware_image_tmp.vmdk
3 | vyos_vmware_mf: /tmp/vyos_vmware_image.mf
4 | vyos_vmware_vmdk: /tmp/vyos_vmware_image.vmdk
5 | vyos_vmware_cert: /tmp/vyos_vmware_image.cert
6 |
--------------------------------------------------------------------------------
/roles/install-grub-wrapper/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Select GRUB for installer for VyOS <=1.3
2 | include_role:
3 | name: install-grub
4 | when: vyos_version is regex("^1\.[2-3].*$")
5 |
6 | - name: Select GRUB for installer for VyOS >=1.4
7 | include_role:
8 | name: install-grub-v2
9 | when: vyos_version is regex("^1\.[4-9].*$")
10 |
--------------------------------------------------------------------------------
/roles/compress-image/tasks/main.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Delete filesystem.squashfs
3 | become: true
4 | file:
5 | path: "/tmp/live-{{ vyos_version }}/live/filesystem.squashfs"
6 | state: absent
7 |
8 | - name: compress path to squashfs image
9 | become: true
10 | command: mksquashfs {{ vyos_install_root }} /tmp/live-{{ vyos_version }}/live/filesystem.squashfs -comp xz
11 |
--------------------------------------------------------------------------------
/roles/get-version/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Read version string from iso packages
2 | shell: cat {{ vyos_cd_squash_root }}/opt/vyatta/etc/version | awk '{print $2}' | tr + -
3 | register: result
4 |
5 | - name: Set vyos_version
6 | set_fact:
7 | vyos_version: "{{ result.stdout }}"
8 |
9 | - name: Debug version string as read from ISO
10 | debug: msg="This is version {{ vyos_version }}"
11 |
--------------------------------------------------------------------------------
/roles/install-config/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Make sure that config partition marker exists
2 | become: true
3 | file:
4 | path: "{{ vyos_install_root }}/opt/vyatta/etc/config/.vyatta_config"
5 | state: touch
6 |
7 | - name: Copy config to the installed image
8 | become: true
9 | template:
10 | src: config.boot.j2
11 | dest: "{{ vyos_install_root }}/opt/vyatta/etc/config/config.boot"
12 | mode: 0755
13 |
--------------------------------------------------------------------------------
/roles/install-cloud-init-wrapper/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Check if we need to install Cloud-Init
2 | include_role:
3 | name: install-cloud-init
4 | when: cloud_init == "true"
5 | - name: Set Cloud-Init tag for image file name
6 | set_fact:
7 | ci_tag: "-cloud-init"
8 | when: cloud_init == "true"
9 | # - name: Set empty Cloud-Init tag for image file name
10 | # set_fact:
11 | # ci_tag: ""
12 | # when: cloud_init == "false"
13 |
--------------------------------------------------------------------------------
/roles/vagrant-libvirt-box/vars/main.yml:
--------------------------------------------------------------------------------
1 | vyos_vagrant_libvirt_dir: "/tmp/vyos_vagrant_libvirt"
2 | vyos_vagrant_libvirt_box_img: "{{ vyos_vagrant_libvirt_dir }}/box.img"
3 | vyos_vagrant_libvirt_metadata: files/metadata.json
4 | vyos_vagrant_libvirt_vagrantfile: files/Vagrantfile
5 | vyos_vagrant_libvirt_tmp_metadata: "{{ vyos_vagrant_libvirt_dir }}/metadata.json"
6 | vyos_vagrant_libvirt_tmp_vagrantfile: "{{ vyos_vagrant_libvirt_dir }}/Vagrantfile"
7 | vyos_vagrant_box_name: vyos/current
8 |
--------------------------------------------------------------------------------
/roles/install-packages/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Install required packages
2 | become: true
3 | apt:
4 | update_cache: true
5 | name:
6 | - gdisk
7 | - kpartx
8 | - dosfstools
9 | - e2fsprogs
10 | - gnupg
11 | - qemu-utils
12 | - python3-lxml
13 | - grub-efi-amd64
14 | - grub-efi-amd64-bin
15 | - grub-common
16 | - isolinux
17 | - python3-requests
18 | - rsync
19 | - unzip
20 | - zlib1g-dev
21 | - squashfs-tools
22 | - xorriso
23 | state: present
24 |
--------------------------------------------------------------------------------
/roles/mount-iso/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Mount ISO
2 | become: true
3 | mount:
4 | name: "{{ vyos_cd_root }}"
5 | src: "{{ vyos_iso_local }}"
6 | fstype: iso9660
7 | opts: loop,ro
8 | state: mounted
9 | boot: no
10 |
11 | - name: Verify checksums of all the files in the ISO image
12 | command: md5sum -c md5sum.txt
13 | args:
14 | chdir: "{{ vyos_cd_root }}"
15 | changed_when: False
16 |
17 | - name: Mount squashfs image from ISO
18 | become: true
19 | mount:
20 | name: "{{ vyos_cd_squash_root }}"
21 | src: "{{ vyos_squashfs_image }}"
22 | fstype: squashfs
23 | opts: loop,ro
24 | state: mounted
25 | boot: no
26 |
--------------------------------------------------------------------------------
/roles/unmount-pre/tasks/main.yml:
--------------------------------------------------------------------------------
1 | # Unmount /sys /proc /dev
2 | - name: Unmount {{ vyos_install_root }}/sys, {{ vyos_install_root }}/proc, {{ vyos_install_root }}/dev
3 | become: true
4 | mount:
5 | name: "{{ vyos_install_root }}/{{ item }}"
6 | src: "/{{ item }}"
7 | fstype: none
8 | state: unmounted
9 | with_items: [ 'sys', 'proc', 'dev' ]
10 |
11 | - name: Unmount {{ vyos_install_root }}/sys, {{ vyos_install_root }}/proc, {{ vyos_install_root }}/dev
12 | become: true
13 | mount:
14 | name: "{{ vyos_install_root }}/{{ item }}"
15 | src: "/{{ item }}"
16 | fstype: none
17 | state: absent
18 | with_items: [ 'sys', 'proc', 'dev' ]
19 |
--------------------------------------------------------------------------------
/roles/vagrant-libvirt-box/files/Vagrantfile:
--------------------------------------------------------------------------------
1 | Vagrant.configure("2") do |config|
2 | config.vm.post_up_message = "VyOS box. See https://app.vagrantup.com/vyos for help and bug reports"
3 | config.vm.synced_folder './', '/vagrant',
4 | type: "rsync",
5 | owner: 'vyos',
6 | group: 'users',
7 | mount_options: ['dmode=775,fmode=775']
8 | config.ssh.username = "vyos"
9 | config.ssh.password = "vyos"
10 | config.vm.provider :libvirt do |libvirt|
11 | libvirt.driver = "kvm"
12 | libvirt.connect_via_ssh = false
13 | libvirt.username = "root"
14 | libvirt.storage_pool_name = "default"
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/roles/cleanup-ending/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Delete RAW image
2 | file:
3 | path: "{{ vyos_raw_img }}"
4 | state: absent
5 |
6 | - name: Delete PXE folder
7 | file:
8 | path: "/tmp/vyos-pxe-{{ vyos_version }}{{ ci_tag | default() }}"
9 | state: absent
10 | when:
11 | - pxe is defined
12 | - pxe == "true"
13 |
14 | - name: Delete Release key
15 | file:
16 | path: "{{ vyos_key_local }}"
17 | state: absent
18 |
19 | - name: Delete extracted squashfs path
20 | become: true
21 | file:
22 | path: "{{ vyos_install_root }}"
23 | state: absent
24 |
25 | - name: Delete temp iso creation path
26 | become: true
27 | file:
28 | path: "/tmp/live-{{ vyos_version }}"
29 | state: absent
30 |
--------------------------------------------------------------------------------
/roles/create-iso/tasks/main.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: create new iso
3 | become: true
4 | command: >
5 | xorriso -as mkisofs -R -r -J -joliet-long -l -cache-inodes \
6 | -iso-level 3 -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
7 | -partition_offset 16 -A "VyOS" -p "live-build 1:20190311.1; \
8 | https://debian-live.alioth.debian.org/live-build" \
9 | -publisher "autobuild@vyos.net" -V "VyOS" --modification-date={{ lookup('pipe','date +\"%Y%m%d%H%M%S%2N\"') }} \
10 | -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
11 | -boot-info-table -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot \
12 | -isohybrid-gpt-basdat -isohybrid-apm-hfsplus -o {{ vyos_cloud_upgrade_iso }} /tmp/live-{{ vyos_version }}
13 |
--------------------------------------------------------------------------------
/vagrant-libvirt.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: vagrant_libvirt
3 | become: True
4 | gather_facts: False
5 | connection: local
6 | vars:
7 | vyos_platform: vagrant-libvirt
8 | vyos_format: box
9 | vyos_vagrant_libvirt_box: "vyos_vagrant_libvirt_image.box"
10 | vyos_output_img: "{{ vyos_vagrant_libvirt_box }}"
11 | cloud_init: False
12 | enable_dhcp: True
13 | enable_ssh: True
14 | vagrant_provider: libvirt
15 | roles:
16 | - install-packages
17 | - download-iso
18 | - mount-iso
19 | - get-version
20 | - create-disk
21 | - setup-root-partition
22 | - install-image
23 | - mount-root-fs
24 | - install-config
25 | - install-grub-wrapper
26 | - install-persistence-conf
27 | - unmount-pre
28 | - unmount-all
29 | - vagrant-libvirt-box
30 | - release-vagrant-box
31 |
--------------------------------------------------------------------------------
/group_vars/all.yml:
--------------------------------------------------------------------------------
1 | ansible_host_key_checking: False
2 | ansible_python_interpreter: /usr/bin/python3
3 |
4 | vyos_iso_url: https://s3.amazonaws.com/s3-us.vyos.io/rolling/current/vyos-rolling-latest.iso
5 | vyos_iso_local: "{{ iso_local | default('/tmp/vyos.iso') }}"
6 | vyos_key_url: https://downloads.vyos.io/vyos-release.gpg
7 | vyos_key_local: /tmp/vyos-release.gpg
8 |
9 | vyos_cd_root: /mnt/cdrom
10 | vyos_cd_squash_root: /mnt/cdsquash
11 | vyos_squashfs_image: "{{ vyos_cd_root }}/live/filesystem.squashfs"
12 | vyos_write_root: /mnt/wroot
13 | vyos_read_root: /mnt/squashfs
14 | vyos_install_root: /mnt/inst_root
15 |
16 | vyos_disk_size: "{{ disk_size | default(10) }}"
17 | vyos_parttable_type: "{{ parttable_type | default('hybrid') }}"
18 | vyos_root_fstype: ext4
19 |
20 | vyos_target_drive: ""
21 | vyos_raw_img: /tmp/vyos_raw_image.img
22 | grub_console: "kvm"
23 |
--------------------------------------------------------------------------------
/hyperv.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: hyperv
3 | become: True
4 | gather_facts: False
5 | connection: local
6 | vars:
7 | vyos_platform: Hyper-V
8 | vyos_format: vhdx
9 | vyos_hyperv_img: /tmp/vyos_hyperv_image.vhdx
10 | vyos_output_img: "{{ vyos_hyperv_img }}"
11 | cloud_init: "false"
12 | cloud_init_ds_string: "{{ cloud_init_ds | default('NoCloud, ConfigDrive, None') }}"
13 | cloud_init_ds_list: "{{ cloud_init_ds_string.split(',') }}"
14 | roles:
15 | - install-packages
16 | - download-iso
17 | - mount-iso
18 | - get-version
19 | - create-disk
20 | - setup-root-partition
21 | - install-image
22 | - mount-root-fs
23 | - install-config
24 | - install-grub-wrapper
25 | - install-persistence-conf
26 | - install-cloud-init-wrapper
27 | - unmount-pre
28 | - unmount-all
29 | - hyperv-vhd
30 | - release
31 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM debian:11.8
2 |
3 | # Install minimal dependencies
4 | RUN apt-get update && apt-get install -y \
5 | ansible \
6 | python3
7 |
8 | # Install required packages (from ansible role "install-packages")
9 | RUN apt-get update && apt-get install -y \
10 | gdisk \
11 | kpartx \
12 | dosfstools \
13 | e2fsprogs \
14 | gnupg \
15 | qemu-utils \
16 | python3-lxml \
17 | grub-efi-amd64 \
18 | grub-efi-amd64-bin \
19 | grub-common \
20 | isolinux \
21 | python3-requests \
22 | rsync \
23 | unzip \
24 | zlib1g-dev \
25 | squashfs-tools \
26 | xorriso \
27 | build-essential
28 |
29 | # Install not required dependencies
30 | RUN apt-get install -y \
31 | git \
32 | mc \
33 | nano \
34 | && rm -rf /var/lib/apt/lists/*
35 |
36 | # Make build directory
37 | RUN mkdir -p /home/build
38 | WORKDIR /home/build
39 |
--------------------------------------------------------------------------------
/roles/vagrant-libvirt-box/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Create output directory if it does not exist
2 | file:
3 | path: "{{ vyos_vagrant_libvirt_dir }}"
4 | state: directory
5 | mode: '0777'
6 |
7 | - name: Convert raw to qcow2
8 | command: qemu-img convert -f raw "{{ vyos_raw_img }}" -O qcow2 "{{ vyos_vagrant_libvirt_box_img }}"
9 | - name: Copy metadata.json
10 | become: false
11 | copy:
12 | src: "{{ vyos_vagrant_libvirt_metadata }}"
13 | dest: "{{ vyos_vagrant_libvirt_tmp_metadata }}"
14 | - name: Copy Vagrantfile
15 | become: false
16 | copy:
17 | src: "{{ vyos_vagrant_libvirt_vagrantfile }}"
18 | dest: "{{ vyos_vagrant_libvirt_tmp_vagrantfile }}"
19 | - name: Create Vagrant box
20 | become: false
21 | archive:
22 | path:
23 | - "{{ vyos_vagrant_libvirt_box_img }}"
24 | - "{{ vyos_vagrant_libvirt_tmp_metadata }}"
25 | - "{{ vyos_vagrant_libvirt_tmp_vagrantfile }}"
26 | dest: "{{ vyos_vagrant_libvirt_box }}"
27 | format: tar
28 |
--------------------------------------------------------------------------------
/roles/install-open-vmdk/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Check vmdk-convert exists
2 | stat:
3 | path: /usr/bin/vmdk-convert
4 | register: stat_result
5 | - name: Download open-vmdk
6 | get_url:
7 | url: https://github.com/vmware/open-vmdk/archive/master.zip
8 | dest: /tmp/master.zip
9 | when: stat_result.stat.exists == False
10 | - name: Extract master.zip into /tmp
11 | unarchive:
12 | src: /tmp/master.zip
13 | dest: /tmp
14 | when: stat_result.stat.exists == False
15 | - name: Build open-vmdk
16 | become: true
17 | make:
18 | chdir: /tmp/open-vmdk-master/vmdk
19 | when: stat_result.stat.exists == False
20 | - name: Install open-vmdk
21 | become: true
22 | make:
23 | chdir: /tmp/open-vmdk-master/vmdk
24 | target: install
25 | when: stat_result.stat.exists == False
26 | - name: Delete installation directory and archive
27 | file:
28 | path: "{{ item }}"
29 | state: absent
30 | loop:
31 | - "/tmp/open-vmdk-master"
32 | - "/tmp/master.zip"
33 | when: stat_result.stat.exists == False
34 |
--------------------------------------------------------------------------------
/roles/install-image/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Create {{ vyos_write_root }} directories
2 | become: true
3 | file:
4 | path: "{{ vyos_write_root }}/boot/{{ vyos_version }}/rw"
5 | state: directory
6 | register: vyos_rw_dir
7 |
8 | - name: Create the work directory
9 | become: true
10 | file:
11 | path: "{{ vyos_write_root }}/boot/{{ vyos_version }}/work/work"
12 | state: directory
13 |
14 | - name: Copy squashfs image from ISO to root partition
15 | become: true
16 | command: cp -p {{ vyos_squashfs_image }} {{ vyos_write_root }}/boot/{{ vyos_version }}/{{ vyos_version }}.squashfs
17 | args:
18 | creates: "{{ vyos_write_root }}/boot/{{ vyos_version }}/{{ vyos_version }}.squashfs"
19 |
20 | - name: Copy boot files (kernel and initrd images) from ISO to root partition
21 | become: true
22 | shell: find {{ vyos_cd_squash_root }}/boot -maxdepth 1 \( -type f -o -type l \) -print -exec cp -dp {} {{ vyos_write_root }}/boot/{{ vyos_version }}/ \;
23 | args:
24 | creates: "{{ vyos_write_root }}/boot/{{ vyos_version }}/vmlinuz"
25 |
--------------------------------------------------------------------------------
/roles/release-vagrant-box/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Relase Vagrant Box
2 | when: release
3 | block:
4 | - name: Check Vagrant Cloud login
5 | become: no
6 | command: "vagrant cloud auth login --check"
7 |
8 | - name: Set box version for rolling release
9 | set_fact:
10 | box_version: "{{ vyos_version.split('-')[2][0:8] }}.{{ vyos_version.split('-')[2][8:10] }}.{{ vyos_version.split('-')[2][10:12] }}"
11 | when: vyos_version.split("-") | length == 3
12 |
13 | - name: Set box version for epa and rc
14 | set_fact:
15 | box_version: "{{ vyos_version.split('-')[0] }}"
16 | when: vyos_version.split("-") | length == 2
17 |
18 | - name: Set box version for LTS release
19 | set_fact:
20 | box_version: "{{ vyos_version }}"
21 | when: vyos_version.split("-") | length == 1
22 |
23 | - name: Publish the Vagrant box
24 | become: no
25 | command: "vagrant cloud publish {{ vyos_vagrant_box_name }} {{ box_version }} {{ vagrant_provider }} {{ vyos_output_img }} --version-description \"VyOS {{ vyos_version }}\" --release --force"
26 |
--------------------------------------------------------------------------------
/templates/debian.list.j2:
--------------------------------------------------------------------------------
1 | {% if vyos_version | regex_search('(^1\.2)') %}
2 | deb http://deb.debian.org/debian jessie main contrib non-free
3 | deb http://deb.debian.org/debian jessie-updates main contrib non-free
4 | deb http://security.debian.org/debian-security/ jessie/updates main contrib non-free
5 | deb http://dev.packages.vyos.net/repositories/crux/vyos crux main
6 | deb http://dev.packages.vyos.net/repositories/crux/debian crux main
7 | {% elif vyos_version | regex_search('(^1\.3)') %}
8 | deb http://deb.debian.org/debian buster main contrib non-free
9 | deb http://deb.debian.org/debian buster-updates main contrib non-free
10 | deb http://security.debian.org/debian-security/ buster/updates main contrib non-free
11 | deb http://dev.packages.vyos.net/repositories/equuleus equuleus main
12 | {% else %}
13 | deb http://deb.debian.org/debian bookworm main contrib non-free
14 | deb http://deb.debian.org/debian bookworm-updates main contrib non-free
15 | deb http://deb.debian.org/debian-security/ bookworm-security main contrib non-free
16 | deb http://dev.packages.vyos.net/repositories/current current main
17 | {% endif %}
18 |
--------------------------------------------------------------------------------
/roles/mount-root-fs/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Mount squashfs image from root partition
2 | become: true
3 | mount:
4 | path: "{{ vyos_read_root }}"
5 | src: "{{ vyos_write_root }}/boot/{{ vyos_version }}/{{ vyos_version }}.squashfs"
6 | fstype: squashfs
7 | opts: loop,ro
8 | state: mounted
9 | boot: no
10 |
11 | - name: Set rw directory for overlayfs
12 | set_fact:
13 | vyos_rw_dir: "{{ vyos_write_root }}/boot/{{ vyos_version }}/rw"
14 |
15 | - name: Create a rw directory if it does not exist
16 | file:
17 | path: "{{ vyos_rw_dir }}"
18 | state: directory
19 | mode: '0755'
20 |
21 | - name: Set work directory for overlayfs
22 | set_fact:
23 | vyos_work_dir: "{{ vyos_write_root }}/boot/{{ vyos_version }}/work"
24 |
25 | - name: Create a work directory if it does not exist
26 | file:
27 | path: "{{ vyos_work_dir }}"
28 | state: directory
29 | mode: '0755'
30 |
31 | - name: Set up union root for post installation tasks
32 | become: true
33 | mount:
34 | path: "{{ vyos_install_root }}"
35 | src: overlay
36 | fstype: overlay
37 | opts: "noatime,upperdir={{ vyos_rw_dir }},lowerdir={{ vyos_read_root }},workdir={{ vyos_work_dir }}"
38 | state: mounted
39 | boot: no
40 |
--------------------------------------------------------------------------------
/roles/install-config/templates/config.boot.j2:
--------------------------------------------------------------------------------
1 | system {
2 | host-name vyos
3 | {% if without_login is not defined or without_login == "false" %}
4 | login {
5 | user vyos {
6 | authentication {
7 | {% if cloud_init == "true" and not ( keep_user is defined and keep_user == "true" ) %}
8 | encrypted-password "*"
9 | {% else %}
10 | encrypted-password "$6$MjV2YvKQ56q$QbL562qhRoyUu8OaqrXagicvcsNpF1HssCY06ZxxghDJkBCfSfTE/4FlFB41xZcd/HqYyVBuRt8Zyq3ozJ0dc."
11 | {% endif %}
12 | plaintext-password ""
13 | }
14 | {% if vyos_version | regex_search('(^1\.2)') %}
15 | level admin
16 | {% endif %}
17 | }
18 | }
19 | {% endif %}
20 | syslog {
21 | global {
22 | facility all {
23 | level notice
24 | }
25 | facility protocols {
26 | level debug
27 | }
28 | }
29 | }
30 | ntp {
31 | server "time1.vyos.net"
32 | server "time2.vyos.net"
33 | server "time3.vyos.net"
34 | }
35 | config-management {
36 | commit-revisions 100
37 | }
38 | }
39 | interfaces {
40 | {% if enable_dhcp %}
41 | ethernet eth0 {
42 | address dhcp
43 | }
44 | {% endif %}
45 | loopback lo {
46 | }
47 | }
48 | {% if enable_ssh %}
49 | service {
50 | ssh {
51 | }
52 | }
53 | {% endif %}
54 |
--------------------------------------------------------------------------------
/raw.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: qemu
3 | gather_facts: false
4 | connection: local
5 | vars:
6 | vyos_platform: QEMU
7 | vyos_format: raw
8 | vyos_qemu_raw_img: "/tmp/vyos-{{ vyos_version }}{{ ci_tag | default() }}-{{vyos_disk_size}}G-qemu.raw"
9 | vyos_output_img: "{{ vyos_qemu_img }}"
10 | cloud_init: "false"
11 | cloud_init_ds_string: "{{ cloud_init_ds | default('NoCloud,ConfigDrive,None') }}"
12 | cloud_init_ds_list: "{{ cloud_init_ds_string.split(',') }}"
13 | tasks:
14 | - block:
15 | - include_role:
16 | name: '{{ roleinputvar }}'
17 | loop:
18 | - install-packages
19 | - download-iso
20 | - mount-iso
21 | - get-version
22 | - create-disk
23 | - setup-root-partition
24 | - install-image
25 | - mount-root-fs
26 | - install-config
27 | - install-grub-wrapper
28 | - install-persistence-conf
29 | - install-cloud-init-wrapper
30 | - install-guest-agent-wrapper
31 | - fstrim
32 | - unmount-pre
33 | - create-pxe-archive
34 | - unmount-all
35 | - qemu-raw
36 | - cleanup-ending
37 | - release
38 | loop_control:
39 | loop_var: roleinputvar
40 | rescue:
41 | - include_role:
42 | name: '{{ roleinputvar }}'
43 | loop:
44 | - unmount-pre
45 | - unmount-all
46 | loop_control:
47 | loop_var: roleinputvar
48 |
49 |
--------------------------------------------------------------------------------
/vmware.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: vmware
3 | gather_facts: false
4 | connection: local
5 | vars:
6 | vyos_platform: VMware
7 | vyos_format: ova
8 | vyos_vmdk_size: 10
9 | vyos_vmware_ova: "/tmp/vyos-{{ vyos_version }}{{ ci_tag | default() }}-vmware.ova"
10 | vyos_output_img: "{{ vyos_vmware_ova }}"
11 | cloud_init: "true"
12 | cloud_init_ds_string: "{{ cloud_init_ds | default('OVF,None') }}"
13 | cloud_init_ds_list: "{{ cloud_init_ds_string.split(',') }}"
14 | vmware_guest: debian10_64Guest
15 | debian_release: 10
16 | tasks:
17 | - block:
18 | - include_role:
19 | name: '{{ roleinputvar }}'
20 | loop:
21 | - install-packages
22 | - download-iso
23 | - mount-iso
24 | - get-version
25 | - create-disk
26 | - setup-root-partition
27 | - install-image
28 | - mount-root-fs
29 | - install-config
30 | - install-grub-wrapper
31 | - install-persistence-conf
32 | - install-cloud-init-wrapper
33 | - fstrim
34 | - unmount-pre
35 | - unmount-all
36 | - install-open-vmdk
37 | - vmware
38 | - cleanup-ending
39 | - release
40 | loop_control:
41 | loop_var: roleinputvar
42 | rescue:
43 | - include_role:
44 | name: '{{ roleinputvar }}'
45 | loop:
46 | - unmount-pre
47 | - unmount-all
48 | loop_control:
49 | loop_var: roleinputvar
50 |
--------------------------------------------------------------------------------
/roles/install-grub/templates/boot/grub/grub.cfg.j2:
--------------------------------------------------------------------------------
1 | {% if grub_console == "kvm" %}
2 | set default=0
3 | {% elif grub_console == "serial" %}
4 | set default=1
5 | {% endif %}
6 | set timeout=5
7 | serial --unit=0
8 | terminal_output --append serial
9 | terminal_input serial console
10 | insmod efi_gop
11 | insmod efi_uga
12 |
13 | menuentry "VyOS {{ vyos_version }} for {{ vyos_platform }} (KVM console)" {
14 | linux /boot/{{ vyos_version }}/vmlinuz boot=live rootdelay=5 noautologin net.ifnames=0 biosdevname=0 vyos-union=/boot/{{ vyos_version }} console=tty0
15 | initrd /boot/{{ vyos_version }}/initrd.img
16 | }
17 |
18 | menuentry "VyOS {{ vyos_version }} for {{ vyos_platform }} (Serial console)" {
19 | linux /boot/{{ vyos_version }}/vmlinuz boot=live rootdelay=5 noautologin net.ifnames=0 biosdevname=0 vyos-union=/boot/{{ vyos_version }} console=ttyS0
20 | initrd /boot/{{ vyos_version }}/initrd.img
21 | }
22 |
23 | menuentry "VyOS {{ vyos_version }} for {{ vyos_platform }} - password reset (KVM console)" {
24 | linux /boot/{{ vyos_version }}/vmlinuz boot=live rootdelay=5 noautologin net.ifnames=0 biosdevname=0 vyos-union=/boot/{{ vyos_version }} console=tty0 init=/opt/vyatta/sbin/standalone_root_pw_reset
25 | initrd /boot/{{ vyos_version }}/initrd.img
26 | }
27 |
28 | menuentry "VyOS {{ vyos_version }} for {{ vyos_platform }} - password reset (Serial console)" {
29 | linux /boot/{{ vyos_version }}/vmlinuz boot=live rootdelay=5 noautologin net.ifnames=0 biosdevname=0 vyos-union=/boot/{{ vyos_version }} console=ttyS0 init=/opt/vyatta/sbin/standalone_root_pw_reset
30 | initrd /boot/{{ vyos_version }}/initrd.img
31 | }
32 |
--------------------------------------------------------------------------------
/qemu.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: qemu
3 | gather_facts: false
4 | connection: local
5 | vars:
6 | vyos_platform: QEMU
7 | vyos_format: qcow2
8 | vyos_qemu_img: "/tmp/vyos-{{ vyos_version }}{{ ci_tag | default() }}-{{vyos_disk_size}}G-qemu.qcow2"
9 | vyos_output_img: "{{ vyos_qemu_img }}"
10 | cloud_init: "false"
11 | cloud_init_ds_string: "{{ cloud_init_ds | default('NoCloud,ConfigDrive,None') }}"
12 | cloud_init_ds_list: "{{ cloud_init_ds_string.split(',') }}"
13 | tasks:
14 | - block:
15 | - include_role:
16 | name: '{{ roleinputvar }}'
17 | loop:
18 | - install-packages
19 | - download-iso
20 | - mount-iso
21 | - get-version
22 | - create-disk
23 | - setup-root-partition
24 | - install-image
25 | - mount-root-fs
26 | - install-config
27 | - install-grub-wrapper
28 | - install-persistence-conf
29 | - install-cloud-init-wrapper
30 | - install-guest-agent-wrapper
31 | - install-custom-packages-wrapper
32 | - copy-custom-files
33 | - fstrim
34 | - unmount-pre
35 | - create-pxe-archive
36 | - unmount-all
37 | - qemu-qcow2
38 | - cleanup-ending
39 | - release
40 | loop_control:
41 | loop_var: roleinputvar
42 | rescue:
43 | - include_role:
44 | name: '{{ roleinputvar }}'
45 | loop:
46 | - unmount-pre
47 | - unmount-all
48 | loop_control:
49 | loop_var: roleinputvar
50 |
--------------------------------------------------------------------------------
/roles/vmware/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Convert raw to vmdk
2 | command: qemu-img convert -f raw "{{ vyos_raw_img }}" -O vmdk -o adapter_type=lsilogic "{{ vyos_vmware_tmp_vmdk }}"
3 |
4 | - name: Fix vmdk with open-vmdk
5 | command: vmdk-convert "{{ vyos_vmware_tmp_vmdk }}" "{{ vyos_vmware_vmdk }}"
6 |
7 | - name: Delete temporary image
8 | file:
9 | path: "{{ vyos_vmware_tmp_vmdk }}"
10 | state: absent
11 |
12 | - name: Get vmdk_file_size
13 | shell: du --bytes "{{ vyos_vmware_vmdk }}" | cut -f1
14 | register: vmdk_file_size
15 |
16 | - name: Get vmdk_populated_size
17 | shell: vmdk-convert -i "{{ vyos_vmware_vmdk }}"
18 | register: result
19 |
20 | - name: Set vmdk_populated_size
21 | set_fact:
22 | vmdk_populated_size: "{{ (result.stdout | from_json).used }}"
23 |
24 | - name: Generate OVF
25 | become: false
26 | template:
27 | src: templates/vyos_vmware_image.ovf.j2
28 | dest: "{{ vyos_vmware_ovf }}"
29 |
30 | - name: Generate MF
31 | shell: openssl sha1 "{{ vyos_vmware_vmdk | basename }}" "{{ vyos_vmware_ovf | basename }}"
32 | args:
33 | chdir: /tmp
34 | register: result
35 |
36 | - name: Create MF
37 | become: false
38 | copy:
39 | dest: "{{ vyos_vmware_mf }}"
40 | content: "{{ result.stdout }}"
41 |
42 | - name: Converting the OVF to signed OVA
43 | become: false
44 | command: "ovftool --privateKey={{ vyos_vmware_private_key_path }} {{ vyos_vmware_ovf }} {{ vyos_vmware_ova }}"
45 |
46 | - name: Delete temporary files for VMware
47 | file:
48 | path: "{{ item }}"
49 | state: absent
50 | loop:
51 | - "{{ vyos_vmware_ovf }}"
52 | - "{{ vyos_vmware_mf }}"
53 | - "{{ vyos_vmware_vmdk }}"
54 |
--------------------------------------------------------------------------------
/roles/create-pxe-archive/tasks/main.yml:
--------------------------------------------------------------------------------
1 | # Create an archive with files, required for PXE
2 | - name: Create directory for PXE files
3 | become: true
4 | file:
5 | path: "/tmp/vyos-pxe-{{ vyos_version }}{{ ci_tag | default() }}"
6 | state: directory
7 | when:
8 | - pxe is defined
9 | - pxe == "true"
10 |
11 | - name: Save files required for PXE boot
12 | become: true
13 | copy:
14 | src: "{{ vyos_write_root }}/boot/{{ vyos_version }}/{{ item }}"
15 | dest: "/tmp/vyos-pxe-{{ vyos_version }}{{ ci_tag | default() }}/{{ item }}"
16 | with_items:
17 | - initrd.img
18 | - vmlinuz
19 | when:
20 | - pxe is defined
21 | - pxe == "true"
22 |
23 | # We need to skip boot directory (it contain too much unneeded items) and cc_vyos.py (optionally - may conflict with User-Data handler)
24 | - name: Create new squashfs image
25 | become: true
26 | command: "mksquashfs {{ vyos_install_root }} /tmp/vyos-pxe-{{ vyos_version }}{{ ci_tag | default() }}/filesystem.squashfs -comp gzip -no-progress -Xcompression-level 9 -e {{ vyos_install_root }}/boot"
27 | when:
28 | - pxe is defined
29 | - pxe == "true"
30 |
31 | - name: Add the /boot directory
32 | become: true
33 | command: "mksquashfs {{ vyos_read_root }}/boot /tmp/vyos-pxe-{{ vyos_version }}{{ ci_tag | default() }}/filesystem.squashfs -keep-as-directory -comp gzip -no-progress -Xcompression-level 9"
34 | when:
35 | - pxe is defined
36 | - pxe == "true"
37 |
38 | - name: Create an archive with files for PXE
39 | become: true
40 | archive:
41 | path: "/tmp/vyos-pxe-{{ vyos_version }}{{ ci_tag | default() }}"
42 | format: gz
43 | dest: "/tmp/vyos-pxe-{{ vyos_version }}{{ ci_tag | default() }}.tgz"
44 | when:
45 | - pxe is defined
46 | - pxe == "true"
47 |
--------------------------------------------------------------------------------
/roles/install-guest-agent/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Set VyOS branch name crux
2 | set_fact:
3 | vyos_branch: "crux"
4 | when: vyos_version is regex("^1\.2.*$")
5 | - name: Set VyOS branch name equuleus
6 | set_fact:
7 | vyos_branch: "equuleus"
8 | when: vyos_version is regex("^1\.3.*$")
9 | - name: Put debian.list
10 | become: true
11 | template:
12 | src: "templates/debian.list.j2"
13 | dest: "{{ vyos_install_root }}/etc/apt/sources.list.d/debian.list"
14 | - name: backup resolv.conf
15 | become: true
16 | command: mv {{ vyos_install_root }}/etc/resolv.conf /tmp/resolv.conf
17 | - name: add nameserver settings to chroot
18 | become: true
19 | copy:
20 | src: "files/resolv.conf"
21 | dest: "{{ vyos_install_root }}/etc/resolv.conf"
22 | - name: apt-get update
23 | become: true
24 | command: chroot {{ vyos_install_root }} apt-get update
25 | - name: Install qemu-guest-agent
26 | become: true
27 | command: chroot {{ vyos_install_root }} apt-get -t {{ vyos_branch | default('current') }} install -y qemu-guest-agent
28 | when: guest_agent == "qemu"
29 | - name: Install open-vm-tools
30 | become: true
31 | command: chroot {{ vyos_install_root }} apt-get -t {{ vyos_branch | default('current') }} install -y open-vm-tools
32 | when: guest_agent == "vmware"
33 | - name: apt-get clean
34 | become: true
35 | command: chroot {{ vyos_install_root }} apt-get clean
36 | - name: delete apt lists from cache
37 | become: true
38 | command: chroot {{ vyos_install_root }} rm -rf /var/lib/apt/lists/
39 | - name: Delete debian.list
40 | become: true
41 | file:
42 | path: "{{ vyos_install_root }}/etc/apt/sources.list.d/debian.list"
43 | state: absent
44 | - name: restore original resolv.conf
45 | become: true
46 | command: mv /tmp/resolv.conf {{ vyos_install_root }}/etc/resolv.conf
47 |
--------------------------------------------------------------------------------
/roles/install-grub-v2/files/vyos_unattended_installer.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | #
3 | # Copyright (C) 2023 VyOS maintainers and contributors
4 | #
5 | # This program is free software; you can redistribute it and/or modify
6 | # it under the terms of the GNU General Public License version 2 or later as
7 | # published by the Free Software Foundation.
8 | #
9 | # This program is distributed in the hope that it will be useful,
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | # GNU General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU General Public License
15 | # along with this program. If not, see .
16 |
17 | from importlib import util
18 | from os import environ
19 | from sys import exit
20 |
21 | spec = util.spec_from_file_location(
22 | "vinstall", "/usr/libexec/vyos/op_mode/image_installer.py"
23 | )
24 | vinstall = util.module_from_spec(spec)
25 | spec.loader.exec_module(vinstall)
26 |
27 | if __name__ == "__main__":
28 | # read configuration variables
29 | vyos_version = environ["vyos_version"]
30 | console_type = "tty" if environ["console_type"] == "kvm" else "ttyS"
31 | install_target = environ["install_target"]
32 |
33 | # install GRUB configuration files
34 | vinstall.setup_grub("/boot")
35 | vinstall.grub.version_add(vyos_version, "/boot")
36 | vinstall.grub.set_default(vyos_version, "/boot")
37 | vinstall.grub.set_console_type(console_type, "/boot")
38 |
39 | # install GRUB
40 | vinstall.grub.install(install_target, "/boot/boot", "/boot/efi")
41 |
42 | # sort inodes (to make GRUB read config files in alphabetical order)
43 | vinstall.grub.sort_inodes(f"/boot/{vinstall.grub.GRUB_DIR_VYOS}")
44 | vinstall.grub.sort_inodes(f"/boot/{vinstall.grub.GRUB_DIR_VYOS_VERS}")
45 |
46 | exit()
47 |
--------------------------------------------------------------------------------
/roles/install-grub-v2/tasks/main.yml:
--------------------------------------------------------------------------------
1 | # It is necessary to mount and bind /dev, /proc, /sys and /boot in order to execute grub-install
2 | # and install GRUB correctly within the {{ volume_drive }} using chroot
3 |
4 | # XXX: ansible mount module requires fstype so it cannot be used for binding an already
5 | # mounted location, we get to use mount directly at least for /boot
6 | - name: Mount and bind /dev /proc /sys and {{ vyos_write_root }}/boot to {{ vyos_install_root }}
7 | become: true
8 | shell: mount --bind /dev {{ vyos_install_root }}/dev &&
9 | mount --bind /proc {{ vyos_install_root }}/proc &&
10 | mount --bind /sys {{ vyos_install_root }}/sys &&
11 | mount --bind {{ vyos_write_root }} {{ vyos_install_root }}/boot
12 |
13 | - name: Mount EFI
14 | become: true
15 | mount:
16 | src: "{{ vyos_target_drive }}p{{ partition_num_efi }}"
17 | path: "{{ vyos_install_root }}/boot/efi"
18 | fstype: vfat
19 | state: mounted
20 | boot: no
21 | when: partition_num_efi is defined
22 |
23 | - name: Copy installer
24 | become: true
25 | copy:
26 | src: "files/vyos_unattended_installer.py"
27 | dest: "{{ vyos_install_root }}/tmp/vyos_unattended_installer.py"
28 |
29 | - name: Install GRUB and configuration
30 | become: true
31 | command: chroot {{ vyos_install_root }} python3 /tmp/vyos_unattended_installer.py
32 | environment:
33 | vyos_version: "{{ vyos_version }}"
34 | install_target: "{{ loop_device.stdout }}"
35 | console_type: "{{ grub_console }}"
36 |
37 | - name: Remove installer
38 | become: true
39 | file:
40 | path: "{{ vyos_install_root }}/tmp/vyos_unattended_installer.py"
41 | state: absent
42 |
43 | - name: Unmount EFI
44 | become: true
45 | mount:
46 | src: "{{ vyos_target_drive }}p{{ partition_num_efi }}"
47 | path: "{{ vyos_install_root }}/boot/efi"
48 | fstype: vfat
49 | state: absent
50 | boot: no
51 | when: partition_num_efi is defined
52 |
--------------------------------------------------------------------------------
/roles/unmount-all/tasks/main.yml:
--------------------------------------------------------------------------------
1 | # Unmount all mounts
2 | # If remove unmounted before absent, cannot unmount vyos_install_root...
3 | - name: Unmount {{ vyos_install_root }}/boot
4 | become: true
5 | mount:
6 | name: "{{ vyos_install_root }}/boot"
7 | src: "{{ vyos_write_root }}"
8 | fstype: none
9 | state: unmounted
10 |
11 | - name: Unmount {{ vyos_install_root }}/boot
12 | become: true
13 | mount:
14 | name: "{{ vyos_install_root }}/boot"
15 | src: "{{ vyos_write_root }}"
16 | fstype: none
17 | state: absent
18 |
19 | - name: Unmount {{ vyos_install_root }}
20 | become: true
21 | mount:
22 | name: "{{ vyos_install_root }}"
23 | src: overlayfs
24 | fstype: overlayfs
25 | state: absent
26 |
27 | - name: Unmount {{ vyos_read_root }}
28 | become: true
29 | mount:
30 | name: "{{ vyos_read_root }}"
31 | src: "{{ vyos_write_root }}/boot/{{ vyos_version }}/{{ vyos_version }}.squashfs"
32 | fstype: squashfs
33 | state: absent
34 |
35 | - name: Unmount {{ vyos_write_root }}
36 | become: true
37 | mount:
38 | name: "{{ vyos_write_root }}"
39 | state: absent
40 |
41 | - name: Check if the raw image file exists
42 | stat:
43 | path: "{{ vyos_raw_img }}"
44 | register: st
45 |
46 | - name: Remove image partitions
47 | become: true
48 | command: "kpartx -dv {{ vyos_raw_img }}"
49 | when: st.stat.exists
50 |
51 | - name: Remove /dev/mapper entries
52 | become: true
53 | command: "dmsetup remove {{ item }} || true"
54 | with_items: "{{ loop_partitions.stdout_lines }}"
55 | when: loop_partitions.stdout_lines is defined
56 | failed_when: false
57 |
58 | - name: Detach {{ loop_device.stdout }}
59 | become: true
60 | command: "losetup -d {{ loop_device.stdout }}"
61 | when: loop_device.stdout is defined
62 | failed_when: false
63 |
64 | - name: Unmount {{ vyos_cd_squash_root }}
65 | become: true
66 | mount:
67 | name: "{{ vyos_cd_squash_root }}"
68 | src: "{{ vyos_squashfs_image }}"
69 | fstype: squashfs
70 | state: absent
71 |
72 | - name: Unmount {{ vyos_cd_root }}
73 | become: true
74 | mount:
75 | name: "{{ vyos_cd_root }}"
76 | src: "{{ vyos_iso_local }}"
77 | fstype: iso9660
78 | state: absent
79 |
--------------------------------------------------------------------------------
/roles/install-custom-packages/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Set VyOS branch name crux
2 | set_fact:
3 | vyos_branch: "crux"
4 | when: vyos_version is regex("^1\.2.*$")
5 | - name: Set VyOS branch name equuleus
6 | set_fact:
7 | vyos_branch: "equuleus"
8 | when: vyos_version is regex("^1\.3.*$")
9 | - name: Put debian.list
10 | become: true
11 | template:
12 | src: "templates/debian.list.j2"
13 | dest: "{{ vyos_install_root }}/etc/apt/sources.list.d/debian.list"
14 | - name: backup resolv.conf
15 | become: true
16 | command: mv {{ vyos_install_root }}/etc/resolv.conf /tmp/resolv.conf
17 | - name: add nameserver settings to chroot
18 | become: true
19 | copy:
20 | src: "files/resolv.conf"
21 | dest: "{{ vyos_install_root }}/etc/resolv.conf"
22 | - name: apt-get update
23 | become: true
24 | command: chroot {{ vyos_install_root }} apt-get update
25 | - name: Copy packages to a temporary directory
26 | become: true
27 | copy:
28 | src: "files/custom_debs/"
29 | dest: "{{ vyos_install_root }}/tmp/custom_debs/"
30 | - name: Install custom packages from a list
31 | become: true
32 | command: chroot {{ vyos_install_root }} apt-get -t {{ vyos_branch | default('current') }} install -y --no-install-recommends {{ lookup('file', 'files/custom_packages_list.txt') }}
33 | - name: Install custom packages from deb files
34 | become: true
35 | command: chroot {{ vyos_install_root }} dpkg -i --force-depends /tmp/custom_debs/{{ item | basename }}
36 | with_fileglob: "{{ vyos_install_root }}/tmp/custom_debs/*.deb"
37 | - name: Install missed dependencies
38 | become: true
39 | command: chroot {{ vyos_install_root }} apt-get -f -y install
40 | - name: Delete DEB packages
41 | become: true
42 | command: chroot {{ vyos_install_root }} rm -rf /tmp/custom_debs/
43 | - name: apt-get clean
44 | become: true
45 | command: chroot {{ vyos_install_root }} apt-get clean
46 | - name: delete apt lists from cache
47 | become: true
48 | command: chroot {{ vyos_install_root }} rm -rf /var/lib/apt/lists/
49 | - name: Delete debian.list
50 | become: true
51 | file:
52 | path: "{{ vyos_install_root }}/etc/apt/sources.list.d/debian.list"
53 | state: absent
54 | - name: restore original resolv.conf
55 | become: true
56 | command: mv /tmp/resolv.conf {{ vyos_install_root }}/etc/resolv.conf
57 |
--------------------------------------------------------------------------------
/roles/setup-root-partition/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Partition disk (MBR)
2 | become: true
3 | command:
4 | cmd: "sfdisk -q -X dos {{ vyos_raw_img }}"
5 | stdin: "2048,+,L,*"
6 | when: vyos_parttable_type == "mbr"
7 |
8 | - name: Partition disk (GPT)
9 | become: true
10 | command:
11 | cmd: "sgdisk -a1 -n1:2048:+256M -t1:EF00 -n2:0:0:+100% -t2:8300 {{ vyos_raw_img }}"
12 | when: vyos_parttable_type == "gpt"
13 |
14 | - name: Partition disk (hybrid)
15 | become: true
16 | command:
17 | cmd: "sgdisk -a1 -n1:2048:4095 -t1:EF02 -n2:4096:+256M -t2:EF00 -n3:0:0:+100% -t3:8300 {{ vyos_raw_img }}"
18 | when: vyos_parttable_type == "hybrid"
19 |
20 | - name: Set partition numbers for next actions (MBR)
21 | set_fact:
22 | partition_num_root: 1
23 | when: vyos_parttable_type == "mbr"
24 |
25 | - name: Set partition numbers for next actions (GPT)
26 | set_fact:
27 | partition_num_efi: 1
28 | partition_num_root: 2
29 | when: vyos_parttable_type == "gpt"
30 |
31 | - name: Set partition numbers for next actions (hybrid)
32 | set_fact:
33 | partition_num_efi: 2
34 | partition_num_root: 3
35 | when: vyos_parttable_type == "hybrid"
36 |
37 | - name: Reread partitions from image and mount to loopback
38 | become: true
39 | shell: "kpartx -av {{ vyos_raw_img }} | awk '{ print $3 }'"
40 | register: loop_partitions
41 |
42 | - name: Find loop device path
43 | become: true
44 | shell: "losetup -l -O NAME,BACK-FILE | awk '{ if (match($2, \"{{ vyos_raw_img }}\")) print $1}'"
45 | register: loop_device
46 |
47 | - name: Set vyos_target_drive fact
48 | set_fact:
49 | vyos_target_drive: "{{ loop_device.stdout | regex_replace('^/dev/(loop.*)$', '/dev/mapper/\\1') }}"
50 |
51 | - name: Create a fileystem on EFI partition
52 | become: true
53 | filesystem:
54 | fstype: "vfat"
55 | device: "{{ vyos_target_drive }}p{{ partition_num_efi }}"
56 | opts: "-n EFI -F 32 -s 1"
57 | when: partition_num_efi is defined
58 |
59 | - name: Create a fileystem on root partition
60 | become: true
61 | filesystem:
62 | fstype: "{{ vyos_root_fstype }}"
63 | device: "{{ vyos_target_drive }}p{{ partition_num_root }}"
64 | opts: "-L persistence"
65 |
66 | - name: Mount root partition
67 | become: true
68 | mount:
69 | name: "{{ vyos_write_root }}"
70 | src: "{{ vyos_target_drive }}p{{ partition_num_root }}"
71 | fstype: "{{ vyos_root_fstype }}"
72 | state: mounted
73 | opts: discard
74 | boot: no
75 |
--------------------------------------------------------------------------------
/roles/install-grub/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Create GRUB directory
2 | become: true
3 | file:
4 | path: "{{ vyos_install_root }}/boot/grub"
5 | state: directory
6 |
7 | # It is necessary to mount and bind /dev, /proc, /sys and /boot in order to execute grub-install
8 | # and install GRUB correctly within the {{ volume_drive }} using chroot
9 |
10 | # XXX: ansible mount module requires fstype so it cannot be used for binding an already
11 | # mounted location, we get to use mount directly at least for /boot
12 | - name: Mount and bind /dev /proc /sys and {{ vyos_write_root }}/boot to {{ vyos_install_root }}
13 | become: true
14 | shell: mount --bind /dev {{ vyos_install_root }}/dev &&
15 | mount --bind /proc {{ vyos_install_root }}/proc &&
16 | mount --bind /sys {{ vyos_install_root }}/sys &&
17 | mount --bind {{ vyos_write_root }} {{ vyos_install_root }}/boot
18 |
19 | - name: Create efi directory
20 | become: true
21 | file:
22 | path: "{{ vyos_install_root }}/boot/grub"
23 | state: directory
24 |
25 | - name: Mount EFI
26 | become: true
27 | mount:
28 | src: "{{ vyos_target_drive }}p{{ partition_num_efi }}"
29 | path: "{{ vyos_install_root }}/boot/efi"
30 | fstype: vfat
31 | state: mounted
32 | boot: no
33 | when: partition_num_efi is defined
34 |
35 | - name: Install GRUB in the boot sector of {{ vyos_target_drive }}
36 | become: true
37 | command: "chroot {{ vyos_install_root }} grub-install --no-floppy --target=i386-pc --root-directory=/boot {{ loop_device.stdout }} --force"
38 | args:
39 | creates: "{{ vyos_install_root }}/boot/grub/grubenv"
40 | when: (vyos_parttable_type == "mbr") or
41 | (vyos_parttable_type == "hybrid")
42 |
43 | - name: Install EFI GRUB to {{ vyos_target_drive }}p{{ partition_num_efi }}
44 | become: true
45 | command: "chroot {{ vyos_install_root }} grub-install --no-floppy --recheck --target=x86_64-efi --force-extra-removable --root-directory=/boot --efi-directory=/boot/efi --bootloader-id='VyOS' --no-uefi-secure-boot"
46 | when: partition_num_efi is defined
47 |
48 | - name: Configure GRUB
49 | become: true
50 | template:
51 | src: templates/boot/grub/grub.cfg.j2
52 | dest: "{{ vyos_write_root }}/boot/grub/grub.cfg"
53 | mode: 0644
54 |
55 | - name: Unmount EFI
56 | become: true
57 | mount:
58 | src: "{{ vyos_target_drive }}p{{ partition_num_efi }}"
59 | path: "{{ vyos_install_root }}/boot/efi"
60 | fstype: vfat
61 | state: absent
62 | boot: no
63 | when: partition_num_efi is defined
64 |
--------------------------------------------------------------------------------
/roles/install-cloud-init/tasks/main.yml:
--------------------------------------------------------------------------------
1 | - name: Set VyOS branch name crux
2 | set_fact:
3 | vyos_branch: "crux"
4 | when: vyos_version is regex("^1\.2.*$")
5 | - name: Set VyOS branch name equuleus
6 | set_fact:
7 | vyos_branch: "equuleus"
8 | when: vyos_version is regex("^1\.3.*$")
9 | - name: Put debian.list
10 | become: true
11 | template:
12 | src: "templates/debian.list.j2"
13 | dest: "{{ vyos_install_root }}/etc/apt/sources.list.d/debian.list"
14 | - name: backup resolv.conf
15 | become: true
16 | command: mv {{ vyos_install_root }}/etc/resolv.conf /tmp/resolv.conf
17 | - name: add nameserver settings to chroot
18 | become: true
19 | copy:
20 | src: "files/resolv.conf"
21 | dest: "{{ vyos_install_root }}/etc/resolv.conf"
22 | - name: apt-get update
23 | become: true
24 | command: chroot {{ vyos_install_root }} apt-get update
25 | - name: Install cloud-init
26 | become: true
27 | command: chroot {{ vyos_install_root }} apt-get -t {{ vyos_branch | default('current') }} install -y --force-yes cloud-init cloud-utils ifupdown
28 | - name: apt-get clean
29 | become: true
30 | command: chroot {{ vyos_install_root }} apt-get clean
31 | - name: delete apt lists from cache
32 | become: true
33 | command: chroot {{ vyos_install_root }} rm -rf /var/lib/apt/lists/
34 | - name: Delete debian.list
35 | become: true
36 | file:
37 | path: "{{ vyos_install_root }}/etc/apt/sources.list.d/debian.list"
38 | state: absent
39 | - name: Create cfg.d dir
40 | become: true
41 | file:
42 | path: "{{ vyos_install_root }}/etc/cloud/cloud.cfg.d/"
43 | state: directory
44 | mode: 0755
45 | - name: Put datasource_list.cfg
46 | become: true
47 | template:
48 | src: 90_dpkg.cfg.j2
49 | dest: "{{ vyos_install_root }}/etc/cloud/cloud.cfg.d/90_dpkg.cfg"
50 | - name: run dpkg-reconfigure cloud-init
51 | become: true
52 | command: chroot {{ vyos_install_root }} dpkg-reconfigure -f noninteractive cloud-init
53 | - name: Disable config-stage modules
54 | become: true
55 | copy:
56 | src: "files/90_disable_config_stage.cfg"
57 | dest: "{{ vyos_install_root }}/etc/cloud/cloud.cfg.d/90_disable_config_stage.cfg"
58 | when:
59 | - cloud_init_disable_config is defined
60 | - cloud_init_disable_config == "true"
61 | - name: Add source-directory to the /etc/network/interfaces
62 | become: true
63 | lineinfile:
64 | path: "{{ vyos_install_root }}/etc/network/interfaces"
65 | line: "source-directory /etc/network/interfaces.d"
66 | create: yes
67 | - name: restore original resolv.conf
68 | become: true
69 | command: mv /tmp/resolv.conf {{ vyos_install_root }}/etc/resolv.conf
70 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # vyos-vm-images
2 |
3 | [Ansible](https://www.ansible.com/) playbooks to build VyOS VM images.
4 |
5 | ## Requirements
6 |
7 | 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:
8 |
9 | ```
10 | sudo apt update
11 | sudo apt install -y ansible python3
12 | ```
13 |
14 | If you want to build an OVA image, you also need `ovftool` from VMware. It should be downloaded from the [VMware site](https://code.vmware.com/tool/ovf). Also, you need a private key to sign an OVA file. It can be generated with the next command:
15 |
16 | ```
17 | openssl req -x509 -nodes -sha256 -days 365 -newkey rsa:1024 -keyout myself.pem -out myself.pem
18 | ```
19 |
20 | All other requirements will be installed by ansible-playbook.
21 |
22 |
23 | ## Prepare
24 |
25 | 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.
26 |
27 | ### Docker
28 | The Dockerfile has all required dependencies.
29 | 1. Download the `Dockerfile`
30 | ```
31 | wget https://raw.githubusercontent.com/vyos/vyos-vm-images/current/Dockerfile
32 | ```
33 | 2. Build local image with name `vyos-vm-images` (only if you do not have it)
34 | ```
35 | docker build --tag vyos-vm-images:latest -f ./Dockerfile .
36 | ```
37 | 3. Start and connect to the container:
38 | ```shell
39 | docker run --rm -it --privileged -v $(pwd):/vm-build -v $(pwd)/images:/images -w /vm-build vyos-vm-images:latest bash
40 | ```
41 | 4. Clone repo
42 | ```
43 | git clone https://github.com/vyos/vyos-vm-images.git && cd vyos-vm-images
44 | ```
45 |
46 | ## Supported Platforms
47 |
48 | - QEMU
49 |
50 | ```
51 | ansible-playbook qemu.yml
52 | ```
53 |
54 | - VMware Cloud-init
55 |
56 | ```
57 | ansible-playbook vmware.yml -e vyos_vmware_private_key_path=path_to_private_key
58 | ```
59 |
60 | - VMware simple ova
61 |
62 | ```
63 | ansible-playbook vmware.yml -e vyos_vmware_private_key_path=path_to_private_key -e cloud_init=false -e ovf_template=simple
64 | ```
65 |
66 | - Microsoft Hyper-V
67 |
68 | ```
69 | ansible-playbook hyperv.yml
70 | ```
71 |
72 | - Vagrant libvirt
73 |
74 | ```
75 | ansible-playbook vagrant-libvirt.yml
76 | ```
77 |
78 | ## Additional (optional) parameters
79 |
80 | - Path to local ISO image (default: /tmp/vyos.iso):
81 |
82 | ```
83 | -e iso_local=path
84 | ```
85 |
86 | Example:
87 |
88 | ```
89 | -e iso_local=/tmp/vyos/custom_image.iso
90 | ```
91 |
92 | - Disk size (default: 10GB):
93 |
94 | ```
95 | -e disk_size=size
96 | ```
97 |
98 | Example for 2 GB:
99 |
100 | ```
101 | -e disk_size=2
102 | ```
103 |
104 | - Enable Cloud-init (default: according to platform):
105 |
106 | ```
107 | -e cloud_init=true
108 | ```
109 |
110 | - Configure custom Cloud-init datasources (default: according to platform):
111 |
112 | ```
113 | -e cloud_init_ds=datasources
114 | ```
115 |
116 | Example:
117 | ```
118 | -e cloud_init_ds=NoCloud,ConfigDrive,None
119 | ```
120 |
121 | - Install guest agent. It can be `qemu`, `vmware` (default: none):
122 |
123 | ```
124 | -e guest_agent=agent
125 | ```
126 |
127 | Example:
128 | ```
129 | -e guest_agent=qemu
130 | ```
131 |
132 | - 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):
133 | ```
134 | -e cloud_init_disable_config=true
135 | ```
136 |
137 | - Create an archive with files required to PXE boot (default: false):
138 |
139 | ```
140 | -e pxe=true
141 | ```
142 |
143 | - Keep default `vyos` user with password `vyos` in configuration when building an image with Cloud-init (default: false):
144 |
145 | ```
146 | -e keep_user=true
147 | ```
148 |
149 | - Select a type of partition table for a disk image. Supported: `mbr`, `gpt`, `hybrid` (default: `hybrid`):
150 |
151 | ```
152 | -e parttable_type=hybrid
153 | ```
154 | - Select default console for boot. Supported: `kvm`, `serial` (default: depending on platform):
155 |
156 | ```
157 | -e grub_console=serial
158 | ```
159 |
160 | - 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:
161 |
162 | ```
163 | -e custom_packages=true
164 | ```
165 |
166 | - Copy custom files. All files from inside the `files/custom_files/` directory will be copied to the target filesystem recursively:
167 |
168 | ```
169 | -e custom_files=true
170 | ```
171 |
172 | - Enable DHCP on eth0 (default: `false`):
173 |
174 | ```
175 | -e enable_dhcp=true
176 | ```
177 |
178 | - Enable SSH (default: `false`):
179 |
180 | ```
181 | -e enable_ssh=true
182 | ```
183 |
184 | - Remove `login` from configuration. Unlike `keep_user`, this option will completely remove `system login` from configuration.
185 |
186 | ```
187 | -e without_login=true
188 | ```
189 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to VyOS
2 |
3 | You wan't to help us improve VyOS? This is awesome!
4 |
5 | We accept any kind of Pull Requests on GitHub. In order to get your changes into
6 | the main repository as smooth as possible please take yourself some time and
7 | review this contribution guideline.
8 |
9 | The following paragraphs are an excerpt from our Documentation.
10 |
11 | ## Submit a Patch
12 |
13 | Patches are always more than welcome. To have a clean and easy to maintain
14 | repository we have some guidelines when working with Git. A clean repository
15 | eases the automatic generation of a changelog file.
16 |
17 | A good approach for writing commit messages is actually to have a look at the
18 | file(s) history by invoking git log path/to/file.txt.
19 |
20 | ### Prepare patch/commit
21 |
22 | In a big system, such as VyOS, that is comprised of multiple components, it’s
23 | impossible to keep track of all the changes and bugs/feature requests in one’s
24 | head. We use a bugtracker known as Phabricator for it (“issue tracker” would
25 | be a better term, but this one stuck).
26 |
27 | The information is used in three ways:
28 |
29 | * Keep track of the progress (what we have already done in this branch and
30 | what we still need to do).
31 | * Prepare automatic release notes for upcoming releases
32 | * Help future maintainers of VyOS (it could be you!) to find out why certain
33 | things have been changed in the codebase or why certain features have been
34 | added
35 |
36 | To make this approach work, every change must be associated with a task number
37 | (prefixed with **T**) and a component. If there is no bug report/feature
38 | request for the changes you are going to make, you have to create a Phabricator
39 | task first. Once there is an entry in Phabricator, you should reference its id
40 | in your commit message, as shown below:
41 |
42 | * `ddclient: T1030: auto create runtime directories`
43 | * `Jenkins: add current Git commit ID to build description`
44 |
45 | If there is no [Phabricator](https://phabricator.vyos.net) reference in the
46 | commits of your pull request, we have to ask you to amend the commit message.
47 | Otherwise we will have to reject it.
48 |
49 | ## Writing good commit messages
50 |
51 | The format should be and is inspired by this very good and detailed
52 | [Git documentation](https://git-scm.com/book/ch5-2.html), it is also worth
53 | reading https://chris.beams.io/posts/git-commit/.
54 |
55 | This is nothing VyOS specific - it is more a general topic for distributed
56 | development environments.
57 |
58 | * A single, short, summary of the commit (recommended 50 characters or less,
59 | not exceeding 80 characters) containing a prefix of the changed component
60 | and the corresponding Phabricator reference e.g. `snmp: T1111:` or
61 | `ethernet: T2222:` - multiple components could be concatenated as in `snmp:
62 | ethernet: T3333`
63 | * In some contexts, the first line is treated as the subject of an email and
64 | the rest of the text as the body. The blank line separating the summary from
65 | the body is critical (unless you omit the body entirely); tools like rebase
66 | can get confused if you run the two together.
67 | * Followed by a message which describes all the details like:
68 | * What/why/how something has been changed, makes everyone’s life easier when
69 | working with `git bisect`
70 | * All text of the commit message should be wrapped at 72 characters if
71 | possible which makes reading commit logs easier with git log on a standard
72 | terminal (which happens to be 80x25)
73 | * If applicable a reference to a previous commit should be made linking those
74 | commits nicely when browsing the history: `After commit abcd12ef ("snmp:
75 | this is a headline") a Python import statement is missing, throwing the
76 | following exception: ABCDEF`
77 | * Always use the `-x` option to the `git cherry-pick` command when back or
78 | forward porting an individual commit. This automatically appends the line:
79 | `(cherry picked from commit )` to the original authors commit message
80 | making it easier when bisecting problems.
81 | * Every change set must be consistent (self containing)! Do not fix multiple
82 | bugs in a single commit. If you already worked on multiple fixes in the same
83 | file use git add –patch to only add the parts related to the one issue into
84 | your upcoming commit.
85 |
86 | ## Bug Report/Issue
87 | Issues or bugs are found in any software project. VyOS is not an exception.
88 |
89 | All issues should be reported to the developers. This lets the developers know
90 | what is not working properly. Without this sort of feedback every developer
91 | will believe that everything is working correctly.
92 |
93 | ### I have found a bug, what should I do?
94 |
95 | When you believe you have found a bug, it is always a good idea to verify the
96 | issue prior to opening a bug request.
97 |
98 | * Consult our [Documentation](https://docs.vyos.io) to ensure that you have
99 | configured your system correctly
100 | * Get community support via [Slack](https://slack.vyos.io) or our online
101 | [Forum](https://forum.vyos.io)
102 |
103 | #### Ensure the problem is reproducible
104 |
105 | When you are able to verify that it is actually a bug, spend some time to
106 | document how to reproduce the issue. This documentation can be invaluable.
107 |
108 | When you wish to have a developer fix a bug that you found, helping them
109 | reproduce the issue is beneficial to everyone. Be sure to include information
110 | about the hardware you are using, commands that you were running, any other
111 | activities that you may have been doing at the time. This additional
112 | information can be very useful.
113 |
114 | * What were you attempting to achieve?
115 | * What was the configuration prior to the change?
116 | * What commands did you use? Use e.g. ``show configuration commands``
117 |
118 | #### Include output
119 |
120 | The output you get when you find a bug can provide lots of information. If you
121 | get an error message on the screen, copy it exactly. Having the exact message
122 | can provide detail that the developers can use. Like wise if you have any log
123 | messages that also are from the time of the issue, include those. They may
124 | also contain information that is helpful for the development team.
125 |
126 | ### Reporting
127 |
128 | In order to open up a bug-report/feature request you need to create yourself
129 | an account on [Phabricator](https://phabricator.vyos.net). On the left
130 | side of the specific project (VyOS 1.2 or VyOS 1.3) you will find quick-links
131 | for opening a bug-report/feature request.
132 |
133 | * Provide as much information as you can
134 | * Which version of VyOS are you using? Use operational level command:
135 | ``show version``
136 | * How can we reproduce this Bug? Please include a CLI configuration, you can
137 | use ``show configuration command | strip-private`` to remove sensitive
138 | information before publishing.
139 |
140 | ## Feature Request
141 |
142 | You have an idea of how to make VyOS better or you are in need of a specific
143 | feature which all users of VyOS would benefit from? To send a feature request
144 | please search [Phabricator](https://phabricator.vyos.net) if there is already a
145 | request pending. You can enhance it or if you don't find one, create a new one
146 | by use the quick link in the left side under the specific project.
147 |
148 | ## Code Contribution
149 |
150 | For contributing code to VyOS please take a short moment and review the guideline
151 | outlined in our Documentation at
152 | https://docs.vyos.io/en/latest/contributing/development.html#submit-a-patch
153 |
154 | ### Coding Guidelines
155 |
156 | We have some small coding guidelines which are defined in a separate section of
157 | at https://docs.vyos.io/en/latest/contributing/development.html#coding-guidelines.
158 | The guidelines cover how to create the necessary XML structure for new features
159 | and also how to read in the code from the CLI into the Python based scripting
160 | backend.
161 |
162 | Thank you for taking the time reading this guide.
163 |
164 | It might also worth browsing our [Blog](https://blog.vyos.io) for additional
165 | info and updates.
166 |
--------------------------------------------------------------------------------
/roles/vmware/templates/vyos_vmware_image.ovf.j2:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | The list of logical networks
8 |
9 | WAN network
10 |
11 |
12 | LAN network
13 |
14 |
15 | {%- if ovf_template|default('ci') != 'simple' -%}
16 |
17 | List of profiles
18 |
19 |
20 | Minimal hardware profile - 1 vCPU, 512 MB RAM
21 |
22 |
23 |
24 | Medium hardware profile - 4 vCPUs, 16 GB RAM
25 |
26 |
27 |
28 | Large hardware profile - 8 vCPUs, 32 GB RAM
29 |
30 |
31 | {%- endif -%}
32 |
33 | Supported IP assignment schemes
34 |
35 |
36 | Virtual disk information
37 |
38 |
39 |
40 | A virtual machine
41 |
42 | VyOS is a Linux-based network operating system that provides software-based network routing, firewall, and VPN functionality.
43 | VyOS
44 | Sentrium S.L.
45 | {{ vyos_version }}
46 | https://www.vyos.io
47 | https://sentrium.io/
48 |
49 | Appliance user Settings
50 | {%- if ovf_template|default('ci') != 'simple' -%}
51 |
52 |
53 | The password for the appliance 'vyos' account. Passwords must be at least 8 characters in length.
54 |
55 |
56 |
57 | The public ssh key for the appliance 'vyos' account.
58 |
59 | Appliance IPv4 Network Settings (WAN interface)
60 |
61 |
62 | The host name for this virtual machine.
63 |
64 |
65 |
66 | The IPv4 address. Leave blank if DHCP is desired.
67 |
68 |
69 |
70 | The IPv4 netmask or prefix for this interface. Leave blank if DHCP is desired.
71 |
72 |
73 |
74 | Default gateway address. Leave blank if DHCP is desired.
75 |
76 |
77 |
78 | The domain name server IP Addresses for this VM (comma separated). Leave blank if DHCP is desired.
79 |
80 |
81 |
82 | NTP servers for this VM (comma separated). Leave blank if DHCP is desired.
83 |
84 | Appliance API Settings
85 |
86 |
87 | API key to access the VyOS api. If left blank the api wil not be enabled.
88 |
89 |
90 |
91 | API port to listen on for calls. Leave blank to keep it default '443'.
92 |
93 |
94 |
95 | Enable API debug logging
96 |
97 |
98 |
99 | User-Data, encoded with base64.
100 |
101 | {%- endif -%}
102 |
103 |
104 | VM specific properties
105 |
106 |
107 |
108 |
109 | VyOS
110 |
111 |
112 | The operating system installed
113 | Debian GNU/Linux {{ debian_release }} (64-bit)
114 |
115 |
116 | Virtual Hardware Requirements
117 |
118 | Virtual Hardware Family
119 | 0
120 | vmx-{{ 11 if debian_release == 8 else 13 }}
121 |
122 | {%- if ovf_template|default('ci') != 'simple' -%}
123 | -
124 | hertz * 10^6
125 | Number of virtual CPUs
126 | 1 virtual CPU
127 | 1
128 | 3
129 | 1
130 |
131 | -
132 | hertz * 10^6
133 | Number of virtual CPUs
134 | 4 virtual CPUs
135 | 1
136 | 3
137 | 4
138 |
139 | -
140 | hertz * 10^6
141 | Number of virtual CPUs
142 | 8 virtual CPUs
143 | 1
144 | 3
145 | 8
146 |
147 | -
148 | byte * 2^20
149 | Memory Size
150 | 512 MB of memory
151 | 2
152 | 512
153 | 4
154 | 512
155 |
156 | -
157 | byte * 2^20
158 | Memory Size
159 | 16 GB of memory
160 | 2
161 | 16384
162 | 4
163 | 16384
164 |
165 | -
166 | byte * 2^20
167 | Memory Size
168 | 32 GB of memory
169 | 2
170 | 32768
171 | 4
172 | 32768
173 |
174 | {%- else -%}
175 | -
176 | hertz * 10^6
177 | Number of virtual CPUs
178 | 1 virtual CPU
179 | 1
180 | 3
181 | 1
182 |
183 | -
184 | byte * 2^20
185 | Memory Size
186 | 4 GB of memory
187 | 2
188 | 4
189 | 4096
190 |
191 | {%- endif -%}
192 | -
193 | 0
194 | SCSI Controller 0 - VMware Paravirtual SCSI
195 | 3
196 | VirtualSCSI
197 | 6
198 |
199 | -
200 | 0
201 | disk0
202 | ovf:/disk/vmdisk1
203 | 4
204 | 3
205 | 17
206 |
207 | -
208 | 0
209 | IDE Controller 0
210 | 5
211 | 5
212 |
213 | -
214 | 0
215 | false
216 | CD/DVD Drive 1
217 | 6
218 | 5
219 | 15
220 |
221 |
222 | 7
223 | true
224 | WAN
225 | NIC representing WAN
226 | WAN
227 | 7
228 | vmxnet3
229 | 10
230 |
231 |
232 | 8
233 | true
234 | LAN
235 | NIC representing LAN
236 | LAN
237 | 8
238 | vmxnet3
239 | 10
240 |
241 |
242 |
243 | {%- if parttable_type == 'gpt' -%}
244 |
245 |
246 | {%- endif -%}
247 |
248 |
249 |
250 |
--------------------------------------------------------------------------------