2019-02-18 17:16:57 +01:00
|
|
|
---
|
2019-04-09 11:32:22 +02:00
|
|
|
- name: Create (check)
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: present
|
|
|
|
keyfile: "{{ role_path }}/files/keyfile1"
|
|
|
|
check_mode: yes
|
|
|
|
become: yes
|
|
|
|
register: create_check
|
2019-02-18 17:16:57 +01:00
|
|
|
- name: Create
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: present
|
|
|
|
keyfile: "{{ role_path }}/files/keyfile1"
|
|
|
|
become: yes
|
|
|
|
register: create
|
|
|
|
- name: Create (idempotent)
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: present
|
|
|
|
keyfile: "{{ role_path }}/files/keyfile1"
|
|
|
|
become: yes
|
|
|
|
register: create_idem
|
2019-04-09 11:32:22 +02:00
|
|
|
- name: Create (idempotent, check)
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: present
|
|
|
|
keyfile: "{{ role_path }}/files/keyfile1"
|
|
|
|
check_mode: yes
|
|
|
|
become: yes
|
|
|
|
register: create_idem_check
|
2019-02-18 17:16:57 +01:00
|
|
|
- assert:
|
|
|
|
that:
|
2019-04-09 11:32:22 +02:00
|
|
|
- create_check is changed
|
2019-02-18 17:16:57 +01:00
|
|
|
- create is changed
|
|
|
|
- create_idem is not changed
|
2019-04-09 11:32:22 +02:00
|
|
|
- create_idem_check is not changed
|
2019-02-18 17:16:57 +01:00
|
|
|
|
2019-04-09 11:32:22 +02:00
|
|
|
- name: Open (check)
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: opened
|
|
|
|
keyfile: "{{ role_path }}/files/keyfile1"
|
|
|
|
check_mode: yes
|
|
|
|
become: yes
|
|
|
|
register: open_check
|
2019-02-18 17:16:57 +01:00
|
|
|
- name: Open
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: opened
|
|
|
|
keyfile: "{{ role_path }}/files/keyfile1"
|
|
|
|
become: yes
|
|
|
|
register: open
|
|
|
|
- name: Open (idempotent)
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: opened
|
|
|
|
keyfile: "{{ role_path }}/files/keyfile1"
|
|
|
|
become: yes
|
|
|
|
register: open_idem
|
2019-04-09 11:32:22 +02:00
|
|
|
- name: Open (idempotent, check)
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: opened
|
|
|
|
keyfile: "{{ role_path }}/files/keyfile1"
|
|
|
|
check_mode: yes
|
|
|
|
become: yes
|
|
|
|
register: open_idem_check
|
2019-02-18 17:16:57 +01:00
|
|
|
- assert:
|
|
|
|
that:
|
2019-04-09 11:32:22 +02:00
|
|
|
- open_check is changed
|
2019-02-18 17:16:57 +01:00
|
|
|
- open is changed
|
|
|
|
- open_idem is not changed
|
2019-04-09 11:32:22 +02:00
|
|
|
- open_idem_check is not changed
|
2019-02-18 17:16:57 +01:00
|
|
|
|
2019-04-09 11:32:22 +02:00
|
|
|
- name: Closed (via name, check)
|
|
|
|
luks_device:
|
|
|
|
name: "{{ open.name }}"
|
|
|
|
state: closed
|
|
|
|
check_mode: yes
|
|
|
|
become: yes
|
|
|
|
register: close_check
|
2019-02-18 17:16:57 +01:00
|
|
|
- name: Closed (via name)
|
|
|
|
luks_device:
|
|
|
|
name: "{{ open.name }}"
|
|
|
|
state: closed
|
|
|
|
become: yes
|
|
|
|
register: close
|
|
|
|
- name: Closed (via name, idempotent)
|
|
|
|
luks_device:
|
|
|
|
name: "{{ open.name }}"
|
|
|
|
state: closed
|
|
|
|
become: yes
|
|
|
|
register: close_idem
|
2019-04-09 11:32:22 +02:00
|
|
|
- name: Closed (via name, idempotent, check)
|
|
|
|
luks_device:
|
|
|
|
name: "{{ open.name }}"
|
|
|
|
state: closed
|
|
|
|
check_mode: yes
|
|
|
|
become: yes
|
|
|
|
register: close_idem_check
|
2019-02-18 17:16:57 +01:00
|
|
|
- assert:
|
|
|
|
that:
|
2019-04-09 11:32:22 +02:00
|
|
|
- close_check is changed
|
2019-02-18 17:16:57 +01:00
|
|
|
- close is changed
|
|
|
|
- close_idem is not changed
|
2019-04-09 11:32:22 +02:00
|
|
|
- close_idem_check is not changed
|
2019-02-18 17:16:57 +01:00
|
|
|
|
|
|
|
- name: Re-open
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: opened
|
|
|
|
keyfile: "{{ role_path }}/files/keyfile1"
|
|
|
|
become: yes
|
|
|
|
|
2019-04-09 11:32:22 +02:00
|
|
|
- name: Closed (via device, check)
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: closed
|
|
|
|
check_mode: yes
|
|
|
|
become: yes
|
|
|
|
register: close_check
|
2019-02-18 17:16:57 +01:00
|
|
|
- name: Closed (via device)
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: closed
|
|
|
|
become: yes
|
|
|
|
register: close
|
|
|
|
- name: Closed (via device, idempotent)
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: closed
|
|
|
|
become: yes
|
|
|
|
register: close_idem
|
2019-04-09 11:32:22 +02:00
|
|
|
- name: Closed (via device, idempotent, check)
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: closed
|
|
|
|
check_mode: yes
|
|
|
|
become: yes
|
|
|
|
register: close_idem_check
|
2019-02-18 17:16:57 +01:00
|
|
|
- assert:
|
|
|
|
that:
|
2019-04-09 11:32:22 +02:00
|
|
|
- close_check is changed
|
2019-02-18 17:16:57 +01:00
|
|
|
- close is changed
|
|
|
|
- close_idem is not changed
|
2019-04-09 11:32:22 +02:00
|
|
|
- close_idem_check is not changed
|
|
|
|
|
2019-02-18 17:16:57 +01:00
|
|
|
- name: Re-opened
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: opened
|
|
|
|
keyfile: "{{ role_path }}/files/keyfile1"
|
|
|
|
become: yes
|
|
|
|
|
2019-04-09 11:32:22 +02:00
|
|
|
- name: Absent (check)
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: absent
|
|
|
|
check_mode: yes
|
|
|
|
become: yes
|
|
|
|
register: absent_check
|
2019-02-18 17:16:57 +01:00
|
|
|
- name: Absent
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: absent
|
|
|
|
become: yes
|
|
|
|
register: absent
|
|
|
|
- name: Absent (idempotence)
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: absent
|
|
|
|
become: yes
|
|
|
|
register: absent_idem
|
2019-04-09 11:32:22 +02:00
|
|
|
- name: Absent (idempotence, check)
|
|
|
|
luks_device:
|
|
|
|
device: "{{ cryptfile_device }}"
|
|
|
|
state: absent
|
|
|
|
check_mode: yes
|
|
|
|
become: yes
|
|
|
|
register: absent_idem_check
|
2019-02-18 17:16:57 +01:00
|
|
|
- assert:
|
|
|
|
that:
|
2019-04-09 11:32:22 +02:00
|
|
|
- absent_check is changed
|
2019-02-18 17:16:57 +01:00
|
|
|
- absent is changed
|
|
|
|
- absent_idem is not changed
|
2019-04-09 11:32:22 +02:00
|
|
|
- absent_idem_check is not changed
|