Commit Graph

13034 Commits

Author SHA1 Message Date
Felix Fontein
352d8ec33a
ansible-doc: fix indent and line wrapping for first line of (sub-)option and (sub-)return value descriptions (#84690)
* Fix initial indent for descriptions of suboptions.
* Fix line width for initial line of option descriptions.
2025-04-14 16:38:21 -04:00
Matt Davis
35750ed321
Templating overhaul, implement Data Tagging (#84621)
Co-authored-by: Matt Davis <mrd@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2025-04-14 08:54:36 -07:00
Brian Coca
6fc592df9b
Fix uninstall tests (#84973)
match file name to package_manager detection of dnf5
2025-04-11 18:55:08 -04:00
Matt Clay
3d30e05bb4
ansible-test - Improve runme.sh error handling (#84972) 2025-04-11 20:56:34 +00:00
Abhijeet Kasurde
c54ff7de41
Filter: add support for URL-safe encoding/decoding in b64* (#84949)
* Added support for URL-safe decoding into b64decode
* Added support for URL-safe encoding into b64encode

Fixes: #84147

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-04-11 09:08:02 -07:00
Martin Krizek
244c2f06ed
Add ssh-agent launching, and ssh-agent python client (#84754)
* Add ssh-agent launching, and ssh-agent python client

* Move things around, is this better??

* docs

* postpone creating dir after bin lookup

* fix method name

* changelog ssh agent

* address reviews

* fix typing

* do not redefine public_key

* typing

* more typing

* Catch OSError when starting ssh agent

* likely copy pasted old code

* var type fix

* why is this needed?

ci_complete

* ignoring the change for now

* write out pub key file atomically

* defensive timeout for the socket

* _populate_agent docstring

* do not allow setting these in config

* check expected length before slicing blobs

* test all key types

* remove lock/unlock functionality

* docstring

* private _ssh_agent

* .

* launch agent in cli and ansible_ssh_*

* additional info for ssh-agent comment

* Add tests for remove and remove_all

* comment on os.rename

* hopefully mitigate agent startup/delays problems

* exceptions

* unused import

* fix sanity

* perf

---------

Co-authored-by: Matt Martz <matt@sivel.net>
2025-04-10 15:30:34 -07:00
Brian Coca
4bc4030988
ansible-pull fix adhoc output inconsistencies on changed (#84869)
Two fixes for single bug:
  - ignore callback changes for adhoc
  - allow 'yaml' change matching
---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-04-10 14:56:52 -04:00
Matt Martz
fd76cc2821
Revert "basic: remember the user sensitive information to use later (#84699)" (#84959)
This reverts commit 19e9f3dae2.
2025-04-10 11:19:11 -05:00
Abhijeet Kasurde
5347d4d4fc
distro: detect debian for OS_FAMILY for LMDE 6 (#84941)
Fixes: #84934

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-04-09 16:22:20 -04:00
Abhijeet Kasurde
19e9f3dae2
basic: remember the user sensitive information to use later (#84699)
* Git allows embedding username and password in repo URL for
  https authentication. This may lead to exposing the user sensitive
  information to logs and unautheticated users.
  Adding no_log will partially solve this.
* Added documentation warning user about URL embedded with username
  and password.
* Added logic to remember user sensitive information for later sanitization

Fixes: #84557

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-04-08 09:53:36 -05:00
Matt Clay
462affa7c4
Clean up interpreter discovery (#84394)
* Clean up interpreter discovery

- Deprecated `auto_legacy` and `auto_legacy_silent`
- Removed obsolete platform fallback config and logic
- Replaced unit tests with integration tests
- Increased test coverage
2025-04-03 18:07:36 +00:00
Jordan Borean
b7d76a93b2
Fix up coverage with async on Windows (#84917)
Fixes the coverage collection for Windows and async tasks. This ensures
the async task still has access to the PSHost so that it can access the
runspace debugger tasks on the host.
2025-04-03 12:56:51 +10:00
Abhijeet Kasurde
2a4b1c8248
ansible-config: Dump galaxy server config in proper JSON format (#84912)
Fixes: #84840

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-04-01 11:36:15 -04:00
Jordan Borean
7d0886457a
Windows Exec Runner Update (#84868)
Updates the Windows exec runner in preparation for the WDAC changes.
This new process is designed to improve the way modules are run by
Windows and expose common functionality to run PowerShell code in a
common environment. It also includes futher changes to improve the error
handling to make it easier to see where an error occurred in the running
code.
2025-04-01 11:24:35 +10:00
Matt Clay
b3d21e3ad2
Fix apt and dpkg_selections tests (#84900)
* Fix apt and dpkg_selections tests

The tests now support aarch64.
They also have reduced dependencies on URLs hosted on third-party servers.

* Skip tests on unsupported platforms

* Use same package version for both tests

* Fix multi-arch support for Ubuntu 22.04
2025-03-27 09:05:25 -07:00
Matt Clay
87422526f5
Expand tests for apt_repository (#84904) 2025-03-27 04:52:24 +00:00
Anvit Pusalkar
1e5aac7b4f
Set IPv4 and IPv6 simultaneously (#84829) 2025-03-21 16:19:58 -04:00
Matt Clay
e53c12fe2b
ansible-test - Update base/default containers (#84874) 2025-03-20 13:25:55 -07:00
Matt Clay
f4aafe1a94
ansible-test - Update pylint requirement (#84872) 2025-03-20 17:18:03 +00:00
Matt Clay
35665db4ed
Miscellaneous integration test fixes (#84871) 2025-03-20 16:48:02 +00:00
Matt Clay
091994a477
ansible-test - Update sanity test requirements (#84866) 2025-03-20 01:21:56 +00:00
Matt Clay
b7a5411d8b
ansible-test - Improve pep8 compat with black (#84867) 2025-03-20 01:17:01 +00:00
Matt Clay
7e7946b60d
Require Jinja2 3.1.0 or later (#84864) 2025-03-20 00:21:26 +00:00
Matt Clay
ad5cf37625
Add typing_extensions for core unit tests on <3.11 (#84865) 2025-03-20 00:00:07 +00:00
Brian Coca
0d4f00f5c8
needed intesect, not difference (#84839)
fixes #84750

Added tests to verify output when using smart + others
2025-03-19 10:41:30 -04:00
Robert Muir
61a6222e0e
uri: form location correctly from relative redirect (#84541)
* uri: form location correctly from relative redirect

Previously, the original URL would be combined with the relative location incorrectly, especially for URL of any complexity.

Add simple tests demonstrating the problem that fail without the fix

* fix pylint error, import the method similar to other uri methods

* add changelog fragment

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-03-18 15:54:48 -04:00
Jordan Borean
101e2eb19a
windows async - refactor async wrapper code (#84712)
Refactor the async wrapper and watchdog scripts for Windows. This
attempts to avoid WMI on connection plugins that allow breaking away
from a job like winrm and ssh as an optimisation and changes how WMI is
used so that we can get the error details on a failed process more
easily.

These changes are being made also in preparation for the WDAC
implementation that requires this new execution model where input needs
to be provided through stdin.
2025-03-19 04:47:32 +10:00
Matt Martz
8127abbc29
Don't inherit stdio (#82770) 2025-03-17 10:08:11 -05:00
Matt Martz
3684b4824d
Remove reliance on sshpass and utilize SSH_ASKPASS (#83936)
* Add SSH_ASKPASS as an alternative means to provide ssh with passwords
2025-03-17 10:07:44 -05:00
Matt Clay
4efb01c2f3
ansible-test - Replace FreeBSD 13.4 with 13.5 (#84812) 2025-03-11 15:21:38 -07:00
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко)
df08ed3ef3
🔥 Remove Python 2 datetime compat fallbacks
This patch marks the `ansible.module_utils.compat.datetime` module as deprecated, including `UTC`, `utcfromtimestamp()`  and `utcnow` shims that it provides, scheduling its removal for v2.21.

It also replaces any uses of the compatibility helpers with non-deprecated calls to CPython stdlib.

PR #81874

Co-authored-by: Matt Clay <matt@mystile.com>
2025-03-11 17:19:40 +01:00
Abhijeet Kasurde
50b4e0d279
facts: use pagesize for darwin (#84779)
Fixes: #84773

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-03-11 15:40:46 +00:00
Martin Krizek
7fbaf6cfcf
dnf5: fix is_installed check for provided packages (#84802)
Fixes #84578
2025-03-11 16:27:13 +01:00
Martin Krizek
09391f38f0
dnf tests: unique environment/group name (#84785)
Prevents `Group state for \"customenvgroup\" not found` error which may
or may not be a regression in dnf5. Just name groups/envs uniquely to
workaround the issue.
2025-03-06 11:28:19 +01:00
Abhijeet Kasurde
532e3ea3ec
test: error handling in include_role (#84737)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-03-04 15:17:01 +00:00
Matt Clay
9ef623a517
Integration test cleanup (#84763)
This brings in integration test fixes from the data tagging PR which are unrelated to DT changes.
2025-03-01 03:11:46 +00:00
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко)
4a710587dd
🧪 Add macOS 15.3 to CI and ansible-test (#84665) 2025-02-25 18:55:03 +01:00
Matt Clay
5ff8d093f0
ansible-test - Code style cleanup (#84749)
* ansible-test - Minor style cleanup (add blank lines)

* ansible-test - Use `"""` instead of `'''`
2025-02-25 04:47:45 +00:00
Jordan Borean
e9e6001263
winrm - Remove pexpect kinit code (#84735)
Removes the use of pexpect in the winrm connection plugin and rely on
just subprocess. In the past pexpect was used for macOS compatibility so
that it could handle the TTY prompt but after testing it seems like
subprocess with `start_new_session=True` is enough to get it reading
from stdin on all platforms. This simplifies the code as there's no
longer an optional library changing how things are called and will work
out of the box.
2025-02-25 04:59:04 +10:00
Matt Clay
bddb9a7490
ansible-test - Support target testing with black (#84744) 2025-02-24 17:09:38 +00:00
Matt Clay
989e583356
ansible-test - Initial support for black in core (#84741) 2025-02-24 08:39:59 +00:00
Matt Martz
2a3c93f593
Deprecate strategy plugins (#84728)
* Deprecate strategy plugins. Fixes #84725
2025-02-19 14:28:55 -06:00
Jordan Borean
a742e20fca
ansible-test validate-modules - fix ps util checks (#84610)
* ansible-test validate-modules - fix ps util checks

Fix the module util import checks done by `ansible-test sanity --test
validate-modules` to support the newer `#AnsibleRequires` import
statement and `-Optional` flag.

* Fix sanity issues
2025-02-19 07:42:22 +10:00
Lee Garrett
d21788a9b4
Fix integration tests on debian (#84379)
* Simplify conditional for service_facts integration test

This test requires systemd, so just test for that. Also fixes running this on
Debian testing/unstable releases, where ansible_distribution_version is "n/a".

* Clean up after service_facts integration test

* Simplify set_fact in interpreter_discovery_python test

Those vars are always set, either to something discovered, or "n/a". There are
no evaluations against the value "unknown".

* interpreter_discovery_python: Fix Debian test

Debian doesn't set VERSION_ID in /etc/os-release on pre-releases, see
https://bugs.debian.org/1008735

ansible 2.17 onwards does not support python 2.7 anyway.

* fix deb822_repository integration test failure on Debian

* Fix integration test hostname for Debian

* Fix integration test mount_facts

Some VMs might only have a single mount point, so they only have a single UUID.

* Add package deps for integration test subversion

/usr/bin/htpasswd is shipped in apache2-utils and needed by the main playbook.

* Fix integration test "service" on Debian sid

Debian sid does not set ansible_distribution_version, as such any tests assuming
it's a numeric value will fail. Since this is ancient test code that predates
ansible_service_mgr, remove the error-prone heuristic and rely on that var
instead.

* Fix service integration tests not running on *BSD

---------

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
2025-02-18 13:33:24 -08:00
simonLeary42
55e9e21ded
better error message for malformed documentation (#84705)
No the file name that caused the error will be apparent
---------

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-02-17 16:12:14 -05:00
Martin Krizek
cc30f25c42
Make timeout on become an unreachable error (#84589)
* Make timeout on become an unreachable error

Fixes #84468
2025-02-17 08:49:50 -06:00
Matt Davis
5d7b8288f8
Fix local connection and become issues (#84700)
* Fixed various become-related issues in `local` connection plugin.
* Fixed various issues in `sudo` and `su` become plugins.
* Added unit and integration test coverage.

Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Matt Davis <nitzmahone@redhat.com>
2025-02-13 09:17:57 -08:00
Martin Wilck
21492e27fa
Add openSUSE MicroOS to SUSE family list (#84685)
* Add openSUSE MicroOS to SUSE family list

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-02-11 10:27:10 -05:00
Abhijeet Kasurde
411b7985a5
test: Enable group tests for Alpine (#84652)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-02-11 10:10:08 -05:00
Abhijeet Kasurde
d0110ff691
test: enable user test for alpine (#84644)
* test: enable user test for alpine

* Disable user home update tests

* Disable some more tests which are not applicable for Alpine

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-02-11 10:09:29 -05:00
Sloane Hertel
d049e7b1b3
fix broken ansible-galaxy-collection resolvelib test (#84626) 2025-02-11 10:03:58 -05:00
Sloane Hertel
a086c34a91
linear - don't treat end_role as a run_once task (#84673) 2025-02-11 08:54:39 -06:00
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко)
cdb1ce000a
Fix is_pinned property of Requirement (#81812)
Previously, requirement version specs starting with `!=` were
incorrectly considered as pinned release requests because the
comparison was being made against a one-char string while the
operator is two-char. This patch changes the check to test against `!`
which is enough to detect this case.
2025-02-08 00:01:23 +01:00
Sloane Hertel
333ee8d010
Test include_vars reserved variable matching (#84678)
* Add test case for include_vars

* Revise test to catch erroneous warnings
2025-02-07 16:15:59 -05:00
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко)
ee49adfaf4
🧪🔥 Delete the egg-info integration test (#84686)
Previously, the integration test depended on luck. `setuptools` used
to be bundled in Python stdlib's `ensurepip`. Python 3.12 and newer no
longer include it. This test imports `pkg_resources` that is a part of
`setuptools`, meaning that it'll run out of luck at some point, under
newer Python runtimes.

This test does not seem to be useful to us so instead of fixing it, we
remove it from the repo [[1]].

Supersedes #84681.

[1]: https://github.com/ansible/ansible/pull/84681#discussion_r1945525317
2025-02-07 19:43:29 +01:00
Matt Clay
f3ccd78cce
ansible-test - Update base/default containers (#84670) 2025-02-05 02:09:06 +00:00
Matt Clay
cd881bf71e
ansible-test - Add pytest-mock to mypy sanity test (#84669) 2025-02-05 00:58:48 +00:00
Matt Clay
7594243fc0
ansible-test - Update sanity test requirements (#84667) 2025-02-04 15:03:34 -08:00
Matt Clay
21bc1d915d
ansible-test - Fix warning message grammar (#84666) 2025-02-04 19:58:21 +00:00
Matt Clay
4b38456e4f
ansible-test - Correct CLI arg type and annotation (#84664) 2025-02-04 17:53:14 +00:00
Matt Davis
a6b5861c53
add lightweight core issue template for bot-ignored issues (#84638) 2025-01-29 18:18:48 -08:00
Matt Clay
ce392dd86e
Revert "generator: add support for extra vars usage (#84544)" (#84619)
This reverts commit 186c716af1.
2025-01-27 17:59:29 -08:00
Abhijeet Kasurde
e6adddcaf8
debug: hide loop variables while using var (#84597)
Fixes: #65856

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-23 15:00:32 -08:00
Abhijeet Kasurde
c9097f73a2
uri: Handle HTTP exception raised (#84015)
* Handle HTTP exceptions raised when reading the content
  such as IncompleteRead

Fixes: #83794

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-21 21:39:28 +00:00
Abhijeet Kasurde
186c716af1
generator: add support for extra vars usage (#84544)
* generator: add support for extra vars usage

Fixes: #83270

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* CI green

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Review requests

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Review requests II

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-21 15:20:51 -05:00
Brian Coca
4953fc7b26
Apt key bye (#84555)
* apt-key module updates due to debian removal

Still kept for now for backwards compat, but removing from testing when not present
And adding more explicit mesasges to errors to point to new module

* added docs and error msg

* clog

* aslkdfj

* no docs to document doc changes

* also add warning to apt_repository

* clog on apt_repo too

* fix string concat

* Apply suggestions from code review

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-21 14:45:38 -05:00
Martin Krizek
3b6d086f5e
targets/handlers: fix incorrect test cmd (#84567) 2025-01-21 10:38:03 -05:00
Jordan Borean
8c5e33cd3a
Ansible.Basic - Fix required_if check (#84562)
Fixes the Ansible.Basic `required_if` check when the option to check is
either unset or explicitly set to null.
2025-01-21 05:00:03 +10:00
Jordan Borean
f86c58e2d2
ssh - Improve CLIXML stderr parsing (#84569)
Improves the logic for parsing CLIXML values in the stderr returned by
SSH. This fixes encoding problems by having a fallback in case the
output is not valid UTF-8. It also can now extract embedded CLIXML
sequences in all of stderr rather than just at the start.
2025-01-21 04:42:12 +10:00
Brian Coca
675d7201d8
fix template (#84563)
also fix gather_subset warning and add some comments/notes
---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-16 16:33:43 -05:00
Lee Garrett
3030c79331
user: Fix homedir permissions when UMASK is unset in /etc/login.defs
When a user doesn't exist and user module is used to create the user and the
homedir, adduser is called which parses HOME_MODE from /etc/login.defs, and when
not set calculates the mode from UMASK from the same file.

When a user already exists without homedir, and the user module is used to add a
home dir, it incorrectly ignores HOME_MODE, resulting in a world-readable home
dir when UMASK is not set. This is for example the case in Debian trixie and
later, and likely Ubuntu 25.04 and later.


Signed-off-by: Lee Garrett <lgarrett@rocketjump.eu>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-14 11:44:16 -08:00
Matt Clay
5623a386c1
Fix unit and integration tests (#84554)
This is a follow-up to https://github.com/ansible/ansible/pull/84473
2025-01-14 09:27:39 -08:00
Matt Clay
7677bf1c9b
ansible-test - Use urllib intead of curl (#84551)
Also added automatic retries on HTTP request exceptions, since all currently implemented methods (GET/PUT/DELETE) are idempotent.
2025-01-14 08:59:42 -08:00
Brian Coca
a046ef5a95
fix incongruent ansible-vault cli options (#84494)
prompt now only errors if stdin is specifically triggered and not due to lack of other args

fixes #84489
---------

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2025-01-14 10:46:52 -05:00
Lee Garrett
73180c0630
ansible-vault integration test fix (fixes: #83837) (#84486)
Correct the test that expects an error when using ansible-vault to write against
a non-writeable dir. Skip the test as root, as root can always write.

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
2025-01-14 15:46:31 +00:00
Abhijeet Kasurde
5b0d170496
get_url: add support for BSD-style digest (#84485)
* Added support for BSD-style digest file to test
  checksum of downloaded file.

Fixes: #84476

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-14 15:44:29 +00:00
Kristopher Newsome
f727d74fc2
Allows iptables chain creation with wait parameter (#84491)
* Allows iptables chain creation with wait parameter

Fixes #84490

* Add the changelog fragment for 84490
2025-01-14 10:43:08 -05:00
Felix Fontein
ae55f874a0
Enforce FQCNs in seealso plugin/module entries. (#84325) 2025-01-13 17:24:09 -05:00
Felix Fontein
60e2135c2b
Bump acme test container to 2.3.0 (#84547) 2025-01-13 11:24:56 -08:00
Matt Clay
eb475e23f7
ansible-test - Update utility containers (#84545) 2025-01-11 01:09:48 +00:00
Brian Coca
20baf29a2a
fix warnings about reserved variable names to cover all sources (#84432)
Also remove redundant check from tqm
Now covers module output (set_fact/include_vars)
Includes play objects at any stage (tasks that error were not covered)
Added tests, moved them to role structure
2025-01-10 18:03:18 +00:00
Matt Clay
96f7090acc
Use ECR Public for container test (#84537) 2025-01-09 21:16:01 -08:00
Matt Clay
3b77277428
ansible-test - Fix FreeBSD instance CA certs (#84529)
Some versions and architectures come with `ca_root_nss` pre-installed.
However, at least FreeBSD 13.4 on aarch64 does not.
This change ensures the certificates will always be installed.
2025-01-07 19:17:35 -08:00
Matt Clay
1b3face065
ansible-test - Replace FreeBSD 14.1 with 14.2 (#84527)
* ansible-test - Replace FreeBSD 14.1 with 14.2

* Remove cron faketime testing from FreeBSD
2025-01-07 17:15:27 -08:00
Matt Clay
f552fe2c15
ansible-test - Replace RHEL 9.4 with 9.5 (#84526) 2025-01-07 15:11:33 -08:00
Matt Clay
35c4b58c11
ansible-test - Replace Alpine 3.20 with 3.21 (#84525) 2025-01-07 14:37:35 -08:00
Matt Clay
648dcd3a6a
ansible-test - Replace Fedora 40 with 41 (#84281)
* ansible-test - Replace Fedora 40 with 41

Also update other distro containers to remove unnecessary packages:

* apache2
* subversion
* ruby

* Fix subversion test on Ubuntu

Also remove obsolete vars files from subversion test.

* Skip dnf test on Fedora 41+

The dnf5 test is all that is needed.

* Support dnf5 for the package test

* Extend unix-chkpwd work-around for Fedora
2025-01-07 13:46:48 -08:00
Matt Clay
91f4b71d40
Fix uri integration test on Python 3.13 (#84518) 2025-01-06 17:50:34 -08:00
Matt Clay
eb6d581286
ansible-test - Update nios-test-container to 7.0.0 (#84517) 2025-01-06 15:59:58 -08:00
Matt Clay
5ec236b564
Fix result_pickle_error integration test (#84506)
The test has been updated to use a custom type which does not support pickling,
instead of relying on Jinja's `Undefined` type. As of Jinja 3.1.5 that type now
supports pickle, which breaks the original implementation of the test.
2025-01-02 19:59:16 -08:00
Abhijeet Kasurde
f72aa1dc0c
test: Update regex for required and default in FieldAttributes (#84209)
Fixes: #61460

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-03 02:14:56 +00:00
Brian Coca
c64c389007
gather_facts, fix 'smart' handling with network os and 'setup' (#84425)
gather_facts, fix network_os and smart logic and defaults

setup will be default for smart only if network_os is not set, now you get warnings and errors when missing a valid facts module for a network os

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-17 10:19:43 -05:00
David Lassig
106909db8b
adding option for form-multipart data to switch multipart encoding (#80566)
* adding option for form-multipart data to switch multipart encoding from default base64 to 7or8bit encoding

Co-authored-by: davlas <david.lassig@bwi.de>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2024-12-10 07:54:23 -08:00
Brian Coca
3c91eab0d8
copy, prevent internal options in task (#84422)
* copy, prevent internal options in task

fixes #84367
2024-12-10 10:07:12 -05:00
Herman van Rink
363c57b311
csvfile - let the config system do the typecasting (#82263)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-06 16:15:17 +00:00
Abhijeet Kasurde
ac110eb012
lookup_template: added trim_blocks option (#84254)
* Allow user to control the trimming of blocks while templating
* Added tests
* Updated documentation and example

Fixes: #75962

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-06 15:44:08 +00:00
Abhijeet Kasurde
0f466bb75f
test: Remove dead code (#84436)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-05 14:52:12 -08:00
Stefano Rivera
d500354798
unarchive: Clamp zip timestamps on 32-bit time_t (#84409)
Clamp zip timestamps to representible values when unpacking zip files on
platforms that use 32-bit time_t (e.g.  Debian i386). This is a
non-issue in practice (in 2024), but should allow the test suite to pass
on Debian i386.

We use a round value of 2038-01-01 00:00:00 for simplicity, and to avoid
running into timezone offsets closer to the actual limit.

MR #81520 introduced sanity-checking tests that used dates not
representable with a 32-bit time_t.
2024-12-05 17:26:58 -05:00
Sloane Hertel
af2bb2c182
wait_for_connection - test connection=local does not emit warning (#84438)
Add test for PR 84421
2024-12-05 17:24:48 -05:00
Alex Willmer
59d9737788
fix reset_connection with templated connection variables (#84240)
* ssh: Test reset_connection with templated ansible_ssh_executable

Add failing test to confirm subsequent fixes are necessary & sufficient.

* ssh: Fix reset_connection with templated ansible_ssh_executable

Signed-off-by: Alex Willmer <alex@moreati.org.uk>
2024-12-05 15:54:46 -05:00
Abhijeet Kasurde
b154e38e54
config lookup, fixes and tests (#84398)
* Integration tests for lookup_config

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-05 11:19:34 -08:00
Lee Garrett
6d21e28c73
Fix non-root integration tests failure (#84378)
* Fix callback_default integration test for non-root users

This test compares the test output to previously collected output. However, this
previously assumed that the tests are run as root, even though needs/root in
aliases is not set.

So instead parameterize the output, and use sed to replace the value that
diverge when running it as different users.

* integration tests: Ensure temp file removal doesn't fail as non-root user

* Don't fail when ansible-galaxy integration test runs as non-root

* Update integration test callback list

---------

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
2024-12-05 14:17:29 -05:00
Abhijeet Kasurde
1ad0c404ef
Coverage for virtual/sunos.py (#84357)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-03 09:11:49 -08:00
Abhijeet Kasurde
2ca086c993
Coverage for virtual/hpux.py (#84362)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-03 10:41:56 -05:00
Abhijeet Kasurde
5b231bbbdb
test coverage for virtual/sysctl.py (#84356)
* test coverage for virtual/sysctl.py

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-03 10:33:30 -05:00
Abhijeet Kasurde
92cf41aa46
Additional tests for lookup_sequence (#84315)
* Additional tests for lookup_sequence

* Follow up for https://github.com/ansible/ansible/pull/83758,
  to add tests for stride parameter.
---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-03 10:06:29 -05:00
Abhijeet Kasurde
9588215601
Removed deprecated include_delegate_to param (#84306)
* Removed deprecated include_delegate_to param

* Remove deprecated include_delegate_to param from
  get_vars API in manager.py

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Make ignore.txt

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-03 10:04:32 -05:00
Jordan Borean
f9b58fa13f
ansible-test - fix coverage for test modules (#84366)
Fixes the coverage path translation for modules located in integration
test paths. Instead of trying to match by the unique temporary path name
that the module is executed as, the reporting tool will translate it to
the static path that the module is actually located under.
2024-11-27 13:43:06 +10:00
Lee Garrett
f2a77b071e
Test aliases fix (#84377)
* integrity tests: Tag (destructive) root tests as such

- apt_key needs root to touch the apt key database
- debconf needs root to change debconf values of system packages
- gathering writes to /etc/ansible/*, writeable only to root
- group creates system groups
- noexec mounts/umounts a ramdisk
- systemd requires root to start/stop services

Mark all except noexec as "destructive" as they change the state of the system.

* integration test cron requires root, as it calls setup_cron

* integration test dpkg_selection runs dpkg as root

* integration test facts_linux_network requires root

It adds/removes IP addresses from network interfaces, requiring root for that.

* integration test package requires root

installs/removes system packages

* Integration test service requires root

Creates/starts/stops/removes systemd services

* integration test user requires root to create users

* integration tests using setup_test_user require root

---------

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
2024-11-25 16:43:40 -08:00
Martin Krizek
2a53b851fe
dnf5,apt: add auto_install_module_deps option (#84292)
* dnf5,apt: add auto_install_module_deps option

Fixes #84206
2024-11-21 10:06:18 -06:00
Matt Clay
95e3af3e0f
ansible-test - Improve container network detection (#84323)
When detection of the current container network fails, a warning is now issued and execution continues.
This simplifies usage in cases where the current container cannot be inspected, such as when running in GitHub Codespaces.
2024-11-19 10:49:24 -08:00
Martin Krizek
c99493eb3f
dnf5 - consolidate package resolving settings (#84335)
Fixes #84334
2024-11-19 18:00:35 +01:00
Martin Krizek
a27a7a27d1
dnf5: fix is_installed check (#84275)
Fixes #84259
2024-11-19 09:32:04 +01:00
Sloane Hertel
3e82ed307b
include_vars - fix including new hash variables when hash_behaviour is set to merge (#84303) 2024-11-14 13:50:14 -05:00
James Ramsaran
e14f9fe725
Sequence query fix (#83758)
Co-authored-by: flowerysong <junk+github@flowerysong.com>
2024-11-13 19:46:57 -08:00
Abhijeet Kasurde
ca0810da85
Add tests for deprecations (#84284)
* Check for module deprecation
* Check for module option deprecation
* Check for plugin deprecation

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-11-12 16:09:39 +01:00
Brian Coca
e404bc17f7
package_facts fix empty packages on foreign mgr (#83855)
* package_facts fix empty packages on foreign mgr

return the first package manager that provides output

add tests with fake rpm on apt machines
2024-11-12 08:36:26 -05:00
Jordan Borean
52ecd3664a
ansible-test - align 2025 connection defaults to CI matrix (#84291) 2024-11-11 09:07:35 +10:00
Matt Clay
9d249432c4
Increase scope of mypy sanity test (#84288)
* Increase scope of mypy sanity test

* Fix issues reported by mypy
2024-11-09 02:58:29 +00:00
Jordan Borean
7501bbec20
Add support for Windows Server 2025 (#84285)
Adds Windows Server 2025 to the testing matrix.
2024-11-08 12:28:20 +10:00
Matt Clay
a98801903d
ansible-test - Replace FreeBSD 13.3 with 13.4 (#84236)
* ansible-test - Replace FreeBSD 13.3 with 13.4
* ansible-test - Fix typos in bootstrap.sh
* Skip libfaketime on FreeBSD except FreeBSD 14
2024-11-07 13:19:26 -08:00
Alexei Znamensky
1d61f2a4fd
remove ignore clauses for module uri (#83642)
Co-authored-by: flowerysong <junk+github@flowerysong.com>
2024-11-07 14:56:51 +00:00
Sloane Hertel
157ef04b1e
Add --flush-cache option to ansible-pull (#84211) 2024-11-06 11:40:15 -05:00
Sloane Hertel
771f7ad29c
update ansible-galaxy resolvelib requirement to >= 0.5.3, < 2.0.0 (#84218)
* Update resolvelib upperbound to 2.0.0

Minor SemVer releases should not contain breaking changes

* Test the latest minor release and reduce number of resolvelib versions tested for efficiency
2024-11-06 10:20:26 -05:00
Matt Clay
68bfa37838
ansible-test - Fix interactive cmd traceback (#84264) 2024-11-05 23:50:34 +00:00
spyinx
9cdd6e58b3
Fixed ipv6 pattern in parse_address (#84237) 2024-11-05 08:05:21 -08:00
Abhijeet Kasurde
f92e99fd8f
test: fix check_required_by (#84153)
* Update the documentation for check_required_by
* Fix return value for check_required_by (now returns empty list on success)

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-11-02 10:36:45 -07:00
Sloane Hertel
32ae3ce117
Remove encrypt unit tests for undocumented algorithms, which are disallowed in 2.19. (#84219) 2024-11-01 13:21:24 -04:00
Abhijeet Kasurde
8784469b4c
encrypt: raise error on passing unsupported passlib hashtype (#84186)
* Raise an AnsibleFilterError when unsupported passlib hashtype is
  provided in do_encrypt.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-31 15:27:37 +00:00
anvitpusalkar
2c6b78f516
Add --flush-cache option for ansible and ansible-console (#84149)
* Allow CLIs that accept inventory options to flush the inventory cache(s) and fact cache

Fixes #83749
2024-10-30 14:59:01 -04:00
Sloane Hertel
03acb22f99
Fix returning unreachable for looped tasks (#84049)
* Fix returning unreachable for looped tasks

Add tests for ignore_unreachable and loop
2024-10-30 10:35:23 -04:00
Sloane Hertel
a3b58fb67c
Add a test using ignore_errors as a variable (#84175)
* Add a regression test for https://github.com/ansible/ansible/issues/32384
2024-10-29 16:32:17 +01:00
Abhijeet Kasurde
3a40ba3b2c
Remove deprecated pycompat24 and importlib (#84161)
* Removed deprecated pycompat24 and importlib

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Make CI green

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Ignore basic.py

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Make CI green III

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Make CI green IV

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-29 16:14:01 +01:00
Abhijeet Kasurde
f29b46e438
Remove deprecated plural form of collection path (#84156)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-29 16:07:20 +01:00
Conner Crosby
d662a8d088
Enable file module to disable diff_mode (#83700)
Several tasks within the modification_time.yml and state_link.yml task
lists have explicitly enabled diff_mode because these tests previously
assumed a diff attribute would always be returned from the file module.
2024-10-25 18:32:11 +00:00
Abhijeet Kasurde
ab1a8cb3b3
docs: print deprecation collection name (#84126)
While showing the deprecation message, mention the collection name
from which the module is removed.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-25 11:20:11 -07:00
Matt Davis
c9ac477e53
Preserve _ansible_no_log from action result; fix include_vars to set properly (#84143)
* fixes for CVE-2024-8775

* propagate truthy `_ansible_no_log` in action result (previously superseded by task-calculated value)
* always mask entire `include_vars` action result if any file loaded had a false `show_content` flag (previously used only the flag value from the last file loaded)

* update no_log tests for CVE-2024-8775
* include validation of _ansible_no_log preservation when set by actions
* replace static values with dynamic for increased robustness to logging/display/callback changes (but still using grep counts :( )

* changelog

* use ternary, coerce to bool explicitly
2024-10-24 22:56:54 +00:00
Brian Coca
11e4a6a722
user module avoid conflicts ssh pub key (#84165)
Remove pub key if we are going to generate private
fix tests for os X
2024-10-24 14:39:51 -04:00
Abhijeet Kasurde
b1816880cb
Remove deprecated compat.selector (#84155)
* Removed files related to selector compat

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-23 14:54:40 +00:00
Abhijeet Kasurde
1e6ffc1d02
Fixed broken tests (#84088)
* Add `match=` in pytest.raises
* Remove redundant assert statements

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2024-10-18 14:11:33 -07:00
Abhijeet Kasurde
1727bbecce
test: Remove unreachable tests (#83696)
variable_manager unit tests are unreachable. These tests
are already covered in integration tests.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-18 12:23:40 -07:00
Abhijeet Kasurde
53ceb74e84
Use open with context manager (#83337)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-18 10:53:11 -07:00
Sviatoslav Sydorenko (Святослав Сидоренко)
f7766cf843
Trim selinux_policytype @ integration tests (#84136)
The shell command sometimes prints a trailing whitespace which breaks
the tests on old RHELs. This patch is supposed to fix that.
2024-10-18 09:25:40 -07:00
Colin Watson
c6e166319a
test: use password to generate random string instead of range (#84129)
* Use password lookup instead of range
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-17 19:17:42 +00:00
Abhijeet Kasurde
663f7f3b56
test for gathering FIPS facts (#83266)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-16 12:35:12 -07:00
ShIRann Chen
58cb8ca4fa
feat: checksum_algo param for find module (#83014)
Co-authored-by: shirann <shirannx@gmail.com>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <webknjaz@redhat.com>
2024-10-11 11:02:39 -07:00
Matt Clay
48be6f8b6f
ansible-test - Improve container probe error handling (#84109) 2024-10-10 22:58:38 +00:00
Brian Coca
6aaac6cab3
service_facts: add FreeBSD support (#82556)
new freebsd scanner using 'their version' of service cli tool
also avoid loading the linuxy service scanner when freebsd
2024-10-10 14:22:21 -04:00
Matt Clay
56bab1d097
Enable bad-docstring-quotes pylint rule for core (#84100)
* Enable bad-docstring-quotes pylint rule for core

* Ignore previously bulk update in git blame
2024-10-09 21:57:05 +00:00
Matt Clay
a0495fc314
Update triple single quotes to triple double quotes (#84099)
* Update triple single quotes to triple double quotes

This change was fully automated.

The updated Python files have been verified to tokenize the same as the originals, except for the expected change in quoting of strings, which were verified through literal_eval.

* Manual conversion of docstring quotes
2024-10-09 21:22:35 +00:00
Matt Clay
62ce21b6e4
ansible-test - Work around pylint issue on 3.11 (#84094) 2024-10-09 17:19:55 +00:00
Matt Clay
83671ecb39
ansible-test - Enable pylint docstyle for tests (#84092)
This cleans up the implementation of the pylint sanity test and enables the docstyle extension rule `bad-docstring-quotes` for tests.

The rule will be enabled for the rest of ansible-core once automated cleanup has been performed on existing docstrings.
2024-10-09 15:38:32 +00:00
Matt Clay
0b661438a0
ansible-test - Update base/default containers (#84089) 2024-10-08 18:33:04 -07:00
Matt Clay
955e310b4c
Cover unit tests with mypy (#84084)
* Added support for testing unit tests with mypy.
* Added support for ignoring individual mypy error codes.
* Added missing assert on unit tests and marked xfail.
* Added type hints for some unit tests.
* Added ignores for unit tests not passing mypy.
* Fixed incorrect autouse argument in unit test fixtures.
* Fixed minor issues causing problems with mypy in unit tests.
2024-10-08 13:29:37 -07:00
Brian Coca
0959472bc6
user module, avoid chmoding symlink'd home file (#83956)
also added tests

---------
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2024-10-08 13:15:34 -04:00
Sloane Hertel
d0df3a174a
ansible-galaxy - fix ignoring certs when installing from git repos (#83332)
* Fix installing collections|roles from git repos with GALAXY_IGNORE_CERTS

* Fix installing collections from git repos with --ignore-certs

* Update unit test

* Add test case
2024-10-07 18:42:49 -04:00
Matt Clay
50604e8461
ansible-test - Update astroid for pylint sanity test (#84054) 2024-10-04 13:18:07 -07:00
Matt Clay
3cf308f672
ansible-test - Disable pylint deprecated-* rules (#84050) 2024-10-04 08:31:46 -07:00
Martin Krizek
0f4f05ebe4
Implicit flush_handlers inherit play tags (#83968) 2024-10-04 09:47:28 +02:00
Sloane Hertel
ee9e6130a7
Fix error message given by ansible.module_utils.facts.timeout.timeout (#83945)
* Update unit test

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2024-10-03 21:54:54 +00:00
Matt Clay
9406ed3109
ansible-test - Update sanity tests and default Python (#83998)
* ansible-test - Update sanity test requirements
* ansible-test - Default to Python 3.13 in base/default containers
* ansible-test - Fix incorrect AnyStr type hints
2024-10-03 09:59:56 -07:00
Martin Krizek
d6d2251929
Reduce number of implicit meta tasks (#84007)
This greatly reduces run time on large inventories since meta tasks are
executed in the main process sequentially and just executing them is expensive.

This change avoids running the following implicit meta tasks:
  * ``flush_handlers`` on hosts where no handlers are notified
  * ``noop`` for the linear strategy's lockstep, instead hosts that are
    not executing the current task are just not part of the current host loop

A playbook consiting of two simple plays both running on ~6000 hosts
runs in:
devel: 37s
this PR: 1.3s

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2024-10-03 16:02:02 +02:00
Martin Krizek
f593eb42a3
get_url: properly parse filename in content-disposition (#83748)
Since we don't really care about the type we don't have to
query for it and just retrieve the filename value.
Unfortunately we cannot use module_utils.urls.get_response_filename
as we don't have the response object, so just utilize
email.message.Message to parse the filename
instead of manually doing the work ourselves.

Fixes: #83690
2024-10-03 15:36:42 +02:00
Abhijeet Kasurde
b3c4154e86
Use sentinel everywhere (#84041)
* Use sentinel everywhere

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-02 15:49:35 -07:00
Matt Clay
9abc651cd6
ansible-test - Update nios-test-container to 6.0.0 (#84042) 2024-10-02 16:37:37 +00:00
Alexei Znamensky
bebc192c3e
remove one ignore clause for module copy (#83643)
---------
Co-authored-by: flowerysong <junk+github@flowerysong.com>
2024-10-02 13:53:58 +00:00
Abhijeet Kasurde
79e8c4c26c
debconf: set empty password value (#83217)
Fixes: #83214

---------
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-01 11:48:57 -04:00
Matt Martz
fb7fd51b93
Prevent condor from being installed and fulfilling libfmt dependency (#84023) 2024-09-30 11:11:22 -05:00
Abhijeet Kasurde
34f8f55d9e
facts: Skip path if the distribution path is directory (#84012)
* facts: Skip path if the distribution path is directory

Skip path if the distribution path is directory instead of file.
Handle exception raised while handling distribution path.

Fixes: #84006

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Review requests

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-09-26 15:05:57 -04:00
Matt Clay
facf9186b4
Test entry points with editable install (#84002)
This allows collection of code coverage for the entry points.
2024-09-24 11:23:20 -07:00
Brian Coca
0c8efa29b2
Ansible Errors, Don't hide stacked messages when yaml (#83933)
Also remove redundant msg now that we fixed yaml case
So no more need to %s % e.

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-09-24 13:58:41 -04:00
Felix Fontein
f4e2e206b3
Add basic validation for action_groups (#83965)
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2024-09-24 17:15:43 +02:00
Matt Clay
c0fb71a642
Move ansible-deprecated ignores for tests inline (#83989) 2024-09-23 17:33:01 -07:00
Matt Davis
1b8bfd40ab
bump devel to 2.19 (#83985) 2024-09-23 15:29:06 -07:00
Abhijeet Kasurde
b5263c2c10
isidentifier: Remove Python 2 specific code (#83688)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-09-23 20:41:08 +00:00
Matt Clay
7693c892fa
ansible-test - Use Python version in pylint contexts (#83984) 2024-09-23 13:40:10 -07:00
Martin Krizek
aa24e97435
dnf5: re-introduce `state: installed` alias (#83961)
Fixes #83960
2024-09-23 09:33:38 +02:00
Brian Coca
6efb30b43e
Do not convert floats to ints when there is truncation (#83864)
Adjusted error messages
fixed tests
removed py2 compat tests, since no more py2

Co-authored-by: Matt Clay <matt@mystile.com>
2024-09-20 10:06:15 -04:00
Sloane Hertel
40ade1f84b
Add mount_facts module (#83508)
* Add a mount_facts module capable of gathering mounts skipped by default
fact gathering

* By default, collect mount facts from standard locations including
/etc/mtab, /proc/mounts, /etc/fstab, /etc/mnttab, /etc/vfstab, and on AIX,
/etc/filesystems.

When no file-based source for the current mounts can be found
(like /proc/mounts), the module falls back to using mount as a source.
This allows BSD and AIX to collect the existing mounts by default, without
causing Linux hosts to use both /proc/mounts and mount output.

* Non-standard locations and "mount" can be configured as a sources.

* Support returning an aggregate list of mount points in addition to first
found.

When there are multiple mounts for the same mount point in an
individual source, a warning is given if the include_aggregate_mounts
option is not configured.

* Add options to filter on fstypes and devices (supporting UNIX shell
wildcards).

* Support configuring a timeout and timeout behavior to make it easier
to use the module as a default facts module without risking a hang.

* Include the source and line(s) corresponding to a mount for easier
debugging.

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2024-09-19 15:05:05 -04:00
Brian Coca
bcee35385b
timedout extended (#83953)
* timedout extended

* add timedout test
2024-09-18 09:58:30 -05:00
Brian Coca
d58988d8ff
fact gathering, mounts, fixes for single proc code and tests (#83866)
* Fact gathering fix 'no shm' branhc

* Use concurrent.futures instead of multiprocessing

This entirely avoids the need for fallback logic since the concurrent.futures thread pool does not depend on `/dev/shm`.

Co-authored-by: Matt Clay <matt@mystile.com>
2024-09-10 12:15:29 -04:00
Matt Clay
31d73b0645
Replace binary_modules Makefile with Python script (#83925)
Also update the platform list:

* Remove linux ppc64le
* Add darwin arm64
2024-09-09 15:06:36 -07:00
Matt Clay
a84fa50096
ansible-test - Update base/default containers (#83930) 2024-09-09 20:54:02 +00:00
Matt Clay
cf2a4a85da
ansible-test - Update sanity test requirements (#83921) 2024-09-09 11:22:28 -07:00
Matt Clay
cd342f76b4
release.py - Use changelog requirements (#83920)
Use the changelog sanity test requirements instead of the package-data sanity test requirements.

This enables removal of most package-data sanity test requirements, as they are no longer used by the test itself.
The additional requirements were being maintained only to provide pinned requirements for building the changelog during a release.
2024-09-09 10:49:04 -07:00
Brian Coca
11e56d9c27
iptables, use existing validation (#83907)
also remove redundant  and wrong test
2024-09-06 16:57:05 -04:00
Brian Coca
9c49fdd86d
delay keyword changed from int to float (#83901)
* delay keyword changed from int to float

* draft test

* fixed test

* expanded test, fixed 'name' tests also

* cleanup

* fix
2024-09-06 14:50:35 +10:00
Brian Coca
4fa512406b
loop_control "early exit" feature (#62151)
* add a loop_control break_when directive to break out of a loop after any item

* remove loop var as normal exit would

* example usage:

- name: generate a random password up to 10 times, until it matches the policy
  set_fact:
    password: "{{ lookup('password', '/dev/null', chars=character_set, length=length) }}"
  loop: "{{ range(0, 10) }}"
  loop_control:
    break_when:
      - password is match(password_policy)

Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
2024-09-05 10:16:23 -04:00
Matt Davis
24e5b0d4fc
Add DaemonThreadPoolExecutor impl (#83880)
* Add DaemonThreadPoolExecutor impl
* Provide a simple parallel execution method with the ability to abandon timed-out operations that won't block threadpool/process shutdown, and without a dependency on /dev/shm (as multiprocessing Thread/Process pools have).
* Create module_utils/_internal to ensure that this is clearly not supported for public consumption.
2024-09-03 11:23:38 -07:00
Jordan Borean
1a4644ff15
psrp - Remove extras lookups (#83760)
* psrp - Remove extras lookups

Removed the extras variable lookups for the psrp connection plugin. All
valid options are already documented and the extras functionality is
slated to be deprecated at a future point in time. This should have
affect on existing user's playbooks.

* Fix up sanity tests and add explicit boolean conversion test
2024-09-02 11:58:46 +10:00
Jordan Borean
1503805b70
Add location on include_tasks fail inside include (#83876)
Adds the datastore details to the parser error when attempting to
include tasks that contain include_tasks without a filename set. This
change will now display the exact location of the include_tasks that
failed like any normal syntax error.
2024-09-02 06:21:30 +10:00
Matt Clay
4346430003
ansible-test - Reduce scope of empty-init test (#83878) 2024-08-30 16:46:45 -07:00
Matt Clay
49490d92c3
Update boilerplate sanity test (#83879)
The `annotations` future can now be imported as `_annotations`.
2024-08-30 16:36:20 -07:00
Jordan Borean
9a5a9e48fc
Improve testing for Windows SSH and other connection plugins (#83834)
Expands the test matrix used for testing on Windows to cover the three
connection plugins we support for all the tasks. This change also
changes how raw commands are run over SSH to avoid starting a
`powershell.exe` process that was uneeded in the majority of cases used
in Ansible. This simplifies our code a bit more by removing extra
Windows specific actions in the ssh plugin and improves the efficiency
when running tasks.
2024-08-29 06:27:16 +10:00
Matt Clay
db04499f58 ansible-test - Update nios-test-container to 5.0.0 2024-08-28 10:58:40 -07:00
Martin Krizek
1f987423fd
Print the name of the option being deprecated (#83761)
Fixes #83759
2024-08-27 11:59:10 +02:00
Matt Davis
c6a391c8d8
fix delegate_to integration test (#83865)
* the test was previously passing erroneously due to the `timeout` elapsing in CI, and that the `failed` test does not encompass `unreachable`
2024-08-26 17:54:08 -07:00
Brian Coca
2a676ff897
copy, fix permissions and atime on diff partitions (#83824)
we just set time also, when on diff partitions
2024-08-26 14:22:15 -04:00
Felix Fontein
faf446a895
runtime-metadata sanity test: do not fail deprecation version checks if galaxy.yml has empty version (#83831)
* Do not create invalid SemanticVersion objects.
* Fix SemanticVersion.parse().
* Add basic runtime-metadata tests.
2024-08-26 13:59:34 -04:00
Jordan Borean
b5e0293645
powershell - Improve CLIXML parsing (#83847)
Improves the logic used when parsing CLIXML to support all escaped
character sequences and not just newlines.
2024-08-23 11:10:12 +10:00
Jordan Borean
69fb629355
Fix up raw_params for ansible.windows modules (#83830)
* Fix up raw_params for ansible.windows modules

Fixes up the logic for detecting if using ansible.windows.win_command or
ansible.windows.win_shell with _raw_params. These two modules are
special in that they can be referenced in 4 different ways but the
ansible.windows collection specific prefix needs to be manually added to
the list.

* Fix up sanity issue
2024-08-20 08:59:07 +10:00
Brian Coca
718ce13673
connection plugins: extras fix (#83353)
Currently we match the load name, which can be an fqcn, but most users expect the 'naked' name
Now plugins can declare that name by setting _extras_prefix property or fallback to 'non fqcn' if no extras prefix
2024-08-19 11:20:34 -04:00
Brian Coca
90de03be50
Gather mount facts, fallback for when multiproc is not feasable (#83750)
* fallback to 'single threaded gathering' for when multiproc fails

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2024-08-19 10:25:29 -04:00
Jordan Borean
520fa688ba
ssh and psrp - Support more complex characters in fetch_file (#83753)
* ssh and psrp - Support more complex chars in fetch_file

Fixes the psrp and ssh (with piped) fetch function to work with paths
that contains glob like characters in the path. For Windows this was
needed when using paths that contain `[]` in the path. For ssh this was
a problem with FreeBSD when using the piped transfer method with similar
characters.

Also tidies up the psrp logic to not inject the paths and buffer size
in the script but pass it as an object through an argument/parameter.

* Fix sanity check
2024-08-19 04:21:24 +10:00
Jordan Borean
dec49e6288
Add explicit winrm/psrp tests for HTTP and HTTPS (#83769) 2024-08-16 08:30:33 +10:00
Jordan Borean
430aaa1960 Fix tests when running against SSH target 2024-08-15 13:40:42 -07:00
Matt Clay
81e025b414 ansible-test - Add Windows remote connection option 2024-08-15 13:40:42 -07:00
Matt Clay
a3ee846a64
Use a venv in more integration tests (#83799)
* Use venv for pause test
* Use venv for debugger test
* Use venv for builtin_vars_prompt test
2024-08-14 17:10:05 -07:00
Matt Clay
6eb16faed2
ansible-test - Update base/default containers (#83796) 2024-08-14 20:40:10 +00:00
Matt Clay
da02611c48
ansible-test - Update sanity test requirements (#83795)
* Remove PyYAML pin for yamllint sanity test
* Freeze sanity test requirements
2024-08-14 19:00:59 +00:00
Matt Clay
ab624ad031
ansible-test - Remove generation of egg-info (#83786)
Also remove egg-info generation from hacking/env-setup scripts.
2024-08-14 09:03:51 -07:00
dkuji
26375e7f12
fix copy module update atime/mtime (#83235)
Ensure we force mtime/atime update when using copystat

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2024-08-14 14:43:12 +00:00
Martin Krizek
89137cb5a0
Add end_role meta task (#83263)
ci_complete
2024-08-13 16:48:59 -05:00
Sloane Hertel
fe7e68bfcb
Fix ansible-vault integration test for missing vault ids (#83777)
* Fix broken, circumvented test for missing vault ids

* verify the command returns a non-zero exit code

Co-authored-by: Matt Clay <matt@mystile.com>
2024-08-13 17:20:39 -04:00
Martin Krizek
9a54ba5a39
Ensure skipped loop iteration register var is available (#83756)
Fixes #83619
2024-08-13 12:48:49 -05:00
Martin Krizek
5c84220dbb
Fix meta tasks breaking host/fork affinity with host_pinned (#83438)
Fixes #83294
2024-08-13 10:39:00 -05:00
Martin Krizek
a0f9bbf3f3
ini lookup: add new interpolation option (#83773)
Fixes #83755
2024-08-13 11:04:42 -04:00
Matt Clay
68515abf97
Drop use of setup.py and setup.cfg (#81443) 2024-08-12 13:54:29 -05:00
Sloane Hertel
2b91c57c85
atomic_move - fix creating file in directory with setgid bit (#83718)
* fix creating file in directory with setgid bit

* add a test using the copy module's content option to create a file in a directory with setgid bit

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2024-08-12 10:34:20 -04:00
Kellin
0d6b034103
Enable validation of subkeys in rpm key module (#83716)
* Enable validation of subkeys in rpm key module

A gpg subkey may change while the primary key remains the same. Due to
this behavior, there are situations where validation of the primary gpg
key fingerprint is not sufficient because the desired target is actually
the gpg subkey. This change allows the user to validate against either
the fingerprint of the primary gpg key or its subkey.

Signed-off-by: Kellin <kellin@retromud.org>

* Improve tests, add multi-fingerprint

- Improve tests to cover all cases
- add multi fingerprint validation

Signed-off-by: Kellin <kellin@retromud.org>
2024-08-12 10:13:39 -04:00
Brian Coca
e4d7286298
use diff intermediate var to preserve functionality (#83738)
add tests
2024-08-08 15:18:00 -04:00
Brian Coca
797e6bb220
Add vaulted_file test (#83717)
* Add vaulted_file test
* fix is_encrypted_file while we are here
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2024-08-08 15:14:05 -04:00
Sloane Hertel
97a60c1e86
Fix csvfile test - quote file argument (#83751)
file was intended to be a string, not an undefined variable
2024-08-08 13:06:53 -04:00
Martin Krizek
d9f1866249
Deprecate remaining safe evals (#83293) 2024-08-08 08:41:52 +02:00
Matt Clay
59ca05b709
ansible-test - Update default and distro containers (#83736) 2024-08-06 19:47:43 -07:00
Matt Davis
a301ae876e
try disabling negative values win_reboot test (#83735)
* hoping to improve CI stability
2024-08-06 18:34:57 -07:00
Matt Clay
70be017f02
ansible-test - Update mypy and package-data tests (#83734)
* package-data - Test min/max setuptools version

* Fix multi-version abstraction

* Convert mypy test to script based test

* Fix f-string in pymarkdown test

* Sanity test fixes
2024-08-06 17:48:02 -07:00
Matt Clay
717f1092e3
ansible-test - Update venv management and sanity requirements (#83729)
* ansible-test - Update venv management
* Upgrade from pip 24.0 to 24.2
* Omit `wheel` and `setuptools` from ansible-test managed virtual environments
* Drop pre-release hacks
* Update mypy requirements
* Freeze sanity test requirements
* Update sanity test configuration
* Update sanity ignores
2024-08-06 14:53:40 -07:00
Sloane Hertel
0be66ed6dc
Fix task-adjacent search path in roles (#83621)
* Restore search path in the current task file’s directory for roles
2024-08-06 17:53:23 -04:00
Sloane Hertel
26c8a28d05
csvfile lookup - fix giving an error when no search term is provided (#83710)
Fixes #83689
2024-08-06 17:50:51 -04:00
Brian Coca
c5210ad3eb
Fix display to log severity mapping (#83712)
add caplevel to display to pass through
also reverse dict order as 'last update wins'
added tests ... and also log severity to log

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2024-08-06 16:18:03 -04:00
Matt Clay
ac5ed40a21
Fix type hints and misc mypy/pylint issues (#83724) 2024-08-05 19:30:37 -07:00
Matt Clay
6019f3f425
ansible-test - Update coverage to 7.6.1 (#83723) 2024-08-05 15:27:49 -07:00
Matt Clay
4e69d83fac
release.py - Auto-update setuptools upper bound (#83713)
When releases are prepared, the upper bound on setuptools in pyproject.toml will be automatically updated
to the latest version available on PyPI. This version will then be tested by the package-data sanity test
during the release process and will be used to build the release.

This change ensures that a released version of ansible-core can be built in the future if a new setuptools
release includes breaking changes that would prevent building a functional package. If a downstream package
maintainer requires a newer setuptools version than the upper bound permits, they can patch pyproject.toml
as needed. Since ansible-core releases support specific Python versions, lack of support for new setuptools
releases will have no effect on support for future Python versions.
2024-08-05 16:59:26 -05:00
Abhijeet Kasurde
207a5fbebb
test: Handle Singleton Display class (#83673)
Fixes: #83538

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-08-01 23:21:08 -07:00
Matt Clay
5ae8b5b3a6
Remove EXTERNALLY-MANAGED marker in apt test (#83706)
The marker is removed in ansible-test managed environments, but the apt test restores it
by installing/upgrading packages. To avoid breaking later tests, the marker needs to be
removed again.

ci_complete
2024-08-01 13:31:47 -07:00
Abhijeet Kasurde
245885177c
systemd facts: Handle AttributeError (#83684)
* Handle AttributeError raised while running systemd facts on
  non-systemd hosts

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-08-01 12:09:02 -07:00
Abhijeet Kasurde
31ad786de1
ansible-doc: handle on_fail (#83676)
Handle errors raised when role doc has errors

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-08-01 12:08:11 -07:00
skupfer
20465ba11a
Add UID and GID min/max keys (#81770)
Fixes: #72183
2024-08-01 09:04:59 -07:00
Karl G
6bf6844a1c
add error handling when parsing values in ini files (#82718)
Fixes: #82717

Co-authored-by: Karl A. Grindley <kgrindley@ll.mit.edu>
2024-08-01 02:34:42 +00:00
Abhijeet Kasurde
c6d5be5cac
test: update tests (#83686)
* Remove commented code
* Enable disabled tests
* Formatting

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-31 17:32:11 -07:00
Abhijeet Kasurde
3daf01e270
tests: use keyserver with keyid while using apt_key (#83694)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-31 15:52:12 -07:00
Jordan Borean
bbf96c250f
winrm - quota retry handling (#83656)
* winrm - quota retry handling

Add a retry attempt when receiving ERROR_WSMAN_QUOTA_MAX_OPERATIONS when
starting a command. This can occur when running a loop with multiple
iterations or an action plugin that runs multiple commands.

* Update pywinrm constraint for test

* Add verbose hint and mark test as destructive
2024-08-01 04:12:31 +10:00
Sloane Hertel
ff5deaf62f
fix module_defaults group incorrectly giving deprecation warnings (#83510)
don't display deprecation warnings for actions/modules as a result of using an action_group containing a deprecated plugin
2024-07-30 13:45:25 +00:00
Martin Krizek
07a1d6a3fd
dnf/setup_rpm_repo: simplify dummy testing repos (#83624)
This change simplifies construction and footprint of testing rpm
repository created by rpmfluff:
* all packages default to noarch
* only when necessary build package for a specific architecture(s)
* do not build several repositories each for specific arch
* remove duplicate "incompatible arch" test
* skip_broken_and_nobest: move testing packages from an external repo
  into our dummy repo for transparency
* remove compatibility code from create_repo.py for versions no longer
  needed
* remove support for old OS versions from setup_rpm_repo
* simplify representation of an rpm in create_repo.py to allow easier
  changes

Notes
* there is one more external testing repo used at
https://ci-files.testing.ansible.com/test/integration/targets/setup_rpm_repo/repo-with-updateinfo
2024-07-29 10:41:23 +02:00
Felix Fontein
3d4bd79574
validate-modules: detect names set mismatch between argument spec and documentation (#83599) 2024-07-28 15:39:01 +00:00
Lee Garrett
7e3916b767
Typo fixes and other bits and bobs (#83672)
Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
2024-07-27 09:16:34 -07:00
Abhijeet Kasurde
504f5b1230
apt: Report change when package is removed (#83547)
While upgrade process removes a package, module should
report changed=True instead of changed=False

Fixes: #46314

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-25 15:01:46 +00:00
Abhijeet Kasurde
cd105d479a
display: warn user about empty log path value (#83381)
Fixes: #79959

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-23 21:21:23 +00:00
Matt Clay
79f819dc54
ansible-test - Remove VyOS tests and support files (#83650)
The VyOS remote image required for running the tests is no longer functional.
2024-07-22 13:42:06 -07:00
Alexei Znamensky
d36dc70afc
remove ignore clauses for module find (#83575)
add testcase for expanding home dir names
2024-07-22 10:10:49 -04:00
Matt Clay
f261a6142f Use build instead of pep517 for integration test 2024-07-19 10:03:29 -07:00
Matt Clay
b90c3a8de5 Revert "🧪 Use setuptools [core] @ collections_runtime_pythonpath (#83627)"
This reverts commit 0d5460df16.
2024-07-19 10:03:29 -07:00
Sviatoslav Sydorenko (Святослав Сидоренко)
0d5460df16
🧪 Use setuptools [core] @ collections_runtime_pythonpath (#83627) 2024-07-19 16:22:33 +02:00
Alexei Znamensky
eeb9b50669
remove ignore clauses for module lineinfile (#83595) 2024-07-18 15:51:08 -04:00
Peter A. Bigot
c904bffc7d
debconf: handle boolean value representation consistently (#83601)
* lift code that normalizes value type for boolean vtype to cover both
  branches of conditional.
* remove obsolete and incomplete conversion of type in set_selection.

Fixes: #83594
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2024-07-18 12:50:31 -07:00
Alexei Znamensky
4408b2c3e1
replace - fix documentation and remove ignore clauses (#83574) 2024-07-18 15:14:23 -04:00
Matt Clay
906c969b55
ansible-test - Improve unknown env error message (#83610) 2024-07-15 16:37:40 +00:00
Alexei Znamensky
08de64076a
remove ignore clauses for module blockinfile (#83577) 2024-07-11 08:56:05 -07:00
Martin Krizek
28cef00576
dnf: follow-up on is_newer_installed arches fix (#83556)
* dnf: follow-up on is_newer_installed arches fix

* fix for the non package object case

* prevent early bailout in dnf _is_newer_version_installed
* non-installed available arches would fail out of the check early

---------

Co-authored-by: Matt Davis <nitzmahone@redhat.com>
2024-07-09 20:26:29 +00:00
Matt Clay
9cdfcd9aed
ansible-test - Update nios-test-container to 4.0.0 (#83539) 2024-07-09 10:37:11 -07:00
Matt Clay
10997ab3aa
ansible-test - Update base/default containers (#83553) 2024-07-09 17:25:20 +00:00
Harshvardhan Sharma
43346f1fdc
Add SL-Micro to Suse family list (#83541) 2024-07-07 21:37:32 -07:00
MajesticMagikarpKing
edce798713
Fix Creating user directory using tilde always reports "changed" (#83113)
Fixes: #82490
2024-07-07 19:26:14 +00:00
Felix Fontein
e5309ba29f
validate-modules: reject option/alias names equal up to casing belonging to different options (#83530)
* Reject option/alias names equal up to casing belonging to different options.

* Update test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2024-07-05 19:35:54 -04:00
flowerysong
63538f7779
package_facts: fix warning logic (#83520)
* package_facts: fix warning logic

* Refactor so that warnings can work
2024-07-05 13:27:45 -04:00
Martin Krizek
775bc1110e
linear: fix included handlers executing in lockstep (#83209)
Fixes #83019
2024-07-04 09:33:37 +02:00
Martin Krizek
571e2a9551
Fix incorrect rc when executing end_host in rescue (#83522)
Fixes #83447
2024-07-04 09:19:56 +02:00
Brian Coca
6c0f4c8a2d
hostvars templating fix, override serialization (#83509)
fixes #82872
nicer implementation courtesy of nitzmahone
2024-07-02 14:27:17 -04:00
Felix Fontein
7d678cbd96
Fix require_only_one. (#83511) 2024-07-02 09:36:23 -04:00
Brian Coca
00ddc27d69
actually show plugin config warnings/deprecations (#82593)
previouslly we recorded but did not show to avoid spam
since we could not dedup from forks, that was already
fixed in another PR so now we can show/display them.

Also:
  * funcitonalize deprecation msg construct from docs
  * reuse formatting func in cli
  * normalize alternatives: most of the code used intended plural
    but some and most data/tests used the singular
  * update schemas and tests

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2024-07-01 19:56:19 -04:00
Martin Krizek
a8e4106c47
Fix tb for when env var contains % (#83499)
Fixes #83498

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2024-06-28 16:50:45 +02:00
Martin Krizek
2930a4664c
dnf - arches must be the same in the is_newer_installed check (#83417)
Fixes #83406
2024-06-28 11:45:40 +02:00
Martin Krizek
0ee6e39615
dnf, dnf5: fix installing via wildcard (#83481)
Fixes #83373
2024-06-26 16:36:12 +02:00
Matt Clay
8f1fddb161
Enable Ubuntu 24.04 group 6 in CI (#83466)
* Enable Ubuntu 24.04 group 6 in CI

* Disable rootfull Podman on Ubuntu

* Disable unix-chkpwd AppArmor profile on Ubuntu for Fedora 40 tests

* Document AppArmor and rootfull issues
2024-06-25 08:42:51 -07:00
Brian Coca
0d28705ce5
linear strategy, show templated task name on start (#83473)
we only templated in some cases but when queueing we could get an untemplated name for the 'on start' event.
2024-06-25 09:24:24 -04:00
Brian Coca
339452c105
Ensure the correct connection name is shown in results (#83354) 2024-06-24 09:52:06 -04:00
Thomas Sjögren
f7dee8aaf8
add support for inactive option (#83355)
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2024-06-21 14:31:31 -04:00
Matt Clay
a121a169e3
ansible-test - Replace FreeBSD 14.0 with 14.1 (#83477) 2024-06-20 15:20:10 -07:00
Abhijeet Kasurde
c93af4e148
unarchive: handle content and size differences (#83454)
Consider content differs and size differs while unarchiving
the same tar.gz file

Fixes: #29610

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-20 10:50:27 -07:00
Danilo Bargen
c2c6005842
get_url: Verify checksum using tmpsrc, not dest (#64092)
Previously, if the checksum of the downloaded file did not match the
specified checksum, the *destination* file was removed. This possibly
leaves the system that is being provisioned in an invalid state.

Instead, the checksum should be calculated on the temporary file only.
If there's a mismatch, delete the *temporary* file, not the destination
file.

This requires checking the checksum before moving the file.
2024-06-20 10:55:59 -04:00
Matt Clay
96c04e9d1d
ansible-test - Update PyPI and utility container (#83475) 2024-06-19 01:31:33 +00:00
Felix Fontein
1b42af5004
ansible-test: update http-test-container to 3.2.0 (#83469) 2024-06-18 13:46:52 -07:00
MajesticMagikarpKing
d62496fe41
human_to_bytes: strictly parse strings (#83403)
Fixes: #82075
2024-06-18 09:21:04 -07:00
Martin Krizek
df29852f3a
Update the dnf5 copr repo (#83459)
The dnf-nightly is the official nightly repo now.
2024-06-18 11:08:19 -04:00
Matt Clay
dad6f07731
ansible-test - Update tested platforms (#83446)
* ansible-test - Update tested platforms

* Add work-around for Alpine tests

* Fix prepare_http_tests on Fedora

* Fix deb-src setup for Ubuntu 24.04+

* Set multiarch_test_pkg for Ubuntu 24.04

* Update AZP test matrix
2024-06-17 23:17:04 +00:00
Matt Clay
44f22162cb
Remove timezone support module and tests (#83465)
The timezone support module was used only for changing the timezone in the user module integration tests.

Changing the timezone for the tests is unecessarily complex for the purpose of asserting proper parsing of user expiration times.
2024-06-17 15:06:39 -07:00
Matt Clay
f4751766db
selinux compat - add ignore, proper ex chaining (#83460) 2024-06-17 13:26:41 -07:00
Martin Krizek
b2a289dcbb
Remove Python 3.10 support for the controller (#83221)
Fixes #83094
2024-06-17 09:03:41 +02:00
Abhijeet Kasurde
6382ea168a
vault: Handle directory value to vault password file (#83384)
When vault password file env variable is set to blank,
this value is converted to CWD and passed for further
processing.
Check if ANSIBLE_VAULT_PASSWORD_FILE is not a directory.

Fixes: #42960

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-14 18:40:30 -07:00
Gilson Guimarães
e64c6c1ca5
unarchive: Better handling of files with an invalid timestamp in zip file (#81520)
Fixes: #81092

Signed-off-by: gilsongpfe <gilson.gpf@gmail.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-13 14:30:37 -07:00
Matt Clay
5af5b4b6c8
ansible-test - Update PyPI test container to 3.1.0 (#83432) 2024-06-13 08:52:43 -07:00
Matt Clay
738180d240
ansible-test - Fix unit test coverage collection (#83433) 2024-06-12 15:47:58 -07:00
Jordan Borean
a9b902f579
ansible-test action-plugin-docs sidecar (#83325)
Fix to have ansible-test sanity --test action-plugin-docs to check for
action plugin documentation inside a sidecar file rather than a Python
module.
2024-06-13 06:16:15 +10:00
Abhijeet Kasurde
6e8a7ed327
Revert warning message in setup/gather_facts (#83427)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-11 12:01:29 -07:00
Matt Clay
cf265eb14d
Add Python 3.13 support (#83416)
* Add Python 3.13 support

* Add temporary work-around for yamllint test
2024-06-11 11:36:10 -07:00
Matt Martz
126ffc7947
Specify -O in windows ssh tests as needed for scp to work with openssh 9+ (#83426) 2024-06-11 10:59:17 -07:00
Matt Clay
14df8c2cf2
ansible-test - Prepare for Python 3.13 (#83414)
Includes an update to `coverage` and pinned Python requirements.
2024-06-10 19:33:33 -07:00
Abhijeet Kasurde
d16ad25e4b
Remove extraneous pylint ignore (#83257)
* Pylint issue 511 is closed, remove ignore related to that.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-10 19:23:49 -07:00
Matt Clay
531bc9891f
Fix issues reported by mypy (#83413) 2024-06-10 18:18:33 -07:00