Hi All,
In my previous playbook, I had this:
``` - name: USERS | Authorized Key toevoegen aan ${item.username} action: authorized_key user=${item.username} key="$FILE(/etc/ansible/keys/${item.username}.pub)" with_items: $tomadmins when_set: $tomadmins tags: - tomadmins ```
Which worked perfectly.
Now I see this has changed, so I tried this:
- name: USERS | Authorized Key toevoegen aan ${item.username}
action: authorized_key user={{ item.username }} key=“{{ lookup(‘file’, ‘/etc/ansible/keys/{{ item.username }}.pub’) }}”
with_items: $tomadmins
tags:
- tomadmins
But now it comes with this error:
TASK: [USERS | Authorized Key toevoegen aan ${item.username}] *****************
fatal: [tom2prap03] => /etc/ansible/keys/{{item.username}}.pub does not exist
FATAL: all hosts have already failed – aborting
Any suggestions much apreciated.
Thanks,
Mark