variable interpolation does not work when name is not used but does otherwise

#- name: user authorized_keys

  • authorized_key: user=${item} key=‘$FILE(${playbook_files_private}/keys/${item}_id_rsa.pub)’
    with_items: $shell_accounts
    tags:
  • user

the config above yields:
ERROR: /etc/ansible/files_private/keys/_id_rsa.pub does not exist

James Nguyễn wrote:

#- name: user authorized_keys
- authorized_key: user=${item}
key='$FILE(${playbook_files_private}/keys/${item}_id_rsa.pub)'
  with_items: $shell_accounts
  tags:
  - user

the config above yields:
ERROR: /etc/ansible/files_private/keys/_id_rsa.pub does not exist

What version of ansible? This should be fixed by 3a36c02.

Daniel

You’re right. I was using an older version. Verified and working now with the latest ansible pull.

Thanks!