summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzdc <zdc@users.noreply.github.com>2021-04-06 19:48:19 +0300
committerGitHub <noreply@github.com>2021-04-06 19:48:19 +0300
commitcd195f1d2b52a7f695474b4a9c4955db7f74d55b (patch)
treeff29b182c2773396170860a2ac5e90911fc9b6b5
parent97778528559a943c481161d5b4848538b9acdbb5 (diff)
parent090e5367dc6df9b49c037e0b60f7adfafdf54a53 (diff)
downloadvyos-vm-images-cd195f1d2b52a7f695474b4a9c4955db7f74d55b.tar.gz
vyos-vm-images-cd195f1d2b52a7f695474b4a9c4955db7f74d55b.zip
Merge pull request #15 from zdc/current
Fixes for Cloud-init, code optimization
-rw-r--r--roles/install-cloud-init/tasks/main.yml12
-rw-r--r--roles/install-custom-packages/tasks/main.yml13
-rw-r--r--roles/install-guest-agent/tasks/main.yml4
-rw-r--r--templates/debian.list.j22
4 files changed, 11 insertions, 20 deletions
diff --git a/roles/install-cloud-init/tasks/main.yml b/roles/install-cloud-init/tasks/main.yml
index ae6f67b..7018e8b 100644
--- a/roles/install-cloud-init/tasks/main.yml
+++ b/roles/install-cloud-init/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"
@@ -28,7 +24,7 @@
command: chroot {{ vyos_install_root }} apt-get update
- name: Install cloud-init
become: true
- command: chroot {{ vyos_install_root }} apt-get -t {{ vyos_branch | default('current') }} install -y cloud-init cloud-utils
+ command: chroot {{ vyos_install_root }} apt-get -t {{ vyos_branch | default('current') }} install -y cloud-init cloud-utils ifupdown
- name: apt-get clean
become: true
command: chroot {{ vyos_install_root }} apt-get clean
@@ -62,6 +58,12 @@
when:
- cloud_init_disable_config is defined
- cloud_init_disable_config == "true"
+- name: Add source-directory to the /etc/network/interfaces
+ become: true
+ lineinfile:
+ path: "{{ vyos_install_root }}/etc/network/interfaces"
+ line: "source-directory /etc/network/interfaces.d"
+ create: yes
- name: restore original resolv.conf
become: true
command: mv /tmp/resolv.conf {{ vyos_install_root }}/etc/resolv.conf
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
diff --git a/roles/install-guest-agent/tasks/main.yml b/roles/install-guest-agent/tasks/main.yml
index 3c0985c..fc864fc 100644
--- a/roles/install-guest-agent/tasks/main.yml
+++ b/roles/install-guest-agent/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"
diff --git a/templates/debian.list.j2 b/templates/debian.list.j2
index 7d7c3f3..69aad9c 100644
--- a/templates/debian.list.j2
+++ b/templates/debian.list.j2
@@ -8,7 +8,7 @@ deb http://dev.packages.vyos.net/repositories/crux/debian crux main
deb http://deb.debian.org/debian buster main contrib non-free
deb http://deb.debian.org/debian buster-updates main contrib non-free
deb http://security.debian.org/debian-security/ buster/updates main contrib non-free
-deb http://dev.packages.vyos.net/repositories/{{ debian_version.stdout }} {{ debian_version.stdout }} main
+deb http://dev.packages.vyos.net/repositories/equuleus equuleus main
{% else %}
deb http://deb.debian.org/debian buster main contrib non-free
deb http://deb.debian.org/debian buster-updates main contrib non-free