diff options
author | zsdc <taras@vyos.io> | 2021-04-06 19:45:09 +0300 |
---|---|---|
committer | zsdc <taras@vyos.io> | 2021-04-06 19:45:09 +0300 |
commit | 090e5367dc6df9b49c037e0b60f7adfafdf54a53 (patch) | |
tree | ff29b182c2773396170860a2ac5e90911fc9b6b5 /roles/install-custom-packages/tasks | |
parent | 97778528559a943c481161d5b4848538b9acdbb5 (diff) | |
download | vyos-vm-images-090e5367dc6df9b49c037e0b60f7adfafdf54a53.tar.gz vyos-vm-images-090e5367dc6df9b49c037e0b60f7adfafdf54a53.zip |
Fixes for Cloud-init, code optimization
- Cleaned up APT configuration code.
- Added ifupdown to Cloud-init install. This is required for all datasources that fetch data from remote hosts.
- Fixed error that stops playbook if the `custom_debs` directory is empty and `-e custom_packages=true` is used.
Diffstat (limited to 'roles/install-custom-packages/tasks')
-rw-r--r-- | roles/install-custom-packages/tasks/main.yml | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/roles/install-custom-packages/tasks/main.yml b/roles/install-custom-packages/tasks/main.yml index 1d8cd47..9b495c9 100644 --- a/roles/install-custom-packages/tasks/main.yml +++ b/roles/install-custom-packages/tasks/main.yml @@ -1,7 +1,3 @@ -- name: Get Debian version - become: true - command: chroot {{ vyos_install_root }} awk 'match($0, /VERSION=.*\((\w+)\)/, version) { print version[1] }' /etc/os-release - register: debian_version - name: Set VyOS branch name crux set_fact: vyos_branch: "crux" @@ -33,13 +29,10 @@ dest: "{{ vyos_install_root }}/tmp/custom_debs/" - name: Install custom packages from a list 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: Check if custom debs directory exists - stat: - path: "{{ vyos_install_root }}/tmp/custom_debs/" - register: custom_debs_dir - name: Install custom packages from deb files - command: chroot {{ vyos_install_root }} dpkg -i --force-depends -R /tmp/custom_debs/ - when: custom_debs_dir.stat.exists + command: + cmd: "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 command: chroot {{ vyos_install_root }} apt-get -f -y install - name: Delete DEB packages |