I’m using Ansible 1.5.3 and Git with ssh agent forwarding (https://help.github.com/articles/using-ssh-agent-forwarding). I can log into the server that I am managing with A
To expand on @j.freckle's answer, the ansible way to change sudoers file is:
- name: Add ssh agent line to sudoers lineinfile: dest: /etc/sudoers state: present regexp: SSH_AUTH_SOCK line: Defaults env_keep += "SSH_AUTH_SOCK"