X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=roles%2Fgnupg%2Ftasks%2Fmain.yml;h=bfbf31a0bcb5492d7aa6fed6797a510b6739dae8;hb=e1c588d325f33930d7a98eec97ec41caf6f3d468;hp=a2b9aa6bd13553e5b3e9beaf40d2792bb2f6505d;hpb=cf86d448f96ede049c04d8165931f92a82f35956;p=perso%2FImmae%2FConfig%2FAnsible.git diff --git a/roles/gnupg/tasks/main.yml b/roles/gnupg/tasks/main.yml index a2b9aa6..bfbf31a 100644 --- a/roles/gnupg/tasks/main.yml +++ b/roles/gnupg/tasks/main.yml @@ -1,16 +1,18 @@ --- -- 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 + - 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 +65,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 +76,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 @@ -93,7 +97,3 @@ state: restarted name: "{{ 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 != ""