ansible-core 2.15.1__py3-none-any.whl → 2.15.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ansible-core might be problematic. Click here for more details.
- ansible/config/manager.py +1 -1
- ansible/galaxy/collection/__init__.py +12 -15
- ansible/module_utils/ansible_release.py +1 -1
- ansible/modules/apt_key.py +8 -5
- ansible/modules/apt_repository.py +2 -0
- ansible/modules/dnf5.py +5 -7
- ansible/modules/find.py +3 -0
- ansible/modules/validate_argument_spec.py +1 -1
- ansible/plugins/action/template.py +26 -15
- ansible/plugins/connection/paramiko_ssh.py +8 -0
- ansible/plugins/connection/psrp.py +3 -3
- ansible/plugins/connection/ssh.py +19 -2
- ansible/plugins/filter/comment.yml +1 -1
- ansible/plugins/filter/split.yml +1 -1
- ansible/plugins/filter/to_yaml.yml +1 -1
- ansible/plugins/lookup/template.py +11 -6
- ansible/plugins/strategy/__init__.py +20 -12
- ansible/plugins/test/change.yml +1 -1
- ansible/plugins/test/changed.yml +1 -1
- ansible/plugins/test/reachable.yml +1 -1
- ansible/plugins/test/succeeded.yml +1 -1
- ansible/plugins/test/success.yml +1 -1
- ansible/plugins/test/successful.yml +1 -1
- ansible/plugins/test/unreachable.yml +1 -1
- ansible/release.py +1 -1
- ansible/template/__init__.py +38 -24
- {ansible_core-2.15.1.dist-info → ansible_core-2.15.2.dist-info}/METADATA +1 -1
- {ansible_core-2.15.1.dist-info → ansible_core-2.15.2.dist-info}/RECORD +43 -43
- ansible_test/_data/completion/remote.txt +2 -1
- ansible_test/_internal/__init__.py +7 -0
- ansible_test/_internal/commands/integration/cloud/__init__.py +2 -2
- ansible_test/_internal/commands/sanity/validate_modules.py +2 -2
- ansible_test/_internal/containers.py +2 -2
- ansible_test/_internal/coverage_util.py +2 -2
- ansible_test/_internal/payload.py +2 -2
- ansible_test/_internal/provisioning.py +5 -2
- ansible_test/_internal/pypi_proxy.py +4 -4
- ansible_test/_internal/util_common.py +38 -6
- {ansible_core-2.15.1.data → ansible_core-2.15.2.data}/scripts/ansible-test +0 -0
- {ansible_core-2.15.1.dist-info → ansible_core-2.15.2.dist-info}/COPYING +0 -0
- {ansible_core-2.15.1.dist-info → ansible_core-2.15.2.dist-info}/WHEEL +0 -0
- {ansible_core-2.15.1.dist-info → ansible_core-2.15.2.dist-info}/entry_points.txt +0 -0
- {ansible_core-2.15.1.dist-info → ansible_core-2.15.2.dist-info}/top_level.txt +0 -0
ansible/config/manager.py
CHANGED
|
@@ -63,7 +63,7 @@ def ensure_type(value, value_type, origin=None):
|
|
|
63
63
|
:temppath: Same as 'tmppath'
|
|
64
64
|
:tmp: Same as 'tmppath'
|
|
65
65
|
:pathlist: Treat the value as a typical PATH string. (On POSIX, this
|
|
66
|
-
means
|
|
66
|
+
means comma separated strings.) Split the value and then expand
|
|
67
67
|
each part for environment variables and tildes.
|
|
68
68
|
:pathspec: Treat the value as a PATH string. Expands any environment variables
|
|
69
69
|
tildes's in the value.
|
|
@@ -1561,6 +1561,13 @@ def install_artifact(b_coll_targz_path, b_collection_path, b_temp_path, signatur
|
|
|
1561
1561
|
"""
|
|
1562
1562
|
try:
|
|
1563
1563
|
with tarfile.open(b_coll_targz_path, mode='r') as collection_tar:
|
|
1564
|
+
# Remove this once py3.11 is our controller minimum
|
|
1565
|
+
# Workaround for https://bugs.python.org/issue47231
|
|
1566
|
+
# See _extract_tar_dir
|
|
1567
|
+
collection_tar._ansible_normalized_cache = {
|
|
1568
|
+
m.name.removesuffix(os.path.sep): m for m in collection_tar.getmembers()
|
|
1569
|
+
} # deprecated: description='TarFile member index' core_version='2.18' python_version='3.11'
|
|
1570
|
+
|
|
1564
1571
|
# Verify the signature on the MANIFEST.json before extracting anything else
|
|
1565
1572
|
_extract_tar_file(collection_tar, MANIFEST_FILENAME, b_collection_path, b_temp_path)
|
|
1566
1573
|
|
|
@@ -1641,22 +1648,12 @@ def install_src(collection, b_collection_path, b_collection_output_path, artifac
|
|
|
1641
1648
|
|
|
1642
1649
|
def _extract_tar_dir(tar, dirname, b_dest):
|
|
1643
1650
|
""" Extracts a directory from a collection tar. """
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
# Create list of members with and without trailing separator
|
|
1647
|
-
if not member_names[-1].endswith(os.path.sep):
|
|
1648
|
-
member_names.append(member_names[-1] + os.path.sep)
|
|
1651
|
+
dirname = to_native(dirname, errors='surrogate_or_strict').removesuffix(os.path.sep)
|
|
1649
1652
|
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
except KeyError:
|
|
1655
|
-
continue
|
|
1656
|
-
break
|
|
1657
|
-
else:
|
|
1658
|
-
# If we still can't find the member, raise a nice error.
|
|
1659
|
-
raise AnsibleError("Unable to extract '%s' from collection" % to_native(member, errors='surrogate_or_strict'))
|
|
1653
|
+
try:
|
|
1654
|
+
tar_member = tar._ansible_normalized_cache[dirname]
|
|
1655
|
+
except KeyError:
|
|
1656
|
+
raise AnsibleError("Unable to extract '%s' from collection" % dirname)
|
|
1660
1657
|
|
|
1661
1658
|
b_dir_path = os.path.join(b_dest, to_bytes(dirname, errors='surrogate_or_strict'))
|
|
1662
1659
|
|
ansible/modules/apt_key.py
CHANGED
|
@@ -27,7 +27,7 @@ attributes:
|
|
|
27
27
|
platform:
|
|
28
28
|
platforms: debian
|
|
29
29
|
notes:
|
|
30
|
-
- The apt-key command
|
|
30
|
+
- The apt-key command used by this module has been deprecated. See the L(Debian wiki,https://wiki.debian.org/DebianRepository/UseThirdParty) for details.
|
|
31
31
|
This module is kept for backwards compatibility for systems that still use apt-key as the main way to manage apt repository keys.
|
|
32
32
|
- As a sanity check, downloaded key id must match the one specified.
|
|
33
33
|
- "Use full fingerprint (40 characters) key ids to avoid key collisions.
|
|
@@ -36,6 +36,8 @@ notes:
|
|
|
36
36
|
- Adding a new key requires an apt cache update (e.g. using the M(ansible.builtin.apt) module's update_cache option).
|
|
37
37
|
requirements:
|
|
38
38
|
- gpg
|
|
39
|
+
seealso:
|
|
40
|
+
- module: ansible.builtin.deb822_repository
|
|
39
41
|
options:
|
|
40
42
|
id:
|
|
41
43
|
description:
|
|
@@ -81,12 +83,13 @@ options:
|
|
|
81
83
|
'''
|
|
82
84
|
|
|
83
85
|
EXAMPLES = '''
|
|
84
|
-
- name: One way to avoid apt_key once it is removed from your distro
|
|
86
|
+
- name: One way to avoid apt_key once it is removed from your distro, armored keys should use .asc extension, binary should use .gpg
|
|
85
87
|
block:
|
|
86
|
-
- name: somerepo |no apt key
|
|
88
|
+
- name: somerepo | no apt key
|
|
87
89
|
ansible.builtin.get_url:
|
|
88
|
-
url: https://
|
|
89
|
-
dest: /etc/apt/keyrings/
|
|
90
|
+
url: https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x36a1d7869245c8950f966e92d8576a8ba88d21e9
|
|
91
|
+
dest: /etc/apt/keyrings/myrepo.asc
|
|
92
|
+
checksum: sha256:bb42f0db45d46bab5f9ec619e1a47360b94c27142e57aa71f7050d08672309e0
|
|
90
93
|
|
|
91
94
|
- name: somerepo | apt source
|
|
92
95
|
ansible.builtin.apt_repository:
|
ansible/modules/dnf5.py
CHANGED
|
@@ -215,7 +215,6 @@ options:
|
|
|
215
215
|
default: "no"
|
|
216
216
|
cacheonly:
|
|
217
217
|
description:
|
|
218
|
-
- This is currently no-op as dnf5 does not implement the feature.
|
|
219
218
|
- Tells dnf to run entirely from system cache; does not download or update metadata.
|
|
220
219
|
type: bool
|
|
221
220
|
default: "no"
|
|
@@ -512,7 +511,7 @@ class Dnf5Module(YumDnf):
|
|
|
512
511
|
conf.clean_requirements_on_remove = self.autoremove
|
|
513
512
|
conf.installroot = self.installroot
|
|
514
513
|
conf.use_host_config = True # needed for installroot
|
|
515
|
-
conf.cacheonly = self.cacheonly
|
|
514
|
+
conf.cacheonly = "all" if self.cacheonly else "none"
|
|
516
515
|
if self.download_dir:
|
|
517
516
|
conf.destdir = self.download_dir
|
|
518
517
|
|
|
@@ -671,16 +670,15 @@ class Dnf5Module(YumDnf):
|
|
|
671
670
|
else:
|
|
672
671
|
transaction.download()
|
|
673
672
|
if not self.download_only:
|
|
674
|
-
|
|
673
|
+
transaction.set_description("ansible dnf5 module")
|
|
674
|
+
result = transaction.run()
|
|
675
|
+
if result == libdnf5.base.Transaction.TransactionRunResult_ERROR_GPG_CHECK:
|
|
675
676
|
self.module.fail_json(
|
|
676
677
|
msg="Failed to validate GPG signatures: {}".format(",".join(transaction.get_gpg_signature_problems())),
|
|
677
678
|
failures=[],
|
|
678
679
|
rc=1,
|
|
679
680
|
)
|
|
680
|
-
|
|
681
|
-
transaction.set_description("ansible dnf5 module")
|
|
682
|
-
result = transaction.run()
|
|
683
|
-
if result != libdnf5.base.Transaction.TransactionRunResult_SUCCESS:
|
|
681
|
+
elif result != libdnf5.base.Transaction.TransactionRunResult_SUCCESS:
|
|
684
682
|
self.module.fail_json(
|
|
685
683
|
msg="Failed to install some of the specified packages",
|
|
686
684
|
failures=["{}: {}".format(transaction.transaction_result_to_string(result), log) for log in transaction.get_transaction_problems()],
|
ansible/modules/find.py
CHANGED
|
@@ -56,6 +56,9 @@ options:
|
|
|
56
56
|
contains:
|
|
57
57
|
description:
|
|
58
58
|
- A regular expression or pattern which should be matched against the file content.
|
|
59
|
+
- If I(read_whole_file) is C(true) it matches against the beginning of the line (uses
|
|
60
|
+
C(re.match())). If I(read_whole_file) is C(false), it searches anywhere for that pattern
|
|
61
|
+
(uses C(re.search())).
|
|
59
62
|
- Works only when I(file_type) is C(file).
|
|
60
63
|
type: str
|
|
61
64
|
read_whole_file:
|
|
@@ -17,7 +17,7 @@ version_added: "2.11"
|
|
|
17
17
|
options:
|
|
18
18
|
argument_spec:
|
|
19
19
|
description:
|
|
20
|
-
- A dictionary like AnsibleModule argument_spec
|
|
20
|
+
- A dictionary like AnsibleModule argument_spec. See R(argument spec definition,argument_spec)
|
|
21
21
|
required: true
|
|
22
22
|
provided_arguments:
|
|
23
23
|
description:
|
|
@@ -10,6 +10,15 @@ import shutil
|
|
|
10
10
|
import stat
|
|
11
11
|
import tempfile
|
|
12
12
|
|
|
13
|
+
from jinja2.defaults import (
|
|
14
|
+
BLOCK_END_STRING,
|
|
15
|
+
BLOCK_START_STRING,
|
|
16
|
+
COMMENT_END_STRING,
|
|
17
|
+
COMMENT_START_STRING,
|
|
18
|
+
VARIABLE_END_STRING,
|
|
19
|
+
VARIABLE_START_STRING,
|
|
20
|
+
)
|
|
21
|
+
|
|
13
22
|
from ansible import constants as C
|
|
14
23
|
from ansible.config.manager import ensure_type
|
|
15
24
|
from ansible.errors import AnsibleError, AnsibleFileNotFound, AnsibleAction, AnsibleActionFail
|
|
@@ -57,12 +66,12 @@ class ActionModule(ActionBase):
|
|
|
57
66
|
dest = self._task.args.get('dest', None)
|
|
58
67
|
state = self._task.args.get('state', None)
|
|
59
68
|
newline_sequence = self._task.args.get('newline_sequence', self.DEFAULT_NEWLINE_SEQUENCE)
|
|
60
|
-
variable_start_string = self._task.args.get('variable_start_string',
|
|
61
|
-
variable_end_string = self._task.args.get('variable_end_string',
|
|
62
|
-
block_start_string = self._task.args.get('block_start_string',
|
|
63
|
-
block_end_string = self._task.args.get('block_end_string',
|
|
64
|
-
comment_start_string = self._task.args.get('comment_start_string',
|
|
65
|
-
comment_end_string = self._task.args.get('comment_end_string',
|
|
69
|
+
variable_start_string = self._task.args.get('variable_start_string', VARIABLE_START_STRING)
|
|
70
|
+
variable_end_string = self._task.args.get('variable_end_string', VARIABLE_END_STRING)
|
|
71
|
+
block_start_string = self._task.args.get('block_start_string', BLOCK_START_STRING)
|
|
72
|
+
block_end_string = self._task.args.get('block_end_string', BLOCK_END_STRING)
|
|
73
|
+
comment_start_string = self._task.args.get('comment_start_string', COMMENT_START_STRING)
|
|
74
|
+
comment_end_string = self._task.args.get('comment_end_string', COMMENT_END_STRING)
|
|
66
75
|
output_encoding = self._task.args.get('output_encoding', 'utf-8') or 'utf-8'
|
|
67
76
|
|
|
68
77
|
wrong_sequences = ["\\n", "\\r", "\\r\\n"]
|
|
@@ -129,16 +138,18 @@ class ActionModule(ActionBase):
|
|
|
129
138
|
templar = self._templar.copy_with_new_env(environment_class=AnsibleEnvironment,
|
|
130
139
|
searchpath=searchpath,
|
|
131
140
|
newline_sequence=newline_sequence,
|
|
132
|
-
block_start_string=block_start_string,
|
|
133
|
-
block_end_string=block_end_string,
|
|
134
|
-
variable_start_string=variable_start_string,
|
|
135
|
-
variable_end_string=variable_end_string,
|
|
136
|
-
comment_start_string=comment_start_string,
|
|
137
|
-
comment_end_string=comment_end_string,
|
|
138
|
-
trim_blocks=trim_blocks,
|
|
139
|
-
lstrip_blocks=lstrip_blocks,
|
|
140
141
|
available_variables=temp_vars)
|
|
141
|
-
|
|
142
|
+
overrides = dict(
|
|
143
|
+
block_start_string=block_start_string,
|
|
144
|
+
block_end_string=block_end_string,
|
|
145
|
+
variable_start_string=variable_start_string,
|
|
146
|
+
variable_end_string=variable_end_string,
|
|
147
|
+
comment_start_string=comment_start_string,
|
|
148
|
+
comment_end_string=comment_end_string,
|
|
149
|
+
trim_blocks=trim_blocks,
|
|
150
|
+
lstrip_blocks=lstrip_blocks
|
|
151
|
+
)
|
|
152
|
+
resultant = templar.do_template(template_data, preserve_trailing_newlines=True, escape_backslashes=False, overrides=overrides)
|
|
142
153
|
except AnsibleAction:
|
|
143
154
|
raise
|
|
144
155
|
except Exception as e:
|
|
@@ -22,6 +22,7 @@ DOCUMENTATION = """
|
|
|
22
22
|
description:
|
|
23
23
|
- Address of the remote target
|
|
24
24
|
default: inventory_hostname
|
|
25
|
+
type: string
|
|
25
26
|
vars:
|
|
26
27
|
- name: inventory_hostname
|
|
27
28
|
- name: ansible_host
|
|
@@ -52,6 +53,7 @@ DOCUMENTATION = """
|
|
|
52
53
|
description:
|
|
53
54
|
- User to login/authenticate as
|
|
54
55
|
- Can be set from the CLI via the C(--user) or C(-u) options.
|
|
56
|
+
type: string
|
|
55
57
|
vars:
|
|
56
58
|
- name: ansible_user
|
|
57
59
|
- name: ansible_ssh_user
|
|
@@ -72,6 +74,7 @@ DOCUMENTATION = """
|
|
|
72
74
|
description:
|
|
73
75
|
- Secret used to either login the ssh server or as a passphrase for ssh keys that require it
|
|
74
76
|
- Can be set from the CLI via the C(--ask-pass) option.
|
|
77
|
+
type: string
|
|
75
78
|
vars:
|
|
76
79
|
- name: ansible_password
|
|
77
80
|
- name: ansible_ssh_pass
|
|
@@ -111,6 +114,7 @@ DOCUMENTATION = """
|
|
|
111
114
|
description:
|
|
112
115
|
- Proxy information for running the connection via a jumphost
|
|
113
116
|
- Also this plugin will scan 'ssh_args', 'ssh_extra_args' and 'ssh_common_args' from the 'ssh' plugin settings for proxy information if set.
|
|
117
|
+
type: string
|
|
114
118
|
env: [{name: ANSIBLE_PARAMIKO_PROXY_COMMAND}]
|
|
115
119
|
ini:
|
|
116
120
|
- {key: proxy_command, section: paramiko_connection}
|
|
@@ -120,6 +124,7 @@ DOCUMENTATION = """
|
|
|
120
124
|
ssh_args:
|
|
121
125
|
description: Only used in parsing ProxyCommand for use in this plugin.
|
|
122
126
|
default: ''
|
|
127
|
+
type: string
|
|
123
128
|
ini:
|
|
124
129
|
- section: 'ssh_connection'
|
|
125
130
|
key: 'ssh_args'
|
|
@@ -134,6 +139,7 @@ DOCUMENTATION = """
|
|
|
134
139
|
alternatives: proxy_command
|
|
135
140
|
ssh_common_args:
|
|
136
141
|
description: Only used in parsing ProxyCommand for use in this plugin.
|
|
142
|
+
type: string
|
|
137
143
|
ini:
|
|
138
144
|
- section: 'ssh_connection'
|
|
139
145
|
key: 'ssh_common_args'
|
|
@@ -152,6 +158,7 @@ DOCUMENTATION = """
|
|
|
152
158
|
alternatives: proxy_command
|
|
153
159
|
ssh_extra_args:
|
|
154
160
|
description: Only used in parsing ProxyCommand for use in this plugin.
|
|
161
|
+
type: string
|
|
155
162
|
vars:
|
|
156
163
|
- name: ansible_ssh_extra_args
|
|
157
164
|
env:
|
|
@@ -259,6 +266,7 @@ DOCUMENTATION = """
|
|
|
259
266
|
private_key_file:
|
|
260
267
|
description:
|
|
261
268
|
- Path to private key file to use for authentication.
|
|
269
|
+
type: string
|
|
262
270
|
ini:
|
|
263
271
|
- section: defaults
|
|
264
272
|
key: private_key_file
|
|
@@ -188,7 +188,7 @@ options:
|
|
|
188
188
|
vars:
|
|
189
189
|
- name: ansible_psrp_ignore_proxy
|
|
190
190
|
type: bool
|
|
191
|
-
default:
|
|
191
|
+
default: false
|
|
192
192
|
|
|
193
193
|
# auth options
|
|
194
194
|
certificate_key_pem:
|
|
@@ -221,7 +221,7 @@ options:
|
|
|
221
221
|
- Disables the use of TLSv1.2 on the CredSSP authentication channel.
|
|
222
222
|
- This should not be set to C(yes) unless dealing with a host that does not
|
|
223
223
|
have TLSv1.2.
|
|
224
|
-
default:
|
|
224
|
+
default: false
|
|
225
225
|
type: bool
|
|
226
226
|
vars:
|
|
227
227
|
- name: ansible_psrp_credssp_disable_tlsv1_2
|
|
@@ -262,7 +262,7 @@ options:
|
|
|
262
262
|
- CBT is used to provide extra protection against Man in the Middle C(MitM)
|
|
263
263
|
attacks by binding the outer transport channel to the auth channel.
|
|
264
264
|
- CBT is not used when using just C(HTTP), only C(HTTPS).
|
|
265
|
-
default:
|
|
265
|
+
default: true
|
|
266
266
|
type: bool
|
|
267
267
|
vars:
|
|
268
268
|
- name: ansible_psrp_negotiate_send_cbt
|
|
@@ -28,6 +28,7 @@ DOCUMENTATION = '''
|
|
|
28
28
|
host:
|
|
29
29
|
description: Hostname/IP to connect to.
|
|
30
30
|
default: inventory_hostname
|
|
31
|
+
type: string
|
|
31
32
|
vars:
|
|
32
33
|
- name: inventory_hostname
|
|
33
34
|
- name: ansible_host
|
|
@@ -55,6 +56,7 @@ DOCUMENTATION = '''
|
|
|
55
56
|
version_added: '2.5'
|
|
56
57
|
password:
|
|
57
58
|
description: Authentication password for the C(remote_user). Can be supplied as CLI option.
|
|
59
|
+
type: string
|
|
58
60
|
vars:
|
|
59
61
|
- name: ansible_password
|
|
60
62
|
- name: ansible_ssh_pass
|
|
@@ -64,6 +66,7 @@ DOCUMENTATION = '''
|
|
|
64
66
|
- Password prompt that sshpass should search for. Supported by sshpass 1.06 and up.
|
|
65
67
|
- Defaults to C(Enter PIN for) when pkcs11_provider is set.
|
|
66
68
|
default: ''
|
|
69
|
+
type: string
|
|
67
70
|
ini:
|
|
68
71
|
- section: 'ssh_connection'
|
|
69
72
|
key: 'sshpass_prompt'
|
|
@@ -75,6 +78,7 @@ DOCUMENTATION = '''
|
|
|
75
78
|
ssh_args:
|
|
76
79
|
description: Arguments to pass to all SSH CLI tools.
|
|
77
80
|
default: '-C -o ControlMaster=auto -o ControlPersist=60s'
|
|
81
|
+
type: string
|
|
78
82
|
ini:
|
|
79
83
|
- section: 'ssh_connection'
|
|
80
84
|
key: 'ssh_args'
|
|
@@ -85,6 +89,7 @@ DOCUMENTATION = '''
|
|
|
85
89
|
version_added: '2.7'
|
|
86
90
|
ssh_common_args:
|
|
87
91
|
description: Common extra args for all SSH CLI tools.
|
|
92
|
+
type: string
|
|
88
93
|
ini:
|
|
89
94
|
- section: 'ssh_connection'
|
|
90
95
|
key: 'ssh_common_args'
|
|
@@ -103,6 +108,7 @@ DOCUMENTATION = '''
|
|
|
103
108
|
- This defines the location of the SSH binary. It defaults to C(ssh) which will use the first SSH binary available in $PATH.
|
|
104
109
|
- This option is usually not required, it might be useful when access to system SSH is restricted,
|
|
105
110
|
or when using SSH wrappers to connect to remote hosts.
|
|
111
|
+
type: string
|
|
106
112
|
env: [{name: ANSIBLE_SSH_EXECUTABLE}]
|
|
107
113
|
ini:
|
|
108
114
|
- {key: ssh_executable, section: ssh_connection}
|
|
@@ -115,6 +121,7 @@ DOCUMENTATION = '''
|
|
|
115
121
|
default: sftp
|
|
116
122
|
description:
|
|
117
123
|
- This defines the location of the sftp binary. It defaults to C(sftp) which will use the first binary available in $PATH.
|
|
124
|
+
type: string
|
|
118
125
|
env: [{name: ANSIBLE_SFTP_EXECUTABLE}]
|
|
119
126
|
ini:
|
|
120
127
|
- {key: sftp_executable, section: ssh_connection}
|
|
@@ -126,6 +133,7 @@ DOCUMENTATION = '''
|
|
|
126
133
|
default: scp
|
|
127
134
|
description:
|
|
128
135
|
- This defines the location of the scp binary. It defaults to C(scp) which will use the first binary available in $PATH.
|
|
136
|
+
type: string
|
|
129
137
|
env: [{name: ANSIBLE_SCP_EXECUTABLE}]
|
|
130
138
|
ini:
|
|
131
139
|
- {key: scp_executable, section: ssh_connection}
|
|
@@ -135,6 +143,7 @@ DOCUMENTATION = '''
|
|
|
135
143
|
version_added: '2.7'
|
|
136
144
|
scp_extra_args:
|
|
137
145
|
description: Extra exclusive to the C(scp) CLI
|
|
146
|
+
type: string
|
|
138
147
|
vars:
|
|
139
148
|
- name: ansible_scp_extra_args
|
|
140
149
|
env:
|
|
@@ -149,6 +158,7 @@ DOCUMENTATION = '''
|
|
|
149
158
|
default: ''
|
|
150
159
|
sftp_extra_args:
|
|
151
160
|
description: Extra exclusive to the C(sftp) CLI
|
|
161
|
+
type: string
|
|
152
162
|
vars:
|
|
153
163
|
- name: ansible_sftp_extra_args
|
|
154
164
|
env:
|
|
@@ -163,6 +173,7 @@ DOCUMENTATION = '''
|
|
|
163
173
|
default: ''
|
|
164
174
|
ssh_extra_args:
|
|
165
175
|
description: Extra exclusive to the SSH CLI.
|
|
176
|
+
type: string
|
|
166
177
|
vars:
|
|
167
178
|
- name: ansible_ssh_extra_args
|
|
168
179
|
env:
|
|
@@ -209,6 +220,7 @@ DOCUMENTATION = '''
|
|
|
209
220
|
description:
|
|
210
221
|
- User name with which to login to the remote server, normally set by the remote_user keyword.
|
|
211
222
|
- If no user is supplied, Ansible will let the SSH client binary choose the user as it normally.
|
|
223
|
+
type: string
|
|
212
224
|
ini:
|
|
213
225
|
- section: defaults
|
|
214
226
|
key: remote_user
|
|
@@ -239,6 +251,7 @@ DOCUMENTATION = '''
|
|
|
239
251
|
private_key_file:
|
|
240
252
|
description:
|
|
241
253
|
- Path to private key file to use for authentication.
|
|
254
|
+
type: string
|
|
242
255
|
ini:
|
|
243
256
|
- section: defaults
|
|
244
257
|
key: private_key_file
|
|
@@ -257,6 +270,7 @@ DOCUMENTATION = '''
|
|
|
257
270
|
- Since 2.3, if null (default), ansible will generate a unique hash. Use ``%(directory)s`` to indicate where to use the control dir path setting.
|
|
258
271
|
- Before 2.3 it defaulted to ``control_path=%(directory)s/ansible-ssh-%%h-%%p-%%r``.
|
|
259
272
|
- Be aware that this setting is ignored if C(-o ControlPath) is set in ssh args.
|
|
273
|
+
type: string
|
|
260
274
|
env:
|
|
261
275
|
- name: ANSIBLE_SSH_CONTROL_PATH
|
|
262
276
|
ini:
|
|
@@ -270,6 +284,7 @@ DOCUMENTATION = '''
|
|
|
270
284
|
description:
|
|
271
285
|
- This sets the directory to use for ssh control path if the control path setting is null.
|
|
272
286
|
- Also, provides the ``%(directory)s`` variable for the control path setting.
|
|
287
|
+
type: string
|
|
273
288
|
env:
|
|
274
289
|
- name: ANSIBLE_SSH_CONTROL_PATH_DIR
|
|
275
290
|
ini:
|
|
@@ -279,7 +294,7 @@ DOCUMENTATION = '''
|
|
|
279
294
|
- name: ansible_control_path_dir
|
|
280
295
|
version_added: '2.7'
|
|
281
296
|
sftp_batch_mode:
|
|
282
|
-
default:
|
|
297
|
+
default: true
|
|
283
298
|
description: 'TODO: write it'
|
|
284
299
|
env: [{name: ANSIBLE_SFTP_BATCH_MODE}]
|
|
285
300
|
ini:
|
|
@@ -295,6 +310,7 @@ DOCUMENTATION = '''
|
|
|
295
310
|
- For OpenSSH >=9.0 you must add an additional option to enable scp (scp_extra_args="-O")
|
|
296
311
|
- Using 'piped' creates an ssh pipe with C(dd) on either side to copy the data
|
|
297
312
|
choices: ['sftp', 'scp', 'piped', 'smart']
|
|
313
|
+
type: string
|
|
298
314
|
env: [{name: ANSIBLE_SSH_TRANSFER_METHOD}]
|
|
299
315
|
ini:
|
|
300
316
|
- {key: transfer_method, section: ssh_connection}
|
|
@@ -321,7 +337,7 @@ DOCUMENTATION = '''
|
|
|
321
337
|
version_added: '2.7'
|
|
322
338
|
use_tty:
|
|
323
339
|
version_added: '2.5'
|
|
324
|
-
default:
|
|
340
|
+
default: true
|
|
325
341
|
description: add -tt to ssh commands to force tty allocation.
|
|
326
342
|
env: [{name: ANSIBLE_SSH_USETTY}]
|
|
327
343
|
ini:
|
|
@@ -354,6 +370,7 @@ DOCUMENTATION = '''
|
|
|
354
370
|
pkcs11_provider:
|
|
355
371
|
version_added: '2.12'
|
|
356
372
|
default: ""
|
|
373
|
+
type: string
|
|
357
374
|
description:
|
|
358
375
|
- "PKCS11 SmartCard provider such as opensc, example: /usr/local/lib/opensc-pkcs11.so"
|
|
359
376
|
- Requires sshpass version 1.06+, sshpass must support the -P option.
|
|
@@ -38,7 +38,7 @@ DOCUMENTATION:
|
|
|
38
38
|
postfix:
|
|
39
39
|
description: Indicator of the end of each line inside a comment block, only available for styles that support multiline comments.
|
|
40
40
|
type: string
|
|
41
|
-
|
|
41
|
+
postfix_count:
|
|
42
42
|
description: Number of times to add a postfix at the end of a line, when a prefix exists and is usable.
|
|
43
43
|
type: int
|
|
44
44
|
default: 1
|
ansible/plugins/filter/split.yml
CHANGED
|
@@ -3,7 +3,7 @@ DOCUMENTATION:
|
|
|
3
3
|
version_added: "historical"
|
|
4
4
|
short_description: split a string into a list
|
|
5
5
|
description:
|
|
6
|
-
- Using Python's text object method C(split) we turn strings into lists via a '
|
|
6
|
+
- Using Python's text object method C(split) we turn strings into lists via a 'splitting character'.
|
|
7
7
|
notes:
|
|
8
8
|
- This is a passthrough to Python's C(str.split).
|
|
9
9
|
positional: _input, _split_string
|
|
@@ -50,10 +50,12 @@ DOCUMENTATION = """
|
|
|
50
50
|
description: The string marking the beginning of a comment statement.
|
|
51
51
|
version_added: '2.12'
|
|
52
52
|
type: str
|
|
53
|
+
default: '{#'
|
|
53
54
|
comment_end_string:
|
|
54
55
|
description: The string marking the end of a comment statement.
|
|
55
56
|
version_added: '2.12'
|
|
56
57
|
type: str
|
|
58
|
+
default: '#}'
|
|
57
59
|
"""
|
|
58
60
|
|
|
59
61
|
EXAMPLES = """
|
|
@@ -145,13 +147,16 @@ class LookupModule(LookupBase):
|
|
|
145
147
|
vars.update(generate_ansible_template_vars(term, lookupfile))
|
|
146
148
|
vars.update(lookup_template_vars)
|
|
147
149
|
|
|
148
|
-
with templar.set_temporary_context(
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
with templar.set_temporary_context(available_variables=vars, searchpath=searchpath):
|
|
151
|
+
overrides = dict(
|
|
152
|
+
variable_start_string=variable_start_string,
|
|
153
|
+
variable_end_string=variable_end_string,
|
|
154
|
+
comment_start_string=comment_start_string,
|
|
155
|
+
comment_end_string=comment_end_string
|
|
156
|
+
)
|
|
153
157
|
res = templar.template(template_data, preserve_trailing_newlines=True,
|
|
154
|
-
convert_data=convert_data_p, escape_backslashes=False
|
|
158
|
+
convert_data=convert_data_p, escape_backslashes=False,
|
|
159
|
+
overrides=overrides)
|
|
155
160
|
|
|
156
161
|
if (C.DEFAULT_JINJA2_NATIVE and not jinja2_native) or not convert_data_p:
|
|
157
162
|
# jinja2_native is true globally but off for the lookup, we need this text
|
|
@@ -652,20 +652,28 @@ class StrategyBase:
|
|
|
652
652
|
# only ensure that notified handlers exist, if so save the notifications for when
|
|
653
653
|
# handlers are actually flushed so the last defined handlers are exexcuted,
|
|
654
654
|
# otherwise depending on the setting either error or warn
|
|
655
|
+
host_state = iterator.get_state_for_host(original_host.name)
|
|
655
656
|
for notification in result_item['_ansible_notify']:
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
657
|
+
for handler in self.search_handlers_by_notification(notification, iterator):
|
|
658
|
+
if host_state.run_state == IteratingStates.HANDLERS:
|
|
659
|
+
# we're currently iterating handlers, so we need to expand this now
|
|
660
|
+
if handler.notify_host(original_host):
|
|
661
|
+
# NOTE even with notifications deduplicated this can still happen in case of handlers being
|
|
662
|
+
# notified multiple times using different names, like role name or fqcn
|
|
663
|
+
self._tqm.send_callback('v2_playbook_on_notify', handler, original_host)
|
|
664
|
+
else:
|
|
665
|
+
iterator.add_notification(original_host.name, notification)
|
|
666
|
+
display.vv(f"Notification for handler {notification} has been saved.")
|
|
667
|
+
break
|
|
667
668
|
else:
|
|
668
|
-
|
|
669
|
+
msg = (
|
|
670
|
+
f"The requested handler '{notification}' was not found in either the main handlers"
|
|
671
|
+
" list nor in the listening handlers list"
|
|
672
|
+
)
|
|
673
|
+
if C.ERROR_ON_MISSING_HANDLER:
|
|
674
|
+
raise AnsibleError(msg)
|
|
675
|
+
else:
|
|
676
|
+
display.warning(msg)
|
|
669
677
|
|
|
670
678
|
if 'add_host' in result_item:
|
|
671
679
|
# this task added a new host (add_host module)
|
ansible/plugins/test/change.yml
CHANGED
ansible/plugins/test/changed.yml
CHANGED
ansible/plugins/test/success.yml
CHANGED