From 7e581d3656af42d8181d5d22459de20ef78a6ae4 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Mon, 4 May 2020 19:08:45 -0500 Subject: use docker for ovftool, no vmware compression and update config file --- roles/install-config/tasks/main.yml | 7 +++++++ roles/install-config/templates/config.boot.j2 | 6 +++--- roles/vmware-ova/tasks/main.yml | 5 +++-- roles/vmware-ova/templates/vyos_vmware_simple.ovf.j2 | 3 +-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/roles/install-config/tasks/main.yml b/roles/install-config/tasks/main.yml index 0715fa1..e0e2925 100644 --- a/roles/install-config/tasks/main.yml +++ b/roles/install-config/tasks/main.yml @@ -10,3 +10,10 @@ src: config.boot.j2 dest: "{{ vyos_install_root }}/opt/vyatta/etc/config/config.boot" mode: 0755 + +- name: Copy config to the installed image + become: true + template: + src: config.boot.j2 + dest: "/tmp/config.boot" + mode: 0755 diff --git a/roles/install-config/templates/config.boot.j2 b/roles/install-config/templates/config.boot.j2 index f0f1e3d..ecbb92e 100644 --- a/roles/install-config/templates/config.boot.j2 +++ b/roles/install-config/templates/config.boot.j2 @@ -3,7 +3,7 @@ system { login { user vyos { authentication { -{% if cloud_init and not ( keep_user is defined and keep_user == "true" ) %} +{% if cloud_init|bool and not ( keep_user is defined and keep_user == "true" ) %} encrypted-password "*" {% else %} encrypted-password "$6$MjV2YvKQ56q$QbL562qhRoyUu8OaqrXagicvcsNpF1HssCY06ZxxghDJkBCfSfTE/4FlFB41xZcd/HqYyVBuRt8Zyq3ozJ0dc." @@ -33,7 +33,7 @@ system { } } interfaces { -{% if cloud_init and not ( empty_config is defined and empty_config == "true" ) %} +{% if cloud_init|bool and not ( empty_config is defined and empty_config == "true" ) %} ethernet eth0 { address dhcp } @@ -41,7 +41,7 @@ interfaces { loopback lo { } } -{% if cloud_init and not ( empty_config is defined and empty_config == "true" ) %} +{% if cloud_init|bool and not ( empty_config is defined and empty_config == "true" ) %} service { ssh { port 22 diff --git a/roles/vmware-ova/tasks/main.yml b/roles/vmware-ova/tasks/main.yml index 85fbb6a..052722f 100644 --- a/roles/vmware-ova/tasks/main.yml +++ b/roles/vmware-ova/tasks/main.yml @@ -24,7 +24,7 @@ - name: Generate OVF become: false template: - src: templates/vyos_vmware_image.ovf.j2 + src: templates/vyos_vmware_simple.ovf.j2 dest: "{{ vyos_vmware_ovf }}" when: simple_ova - name: Generate MF @@ -39,7 +39,8 @@ content: "{{ result.stdout }}" - name: Converting the OVF to signed OVA become: false - command: "ovftool --compress=9 --privateKey={{ vyos_vmware_private_key_path }} + command: "docker run -v {{ vyos_vmware_private_key_path }}:{{ vyos_vmware_private_key_path }} + -v /tmp:/tmp moander/ovftool ovftool --privateKey={{ vyos_vmware_private_key_path }} {{ vyos_vmware_ovf }} {{ vyos_vmware_ova }}" - name: Delete temporary files for VMware file: diff --git a/roles/vmware-ova/templates/vyos_vmware_simple.ovf.j2 b/roles/vmware-ova/templates/vyos_vmware_simple.ovf.j2 index a60b66e..7316c01 100644 --- a/roles/vmware-ova/templates/vyos_vmware_simple.ovf.j2 +++ b/roles/vmware-ova/templates/vyos_vmware_simple.ovf.j2 @@ -25,7 +25,7 @@ VyOS is a Linux-based network operating system that provides software-based network routing, firewall, and VPN functionality. VyOS Sentrium S.L. - {{version}} + {{ vyos_version }} https://www.vyos.io https://sentrium.io/ @@ -117,7 +117,6 @@ - -- cgit v1.2.3