2019-08-31 19:32:41 +02:00
|
|
|
---
|
|
|
|
- name: Create with keysize
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: present
|
|
|
|
keyfile: "{{ role_path }}/files/keyfile1"
|
|
|
|
keysize: 256
|
|
|
|
become: yes
|
|
|
|
register: create_with_keysize
|
|
|
|
- name: Create with keysize (idempotent)
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: present
|
|
|
|
keyfile: "{{ role_path }}/files/keyfile1"
|
|
|
|
keysize: 256
|
|
|
|
become: yes
|
|
|
|
register: create_idem_with_keysize
|
|
|
|
- name: Create with different keysize (idempotent since we do not update keysize)
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: present
|
|
|
|
keyfile: "{{ role_path }}/files/keyfile1"
|
|
|
|
keysize: 512
|
|
|
|
become: yes
|
|
|
|
register: create_idem_with_diff_keysize
|
2019-11-30 20:50:30 +01:00
|
|
|
- name: Create with ambiguous arguments
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: present
|
|
|
|
keyfile: "{{ role_path }}/files/keyfile1"
|
|
|
|
passphrase: "{{ cryptfile_passphrase1 }}"
|
|
|
|
ignore_errors: yes
|
|
|
|
become: yes
|
|
|
|
register: create_with_ambiguous
|
2019-08-31 19:32:41 +02:00
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- create_with_keysize is changed
|
|
|
|
- create_idem_with_keysize is not changed
|
|
|
|
- create_idem_with_diff_keysize is not changed
|
2019-11-30 20:50:30 +01:00
|
|
|
- create_with_ambiguous is failed
|