I’d like to do something like the following, but I couldn’t find anything in the docs or on the mailing list that made it clear whether this should be possible or not:
---
- name: add user keys from GitHub
authorized_key:
user: "{{item.user}}"
key: "{{item.ssh_public_key | default(\"https://github.myenterprise.com/{{item.user}}.keys\")}}"
with_items: users
When I tried to do this, I got an error message about not being able to fetch the key:
msg: Error getting key from: https://github.myenterprise.com/{# item.user #}.keys
I tried both escaping the default value with \"
and using '
, but got the same error each time.
Thanks!
-md