mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
5b28cd65f0
* Add first version of luks_device tests. * Do ~ expansion manually. * Try to enable RHEL8. * Adjust to older losetup version. * Make sure cryptsetup is installed.
123 lines
2.6 KiB
YAML
123 lines
2.6 KiB
YAML
---
|
|
- name: Create with keyfile1
|
|
luks_device:
|
|
device: "{{ cryptfile_device }}"
|
|
state: closed
|
|
keyfile: "{{ role_path }}/files/keyfile1"
|
|
become: yes
|
|
|
|
# Access: keyfile1
|
|
|
|
- name: Try to open with keyfile1
|
|
luks_device:
|
|
device: "{{ cryptfile_device }}"
|
|
state: opened
|
|
keyfile: "{{ role_path }}/files/keyfile1"
|
|
become: yes
|
|
ignore_errors: yes
|
|
register: open_try
|
|
- assert:
|
|
that:
|
|
- open_try is not failed
|
|
- name: Close
|
|
luks_device:
|
|
device: "{{ cryptfile_device }}"
|
|
state: closed
|
|
|
|
- name: Try to open with keyfile2
|
|
luks_device:
|
|
device: "{{ cryptfile_device }}"
|
|
state: opened
|
|
keyfile: "{{ role_path }}/files/keyfile2"
|
|
become: yes
|
|
ignore_errors: yes
|
|
register: open_try
|
|
- assert:
|
|
that:
|
|
- open_try is failed
|
|
|
|
- name: Give access to keyfile2
|
|
luks_device:
|
|
device: "{{ cryptfile_device }}"
|
|
state: closed
|
|
keyfile: "{{ role_path }}/files/keyfile1"
|
|
new_keyfile: "{{ role_path }}/files/keyfile2"
|
|
become: yes
|
|
|
|
# Access: keyfile1 and keyfile2
|
|
|
|
- name: Try to open with keyfile2
|
|
luks_device:
|
|
device: "{{ cryptfile_device }}"
|
|
state: opened
|
|
keyfile: "{{ role_path }}/files/keyfile2"
|
|
become: yes
|
|
ignore_errors: yes
|
|
register: open_try
|
|
- assert:
|
|
that:
|
|
- open_try is not failed
|
|
- name: Close
|
|
luks_device:
|
|
device: "{{ cryptfile_device }}"
|
|
state: closed
|
|
|
|
- name: Remove access from keyfile1
|
|
luks_device:
|
|
device: "{{ cryptfile_device }}"
|
|
state: closed
|
|
keyfile: "{{ role_path }}/files/keyfile1"
|
|
remove_keyfile: "{{ role_path }}/files/keyfile1"
|
|
become: yes
|
|
|
|
# Access: keyfile2
|
|
|
|
- name: Try to open with keyfile1
|
|
luks_device:
|
|
device: "{{ cryptfile_device }}"
|
|
state: opened
|
|
keyfile: "{{ role_path }}/files/keyfile1"
|
|
become: yes
|
|
ignore_errors: yes
|
|
register: open_try
|
|
- assert:
|
|
that:
|
|
- open_try is failed
|
|
|
|
- name: Try to open with keyfile2
|
|
luks_device:
|
|
device: "{{ cryptfile_device }}"
|
|
state: opened
|
|
keyfile: "{{ role_path }}/files/keyfile2"
|
|
become: yes
|
|
ignore_errors: yes
|
|
register: open_try
|
|
- assert:
|
|
that:
|
|
- open_try is not failed
|
|
- name: Close
|
|
luks_device:
|
|
device: "{{ cryptfile_device }}"
|
|
state: closed
|
|
|
|
- name: Remove access from keyfile2
|
|
luks_device:
|
|
device: "{{ cryptfile_device }}"
|
|
state: closed
|
|
keyfile: "{{ role_path }}/files/keyfile2"
|
|
remove_keyfile: "{{ role_path }}/files/keyfile2"
|
|
become: yes
|
|
|
|
# Access: none
|
|
|
|
- name: Try to open with keyfile2
|
|
luks_device:
|
|
device: "{{ cryptfile_device }}"
|
|
state: opened
|
|
keyfile: "{{ role_path }}/files/keyfile2"
|
|
become: yes
|
|
ignore_errors: yes
|
|
register: open_try
|
|
- assert:
|
|
that:
|
|
- open_try is failed
|