linux-system-roles / nbde_client

Ansible role for configuring Network Bound Disk Encryption clients (e.g. clevis)
https://linux-system-roles.github.io/nbde_client/
MIT License
14 stars 24 forks source link

Fix nbde_client error handling #101

Closed richm closed 1 year ago

richm commented 1 year ago

Because the nbde_client role throws the error in a block/always, the error must be caught with rescue and rethrown. See https://richm.github.io/how-to-catch-and-reraise-errors-in-ansible

The sensitive field might be in a deeply nested data structure, so iterate through the data structure.

The re-raised error is not in ansible_failed_result it is in ansible_failed_result.msg