I am trying to build an vyos image 1.5 with cloud init. I follow the procedure here:
But I obtain these errors:
root@85d57cd16a60:/vm-build/vyos-vm-images# ansible-playbook vmware.yml -e iso_local=tmp/vyos.iso -e cloud_init=true -e disk_size=5
PLAY [vmware] ************************************************************************************************************************************************************************************************
TASK [include_role : {{ roleinputvar }}] *********************************************************************************************************************************************************************
TASK [install-packages : Install required packages] **********************************************************************************************************************************************************
ok: [localhost]
TASK [mount-iso : Mount ISO] *********************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {“changed”: false, “msg”: “Error mounting /mnt/cdrom: mount: /mnt/cdrom: failed to setup loop device for tmp/vyos.iso.\n”}
TASK [include_role : {{ roleinputvar }}] *********************************************************************************************************************************************************************
TASK [unmount-pre : Unmount /mnt/inst_root/sys, /mnt/inst_root/proc, /mnt/inst_root/dev] *********************************************************************************************************************
ok: [localhost] => (item=sys)
ok: [localhost] => (item=proc)
ok: [localhost] => (item=dev)
TASK [unmount-pre : Unmount /mnt/inst_root/sys, /mnt/inst_root/proc, /mnt/inst_root/dev] *********************************************************************************************************************
ok: [localhost] => (item=sys)
ok: [localhost] => (item=proc)
ok: [localhost] => (item=dev)
TASK [unmount-all : Unmount /mnt/inst_root/boot] *************************************************************************************************************************************************************
ok: [localhost]
TASK [unmount-all : Unmount /mnt/inst_root/boot] *************************************************************************************************************************************************************
ok: [localhost]
TASK [unmount-all : Unmount /mnt/inst_root] ******************************************************************************************************************************************************************
ok: [localhost]
TASK [unmount-all : Unmount /mnt/squashfs] *******************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {“msg”: “The task includes an option with an undefined variable. The error was: ‘vyos_version’ is undefined\n\nThe error appears to be in ‘/vm-build/vyos-vm-images/roles/unmount-all/tasks/main.yml’: line 27, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Unmount {{ vyos_read_root }}\n ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes. Always quote template expression brackets when they\nstart a value. For instance:\n\n with_items:\n - {{ foo }}\n\nShould be written as:\n\n with_items:\n - "{{ foo }}"\n”}
PLAY RECAP ***************************************************************************************************************************************************************************************************
localhost : ok=6 changed=0 unreachable=0 failed=1 skipped=0 rescued=1 ignored=0