I need to install my ssh public key on a host.  I've got my public key checked 
into my source tree.  I don't want to hard-wire the location of my source tree, 
so I use lookup('pipe', 'hg root') to find the root of my tree and all my file 
references are relative to that.  So, I've got something like


  vars:
    local_base_dir: "{{ lookup('pipe', 'hg root') }}/.."
    path: "{{ local_base_dir }}/source/deploy/ansible/id_rsa.pub"
    ssh_key: "{{ lookup('file', path) }}"

  tasks:
  - name: add authorized ssh keys
    sudo: yes
    authorized_key: user=xxx key="{{ ssh_key }}"


This works, but it seems needlessly complicated.  Is there some way to avoid 
having to generate the temporary path and ssh_key variables?


--
Roy Smith
[email protected]

-- 
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/BA7D579C-CE60-4162-ADD3-F59FA4BFBDA8%40panix.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to