From e1c588d325f33930d7a98eec97ec41caf6f3d468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Tue, 13 Nov 2018 01:50:44 +0100 Subject: Cleanup item loop controls --- roles/contexts/fretlink/tasks/main.yml | 4 +++- roles/git/tasks/main.yml | 6 ++---- roles/gnupg/tasks/main.yml | 20 ++++++-------------- roles/lxde/tasks/main.yml | 7 ++----- roles/programming/haskell/tasks/main.yml | 6 ++---- roles/tools/tasks/main.yml | 4 +++- 6 files changed, 18 insertions(+), 29 deletions(-) diff --git a/roles/contexts/fretlink/tasks/main.yml b/roles/contexts/fretlink/tasks/main.yml index 085da83..4d8e48a 100644 --- a/roles/contexts/fretlink/tasks/main.yml +++ b/roles/contexts/fretlink/tasks/main.yml @@ -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 diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml index 853ecb2..b847d1d 100644 --- a/roles/git/tasks/main.yml +++ b/roles/git/tasks/main.yml @@ -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 diff --git a/roles/gnupg/tasks/main.yml b/roles/gnupg/tasks/main.yml index 117ebf2..bfbf31a 100644 --- a/roles/gnupg/tasks/main.yml +++ b/roles/gnupg/tasks/main.yml @@ -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 @@ -94,14 +90,10 @@ - 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 diff --git a/roles/lxde/tasks/main.yml b/roles/lxde/tasks/main.yml index e7de759..90dffbb 100644 --- a/roles/lxde/tasks/main.yml +++ b/roles/lxde/tasks/main.yml @@ -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" diff --git a/roles/programming/haskell/tasks/main.yml b/roles/programming/haskell/tasks/main.yml index a3ed2a0..309d9e2 100644 --- a/roles/programming/haskell/tasks/main.yml +++ b/roles/programming/haskell/tasks/main.yml @@ -12,11 +12,9 @@ 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 diff --git a/roles/tools/tasks/main.yml b/roles/tools/tasks/main.yml index 94324fc..e9eb887 100644 --- a/roles/tools/tasks/main.yml +++ b/roles/tools/tasks/main.yml @@ -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 -- cgit v1.2.3