If the ssh-agent must be running for your installer to complete, then
you'll probably have to run it after the ssh-add:
- name: Add and load private key to ssh-agent* and start installer*
shell: "eval `ssh-agent -s` && ssh-add ~/.ssh/id_rsa* &&
/path/to/installer*"
My gut feeling is that
The "ssh-agent" and "ssh-add" are usually run on a system as a specific
user to add an SSH key to a temporary 'keychain' so any subsequent SSH
commands can automatically (and without prompting) use a specific ssh key
to connect to a second system.
When you run them in the Ansible "shell"
Hi Jonathan,
I use below task in my playbook,
- name: Add and load private key to ssh-agent
shell: "eval `ssh-agent -s` && ssh-add ~/.ssh/id_rsa"
When i run playbook no error found,
[image: image.png]
But I log in to my client machine and type "ssh-add -l" command then I get
below error
what exactly are you trying to accomplish?
On Sat, Sep 29, 2018 at 6:03 PM pranay varankar
wrote:
> Hi Jonathan,
>
> But which module I use to run *eval `ssh-agent -s` or ssh-add
> /root/bashrc.*
>
> *Shell/command/action/raw module to create task for above command*
>
>
> On Sun 30 Sep, 2018,
Hi Jonathan,
But which module I use to run *eval `ssh-agent -s` or ssh-add /root/bashrc.*
*Shell/command/action/raw module to create task for above command*
On Sun 30 Sep, 2018, 2:53 AM Jonathan Lozada De La Matta, <
jloza...@redhat.com> wrote:
> try
>
> ssh-agent bash
>
> then
>
> ssh-add
>
try
ssh-agent bash
then
ssh-add
On Sat, Sep 29, 2018 at 5:04 PM pranay varankar
wrote:
> Hi Jonathan,
>
> actually i m not getting error when i run playbook but after i will login
> to client machine and check using "ssh-add -l" command then i get "Could
> not open a connection to your
Hi Jonathan,
actually i m not getting error when i run playbook but after i will login
to client machine and check using "ssh-add -l" command then i get "Could
not open a connection to your authentication agent" error.
Can you send me task code to perform this operation.
On Sun, Sep 30, 2018
what error are you getting ?
On Sat, Sep 29, 2018 at 7:05 AM pranay varankar
wrote:
> Hi,
>
> I need to add ssh-agent for root user. so I use below command through
> ansible task but getting an error.
>
> *eval `ssh-agent -s` && ssh-add ~/.ssh/id_rsa"*
>
> please give me task to perform below
Hi,
I need to add ssh-agent for root user. so I use below command through
ansible task but getting an error.
*eval `ssh-agent -s` && ssh-add ~/.ssh/id_rsa"*
please give me task to perform below command on my target machine.
--
You received this message because you are subscribed to the