Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luks_device: can't use device name "crypt00", see issue #409 #817

Open
inflatador opened this issue Nov 17, 2024 · 2 comments
Open

luks_device: can't use device name "crypt00", see issue #409 #817

inflatador opened this issue Nov 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@inflatador
Copy link

SUMMARY

If I try to run luks_device against an already-open luks device named 'crypt00', I get a failure.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.crypto.luks_device

ANSIBLE VERSION
ansible [core 2.17.6]
  config file = /Users/user/.ansible.cfg
  configured module search path = ['/Users/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/user/venvs/P311/lib/python3.11/site-packages/ansible
  ansible collection location = /Users/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/user/venvs/P311/bin/ansible
  python version = 3.11.9 (main, Apr  4 2024, 00:14:24) [Clang 9.1.0 (clang-902.0.39.2)] (/Users/user/venvs/P311/bin/python)
  jinja version = 3.1.3
  libyaml = True
COLLECTION VERSION

-->

# /Users/user/.ansible/collections/ansible_collections
Collection       Version
---------------- -------
community.crypto 2.22.3

# /Users/user/venvs/P311/lib/python3.11/site-packages/ansible_collections
Collection       Version
---------------- -------
community.crypto 2.22.3
CONFIGURATION
CACHE_PLUGIN(/Users/user/.ansible.cfg) = jsonfile
CACHE_PLUGIN_CONNECTION(/Users/user/.ansible.cfg) = /tmp/ansible/facts_cache
CACHE_PLUGIN_TIMEOUT(/Users/user/.ansible.cfg) = 129600
CALLBACKS_ENABLED(/Users/user/.ansible.cfg) = ['ansible.posix.timer']
CONFIG_FILE() = /Users/user/.ansible.cfg
DEFAULT_HOST_LIST(/Users/user/.ansible.cfg) = ['/Users/user/code/riichilab/ansible-roles/hosts.ini']
DEFAULT_LOG_PATH(/Users/user/.ansible.cfg) = /Users/user/.ansible/var/log/ansible.log
DEFAULT_VAULT_IDENTITY_LIST(/Users/user/.ansible.cfg) = ['riichi@~/.ansible/vault', 'mir@~/.ansible/makeitrepeatable']
DEPRECATION_WARNINGS(/Users/user/.ansible.cfg) = False
OS / ENVIRONMENT

controller: MacOS
host: Debian Bookworm

STEPS TO REPRODUCE

If I try to run luks_device against an already-open luks device named 'crypt00', I get a failure.

- name: Ensure encrypted disk is open
  community.crypto.luks_device:
    device: '/dev/sda'
    name: 'crypt00'
    state: 'opened'
    passphrase: "{{ luks_pw }}"

EXPECTED RESULTS

an "ok" response from ansible, indicating that the device is already open and no actions will be taken

ACTUAL RESULTS

I receive an error (listed below). If I change the name of the luks device to "enc00," the command works as expected. I suspect an issue similar to #409.

"luks_device error: Error while
 creating LUKS on /dev/sda: Cannot exclusively open /dev/sda, device in use.\
@felixfontein
Copy link
Contributor

I tried to reproduce this in #821, but wasn't able to.

Can you provide the output of lsblk /dev/sda -nlo type,name and cryptsetup status crypt00 on your system?

@felixfontein
Copy link
Contributor

@inflatador ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants