diff options
author | Ismaël Bouya <ismael.bouya@fretlink.com> | 2018-11-13 01:50:44 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@fretlink.com> | 2018-11-13 01:50:44 +0100 |
commit | e1c588d325f33930d7a98eec97ec41caf6f3d468 (patch) | |
tree | 2a4c64fb04747eccdbcc731d5db11755f021d522 /roles/gnupg/tasks | |
parent | 675e56e525459262cb97a651c1d9e65cb5f37e2c (diff) | |
download | Ansible-e1c588d325f33930d7a98eec97ec41caf6f3d468.tar.gz Ansible-e1c588d325f33930d7a98eec97ec41caf6f3d468.tar.zst Ansible-e1c588d325f33930d7a98eec97ec41caf6f3d468.zip |
Cleanup item loop controls
Diffstat (limited to 'roles/gnupg/tasks')
-rw-r--r-- | roles/gnupg/tasks/main.yml | 20 |
1 files changed, 6 insertions, 14 deletions
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 | ||