summaryrefslogtreecommitdiff
path: root/roles/vagrant-libvirt-box
diff options
context:
space:
mode:
Diffstat (limited to 'roles/vagrant-libvirt-box')
-rw-r--r--roles/vagrant-libvirt-box/files/Vagrantfile4
-rw-r--r--roles/vagrant-libvirt-box/files/metadata.json6
-rw-r--r--roles/vagrant-libvirt-box/tasks/main.yml6
-rw-r--r--roles/vagrant-libvirt-box/vars/main.yml7
4 files changed, 19 insertions, 4 deletions
diff --git a/roles/vagrant-libvirt-box/files/Vagrantfile b/roles/vagrant-libvirt-box/files/Vagrantfile
index 7c89422..7a720d0 100644
--- a/roles/vagrant-libvirt-box/files/Vagrantfile
+++ b/roles/vagrant-libvirt-box/files/Vagrantfile
@@ -1,4 +1,5 @@
Vagrant.configure("2") do |config|
+ config.vm.post_up_message = "VyOS box. See https://app.vagrantup.com/vyos for help and bug reports"
config.vm.synced_folder './', '/vagrant',
type: "rsync",
owner: 'vyos',
@@ -8,5 +9,8 @@ Vagrant.configure("2") do |config|
config.ssh.password = "vyos"
config.vm.provider :libvirt do |libvirt|
libvirt.driver = "kvm"
+ libvirt.connect_via_ssh = false
+ libvirt.username = "root"
+ libvirt.storage_pool_name = "default"
end
end
diff --git a/roles/vagrant-libvirt-box/files/metadata.json b/roles/vagrant-libvirt-box/files/metadata.json
index a502c63..e2e3fef 100644
--- a/roles/vagrant-libvirt-box/files/metadata.json
+++ b/roles/vagrant-libvirt-box/files/metadata.json
@@ -1 +1,5 @@
-{"format":"qcow2","provider":"libvirt","virtual_size":1}
+{
+ "provider" : "libvirt",
+ "format" : "qcow2",
+ "virtual_size" : 10
+}
diff --git a/roles/vagrant-libvirt-box/tasks/main.yml b/roles/vagrant-libvirt-box/tasks/main.yml
index ede229a..1dc6207 100644
--- a/roles/vagrant-libvirt-box/tasks/main.yml
+++ b/roles/vagrant-libvirt-box/tasks/main.yml
@@ -1,3 +1,9 @@
+- name: Create output directory if it does not exist
+ file:
+ path: "{{ vyos_vagrant_libvirt_dir }}"
+ state: directory
+ mode: '0777'
+
- name: Convert raw to qcow2
command: qemu-img convert -f raw "{{ vyos_raw_img }}" -O qcow2 "{{ vyos_vagrant_libvirt_box_img }}"
- name: Copy metadata.json
diff --git a/roles/vagrant-libvirt-box/vars/main.yml b/roles/vagrant-libvirt-box/vars/main.yml
index b262127..490437f 100644
--- a/roles/vagrant-libvirt-box/vars/main.yml
+++ b/roles/vagrant-libvirt-box/vars/main.yml
@@ -1,6 +1,7 @@
-vyos_vagrant_libvirt_box_img: /tmp/box.img
+vyos_vagrant_libvirt_dir: "/tmp/vyos_vagrant_libvirt"
+vyos_vagrant_libvirt_box_img: "{{ vyos_vagrant_libvirt_dir }}/box.img"
vyos_vagrant_libvirt_metadata: files/metadata.json
vyos_vagrant_libvirt_vagrantfile: files/Vagrantfile
-vyos_vagrant_libvirt_tmp_metadata: /tmp/metadata.json
-vyos_vagrant_libvirt_tmp_vagrantfile: /tmp/Vagrantfile
+vyos_vagrant_libvirt_tmp_metadata: "{{ vyos_vagrant_libvirt_dir }}/metadata.json"
+vyos_vagrant_libvirt_tmp_vagrantfile: "{{ vyos_vagrant_libvirt_dir }}/Vagrantfile"
vyos_vagrant_box_name: vyos/current