Files
community.crypto/tests/integration/targets/luks_device/tasks/tests/cryptname.yml
Felix Fontein 99d6a17653 Fix some ansible-lint issues (#907) (#908)
* Fix fqcn[action-core].

* Fix fqcn[action].

* Fix jinja[spacing].

(cherry picked from commit 8792635bef)
2025-05-30 22:43:43 +02:00

63 lines
1.6 KiB
YAML

---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
- name: Fix name
ansible.builtin.set_fact:
cryptname: "crypt{{ '%0x' % ((2**32) | random) }}"
- name: Create
community.crypto.luks_device:
device: "{{ cryptfile_device }}"
name: "{{ cryptname }}"
state: present
keyfile: "{{ remote_tmp_dir }}/keyfile1"
pbkdf:
iteration_time: 0.1
become: true
register: create
- name: Open
community.crypto.luks_device:
device: "{{ cryptfile_device }}"
name: "{{ cryptname }}"
state: opened
keyfile: "{{ remote_tmp_dir }}/keyfile1"
become: true
register: open
- name: Open (idempotent)
community.crypto.luks_device:
device: "{{ cryptfile_device }}"
name: "{{ cryptname }}"
state: opened
keyfile: "{{ remote_tmp_dir }}/keyfile1"
become: true
register: open_idem
- name: Closed (via name)
community.crypto.luks_device:
name: "{{ cryptname }}"
state: closed
become: true
register: close
- name: Closed (via name, idempotent)
community.crypto.luks_device:
name: "{{ cryptname }}"
state: closed
become: true
register: close_idem
- name: Absent
community.crypto.luks_device:
device: "{{ cryptfile_device }}"
name: "{{ cryptname }}"
state: absent
become: true
register: absent
- ansible.builtin.assert:
that:
- create is changed
- open is changed
- open_idem is not changed
- close is changed
- close_idem is not changed
- absent is changed