From 68572bce0883fdc649fb44ee7425336b7769b818 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Sun, 11 Jul 2021 17:29:46 +0200 Subject: [PATCH] updated molotov state --- states/molotov/init.sls | 23 ++++++++++++++++++----- states/molotov/molotov.desktop.j2 | 2 +- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/states/molotov/init.sls b/states/molotov/init.sls index c6d1b93..5e101e8 100644 --- a/states/molotov/init.sls +++ b/states/molotov/init.sls @@ -1,14 +1,23 @@ --- -{%- if not salt['file.file_exists']( salt['pillar.get']('molotov:dest_path') ) or not salt['file.check_hash']( salt['pillar.get']('molotov:dest_path'), salt['pillar.get']('molotov:file_sha256sum') ) %} molotov-install: file.managed: - - name: {{ salt['pillar.get']('molotov:dest_path') }} - - source: {{ salt['pillar.get']('molotov:url') }}/{{ salt['pillar.get']('molotov:file') }} - - source_hash: sha256={{ salt['pillar.get']('molotov:file_sha256sum') }} + - name: {{ salt['pillar.get']('molotov:dest_path') }}/molotov.{{ salt['pillar.get']('molotov:version') }} + - source: {{ salt['pillar.get']('molotov:url') }}/{{ salt['pillar.get']('molotov:version') }}/{{ salt['pillar.get']('molotov:file') }} + - skip_verify: true - user: root - group: root - mode: 755 -{%- endif %} + - if_missing: {{ salt['pillar.get']('molotov:dest_path') }}/molotov.{{ salt['pillar.get']('molotov:version') }} + +molotov-symlink: + file.symlink: + - name: {{ salt['pillar.get']('molotov:dest_path') }}/molotov + - target: {{ salt['pillar.get']('molotov:dest_path') }}/molotov.{{ salt['pillar.get']('molotov:version') }} + - user: root + - group: root + - mode: 755 + - require: + - file: molotov-install molotov-icon: file.managed: @@ -17,6 +26,8 @@ molotov-icon: - user: root - group: root - mode: 644 + - require: + - file: molotov-install molotov-desktop-entry: file.managed: @@ -26,3 +37,5 @@ molotov-desktop-entry: - user: root - group: root - mode: 644 + - require: + - file: molotov-install diff --git a/states/molotov/molotov.desktop.j2 b/states/molotov/molotov.desktop.j2 index fb2b48f..ddd45de 100644 --- a/states/molotov/molotov.desktop.j2 +++ b/states/molotov/molotov.desktop.j2 @@ -3,7 +3,7 @@ Name=Molotov Encoding=UTF-8 Version=1.0 Comment=The app to watch TV, for free -Exec={{ salt['pillar.get']('molotov:dest_path') }} +Exec={{ salt['pillar.get']('molotov:dest_path') }}/molotov Icon=/usr/share/icons/molotov.png Terminal=false StartupWMClass=Molotov