summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@fretlink.com>2018-11-13 01:50:44 +0100
committerIsmaël Bouya <ismael.bouya@fretlink.com>2018-11-13 01:50:44 +0100
commite1c588d325f33930d7a98eec97ec41caf6f3d468 (patch)
tree2a4c64fb04747eccdbcc731d5db11755f021d522
parent675e56e525459262cb97a651c1d9e65cb5f37e2c (diff)
downloadAnsible-e1c588d325f33930d7a98eec97ec41caf6f3d468.tar.gz
Ansible-e1c588d325f33930d7a98eec97ec41caf6f3d468.tar.zst
Ansible-e1c588d325f33930d7a98eec97ec41caf6f3d468.zip
Cleanup item loop controls
-rw-r--r--roles/contexts/fretlink/tasks/main.yml4
-rw-r--r--roles/git/tasks/main.yml6
-rw-r--r--roles/gnupg/tasks/main.yml20
-rw-r--r--roles/lxde/tasks/main.yml7
-rw-r--r--roles/programming/haskell/tasks/main.yml6
-rw-r--r--roles/tools/tasks/main.yml4
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 @@
1--- 1---
2- name: Import roles 2- name: Import roles
3 include_role: 3 include_role:
4 name: "{{ item }}" 4 name: "{{ fretlink_import_item }}"
5 loop: 5 loop:
6 - programming/python 6 - programming/python
7 - programming/haskell 7 - programming/haskell
8 - programming/nodejs 8 - programming/nodejs
9 loop_control:
10 loop_var: fretlink_import_item
9- name: Config dirs 11- name: Config dirs
10 file: 12 file:
11 state: directory 13 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 @@
9- name: Config files 9- name: Config files
10 copy: 10 copy:
11 mode: preserve 11 mode: preserve
12 src: "config_files/{{ config_item }}" 12 src: "config_files/{{ item }}"
13 dest: "$XDG_CONFIG_HOME/{{ config_item }}" 13 dest: "$XDG_CONFIG_HOME/{{ item }}"
14 loop: 14 loop:
15 - tig/config 15 - tig/config
16 - git/templates_fretlink/hooks/pre-push 16 - git/templates_fretlink/hooks/pre-push
17 loop_control:
18 loop_var: config_item
19- name: git config file 17- name: git config file
20 template: 18 template:
21 src: config.j2 19 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 @@
2- name: Config dirs 2- name: Config dirs
3 file: 3 file:
4 state: directory 4 state: directory
5 path: "$XDG_CONFIG_HOME/{{ gnupg_config_item }}" 5 path: "$XDG_CONFIG_HOME/{{ item }}"
6 mode: 0700 6 mode: 0700
7 loop: 7 loop:
8 - gnupg 8 - gnupg
9 loop_control:
10 loop_var: gnupg_config_item
11- name: Config files 9- name: Config files
12 copy: 10 copy:
13 src: "gnupg/{{ gnupg_config_item }}" 11 src: "gnupg/{{ item }}"
14 dest: "$XDG_CONFIG_HOME/gnupg/{{ gnupg_config_item }}" 12 dest: "$XDG_CONFIG_HOME/gnupg/{{ item }}"
15 loop: 13 loop:
16 - gpg-agent.conf 14 - gpg-agent.conf
17 - gpg.conf 15 - gpg.conf
18 loop_control:
19 loop_var: gnupg_config_item
20- name: Get gnupg runtime folder name 16- name: Get gnupg runtime folder name
21 shell: 'gpgconf --list-dirs socketdir | sed -e "s@$XDG_RUNTIME_DIR/gnupg/@@"' 17 shell: 'gpgconf --list-dirs socketdir | sed -e "s@$XDG_RUNTIME_DIR/gnupg/@@"'
22 register: gnupg_runtime_dir_cmd 18 register: gnupg_runtime_dir_cmd
@@ -85,8 +81,8 @@
85 block: 81 block:
86 - name: Add systemd overrides 82 - name: Add systemd overrides
87 template: 83 template:
88 src: "systemd/{{ systemd_item }}.conf.j2" 84 src: "systemd/{{ item }}.conf.j2"
89 dest: "$XDG_CONFIG_HOME/systemd/user/{{ systemd_item }}.socket.d/override.conf" 85 dest: "$XDG_CONFIG_HOME/systemd/user/{{ item }}.socket.d/override.conf"
90 register: results 86 register: results
91 loop: 87 loop:
92 - dirmngr 88 - dirmngr
@@ -94,14 +90,10 @@
94 - gpg-agent-browser 90 - gpg-agent-browser
95 - gpg-agent-extra 91 - gpg-agent-extra
96 - gpg-agent-ssh 92 - gpg-agent-ssh
97 loop_control:
98 loop_var: systemd_item
99 - name: Restart systemd units 93 - name: Restart systemd units
100 systemd: 94 systemd:
101 daemon_reload: true 95 daemon_reload: true
102 scope: user 96 scope: user
103 state: restarted 97 state: restarted
104 name: "{{ restart_systemd_item }}.socket" 98 name: "{{ item }}.socket"
105 loop: "{{ results.results|selectattr('changed')|map(attribute='item')|list }}" 99 loop: "{{ results.results|selectattr('changed')|map(attribute='item')|list }}"
106 loop_control:
107 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 @@
18- name: Config files 18- name: Config files
19 copy: 19 copy:
20 mode: preserve 20 mode: preserve
21 src: "config_files/{{ lxde_config_item }}" 21 src: "config_files/{{ item }}"
22 dest: "$XDG_CONFIG_HOME/{{ lxde_config_item }}" 22 dest: "$XDG_CONFIG_HOME/{{ item }}"
23 loop: 23 loop:
24 - libfm/libfm.conf 24 - libfm/libfm.conf
25 - pcmanfm/LXDE/pcmanfm.conf 25 - pcmanfm/LXDE/pcmanfm.conf
@@ -33,8 +33,6 @@
33 - lxsession/LXDE/desktop.conf 33 - lxsession/LXDE/desktop.conf
34 - gpicview/gpicview.conf 34 - gpicview/gpicview.conf
35 - xinitrc 35 - xinitrc
36 loop_control:
37 loop_var: lxde_config_item
38- name: pcmanfm destkop configuration 36- name: pcmanfm destkop configuration
39 ini_file: 37 ini_file:
40 path: "$XDG_CONFIG_HOME/pcmanfm/LXDE/desktop-items-0.conf" 38 path: "$XDG_CONFIG_HOME/pcmanfm/LXDE/desktop-items-0.conf"
@@ -55,7 +53,6 @@
55 - [ "show_documents", "0" ] 53 - [ "show_documents", "0" ]
56 - [ "show_trash", "1" ] 54 - [ "show_trash", "1" ]
57 - [ "show_mounts", "0" ] 55 - [ "show_mounts", "0" ]
58
59- name: lxmusic configuration 56- name: lxmusic configuration
60 ini_file: 57 ini_file:
61 path: "$XDG_CONFIG_HOME/lxmusic/config" 58 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 @@
12 dest: $HOME/.ghc/ 12 dest: $HOME/.ghc/
13- name: Stack config files 13- name: Stack config files
14 copy: 14 copy:
15 src: "stack/{{ stack_item }}" 15 src: "stack/{{ item }}"
16 dest: "$XDG_DATA_HOME/stack/{{ stack_item }}" 16 dest: "$XDG_DATA_HOME/stack/{{ item }}"
17 loop: 17 loop:
18 - config.yaml 18 - config.yaml
19 - global-project/README.txt 19 - global-project/README.txt
20 - global-project/stack.yaml 20 - global-project/stack.yaml
21 loop_control:
22 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 @@
1--- 1---
2- name: Import other tools 2- name: Import other tools
3 include_role: 3 include_role:
4 name: "{{ item }}" 4 name: "{{ tool_import_item }}"
5 loop: 5 loop:
6 - git 6 - git
7 - gnupg 7 - gnupg
8 loop_control:
9 loop_var: tool_import_item
8- name: Config dirs 10- name: Config dirs
9 file: 11 file:
10 state: directory 12 state: directory