When you specify a list of pubkeys for a single user:
- username: admin
exclusive: true
pubkey:
- "ssh-rsa ..."
- "ssh-dsa ..."
only the final key is kept, the others are discarded.
As per the authorized_key docs
Multiple keys can be specified in a single key string value by separating them by newlines.
This option is not loop aware, so if you use with_ , it will be exclusive per iteration of the loop.
If you want multiple keys in the file you need to pass them all to key in a single batch as mentioned above.
(emphasis added)
Locked myself out of a couple of dev machines 😢