feat(gnupg): add role for configuring gnupg with support to act as an ssh agent

This commit is contained in:
2022-08-18 22:20:24 +02:00
parent dafac3472a
commit 8315d822ee
6 changed files with 148 additions and 0 deletions

View File

@ -0,0 +1,13 @@
#!/bin/bash
rc=$(pgrep gpg-agent)
if [ "$rc" != 0 ]; then
export GPG_AGENT_INFO
export SSH_AUTH_SOCK
export SSH_AGENT_PID
else
eval $(gpg-agent --daemon)
fi
gpg-connect-agent /bye
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)