paulbsd-salt/states/arduino/init.sls

40 lines
1.2 KiB
Plaintext

---
{%- from "arduino/map.jinja" import arduino with context %}
{%- if not salt['file.directory_exists']( arduino.install_dir + '/arduino-' + arduino.version ) %}
arduino-archive-extract:
archive.extracted:
- name: {{ arduino.install_dir }}
- source: {{ arduino.mirror }}/arduino-{{ arduino.version }}-{{ arduino.arch }}.tar.xz
- skip_verify: true
- archive_format: tar
- keep: true
- if_missing: {{ arduino.install_dir }}/arduino-{{ arduino.version }}
arduino-symlink:
file.symlink:
- name: {{ arduino.install_dir }}/arduino
- target: {{ arduino.install_dir }}/arduino-{{ arduino.version }}
- force: true
- onchanges:
- arduino-archive-extract
arduino-bin-symlink:
file.symlink:
- name: /usr/bin/arduino
- target: {{ arduino.install_dir }}/arduino-{{ arduino.version }}/arduino
- force: true
- onchanges:
- arduino-archive-extract
arduino-shortcut:
file.managed:
- name: /usr/share/applications/arduino-arduinoide.desktop
- source: salt://arduino/arduino-arduinoide.desktop.j2
- template: jinja
- user: root
- group: root
- mode: 644
- onchanges:
- arduino-archive-extract
- arduino-symlink
{%- endif %}