mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-08 06:13:03 +00:00
Use semantic markup (#626)
* Enable semantic markup. * Use semantic markup. * Break long lines. * Add ignores. * Use real option, not alias.
This commit is contained in:
@@ -15,12 +15,12 @@ author: "David Kainz (@lolcube)"
|
||||
short_description: Generate OpenSSH private and public keys
|
||||
description:
|
||||
- "This module allows one to (re)generate OpenSSH private and public keys. It uses
|
||||
ssh-keygen to generate keys. One can generate C(rsa), C(dsa), C(rsa1), C(ed25519)
|
||||
or C(ecdsa) private keys."
|
||||
ssh-keygen to generate keys. One can generate V(rsa), V(dsa), V(rsa1), V(ed25519)
|
||||
or V(ecdsa) private keys."
|
||||
requirements:
|
||||
- ssh-keygen (if I(backend=openssh))
|
||||
- cryptography >= 2.6 (if I(backend=cryptography) and OpenSSH < 7.8 is installed)
|
||||
- cryptography >= 3.0 (if I(backend=cryptography) and OpenSSH >= 7.8 is installed)
|
||||
- ssh-keygen (if O(backend=openssh))
|
||||
- cryptography >= 2.6 (if O(backend=cryptography) and OpenSSH < 7.8 is installed)
|
||||
- cryptography >= 3.0 (if O(backend=cryptography) and OpenSSH >= 7.8 is installed)
|
||||
extends_documentation_fragment:
|
||||
- ansible.builtin.files
|
||||
- community.crypto.attributes
|
||||
@@ -49,8 +49,8 @@ options:
|
||||
type: int
|
||||
type:
|
||||
description:
|
||||
- "The algorithm used to generate the SSH private key. C(rsa1) is for protocol version 1.
|
||||
C(rsa1) is deprecated and may not be supported by every version of ssh-keygen."
|
||||
- "The algorithm used to generate the SSH private key. V(rsa1) is for protocol version 1.
|
||||
V(rsa1) is deprecated and may not be supported by every version of ssh-keygen."
|
||||
type: str
|
||||
default: rsa
|
||||
choices: ['rsa', 'dsa', 'rsa1', 'ecdsa', 'ed25519']
|
||||
@@ -71,18 +71,18 @@ options:
|
||||
passphrase:
|
||||
description:
|
||||
- Passphrase used to decrypt an existing private key or encrypt a newly generated private key.
|
||||
- Passphrases are not supported for I(type=rsa1).
|
||||
- Can only be used when I(backend=cryptography), or when I(backend=auto) and a required C(cryptography) version is installed.
|
||||
- Passphrases are not supported for O(type=rsa1).
|
||||
- Can only be used when O(backend=cryptography), or when O(backend=auto) and a required C(cryptography) version is installed.
|
||||
type: str
|
||||
version_added: 1.7.0
|
||||
private_key_format:
|
||||
description:
|
||||
- Used when I(backend=cryptography) to select a format for the private key at the provided I(path).
|
||||
- When set to C(auto) this module will match the key format of the installed OpenSSH version.
|
||||
- Used when O(backend=cryptography) to select a format for the private key at the provided O(path).
|
||||
- When set to V(auto) this module will match the key format of the installed OpenSSH version.
|
||||
- For OpenSSH < 7.8 private keys will be in PKCS1 format except ed25519 keys which will be in OpenSSH format.
|
||||
- For OpenSSH >= 7.8 all private key types will be in the OpenSSH format.
|
||||
- Using this option when I(regenerate=partial_idempotence) or I(regenerate=full_idempotence) will cause
|
||||
a new keypair to be generated if the private key's format does not match the value of I(private_key_format).
|
||||
- Using this option when O(regenerate=partial_idempotence) or O(regenerate=full_idempotence) will cause
|
||||
a new keypair to be generated if the private key's format does not match the value of O(private_key_format).
|
||||
This module will not however convert existing private keys between formats.
|
||||
type: str
|
||||
default: auto
|
||||
@@ -94,8 +94,8 @@ options:
|
||||
version_added: 1.7.0
|
||||
backend:
|
||||
description:
|
||||
- Selects between the C(cryptography) library or the OpenSSH binary C(opensshbin).
|
||||
- C(auto) will default to C(opensshbin) unless the OpenSSH binary is not installed or when using I(passphrase).
|
||||
- Selects between the V(cryptography) library or the OpenSSH binary V(opensshbin).
|
||||
- V(auto) will default to V(opensshbin) unless the OpenSSH binary is not installed or when using O(passphrase).
|
||||
type: str
|
||||
default: auto
|
||||
choices:
|
||||
@@ -109,24 +109,24 @@ options:
|
||||
The module will always generate a new key if the destination file does not exist.
|
||||
- By default, the key will be regenerated when it does not match the module's options,
|
||||
except when the key cannot be read or the passphrase does not match. Please note that
|
||||
this B(changed) for Ansible 2.10. For Ansible 2.9, the behavior was as if C(full_idempotence)
|
||||
this B(changed) for Ansible 2.10. For Ansible 2.9, the behavior was as if V(full_idempotence)
|
||||
is specified.
|
||||
- If set to C(never), the module will fail if the key cannot be read or the passphrase
|
||||
- If set to V(never), the module will fail if the key cannot be read or the passphrase
|
||||
is not matching, and will never regenerate an existing key.
|
||||
- If set to C(fail), the module will fail if the key does not correspond to the module's
|
||||
- If set to V(fail), the module will fail if the key does not correspond to the module's
|
||||
options.
|
||||
- If set to C(partial_idempotence), the key will be regenerated if it does not conform to
|
||||
- If set to V(partial_idempotence), the key will be regenerated if it does not conform to
|
||||
the module's options. The key is B(not) regenerated if it cannot be read (broken file),
|
||||
the key is protected by an unknown passphrase, or when they key is not protected by a
|
||||
passphrase, but a passphrase is specified.
|
||||
- If set to C(full_idempotence), the key will be regenerated if it does not conform to the
|
||||
- If set to V(full_idempotence), the key will be regenerated if it does not conform to the
|
||||
module's options. This is also the case if the key cannot be read (broken file), the key
|
||||
is protected by an unknown passphrase, or when they key is not protected by a passphrase,
|
||||
but a passphrase is specified. Make sure you have a B(backup) when using this option!
|
||||
- If set to C(always), the module will always regenerate the key. This is equivalent to
|
||||
setting I(force) to C(true).
|
||||
- If set to V(always), the module will always regenerate the key. This is equivalent to
|
||||
setting O(force) to V(true).
|
||||
- Note that adjusting the comment and the permissions can be changed without regeneration.
|
||||
Therefore, even for C(never), the task can result in changed.
|
||||
Therefore, even for V(never), the task can result in changed.
|
||||
type: str
|
||||
choices:
|
||||
- never
|
||||
@@ -138,8 +138,8 @@ options:
|
||||
version_added: '1.0.0'
|
||||
notes:
|
||||
- In case the ssh key is broken or password protected, the module will fail.
|
||||
Set the I(force) option to C(true) if you want to regenerate the keypair.
|
||||
- In the case a custom C(mode), C(group), C(owner), or other file attribute is provided it will be applied to both key files.
|
||||
Set the O(force) option to V(true) if you want to regenerate the keypair.
|
||||
- In the case a custom O(mode), O(group), O(owner), or other file attribute is provided it will be applied to both key files.
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
|
||||
Reference in New Issue
Block a user