---
{%- from "weather/map.jinja" import weather with context %}
weather-archive-extract:
  archive.extracted:
    - name: {{ weather.release_dir }}/weather-{{ weather.version }}
    - source: {{ weather.mirror }}/{{ weather.version }}/weather-{{ weather.version }}-{{ weather.os }}-{{ weather.arch }}.tar.gz
    - skip_verify: true
    - enforce_toplevel: false
    - if_missing: {{ weather.release_dir }}/weather-{{ weather.version }}

weather-binary-symlink:
  file.symlink:
    - name: {{ weather.install_dir }}/weather
    - target: {{ weather.release_dir }}/weather-{{ weather.version }}
    - require:
      - archive: weather-archive-extract