Use the latest version of the agent file, externalize common strings into var in defaults
This commit is contained in:
parent
46f25cf616
commit
383abb4458
@ -5,3 +5,5 @@ gpg_cache_ttl_ssh: 300
|
||||
# Array of all keygrips to pass to sshcontrol
|
||||
gpg_keygrips: []
|
||||
|
||||
gpg_folder: "~/.gnupg"
|
||||
|
||||
|
@ -1,14 +0,0 @@
|
||||
#!/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)
|
||||
|
@ -16,21 +16,26 @@
|
||||
- name: Configure gpg.conf (behaviour of gpg)
|
||||
template:
|
||||
src: gpg.conf.j2
|
||||
dest: ~/.gnupg/gpg.conf
|
||||
dest: "(( gpg_folder ))/gpg.conf"
|
||||
|
||||
- name: Configure gpg-agent.conf (agent configuration)
|
||||
template:
|
||||
src: gpg-agent.conf.j2
|
||||
dest: ~/.gnupg/gpg-agent.conf
|
||||
dest: "(( gpg_folder }}/gpg-agent.conf"
|
||||
|
||||
- name: Configure ssh-control (in order for gpg-agent to act as ssh-agent)
|
||||
template:
|
||||
src: sshcontrol.j2
|
||||
dest: ~/.gnupg/sshcontrol
|
||||
dest: "{{ gpg_folder }}/sshcontrol"
|
||||
|
||||
- name: Copy gnupg_agent script, which makes gpg-agent responsible for ssh-auth
|
||||
copy:
|
||||
src: "{{ role_path }}/files/gpg_agent"
|
||||
dest: ~/.gnupg/gpg_agent
|
||||
src: gpg_agent.j2
|
||||
dest: "{{ gpg_folder }}/gpg_agent"
|
||||
mode: 0700
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
#!/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)
|
||||
|
Loading…
Reference in New Issue
Block a user