Can you show me the output from when you are running:
- name: Add nagios ssh key
authorized_key: user=nagios key=“${nagios_public_key.stdout}” state=present
Since you have multiples in there it will obviously fail at the first one, and dare I say it, the quoting should be sufficient in your case so I don’t /quite/ think it’s failing in the way you specify