summaryrefslogtreecommitdiff
path: root/roles/vagrant-libvirt/tasks/release.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/vagrant-libvirt/tasks/release.yml')
-rw-r--r--roles/vagrant-libvirt/tasks/release.yml29
1 files changed, 29 insertions, 0 deletions
diff --git a/roles/vagrant-libvirt/tasks/release.yml b/roles/vagrant-libvirt/tasks/release.yml
new file mode 100644
index 0000000..7d2ca47
--- /dev/null
+++ b/roles/vagrant-libvirt/tasks/release.yml
@@ -0,0 +1,29 @@
+- name: Release image
+ become: false
+ copy:
+ src: "{{ vyos_vagrant_libvirt_box }}"
+ dest: "{{ vyos_images_dir }}/vyos-{{ version_string.stdout }}-vagrant-libvirt.box"
+ when: vyos_images_dir is defined
+- name: Set box version
+ set_fact:
+ box_version: "{{ version_string.stdout.split('-')[2][0:8] }}.{{ version_string.stdout.split('-')[2][8:10] }}.{{ version_string.stdout.split('-')[2][10:12] }}"
+ when: vyos_images_dir is defined and vyos_vagrant_box_base_url is defined
+- name: Create the box version
+ uri:
+ url: "https://app.vagrantup.com/api/v1/box/{{ vyos_vagrant_box_name }}/versions?access_token={{ vyos_vagrant_cloud_access_token }}"
+ method: POST
+ body: "version[version]={{ box_version }}"
+ status_code: 201
+ when: vyos_images_dir is defined and vyos_vagrant_box_base_url is defined and vyos_vagrant_cloud_access_token is defined
+- name: Create the box provider
+ uri:
+ url: "https://app.vagrantup.com/api/v1/box/{{ vyos_vagrant_box_name }}/version/{{ box_version }}/providers?access_token={{ vyos_vagrant_cloud_access_token }}"
+ method: POST
+ body: "provider[name]=libvirt&provider[url]={{ vyos_vagrant_box_base_url }}/vyos-{{ version_string.stdout }}-vagrant-libvirt.box"
+ status_code: 201
+ when: vyos_images_dir is defined and vyos_vagrant_box_base_url is defined and vyos_vagrant_cloud_access_token is defined
+- name: Release the box
+ uri:
+ url: "https://app.vagrantup.com/api/v1/box/{{ vyos_vagrant_box_name }}/version/{{ box_version }}/release?access_token={{ vyos_vagrant_cloud_access_token }}"
+ method: PUT
+ when: vyos_images_dir is defined and vyos_vagrant_box_base_url is defined and vyos_vagrant_cloud_access_token is defined