summaryrefslogtreecommitdiff
path: root/roles/install-cloud-init
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2021-04-06 19:45:09 +0300
committerzsdc <taras@vyos.io>2021-04-06 19:45:09 +0300
commit090e5367dc6df9b49c037e0b60f7adfafdf54a53 (patch)
treeff29b182c2773396170860a2ac5e90911fc9b6b5 /roles/install-cloud-init
parent97778528559a943c481161d5b4848538b9acdbb5 (diff)
downloadvyos-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-cloud-init')
-rw-r--r--roles/install-cloud-init/tasks/main.yml12
1 files changed, 7 insertions, 5 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