c*.py: normalize docs (#9418)

* c*.py: normalize docs

* fix copy/paste mistake

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Alexei Znamensky 2024-12-28 02:29:05 +13:00 committed by GitHub
parent 912065ad0e
commit 43599c6850
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 1437 additions and 1614 deletions

View file

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: crypttab
short_description: Encrypted Linux block devices
description:
@ -24,31 +23,27 @@ attributes:
options:
name:
description:
- Name of the encrypted block device as it appears in the C(/etc/crypttab) file, or
optionally prefixed with V(/dev/mapper/), as it appears in the filesystem. V(/dev/mapper/)
will be stripped from O(name).
- Name of the encrypted block device as it appears in the C(/etc/crypttab) file, or optionally prefixed with V(/dev/mapper/),
as it appears in the filesystem. V(/dev/mapper/) will be stripped from O(name).
type: str
required: true
state:
description:
- Use V(present) to add a line to C(/etc/crypttab) or update its definition
if already present.
- Use V(present) to add a line to C(/etc/crypttab) or update its definition if already present.
- Use V(absent) to remove a line with matching O(name).
- Use V(opts_present) to add options to those already present; options with
different values will be updated.
- Use V(opts_present) to add options to those already present; options with different values will be updated.
- Use V(opts_absent) to remove options from the existing set.
type: str
required: true
choices: [ absent, opts_absent, opts_present, present ]
choices: [absent, opts_absent, opts_present, present]
backing_device:
description:
- Path to the underlying block device or file, or the UUID of a block-device
prefixed with V(UUID=).
- Path to the underlying block device or file, or the UUID of a block-device prefixed with V(UUID=).
type: str
password:
description:
- Encryption password, the path to a file containing the password, or
V(-) or unset if the password should be entered at boot.
- Encryption password, the path to a file containing the password, or V(-) or unset if the password should be entered
at boot.
type: path
opts:
description:
@ -61,10 +56,10 @@ options:
type: path
default: /etc/crypttab
author:
- Steve (@groks)
'''
- Steve (@groks)
"""
EXAMPLES = r'''
EXAMPLES = r"""
- name: Set the options explicitly a device which must already exist
community.general.crypttab:
name: luks-home
@ -78,7 +73,7 @@ EXAMPLES = r'''
opts: discard
loop: '{{ ansible_mounts }}'
when: "'/dev/mapper/luks-' in {{ item.device }}"
'''
"""
import os
import traceback