- Docs »
- crypttab - Encrypted Linux block devices
-
You are reading an unmaintained version of the Ansible documentation. Unmaintained Ansible versions can contain unfixed security vulnerabilities (CVE). Please upgrade to a maintained version. See the latest Ansible documentation.
crypttab - Encrypted Linux block devices
- Control Linux encrypted block devices that are set up during system boot in
/etc/crypttab
.
Parameter |
Choices/Defaults |
Comments |
backing_device
|
|
Path to the underlying block device or file, or the UUID of a block-device prefixed with UUID=.
|
name
required |
|
Name of the encrypted block device as it appears in the /etc/crypttab file, or optionally prefixed with /dev/mapper/ , as it appears in the filesystem. /dev/mapper/ will be stripped from name.
|
opts
|
|
A comma-delimited list of options. See crypttab(5 ) for details.
|
password
|
Default:
"none"
|
Encryption password, the path to a file containing the password, or none or - if the password should be entered at boot.
|
path
|
Default:
"/etc/crypttab"
|
Path to file to use instead of /etc/crypttab . This might be useful in a chroot environment.
|
state
required |
Choices:
- absent
- opts_absent
- opts_present
- present
|
Use present to add a line to /etc/crypttab or update it's definition if already present. Use absent to remove a line with matching name. Use opts_present to add options to those already present; options with different values will be updated. Use opts_absent to remove options from the existing set.
|
- name: Set the options explicitly a device which must already exist
crypttab:
name: luks-home
state: present
opts: discard,cipher=aes-cbc-essiv:sha256
- name: Add the 'discard' option to any existing options for all devices
crypttab:
name: '{{ item.device }}'
state: opts_present
opts: discard
with_items: '{{ ansible_mounts }}'
when: "'/dev/mapper/luks-' in {{ item.device }}"
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.
For a list of other modules that are also maintained by the Ansible Community, see here.
Hint
If you notice any issues in this documentation you can edit this document to improve it.