---
- name: Config files
- synchronize:
- recursive: yes
- archive: no
- checksum: yes
- src: gnupg
- dest: /$XDG_CONFIG_HOME/
+ copy:
+ src: "gnupg/{{ gnupg_config_item }}"
+ dest: "$XDG_CONFIG_HOME/gnupg/{{ gnupg_config_item }}"
+ loop:
+ - gpg-agent.conf
+ - gpg.conf
+ loop_control:
+ loop_var: gnupg_config_item
- name: Protect directory
file:
path: $XDG_CONFIG_HOME/gnupg
- notify add key to immae@immae.eu
- send key to immae@immae.eu
- notify add key to password store
+- meta: flush_handlers
- name: add keygrip to sshcontrol
lineinfile:
line: "{{ keygrip.stdout }}"
when: keygrip is defined and "stdout" in keygrip and keygrip.stdout != ""
notify:
- restart gpg-agent
+- meta: flush_handlers
- name: Override the gpg socket directory
block:
- name: Add systemd overrides
template:
- src: "systemd/{{ item }}.conf.j2"
- dest: "$XDG_CONFIG_HOME/systemd/user/{{ item }}.socket.d/override.conf"
+ src: "systemd/{{ systemd_item }}.conf.j2"
+ dest: "$XDG_CONFIG_HOME/systemd/user/{{ systemd_item }}.socket.d/override.conf"
register: results
loop:
- dirmngr
- 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: "{{ item }}.socket"
+ name: "{{ restart_systemd_item }}.socket"
loop: "{{ results.results|selectattr('changed')|map(attribute='item')|list }}"
-- name: clone password store
- register: clone_password_store
- shell: "cd $(dirname $ANSIBLE_CONFIG ); git submodule update --init password_store"
- changed_when: clone_password_store is defined and "stdout" in clone_password_store and clone_password_store.stdout != ""
+ loop_control:
+ loop_var: restart_systemd_item