Skip to content

Add luksDump to the luks_device module to speed up playbooks #893

@RobVerduijn

Description

@RobVerduijn

Hello,

I think it would be very usefull if the luks_device module could do a luksDump of a luks block device

SUMMARY

cryptsetup luksDump /dev/ gives a lot of usefull information about the device.

By being able to do a luksDump of a device it would become a lot simpler to check all kinds of settings on a device without having to wait on multiple slow queries to the luksdevice.
All the data would become available with only one task.

I then can decide on the output of that task if I need to call other tasks to do the very slow checks if certain settings are set.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

community.crypto.luks_device:
device: /dev/sda1
state: dump
passphrase: secret
register: luksdevice_results

ADDITIONAL INFORMATION

It would reduce the playbook runtime by eliminating the need for multiple time consuming tasks because we can decide on the information gathered by luksDump.
It would be nice if the output would be parsed by the module and returned in a nice json/yaml style,
as it is done by the command 'cryptsetup luksDump /dev/nvme0n1p4 --dump-json-metadata'

yeah I know its trivial to do 2 tasks like

- name: luksDump
  ansible.builtin.command: cryptsetup luksDump /dev/nvme0n1p4 --dump-json-metadata
  register:  commandoutput

 - name: Debug
    ansible.builtin.set_fact:
       luksdump: commandoutput['result'] | from_json

this requires 2 tasks
and will not pass ansible lint without a lot of extra code
(skip_ansible_lint is a statement that will bite you in the future and you can go and figure out what in the blazes you we're thinking when you wrote that play)

community.crypto.luks_device:
  device: /dev/sda1
  state: dump
  passphrase: secret
register: my_luksdevice

ansible.builtin.debug:
   var: my_luksdevice

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions