Commit Graph
55257 Commits
Author SHA1 Message Date
Matt DavisandGitHub 0ee1c36779 local connection always passes str to Popen (#85239) 2025-05-30 14:39:45 -07:00
2a24633964 Misc ssh agent fixes (#85238)
* Misc ssh-agent fixes

* Replace manual SIGALRM handling with new alarm_timeout context manager
* Misc error handling fixes to ssh-agent startup
* Add SSH_AGENT_EXECUTABLE config to ease failure mode testing
* 100% test coverage on agent startup failure code

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

* make SSH Agent support internal

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-30 13:38:59 -07:00
Matt ClayandGitHub eafe5fc739 Add missing warning methods and args (#85225) 2025-05-30 11:36:21 -07:00
cbcefc53a3 Clean up TE error handling, wrap sigalrm handler (#85232)
* Clean up TE error handling, wrap sigalrm handler

* Preserve error detail on AnsibleAction and Connection exceptions.
* Remove multiple layers of unreachable or redundant error handling.
* Wrap manual alarm signal/timeout handling into a context manager, add tests.

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

* update error message check in test

* update test timeout message assertions

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-30 10:45:10 -07:00
d41a3430b7 async handling changed to use 'true' booleans(#85074)
async_status and async_wrrapper now use booleans instead of 0/1 for 'thruthyness'
gather_facts also updated

Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-30 08:32:49 -07:00
Martin KrizekandGitHub 0e2f770a24 jinja2.__version__ is deprecated (#85221)
Prepare for its removal in Jinja 3.3.

See https://github.com/pallets/jinja/pull/2098
2025-05-30 11:40:10 +02:00
91453e30af Added _TEMPLAR_SANDBOX_MODE config (#85222)
* Added _TEMPLAR_SANDBOX_MODE config

* allows unsafe attribute checks to be disabled in Jinja sandbox

* Update lib/ansible/_internal/_templating/_jinja_bits.py

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

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-30 01:37:58 +00:00
Matt ClayandGitHub e2a5377b9a ansible-test - Fix incorrect use of InferenceContext (#85230) 2025-05-29 23:20:39 +00:00
Matt DavisandGitHub b71d9aa4a5 Decouple SSH client verbosity from Ansible display (#85224)
* decouple SSH client verbosity from Ansible display

* remove failing false-coverage unit test
2025-05-29 09:58:16 -07:00
Matt DavisandGitHub 356bf336bd fix from_yaml_all filter inconsistent None handling (#85223)
* fix from_yaml_all filter inconsistent None handling

* always returns empty list for None or empty string input

* deprecate non-string inputs for from_yaml and from_yaml_all
2025-05-29 09:50:01 -07:00
f05b1d1ccf Improve SUSE distribution detection using VARIANT_ID with fallback (#85152)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-05-29 09:20:15 -07:00
Martin KrizekandGitHub 99a3346de6 dnf5 - handle all specific libdnf5 exceptions (#85175)
Fixes #84634
2025-05-29 11:51:12 +02:00
Martin KrizekandGitHub a0132fec0b dnf5 tests: do not remove attr (#85218)
On RHEL 10, the attr package is in the dependency tree of dnf itself
and cannot be removed.
2025-05-28 20:23:28 +02:00
Kimmo SuominenandGitHub 3b66150cc3 Recognize virtualization type correctly on Linode (#85184) 2025-05-27 17:27:01 +02:00
Abhijeet KasurdeandGitHub 068157618c service: Remove py2 specific code (#85191)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-05-27 16:29:54 +02:00
Martin KrizekandGitHub f635a22d81 apt_repository: remove Python 2 support (#85212) 2025-05-27 16:24:23 +02:00
Jordan BoreanandGitHub 17cee7a982 win coverage - Fix untrusted coverage collection (#85197)
Fixes the logic when running a module through App Control when the
module is not trusted to run in Full Language Mode. This ensures
coverage will still run as expected and that the trust verification only
happens in the wrappers that actually run/prepare the code.

Also expands on a comment to clarify why only that branch is set to set
the internal file encoding to UTF-8.
2025-05-21 20:14:56 +00:00
Matt ClayandGitHub 359173c006 Include message in captured tracebacks (#85196)
This matches the formatting of tracebacks from exceptions.
2025-05-21 13:12:28 -07:00
Matt ClayandGitHub e226294855 display - Replace CRNL with NL (#85194) 2025-05-21 17:42:22 +00:00
Matt ClayandGitHub 53b0f1645b ansible-test - Add RHEL 10.0 remote (#85189)
* ansible-test - Add RHEL 10.0 remote

* Update tests for RHEL 10
* Fix iptables test
* Rework rpm_key integration test
2025-05-21 10:21:27 -07:00
Martin KrizekandGitHub c6a2e5ea75 csvfile lookup: remove Python 2 compat (#85186) 2025-05-21 09:54:24 -07:00
Matt ClayandGitHub 6a1c24ca99 Limit SSH agent DSA testing to RHEL 9 (#85193) 2025-05-21 15:53:38 +00:00
75f7b2267d Add support for Windows App Control/WDAC (#84898)
* Add support for Windows App Control/WDAC

Adds preview support for Windows App Control, formerly known as WDAC.
This is a tech preview feature and is designed to test out improvements
needed in future versions of Ansible.

* Use psd1 and parse it through the Ast to avoid any unexpected execution results

* Add tests for various manifest permutations

* Ignore test shebang failure

* Apply suggestions from code review

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

* Use more flexible test expectations

* Add type annotations for shell functions

---------

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2025-05-21 12:28:58 +10:00
Matt ClayandGitHub e82be177cd ansible-test - Improve deprecated checking type inference (#85159)
* ansible-test - Improve deprecated checking type inference

Also disabled the ``bad-super-call`` pylint rule due to false positives.

* Add type comment support

* Try without using register_transform
2025-05-20 11:23:06 -07:00
Matt ClayandGitHub feda0a5c6e ansible-test - Fix option filtering (#85182) 2025-05-20 11:11:45 -07:00
Matt ClayandGitHub 1e64707592 Remove unnecessary module shebang (#85183) 2025-05-20 05:41:33 +00:00
242bb9ebab DTFIX recategorization and error/warning refactor (#85181)
Co-authored-by: Matt Davis <nitzmahone@redhat.com>
2025-05-20 00:48:00 +00:00
Martin KrizekandGitHub 40c919d7bd Integration tests clean up (#85130)
* Integration tests clean up

* more

* we only test with Ubuntu 24.04 on the controller
2025-05-16 08:25:18 -07:00
Matt ClayandGitHub 97dd5f104c Expand scope of black sanity test (#85169) 2025-05-16 06:28:07 +00:00
Matt ClayandGitHub 14bf64ddf8 Code formatting for .azure-pipelines/ (#85166) 2025-05-16 06:14:44 +00:00
ebd022ee42 Mark integration tests as needs/root (#84487)
For calling setup_test_user, which adds a user to the system (and thus requiring
root):
- become
- become_su
- become_sudo
- slurp

And also:
- apt, which installs/removes system packages
- deb822_repository, which adds/removes apt repos
- hardware_facts calls losetup, which requires root
- package_facts, which installs/removes system packages

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
2025-05-15 23:13:55 -07:00
Matt ClayandGitHub 930ffd1a83 Code formatting for packaging/cli-doc/ (#85167) 2025-05-16 05:52:24 +00:00
Matt ClayandGitHub ed0e78fd9c Code formatting for packaging/release.py (#85168) 2025-05-16 05:44:59 +00:00
Matt ClayandGitHub 460343510c Code formatting for test/sanity/code-smell/ (#85165) 2025-05-16 05:44:15 +00:00
fe2d9e316a Fix constructable inventory default keyed group (#85002)
Fix the logic for a constructable inventory `keyed_groups` entry to use
the `default_value` if the ``key` expression result is `None` or `omit`
and not just an empty string. This bug was introduced with the changes
in data tagging and goes back to the original behaviour.

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2025-05-15 09:52:47 -04:00
Matt ClayandGitHub 7ac74ab591 ansible-test - Update default containers (#85161) 2025-05-15 02:38:59 +00:00
Matt ClayandGitHub 588410fe50 ansible-test - Update sanity requirements (#85160) 2025-05-15 01:30:59 +00:00
Matt DavisandGitHub f5a85493c1 recategorize pass over DTFIX-MERGE entries post b4 (#85155) 2025-05-13 23:24:18 +00:00
Matt ClayandGitHub 567fda6906 Add missing cache plugin test scenarios (#85154) 2025-05-13 14:18:32 -07:00
e5476972da ensure builtin tests always return bool (#85149)
* added unit test validation and coverage enforcement

Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-13 02:53:23 +00:00
7be1359841 misc changelog and docstring cleanup (#85148)
* deferred listify_lookup_plugin_terms deprecation

Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-13 00:11:04 +00:00
Matt ClayandGitHub 93aa611435 release.py - Remove email announcement support (#85060)
Also add missing git and run overloads.
2025-05-12 10:29:42 -07:00
9a426fe303 fix ensure_type to support vaulted values (#85129)
* restored parity with 2.18

Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-10 05:05:56 +00:00
fc8a227647 ensure that all config return values are Origin-tagged (#85127)
Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-09 22:10:55 +00:00
9efba4f972 apply trust to declarative plugin config (#85126)
* trust strings in loaded doc fragments
* added tests
* added hard_fail_context test mechanism

Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-09 19:33:33 +00:00
8a4fb78988 facts: CloudStack KVM Hypervisor to Linux virtual fact (#85117)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-05-09 11:52:27 -07:00
Matt ClayandGitHub 7b69cf3266 ansible-test - Relax some deprecation checks (#85122) 2025-05-08 17:08:18 -07:00
4fe9606530 template module - render None as empty string (#85121)
* template module - render `None` as empty string

* Update changelogs/fragments/template-none.yml

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

---------

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2025-05-08 22:45:53 +00:00
d33bedc48f Misc config type coercion fixes (#85119)
* remove dead config comment noise

* update `list` typed config defaults to be lists

* fix tag preservation/propagation in config
* numerous other ensure_type bugfixes
* 100% unit test coverage of ensure_type
* emit warnings on template_default failures
* fix unhandled exception in convert_bool on unhashable inputs

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

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-08 13:06:18 -07:00
j-dr3andGitHub dcc5dac184 sysvinit: make examples consistent (#85108) 2025-05-08 12:08:14 -07:00