- name: Set VyOS branch name crux set_fact: vyos_branch: "crux" when: vyos_version is regex("^1\.2.*$") - name: Set VyOS branch name equuleus set_fact: vyos_branch: "equuleus" when: vyos_version is regex("^1\.3.*$") - name: Put debian.list become: true template: src: "templates/debian.list.j2" dest: "{{ vyos_install_root }}/etc/apt/sources.list.d/debian.list" - name: backup resolv.conf become: true command: mv {{ vyos_install_root }}/etc/resolv.conf /tmp/resolv.conf - name: add nameserver settings to chroot become: true copy: src: "files/resolv.conf" dest: "{{ vyos_install_root }}/etc/resolv.conf" - name: apt-get update become: true command: chroot {{ vyos_install_root }} apt-get update - name: Copy packages to a temporary directory become: true copy: src: "files/custom_debs/" dest: "{{ vyos_install_root }}/tmp/custom_debs/" - name: Install custom packages from a list become: true command: chroot {{ vyos_install_root }} apt-get -t {{ vyos_branch | default('current') }} install -y --no-install-recommends {{ lookup('file', 'files/custom_packages_list.txt') }} - name: Install custom packages from deb files become: true command: chroot {{ vyos_install_root }} dpkg -i --force-depends /tmp/custom_debs/{{ item | basename }} with_fileglob: "{{ vyos_install_root }}/tmp/custom_debs/*.deb" - name: Install missed dependencies become: true command: chroot {{ vyos_install_root }} apt-get -f -y install - name: Delete DEB packages become: true command: chroot {{ vyos_install_root }} rm -rf /tmp/custom_debs/ - name: apt-get clean become: true command: chroot {{ vyos_install_root }} apt-get clean - name: delete apt lists from cache become: true command: chroot {{ vyos_install_root }} rm -rf /var/lib/apt/lists/ - name: Delete debian.list become: true file: path: "{{ vyos_install_root }}/etc/apt/sources.list.d/debian.list" state: absent - name: restore original resolv.conf become: true command: mv /tmp/resolv.conf {{ vyos_install_root }}/etc/resolv.conf