1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Review finding, better readability

This commit is contained in:
Nils Stein 2024-06-01 12:54:01 +02:00
parent d7ed94729a
commit a317dac8ea
No known key found for this signature in database

View file

@ -85,42 +85,49 @@ DOCUMENTATION = r"""
vars: vars:
- name: ansible_paramiko_use_rsa_sha2_algorithms - name: ansible_paramiko_use_rsa_sha2_algorithms
ini: ini:
- {key: use_rsa_sha2_algorithms, section: paramiko_connection} - section: paramiko_connection
key: use_rsa_sha2_algorithms
env: env:
- {name: ANSIBLE_PARAMIKO_USE_RSA_SHA2_ALGORITHMS} - name: ANSIBLE_PARAMIKO_USE_RSA_SHA2_ALGORITHMS
default: True default: True
type: boolean type: boolean
host_key_auto_add: host_key_auto_add:
description: Automatically add host keys. description: Automatically add host keys.
env: [{name: ANSIBLE_PARAMIKO_HOST_KEY_AUTO_ADD}] env:
- name: ANSIBLE_PARAMIKO_HOST_KEY_AUTO_ADD
ini: ini:
- {key: host_key_auto_add, section: paramiko_connection} - section: paramiko_connection
key: host_key_auto_add
type: boolean type: boolean
look_for_keys: look_for_keys:
default: True default: True
description: 'False to disable searching for private key files in ~/.ssh/.' description: "False to disable searching for private key files in ~/.ssh/."
env: [{name: ANSIBLE_PARAMIKO_LOOK_FOR_KEYS}] env:
- name: ANSIBLE_PARAMIKO_LOOK_FOR_KEYS
ini: ini:
- {key: look_for_keys, section: paramiko_connection} - section: paramiko_connection
key: look_for_keys
type: boolean type: boolean
proxy_command: proxy_command:
default: '' default: ""
description: description:
- Proxy information for running the connection via a jumphost. - Proxy information for running the connection via a jumphost.
- Also this plugin will scan 'ssh_args', 'ssh_extra_args' and 'ssh_common_args' from the 'ssh' plugin settings for proxy information if set. - Also this plugin will scan 'ssh_args', 'ssh_extra_args' and 'ssh_common_args' from the 'ssh' plugin settings for proxy information if set.
type: string type: string
env: [{name: ANSIBLE_PARAMIKO_PROXY_COMMAND}] env:
- name: ANSIBLE_PARAMIKO_PROXY_COMMAND
ini: ini:
- {key: proxy_command, section: paramiko_connection} - section: paramiko_connection
key: proxy_command
vars: vars:
- name: ansible_paramiko_proxy_command - name: ansible_paramiko_proxy_command
ssh_args: ssh_args:
description: Only used in parsing ProxyCommand for use in this plugin. description: Only used in parsing ProxyCommand for use in this plugin.
default: '' default: ""
type: string type: string
ini: ini:
- section: 'ssh_connection' - section: "ssh_connection"
key: 'ssh_args' key: "ssh_args"
env: env:
- name: ANSIBLE_SSH_ARGS - name: ANSIBLE_SSH_ARGS
vars: vars:
@ -133,15 +140,15 @@ DOCUMENTATION = r"""
description: Only used in parsing ProxyCommand for use in this plugin. description: Only used in parsing ProxyCommand for use in this plugin.
type: string type: string
ini: ini:
- section: 'ssh_connection' - section: "ssh_connection"
key: 'ssh_common_args' key: "ssh_common_args"
env: env:
- name: ANSIBLE_SSH_COMMON_ARGS - name: ANSIBLE_SSH_COMMON_ARGS
vars: vars:
- name: ansible_ssh_common_args - name: ansible_ssh_common_args
cli: cli:
- name: ssh_common_args - name: ssh_common_args
default: '' default: ""
deprecated: deprecated:
why: In favor of the "proxy_command" option. why: In favor of the "proxy_command" option.
version: "0.1.0" version: "0.1.0"
@ -158,23 +165,23 @@ DOCUMENTATION = r"""
section: ssh_connection section: ssh_connection
cli: cli:
- name: ssh_extra_args - name: ssh_extra_args
default: '' default: ""
deprecated: deprecated:
why: In favor of the "proxy_command" option. why: In favor of the "proxy_command" option.
version: "0.1.0" version: "0.1.0"
alternatives: proxy_command alternatives: proxy_command
pty: pty:
default: True default: True
description: 'SUDO usually requires a PTY, True to give a PTY and False to not give a PTY.' description: "SUDO usually requires a PTY, True to give a PTY and False to not give a PTY."
env: env:
- name: ANSIBLE_PARAMIKO_PTY - name: ANSIBLE_PARAMIKO_PTY
ini: ini:
- section: paramiko_connection - key: pty
key: pty section: paramiko_connection
type: boolean type: boolean
record_host_keys: record_host_keys:
default: True default: True
description: 'Save the host keys to a file' description: "Save the host keys to a file"
env: env:
- name: ANSIBLE_PARAMIKO_RECORD_HOST_KEYS - name: ANSIBLE_PARAMIKO_RECORD_HOST_KEYS
ini: ini:
@ -182,7 +189,7 @@ DOCUMENTATION = r"""
key: record_host_keys key: record_host_keys
type: boolean type: boolean
host_key_checking: host_key_checking:
description: 'Set this to V(False) if you want to avoid host key checking by the underlying tools Ansible uses to connect to the host.' description: "Set this to V(False) if you want to avoid host key checking by the underlying tools Ansible uses to connect to the host."
type: boolean type: boolean
default: True default: True
env: env:
@ -199,7 +206,7 @@ DOCUMENTATION = r"""
- name: ansible_ssh_host_key_checking - name: ansible_ssh_host_key_checking
- name: ansible_paramiko_host_key_checking - name: ansible_paramiko_host_key_checking
use_persistent_connections: use_persistent_connections:
description: 'Toggles the use of persistence for connections' description: "Toggles the use of persistence for connections"
type: boolean type: boolean
default: False default: False
env: env:
@ -257,7 +264,7 @@ DOCUMENTATION = r"""
- name: ansible_paramiko_private_key_file - name: ansible_paramiko_private_key_file
cli: cli:
- name: private_key_file - name: private_key_file
option: '--private-key' option: "--private-key"
vmid: vmid:
description: description:
- Container ID - Container ID
@ -331,13 +338,12 @@ EXAMPLES = r"""
msg: "This is coming from pct environment" msg: "This is coming from pct environment"
""" """
import os
import uuid
from ansible.utils.display import Display
from ansible.plugins.connection.paramiko_ssh import Connection as SSH_Connection
from ansible.errors import AnsibleError
from ansible import constants as C from ansible import constants as C
from ansible.errors import AnsibleError
from ansible.plugins.connection.paramiko_ssh import Connection as SSH_Connection
from ansible.utils.display import Display
import uuid
import os
display = Display() display = Display()