Skip to content

Instantly share code, notes, and snippets.

@ndobbs
Created December 6, 2013 22:36
Show Gist options
  • Save ndobbs/7833333 to your computer and use it in GitHub Desktop.
Save ndobbs/7833333 to your computer and use it in GitHub Desktop.
Ansible 'lookup' function
ansible_code:
- name: Pushing Authorized Keys to remote server(s)
action: authorized_key user={{ item }} key="{{ lookup('file', "{{ item }}/id_rsa.pub") }}"
with_items:
- '{{ admins }}'
output:
fatal: [54.201.43.177] => /Users/ndobbs/src/hc1dev/ansible/roles/common/files/{{item}}/id_rsa.pub does not exist
@drybjed
Copy link

drybjed commented Dec 6, 2013

- name: Pushing Authorized Keys to remote server(s)
  action: authorized_key user={{ item }} key="{{ lookup('file', "{{ item }}/id_rsa.pub") }}"
  with_items:
    - ${admins}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment