I'm giving ansible a try, and it seems the examples aren't quite right - using authorized_keys as a starting point:
# cat e.yml
- name: Set authorized key took from file
authorized_key:
user: charlie
state: present
key: "{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}"
# ansible-playbook e.yml
ERROR! 'authorized_key' is not a valid attribute for a Play
The error appears to have been in '/etc/ansible/e.yml': line 1, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: Set authorized key took from file
^ here
I use a yaml syntax validator, which didn't like the comment after name: but removing that doesn't change anything.