From c76e96d1c148f57c0fbb7b68af5f67a30b8e8c1e Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Mon, 14 Sep 2020 10:04:10 +0200 Subject: [PATCH] Install pinentry-powershell to wsl --- roles/pinentry-wsl/tasks/main.yaml | 29 +++++++++++++++++++++++++++++ wsl-debian.yaml | 1 + 2 files changed, 30 insertions(+) create mode 100644 roles/pinentry-wsl/tasks/main.yaml diff --git a/roles/pinentry-wsl/tasks/main.yaml b/roles/pinentry-wsl/tasks/main.yaml new file mode 100644 index 0000000..64849ff --- /dev/null +++ b/roles/pinentry-wsl/tasks/main.yaml @@ -0,0 +1,29 @@ +--- +- name: ensure user/bin exists + become_user: "{{ account.name }}" + file: + path: "/home/{{ account.name }}/bin" + state: directory + mode: "0777" + +- name: download script + become_user: "{{ account.name }}" + 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: ensure gpg-agent is installed + apt: + name: gpg-agent + state: latest + +- name: enable script in gpg-agent + become_user: "{{ account.name }}" + lineinfile: + path: "/home/{{ account.name }}/.gnupg/gpg-agent.conf" + create: yes + regexp: "^pinentry-program" + line: "pinentry-program /home/{{ account.name }}/bin/pinentry-wsl-ps1.sh" + + diff --git a/wsl-debian.yaml b/wsl-debian.yaml index f531d60..2931a14 100644 --- a/wsl-debian.yaml +++ b/wsl-debian.yaml @@ -15,3 +15,4 @@ - zsh - neovim - tools + - pinentry-wsl