Skip to content

exclusive + pubkey list results in only last key being added #7

@abeluck

Description

@abeluck

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 😢

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions