I have a task with run_once:true , which must run only on the first host
and I need to use that hostname into a lookup file , something like this:

-


* name: Print facts  debug:    var: ansible_nodename  register: admin_host*







*- name: Set authorized key took from file  become: yes  authorized_key:
user: root    state: present    key: "{{ lookup('file',
'/git/cephprep/files/{{ admin_host }}/root/.ssh/id_rsa.pub') }}"*

Just this way it's not working

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAOK917Q5HzMVG6rqapa3hNeQTPj79tfjUBtARt9Qm0MH5r%3DVJA%40mail.gmail.com.

Reply via email to