diff --git a/states/sublimetext/defaults.yaml b/states/sublimetext/defaults.yaml index 36866aa..d4581a6 100644 --- a/states/sublimetext/defaults.yaml +++ b/states/sublimetext/defaults.yaml @@ -1,6 +1,7 @@ --- sublimetext: fetch_url: https://paulbsd-pub.s3.fr-par.scw.cloud/sublimetext - archive_name: sublime_text_build_4107_x64.tar.bz2 + archive_name: sublime_text_build_4107_x64_activated.tar.bz2 install_dir: /opt install_subdir: sublime_text + keys_file: sublime_text_keys.txt diff --git a/states/sublimetext/init.sls b/states/sublimetext/init.sls index 43998fe..5d8d164 100644 --- a/states/sublimetext/init.sls +++ b/states/sublimetext/init.sls @@ -1,25 +1,29 @@ --- {%- from "sublimetext/map.jinja" import sublimetext with context %} -sublime-text-extract-archive: +sublimetext-extract-archive: archive.extracted: - name: {{ sublimetext.install_dir }} - source: {{ sublimetext.fetch_url }}/{{ sublimetext.archive_name }} - skip_verify: true + - options: xj + - list_options: bzcat - user: root - group: root - mode: 0755 - if_missing: {{ sublimetext.install_dir }}/{{ sublimetext.install_subdir }} -sublime-text-licence-key: +sublimetext-licence-key: file.managed: - - name: {{ sublimetext.install_dir }}/{{ sublimetext.install_subdir }}/sublime_text_keys.txt - - source: salt://sublimetext/sublime_text_keys.txt.j2 + - name: {{ sublimetext.install_dir }}/{{ sublimetext.install_subdir }}/{{ sublimetext.keys_file }} + - source: salt://sublimetext/{{ sublimetext.keys_file }} - template: jinja - user: root - group: root - mode: 0644 + - require: + - archive: sublimetext-extract-archive -sublime-text-desktop-entry: +sublimetext-desktop-entry: file.managed: - name: /usr/share/applications/sublime_text.desktop - source: salt://sublimetext/sublime_text.desktop.j2 @@ -27,11 +31,15 @@ sublime-text-desktop-entry: - user: root - group: root - mode: 0644 + - require: + - archive: sublimetext-extract-archive -sublime-text-symlink: +sublimetext-symlink: file.symlink: - name: /usr/bin/sublime_text - target: {{ sublimetext.install_dir }}/{{ sublimetext.install_subdir }}/sublime_text - user: root - group: root - - mode: 0755 \ No newline at end of file + - mode: 0755 + - require: + - archive: sublimetext-extract-archive \ No newline at end of file