]> git.immae.eu Git - perso/Immae/Config/Ansible.git/commitdiff
Cleanup item loop controls
authorIsmaël Bouya <ismael.bouya@fretlink.com>
Tue, 13 Nov 2018 00:50:44 +0000 (01:50 +0100)
committerIsmaël Bouya <ismael.bouya@fretlink.com>
Tue, 13 Nov 2018 00:50:44 +0000 (01:50 +0100)
roles/contexts/fretlink/tasks/main.yml
roles/git/tasks/main.yml
roles/gnupg/tasks/main.yml
roles/lxde/tasks/main.yml
roles/programming/haskell/tasks/main.yml
roles/tools/tasks/main.yml

index 085da83a30899cfc11ebeb8ad9455883e03e1f6b..4d8e48a8dba57179de5e3bf401e5ef1eb68aea82 100644 (file)
@@ -1,11 +1,13 @@
 ---
 - name: Import roles
   include_role:
-    name: "{{ item }}"
+    name: "{{ fretlink_import_item }}"
   loop:
     - programming/python
     - programming/haskell
     - programming/nodejs
+  loop_control:
+    loop_var: fretlink_import_item
 - name: Config dirs
   file:
     state: directory
index 853ecb28300e20c106ba6b7c88cd97b1e56da680..b847d1d327b5229c3c01c4123288d9b6fa567e0c 100644 (file)
@@ -9,13 +9,11 @@
 - name: Config files
   copy:
     mode: preserve
-    src: "config_files/{{ config_item }}"
-    dest: "$XDG_CONFIG_HOME/{{ config_item }}"
+    src: "config_files/{{ item }}"
+    dest: "$XDG_CONFIG_HOME/{{ item }}"
   loop:
     - tig/config
     - git/templates_fretlink/hooks/pre-push
-  loop_control:
-    loop_var: config_item
 - name: git config file
   template:
     src: config.j2
index 117ebf208b5f8366c38589f1500cdf11b914c492..bfbf31a0bcb5492d7aa6fed6797a510b6739dae8 100644 (file)
@@ -2,21 +2,17 @@
 - name: Config dirs
   file:
     state: directory
-    path: "$XDG_CONFIG_HOME/{{ gnupg_config_item }}"
+    path: "$XDG_CONFIG_HOME/{{ item }}"
     mode: 0700
   loop:
     - gnupg
-  loop_control:
-    loop_var: gnupg_config_item
 - name: Config files
   copy:
-    src: "gnupg/{{ gnupg_config_item }}"
-    dest: "$XDG_CONFIG_HOME/gnupg/{{ gnupg_config_item }}"
+    src: "gnupg/{{ item }}"
+    dest: "$XDG_CONFIG_HOME/gnupg/{{ item }}"
   loop:
     - gpg-agent.conf
     - gpg.conf
-  loop_control:
-    loop_var: gnupg_config_item
 - name: Get gnupg runtime folder name
   shell: 'gpgconf --list-dirs socketdir | sed -e "s@$XDG_RUNTIME_DIR/gnupg/@@"'
   register: gnupg_runtime_dir_cmd
@@ -85,8 +81,8 @@
   block:
     - name: Add systemd overrides
       template:
-        src: "systemd/{{ systemd_item }}.conf.j2"
-        dest: "$XDG_CONFIG_HOME/systemd/user/{{ systemd_item }}.socket.d/override.conf"
+        src: "systemd/{{ item }}.conf.j2"
+        dest: "$XDG_CONFIG_HOME/systemd/user/{{ item }}.socket.d/override.conf"
       register: results
       loop:
         - dirmngr
         - gpg-agent-browser
         - gpg-agent-extra
         - gpg-agent-ssh
-      loop_control:
-        loop_var: systemd_item
     - name: Restart systemd units
       systemd:
         daemon_reload: true
         scope: user
         state: restarted
-        name: "{{ restart_systemd_item }}.socket"
+        name: "{{ item }}.socket"
       loop: "{{ results.results|selectattr('changed')|map(attribute='item')|list }}"
-      loop_control:
-        loop_var: restart_systemd_item
index e7de7595bc338c3c9965407112cf459a35132f94..90dffbb13b1e5686f9a10856e20a934d6c334097 100644 (file)
@@ -18,8 +18,8 @@
 - name: Config files
   copy:
     mode: preserve
-    src: "config_files/{{ lxde_config_item }}"
-    dest: "$XDG_CONFIG_HOME/{{ lxde_config_item }}"
+    src: "config_files/{{ item }}"
+    dest: "$XDG_CONFIG_HOME/{{ item }}"
   loop:
     - libfm/libfm.conf
     - pcmanfm/LXDE/pcmanfm.conf
@@ -33,8 +33,6 @@
     - lxsession/LXDE/desktop.conf
     - gpicview/gpicview.conf
     - xinitrc
-  loop_control:
-    loop_var: lxde_config_item
 - name: pcmanfm destkop configuration
   ini_file:
     path: "$XDG_CONFIG_HOME/pcmanfm/LXDE/desktop-items-0.conf"
@@ -55,7 +53,6 @@
     - [ "show_documents", "0" ]
     - [ "show_trash", "1" ]
     - [ "show_mounts", "0" ]
-
 - name: lxmusic configuration
   ini_file:
     path: "$XDG_CONFIG_HOME/lxmusic/config"
index a3ed2a058de5202fb529ac78025d6c1156d44346..309d9e2bb29da5996978d93b4182d3a83538804c 100644 (file)
     dest: $HOME/.ghc/
 - name: Stack config files
   copy:
-    src: "stack/{{ stack_item }}"
-    dest: "$XDG_DATA_HOME/stack/{{ stack_item }}"
+    src: "stack/{{ item }}"
+    dest: "$XDG_DATA_HOME/stack/{{ item }}"
   loop:
     - config.yaml
     - global-project/README.txt
     - global-project/stack.yaml
-  loop_control:
-    loop_var: stack_item
index 94324fc87a2dca44cde4ab67dced97a5e91dd6dd..e9eb88713ef7ffa6e926fcbdfc6ba8099a6a2ad9 100644 (file)
@@ -1,10 +1,12 @@
 ---
 - name: Import other tools
   include_role:
-    name: "{{ item }}"
+    name: "{{ tool_import_item }}"
   loop:
     - git
     - gnupg
+  loop_control:
+    loop_var: tool_import_item
 - name: Config dirs
   file:
     state: directory