Commit Graph

55260 Commits (devel)
 

Author SHA1 Message Date
Matt Clay cdb7af094b
ansible-test - Use OS packages on FreeBSD 13.5 (#85530) 4 months ago
Brian Coca 19f9c66004
plugin config options are now correctly fetched with origin (#85488)
* also update callbcacks, since they override these functions
due to backwards compat _options being taken for CLI
4 months ago
Aditya Putta a0d56d2f4f
Usage of 'sleep' parameter in ansible.builtin.wait_for_connection (#85435)
Signed-off-by: Aditya Putta <puttaa@yahoo.com>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
4 months ago
Matt Davis 2fbd7c114e
Rewrite exception key on failed_when: false (#85516)
* Prevents callback handle_exception from displaying the captured exception when the task is not failed.
* Added tests.

Co-authored-by: Matt Clay <matt@mystile.com>
4 months ago
Patrick Kingston 737c68ace3
Add install_python_debian parameter to deb822_repository (#85487)
* Add python3-debian dependency installation in module

* Add tests to exercise automatic dependency installation

* Fix broken tests to include new module parameter

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
4 months ago
Abhijeet Kasurde d2be8684b3
Remove deprecated py3compat.environ call (#85501)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
4 months ago
Abhijeet Kasurde a2427e45df
docs: use correct URL in docs (#85491)
* wait_for: use correct URL in docs

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
4 months ago
Abhijeet Kasurde 19c7ec6ed2
Distribution: Added UCS in Debian OS Family (#85496)
* Identify Univention Corporate Server as Debian OS Family.

Fixes: #85490

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
4 months ago
Brian Coca 8c3d23513f
removed removed acceleration keywords (#85507) 5 months ago
Jordan Borean 3882366585
Add AnsiballZ debugging support with debugpy (#85476)
* Add AnsiballZ debugging support with debugpy

Adds support for debugging AnsiballZ modules with debugpy which is used
by VSCode as its Python debugger DAP. Debugging can either be done
through a manual Debugpy listening server through a launch.json
configuration or through the new ansible-test --dev-debug-on-deman
argument.

* Fix up integration test

* Simplify config option and move mypy ignore

* Use new API if available and fix typo

* Guard the import of debugpy

* Fix sanity import issue

* Minor cosmetic adjustments

* Simplify debugger setup

* ansible-test - Refactor debugging interface

* Add ansible-test debug integration tests

* Fix ansible-test shell when in unsupported dir

---------

Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Abhijeet Kasurde eb5e57a8f0
six: bump version from 1.16 to 1.17 (#85478)
Fixes: #85408

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
5 months ago
Matt Martz ee96f8e912
Use the API task URI directly for polling collection imports (#85419) 5 months ago
Brian Coca 319dca2ea8
meta: clear_host_errors, clarify what this applies to (#85463)
* meta: clear_host_errors, clarify what this applies to

It clears host for selection, but does not change state in the current iterator.

* also update example
5 months ago
Sloane Hertel da6735160d
Fix passing callbacks the delegated connection, host, port, and user (#85397)
Fix ssh plugin host variables. Variable names should conform to Python variable naming rules.
, and not contain characters like "[" or "]".

Update unit test
5 months ago
Martin Krizek c24b187f88
dnf/dnf5: remove deprecated install_repoquery option (#85440)
https://github.com/ansible/ansible/issues/85410
5 months ago
Martin Krizek e4135b6f19
yum_repository: remove deprecated keepcache option (#85441) 5 months ago
Abhijeet Kasurde 8207406306
Fixed string type in tags fieldattribute (#84655)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 months ago
Abhijeet Kasurde 34f2f39abe
json filter: update docs (#84989)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Matt Clay d19366331f
ansible-test - Remove obsolete network provisioning (#85433) 5 months ago
Matt Clay 35252fd96c
Drop incidental network tests from CI (#85425) 5 months ago
Matt Davis 6b347bfbf7
default _ansible_tracebacks_for to [] when not specified (#85427)
* eases module unit tests that aren't using our fixture
5 months ago
Patrick Kingston a032f96222
Expand expect module test suite (#85422)
* Test expect module for missing pexpect

* Test expect module for incorrect timeout type

* Test expect module for out of date pexpect failures

* Test pexpect.ExceptionPexpect

Also fixed task naming to be inline with the rest of the file.

* Change pexpect management to venv

* Normalize b_out to b'' when falsy for consistent handling

* Move test venv from /tmp/ to output_dir

* Update tests according to corrections

* Remove break_system_packages when installing pexpect 3.3

* Remove unnecessary if statement

pexpect.run(...) shouldn't ever return None, so it's safe
to remove the check entirely. Maintains 100% coverage
5 months ago
Abhijeet Kasurde e162eda1e6
apt: Mark dependencies as auto (#85170)
* Mark dependent packages as auto which are installed as part of
  deb file installation

Fixes: #78123

Co-authored-by: Matt Clay <matt@mystile.com>
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
5 months ago
Thomas Sjögren 205ca648bf
ansible-doc: print where the description is missing (#85320)
* ansible-doc: print where the description is missing

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
5 months ago
Abhijeet Kasurde 557733abb1
yaml filter: update docs (#85261)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
5 months ago
Xiao Wenyang a4e3575077
stat module, add option to return SELinux Context
Added get_selinux_context option
5 months ago
Matt Clay a1d25cca00
ansible-test - Upgrade coverage to 7.9.1 (#85411) 5 months ago
Matt Clay 6ff6339191
Ensure config env/ini values are tagged (#85404)
* Ensure config env/ini values are tagged

Config env and ini values now have origin and trust tags applied.

* Remove unused import
5 months ago
Matt Davis d6efb7db8a
Short-circuit legacy network module prefix->action mapping (#85406)
* Short-circuit legacy network module prefix->action mapping

* Modified a non-short-circuit compound conditional in a legacy networking path that attempted to resolve an action for any module name containing `_`. The bug was always present, but the typical presentation (an ImportError) was ignored prior to 2.19.
* The legacy networking path should be deprecated and removed in 2.20- a module could still be run under the wrong action if one with a matching prefix is found.

* unit test fix
5 months ago
Matt Clay ac8c66d431
Bump devel version to 2.20.0.dev0 (#85409) 5 months ago
Matt Clay 3511299e1e
Fix deprecated pylint plugin version parsing (#85402) 5 months ago
Sloane Hertel 7216e04139
Remove deprecation warning caused by automatic role argument spec validation (#85401) 5 months ago
Martin Krizek 54ccad9e46
Limit askpass prompts to single attempt (#85364)
* Limit askpass prompts to single attempt

OpenSSH client option NumberOfPasswordPrompts defaults to 3 so in case
an incorrect connection password is provided it is excessively tried 3
times. Not only that but running the `_ssh_askpass` entry point multiple
times (via ssh) results in `json.decoder.JSONDecodeError` as after the
first run the shared memory is zero'd and the subsequent runs end up
calling `json.loads` on empty data.

`json.decoder.JSONDecodeError` does not happen prior to Python 3.13 as
the share memory is unlinked automatically on `.close()` and the
`_ssh_askpass` entry point exits with return code 1 before attempting to
load zero'd memory.

Fixes #85359

* changelog and tests

* Update changelogs/fragments/85359-askpass-incorrect-password-retries.yml

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>

* Update lib/ansible/cli/_ssh_askpass.py

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>

* Avoid race condition in second unlink

---------

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Patrick Kingston fcffd707c6
Test multiple inheritance in _utils get_all_subclasses (#85396)
Should bring code coverage in _utils.py to 100%.
Ensures get_all_subclasses won't enter infinite recursion.
5 months ago
Matt Davis 73369f53af
Remove redundant vars FA on PlaybookInclude (#85395)
* The redundant FA declaration was not static, which broke a number of automatic validation behaviors.
* Added tests to assert deferred validation and lack of templating on `import_playbook.vars`.

Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Matt Davis 29cdba1fee
unified Marker propagation for all Jinja plugin/call ops (#85391)
* Errors raised in most Jinja operations and plugin invocations are now propagated as Markers, allowing template pipeline to continue execution when a Marker-aware consumer is present.
* Added ability to inspect ExceptionMarkers to Protomatter `dump_object` filter.
* Added tests.

Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Matt Davis 649c9ec443
Encryptedstring redact fixes (#85390)
* misc DTFIX/docstring cleanup

* fix EncryptedString redaction, add tests

Co-authored-by: Matt Clay <matt@mystile.com>

* Fix test failures

---------

Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Matt Davis db819d2514
ensure transform_to_native_types converts keys (#85389)
* added basic key visitor support to variable visitor (off by default)
* transform_to_native_types enables new key visit/conversion
* add test

Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Matt Clay 4a03ccbd41
Use codecov-cli for uploads (#85386)
ci_coverage
ci_complete
5 months ago
liviozanol 66a7cfe77d
Docs: fix small typo (#85388) 5 months ago
Matt Davis 11f5563895
Jinja sandbox refinement (#85385)
* DTFIX recategorize

* fix ansible-console generated task dict

* use non-deprecated task shape

* switch Jinja from ImmutableSandboxedEnvironment to SandboxedEnvironment

* Restore ability to call collection mutation methods.
* Restore ability to directly call integer bitwise operator methods.
* Adjust tests.

Co-authored-by: Matt Clay <matt@mystile.com>

---------

Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Patrick Kingston e7c7df7074
Add test coverage to ansiballz builder source mapping (#85382)
Should bring code coverage in _builder.py to 100%.
5 months ago
Matt Davis 547c64f326
deprecate esoteric/undocumented playbook syntaxes (#85378)
Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Matt Davis 1f8937b57e
restore playbook import DS rewrite (#85379)
* add tests for FQ "action" aliases
* add validation for multiple directives

Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Matt Davis 3c52b14c9e
deprecate invalid variable names in inventory (#85377)
* deprecate invalid variable names in inventory

* was previously a hard error for `Host`
* added missing check to `Group`
* swapped blanket Python keyword prohibition with Jinja singleton and `not` check

Co-authored-by: Matt Clay <matt@mystile.com>

* fix invalid variable name test

---------

Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Nils Brinkmann 578d25f286
Add type annotations to the `Role.__init__()` method
PR #85346

This patch adds type-checking to the `Role.__init__()` method. 

Context: https://github.com/ansible/ansible/pull/85249#issuecomment-2956115486

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
Co-authored-by: Nils Brinkmann <nils.brinkmann@rheinmetall.com>
5 months ago
Martin Krizek ef9d92b31d
Test both original and latest dnf versions (#85342)
Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Matt Davis dde10a9afb
import_playbook validation cleanup (#85358)
* use declarative FA validation
* deleted redundant/broken imperative validation
* added test case to ensure templating

Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Matt Clay 3354d0d4e2
Add ticket stub for minor changes (#85350) 6 months ago
Matt Davis fa9f286096
display wrap/format arg cleanup (#85352)
Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago