summaryrefslogtreecommitdiff
path: root/roles/release-vagrant-box/tasks/main.yml
blob: 9dcb1dea8a0cc06be730e01dba1e1ac352cf1794 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
- name: Relase Vagrant Box
  when: release
  block:
    - name: Check Vagrant Cloud login
      become: no
      command: "vagrant cloud auth login --check"

    - name: Set box version for rolling release
      set_fact:
        box_version: "{{ vyos_version.split('-')[2][0:8] }}.{{ vyos_version.split('-')[2][8:10] }}.{{ vyos_version.split('-')[2][10:12] }}"
      when: vyos_version.split("-") | length == 3

    - name: Set box version for epa and rc
      set_fact:
        box_version: "{{ vyos_version.split('-')[0] }}"
      when: vyos_version.split("-") | length == 2

    - name: Set box version for LTS release
      set_fact:
        box_version: "{{ vyos_version }}"
      when: vyos_version.split("-") | length == 1

    - name: Publish the Vagrant box
      become: no
      command: "vagrant cloud publish {{ vyos_vagrant_box_name }} {{ box_version }} {{ vagrant_provider }} {{ vyos_output_img }} --version-description \"VyOS {{ vyos_version }}\" --release --force"