]> git.immae.eu Git - perso/Immae/Config/Ansible.git/blob - roles/gnupg/tasks/main.yml
Validation initiale
[perso/Immae/Config/Ansible.git] / roles / gnupg / tasks / main.yml
1 ---
2 - name: Config files
3 synchronize:
4 recursive: yes
5 archive: no
6 checksum: yes
7 src: gnupg
8 dest: /$XDG_CONFIG_HOME/
9 - name: Protect directory
10 file:
11 path: $XDG_CONFIG_HOME/gnupg
12 state: directory
13 mode: 0700
14 - name: Get gnupg runtime folder name
15 shell: 'GNUPGHOME=$XDG_CONFIG_HOME/gnupg gpgconf --list-dirs socketdir | sed -e "s@$XDG_RUNTIME_DIR/gnupg/@@"'
16 register: gnupg_runtime_dir_cmd
17 - name: Add systemd overrides
18 template:
19 src: "systemd/{{ item }}.conf.j2"
20 dest: "$XDG_CONFIG_HOME/systemd/user/{{ item }}.socket.d/override.conf"
21 register: results
22 loop:
23 - dirmngr
24 - gpg-agent
25 - gpg-agent-browser
26 - gpg-agent-extra
27 - gpg-agent-ssh
28 - name: Restart systemd units
29 systemd:
30 daemon_reload: true
31 scope: user
32 state: restarted
33 name: "{{ item }}.socket"
34 loop: "{{ results.results|selectattr('changed')|map(attribute='item')|list }}"