summaryrefslogtreecommitdiff
path: root/roles/gnupg
diff options
context:
space:
mode:
Diffstat (limited to 'roles/gnupg')
-rw-r--r--roles/gnupg/tasks/main.yml26
1 files changed, 17 insertions, 9 deletions
diff --git a/roles/gnupg/tasks/main.yml b/roles/gnupg/tasks/main.yml
index 2bd1c79..183dd7d 100644
--- a/roles/gnupg/tasks/main.yml
+++ b/roles/gnupg/tasks/main.yml
@@ -1,11 +1,13 @@
1--- 1---
2- name: Config files 2- name: Config files
3 synchronize: 3 copy:
4 recursive: yes 4 src: "gnupg/{{ gnupg_config_item }}"
5 archive: no 5 dest: "$XDG_CONFIG_HOME/gnupg/{{ gnupg_config_item }}"
6 checksum: yes 6 loop:
7 src: gnupg 7 - gpg-agent.conf
8 dest: /$XDG_CONFIG_HOME/ 8 - gpg.conf
9 loop_control:
10 loop_var: gnupg_config_item
9- name: Protect directory 11- name: Protect directory
10 file: 12 file:
11 path: $XDG_CONFIG_HOME/gnupg 13 path: $XDG_CONFIG_HOME/gnupg
@@ -63,6 +65,7 @@
63 - notify add key to immae@immae.eu 65 - notify add key to immae@immae.eu
64 - send key to immae@immae.eu 66 - send key to immae@immae.eu
65 - notify add key to password store 67 - notify add key to password store
68- meta: flush_handlers
66- name: add keygrip to sshcontrol 69- name: add keygrip to sshcontrol
67 lineinfile: 70 lineinfile:
68 line: "{{ keygrip.stdout }}" 71 line: "{{ keygrip.stdout }}"
@@ -73,12 +76,13 @@
73 when: keygrip is defined and "stdout" in keygrip and keygrip.stdout != "" 76 when: keygrip is defined and "stdout" in keygrip and keygrip.stdout != ""
74 notify: 77 notify:
75 - restart gpg-agent 78 - restart gpg-agent
79- meta: flush_handlers
76- name: Override the gpg socket directory 80- name: Override the gpg socket directory
77 block: 81 block:
78 - name: Add systemd overrides 82 - name: Add systemd overrides
79 template: 83 template:
80 src: "systemd/{{ item }}.conf.j2" 84 src: "systemd/{{ systemd_item }}.conf.j2"
81 dest: "$XDG_CONFIG_HOME/systemd/user/{{ item }}.socket.d/override.conf" 85 dest: "$XDG_CONFIG_HOME/systemd/user/{{ systemd_item }}.socket.d/override.conf"
82 register: results 86 register: results
83 loop: 87 loop:
84 - dirmngr 88 - dirmngr
@@ -86,10 +90,14 @@
86 - gpg-agent-browser 90 - gpg-agent-browser
87 - gpg-agent-extra 91 - gpg-agent-extra
88 - gpg-agent-ssh 92 - gpg-agent-ssh
93 loop_control:
94 loop_var: systemd_item
89 - name: Restart systemd units 95 - name: Restart systemd units
90 systemd: 96 systemd:
91 daemon_reload: true 97 daemon_reload: true
92 scope: user 98 scope: user
93 state: restarted 99 state: restarted
94 name: "{{ item }}.socket" 100 name: "{{ restart_systemd_item }}.socket"
95 loop: "{{ results.results|selectattr('changed')|map(attribute='item')|list }}" 101 loop: "{{ results.results|selectattr('changed')|map(attribute='item')|list }}"
102 loop_control:
103 loop_var: restart_systemd_item