linux-system-roles / kdump

An ansible role which configures kdump
https://linux-system-roles.github.io/kdump/
MIT License
19 stars 20 forks source link

fix: Ensure authorized_keys management works with multiple hosts #165

Closed richm closed 1 year ago

richm commented 1 year ago

Cause: There was a race condition if multiple hosts tried to add a key to the authorized_keys file on kdump_ssh_server at the same time.

Consequence: A key added by one host could be overwritten by a key added by another host.

Fix: Use the lineinfile module to manage the file - this will ensure that checking for an existing key, and writing the new key, is done in one atomic operation on only one host at a time.

Result: A host cannot overwrite the value from another host, and adding keys is idempotent.

NOTE: You can use the play keyword serial: 1 to workaround this issue at the play level.

Signed-off-by: Rich Megginson rmeggins@redhat.com

richm commented 1 year ago

[citest]