mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
49 lines
1.2 KiB
YAML
49 lines
1.2 KiB
YAML
|
---
|
||
|
- name: Create with invalid device name (check)
|
||
|
luks_device:
|
||
|
device: /dev/asdfasdfasdf
|
||
|
state: present
|
||
|
keyfile: "{{ role_path }}/files/keyfile1"
|
||
|
check_mode: yes
|
||
|
ignore_errors: yes
|
||
|
become: yes
|
||
|
register: create_check
|
||
|
- name: Create with invalid device name
|
||
|
luks_device:
|
||
|
device: /dev/asdfasdfasdf
|
||
|
state: present
|
||
|
keyfile: "{{ role_path }}/files/keyfile1"
|
||
|
ignore_errors: yes
|
||
|
become: yes
|
||
|
register: create
|
||
|
- assert:
|
||
|
that:
|
||
|
- create_check is failed
|
||
|
- create is failed
|
||
|
- "'o such file or directory' in create_check.msg"
|
||
|
- "'o such file or directory' in create.msg"
|
||
|
|
||
|
- name: Create with something which is not a device (check)
|
||
|
luks_device:
|
||
|
device: /tmp/
|
||
|
state: present
|
||
|
keyfile: "{{ role_path }}/files/keyfile1"
|
||
|
check_mode: yes
|
||
|
ignore_errors: yes
|
||
|
become: yes
|
||
|
register: create_check
|
||
|
- name: Create with something which is not a device
|
||
|
luks_device:
|
||
|
device: /tmp/
|
||
|
state: present
|
||
|
keyfile: "{{ role_path }}/files/keyfile1"
|
||
|
ignore_errors: yes
|
||
|
become: yes
|
||
|
register: create
|
||
|
- assert:
|
||
|
that:
|
||
|
- create_check is failed
|
||
|
- create is failed
|
||
|
- "'is not a device' in create_check.msg"
|
||
|
- "'is not a device' in create.msg"
|