summaryrefslogtreecommitdiff
path: root/roles/install-config
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2020-02-20 10:43:36 +0200
committerzsdc <taras@vyos.io>2020-02-20 19:40:42 +0200
commit332dbe851c44543b69e516439baf203c9bebcadc (patch)
tree9eb724cd03ae10f659b9486b1005df0ffa2a4d42 /roles/install-config
parent88832a6324731f9357aa301adc70ef8448d6bc9f (diff)
downloadvyos-vm-images-332dbe851c44543b69e516439baf203c9bebcadc.tar.gz
vyos-vm-images-332dbe851c44543b69e516439baf203c9bebcadc.zip
QEMU image build improvements
* Added missed package dependencies (for Debian 10 based builders) * Added additional options, which can be passed to the playbook: * iso_local - path to local ISO file * disk_size - target disk image size * cloud_init - enable or disable Cloud-init integration to an image * cloud_init_ds - set custom list of data sources for Cloud-init * Added a version number and Cloud-init mark to a QCOW2 image name * Cloud-init installation procedure tuned to use packages from a proper one VyOS repository, according to VyOS and Debian version * Added workaround for /etc/network/interfaces to allow Cloud-init initialize network in a native way * Replaced default config file to Jinja2 template * Fixed GRUB installation on UEFI builders - added target i386-pc * Replaced GRUB configuration: * enable both KVM and Serial console for all images (Serial by default) * added password recovery option for all images * added 5 seconds of a timeout to allow select proper menu entry * fixed booting for 1.3 VyOS * Added loop device detach after image build - allows to build images multiple times without exhausting loop device limit * Added fstrim applying for image - theoretically, this may save some space * Enabled compression for QCOW2 image - this reduces image size significantly * Added RAW image deletion after conversion to more accurate cleanup
Diffstat (limited to 'roles/install-config')
-rw-r--r--roles/install-config/tasks/main.yml6
-rw-r--r--roles/install-config/templates/config.boot.j2 (renamed from roles/install-config/files/config.boot)21
2 files changed, 18 insertions, 9 deletions
diff --git a/roles/install-config/tasks/main.yml b/roles/install-config/tasks/main.yml
index 4447f87..0715fa1 100644
--- a/roles/install-config/tasks/main.yml
+++ b/roles/install-config/tasks/main.yml
@@ -4,9 +4,9 @@
path: "{{ vyos_install_root }}/opt/vyatta/etc/config/.vyatta_config"
state: touch
-- name: Copy the default config for QEMU to the installed image
+- name: Copy config to the installed image
become: true
- copy:
- src: files/config.boot
+ template:
+ src: config.boot.j2
dest: "{{ vyos_install_root }}/opt/vyatta/etc/config/config.boot"
mode: 0755
diff --git a/roles/install-config/files/config.boot b/roles/install-config/templates/config.boot.j2
index f1ec4f5..9b3e8ec 100644
--- a/roles/install-config/files/config.boot
+++ b/roles/install-config/templates/config.boot.j2
@@ -1,14 +1,13 @@
-service {
- ssh {
- port 22
- }
-}
system {
host-name vyos
login {
user vyos {
authentication {
+{% if cloud_init == "true" %}
+ encrypted-password "*"
+{% else %}
encrypted-password "$6$MjV2YvKQ56q$QbL562qhRoyUu8OaqrXagicvcsNpF1HssCY06ZxxghDJkBCfSfTE/4FlFB41xZcd/HqYyVBuRt8Zyq3ozJ0dc."
+{% endif %}
plaintext-password ""
}
level admin
@@ -34,8 +33,18 @@ system {
}
}
interfaces {
+{% if cloud_init == "true" %}
ethernet eth0 {
address dhcp
}
- loopback lo
+{% endif %}
+ loopback lo {
+ }
+}
+{% if cloud_init == "true" %}
+service {
+ ssh {
+ port 22
+ }
}
+{% endif %}