This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
ansible-machine-setup/roles/pinentry-wsl/tasks/main.yaml

42 lines
1.1 KiB
YAML
Raw Permalink Normal View History

2020-09-14 08:04:10 +00:00
---
- name: ensure user/bin exists
become_user: "{{ account.name }}"
file:
path: "/home/{{ account.name }}/bin"
state: directory
2020-11-12 10:29:33 +00:00
mode: "0744"
2020-09-14 08:04:10 +00:00
- 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"
2020-09-30 06:34:32 +00:00
- name: enable session persistence
become_user: "{{ account.name }}"
lineinfile:
path: "/home/{{ account.name }}/bin/pinentry-wsl-ps1.sh"
regexp: "^PERSISTENCE="
2020-11-12 10:42:28 +00:00
line: "PERSISTENCE=\"Session\""
2020-09-30 06:34:32 +00:00
2020-09-14 08:04:10 +00:00
- name: ensure gpg-agent is installed
apt:
name: gpg-agent
state: latest
2020-11-12 10:29:33 +00:00
- name: ensure user/.gnupg exists
become_user: "{{ account.name }}"
file:
path: "/home/{{ account.name }}/.gnupg"
state: directory
mode: "0700"
2020-09-14 08:04:10 +00:00
- 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"