---
- name: ensure user/bin exists
become_user: "{{ account.name }}"
file:
path: "/home/{{ account.name }}/bin"
state: directory
mode: "0744"
- name: download script
get_url:
url: https://github.com/diablodale/pinentry-wsl-ps1/raw/master/pinentry-wsl-ps1.sh
dest: "/home/{{ account.name }}/bin/pinentry-wsl-ps1.sh"
mode: "0755"
- name: enable session persistence
lineinfile:
path: "/home/{{ account.name }}/bin/pinentry-wsl-ps1.sh"
regexp: "^PERSISTENCE="
line: "PERSISTENCE=\"Session\""
- name: ensure gpg-agent is installed
apt:
name: gpg-agent
state: latest
- name: ensure user/.gnupg exists
path: "/home/{{ account.name }}/.gnupg"
mode: "0700"
- name: enable script in gpg-agent
path: "/home/{{ account.name }}/.gnupg/gpg-agent.conf"
create: yes
regexp: "^pinentry-program"
line: "pinentry-program /home/{{ account.name }}/bin/pinentry-wsl-ps1.sh"