diff options
author | Yuya Kusakabe <yuya.kusakabe@gmail.com> | 2018-07-03 17:39:45 +0900 |
---|---|---|
committer | Yuya Kusakabe <yuya.kusakabe@gmail.com> | 2018-07-03 17:39:45 +0900 |
commit | 33f18761adb0fb473865fcb1bac65df4ed2c910f (patch) | |
tree | 9cd278421a59aa6ec2c00bfc109b4a0281eb5950 | |
parent | 24415f2f75f9caf49108e89723b0991a378255d9 (diff) | |
download | vyos-vm-images-33f18761adb0fb473865fcb1bac65df4ed2c910f.tar.gz vyos-vm-images-33f18761adb0fb473865fcb1bac65df4ed2c910f.zip |
Add release-vagrant-libvirt-box role
-rw-r--r-- | roles/release-vagrant-libvirt-box/tasks/main.yml | 21 | ||||
-rw-r--r-- | vagrant-libvirt.yml | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/roles/release-vagrant-libvirt-box/tasks/main.yml b/roles/release-vagrant-libvirt-box/tasks/main.yml new file mode 100644 index 0000000..567aea5 --- /dev/null +++ b/roles/release-vagrant-libvirt-box/tasks/main.yml @@ -0,0 +1,21 @@ +- name: Set box version + set_fact: + box_version: "{{ vyos_version.split('-')[2][0:8] }}.{{ vyos_version.split('-')[2][8:10] }}.{{ vyos_version.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 }}" + 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-{{ vyos_version }}-vagrant-libvirt.box" + 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 diff --git a/vagrant-libvirt.yml b/vagrant-libvirt.yml index c7ea6c7..81d8e53 100644 --- a/vagrant-libvirt.yml +++ b/vagrant-libvirt.yml @@ -25,3 +25,4 @@ - unmount-all - vagrant-libvirt-box - release + - release-vagrant-libvirt-box |