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