]> git.immae.eu Git - perso/Immae/Config/Ansible.git/commitdiff
Add zeal docsets
authorIsmaël Bouya <ismael.bouya@fretlink.com>
Sun, 11 Nov 2018 16:08:37 +0000 (17:08 +0100)
committerIsmaël Bouya <ismael.bouya@fretlink.com>
Sun, 11 Nov 2018 17:25:58 +0000 (18:25 +0100)
roles/contexts/fretlink/defaults/main.yml [new file with mode: 0644]
roles/contexts/fretlink/tasks/main.yml
roles/init/templates/pam_environment.j2
site.yml

diff --git a/roles/contexts/fretlink/defaults/main.yml b/roles/contexts/fretlink/defaults/main.yml
new file mode 100644 (file)
index 0000000..ee9836f
--- /dev/null
@@ -0,0 +1,15 @@
+---
+zeal_roles:
+  - Ansible
+  - Bash
+  - Docker
+  - Haskell
+  - MongoDB
+  - NodeJS
+  - PostgreSQL
+  - Puppet
+  - React
+  - Redis
+  - Rust
+  - Vim
+  - XSLT
index 07861ed2a5e5901ba5e7b14c607e8edeed46164b..78f733a43cc12805047cca1f6f6721561af09c6a 100644 (file)
     - [ "docsets", "path", "{{ lookup('env', 'XDG_DATA_HOME') }}/Zeal/Zeal/docsets" ]
     - [ "search", "fuzzy_search_enabled", "false" ]
     - [ "tabs", "open_new_tab_after_active", "false" ]
+- name: Zeal docsets
+  block:
+    - name: Check missing Zeal docsets
+      register: zeal_missing_docsets
+      shell: "for i in {{ zeal_roles | join(' ') }}; do [ -d $XDG_DATA_HOME/Zeal/Zeal/docsets/$i.docset ] || echo $i; done"
+      changed_when: zeal_missing_docsets.stdout != ""
+      check_mode: no
+    - name: Ask for Zeal docsets
+      when: zeal_missing_docsets.stdout != ""
+      pause:
+        prompt: "install Zeal docsets ? [y/N]"
+      register: zeal_install_docsets
+      check_mode: no
+    - name: Zeal docsets
+      when: zeal_missing_docsets.stdout != "" and zeal_install_docsets.user_input.startswith("y")
+      shell: "dasht-docsets-install {{ item }}"
+      args:
+        creates: "$XDG_DATA_HOME/Zeal/Zeal/docsets/{{ item }}.docset"
+      loop: "{{ zeal_missing_docsets.stdout.split('\n') }}"
 - name: Create pm2 config dir
   file:
     path: $XDG_CONFIG_HOME/pm2
index fc65a10cd13f92f7f5a8c0c8b3a4010461b5bdd4..3b8e96e074d6d6d153cac4e8416bf801b9d347bb 100644 (file)
@@ -65,6 +65,9 @@ NPM_CONFIG_USERCONFIG         DEFAULT="${XDG_CONFIG_HOME}/npm/npmrc"
 # TMUX
 TMUX_TMPDIR                    DEFAULT="${XDG_RUNTIME_DIR}"
 
+# Zeal
+DASHT_DOCSETS_DIR              DEFAULT="${XDG_DATA_HOME}/Zeal/Zeal/docsets/"
+
 # node_modules/pm2/paths.js
 PM2_HOME                       DEFAULT="${XDG_DATA_HOME}/pm2"
 PM2_CONF_FILE                  DEFAULT="${XDG_CONFIG_HOME}/pm2/conf.js"
index 87f4858d8f1245378023081f2198e02d7af9d4a1..28a64edf931d2147160aee990f9705df8051eb92 100644 (file)
--- a/site.yml
+++ b/site.yml
@@ -22,4 +22,5 @@
     - tools
     - gnupg
     - cron
-    - contexts/fretlink
+    - role: contexts/fretlink
+      tags: ["fretlink"]