Hi,

I am trying to provision a couple of hosts:
[masters]
master-1

[nodes]
node-1

Each host has an individual private key used to ssh to that particular 
server. I define ansible_ssh_private_key_file and store private keys on 
localhost: 
"./deployment/{{inventory_hostname}}/id_rsa"

In this example, there are two keys at the following locations:
./deployment/master-1/id_rsa
./deployment/node-1/id_rsa

I would like to execute a slurp task while on node-1. The task reads the 
contents of a file that resides on master-1:
- name: Read remote
  slurp:
    src: "/remote/file"
  register: remote_value
  run_once: true
  delegate_to: "{{ groups['masters'][0] }}"

At the moment the task fails saying it is unable to ssh to master-1. And 
that is correct, considering that ansible_ssh_private_key_file is resolved 
to ".../node-1/id_rsa".
How can I specify private key location for delegate_to: master-1 
(.../master-1/id_rsa)?

Thanks,
Gintas

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3af25ff0-51da-45a8-95e7-72d119731259%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to