]> git.immae.eu Git - perso/Immae/Config/Ansible.git/blobdiff - roles/gnupg/tasks/main.yml
Change gpg sign id
[perso/Immae/Config/Ansible.git] / roles / gnupg / tasks / main.yml
index 2bd1c79ad7e0cfd8ded167909214c8acc4f33bc9..5139beffbf003fa0bee15748b4001f636ca5718d 100644 (file)
@@ -1,16 +1,21 @@
 ---
-- name: Config files
-  synchronize:
-    recursive: yes
-    archive: no
-    checksum: yes
-    src: gnupg
-    dest: /$XDG_CONFIG_HOME/
-- name: Protect directory
+- name: Config dirs
   file:
-    path: $XDG_CONFIG_HOME/gnupg
     state: directory
+    path: "$XDG_CONFIG_HOME/{{ item }}"
     mode: 0700
+  loop:
+    - gnupg
+- name: Config files
+  copy:
+    src: "gnupg/{{ item }}"
+    dest: "$XDG_CONFIG_HOME/gnupg/{{ item }}"
+  loop:
+    - gpg-agent.conf
+- name: gpg config file
+  template:
+    src: "gpg.conf.j2"
+    dest: "$XDG_CONFIG_HOME/gnupg/gpg.conf"
 - name: Get gnupg runtime folder name
   shell: 'gpgconf --list-dirs socketdir | sed -e "s@$XDG_RUNTIME_DIR/gnupg/@@"'
   register: gnupg_runtime_dir_cmd
@@ -63,6 +68,7 @@
     - 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 }}"
@@ -73,6 +79,7 @@
   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