Commit Graph

12635 Commits (a0495fc31497798a7a833ba7406a9729e1528dd8)

Author SHA1 Message Date
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
1 month ago
Matt Clay 62ce21b6e4
ansible-test - Work around pylint issue on 3.11 (#84094) 1 month ago
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.
1 month ago
Matt Clay 0b661438a0
ansible-test - Update base/default containers (#84089) 1 month ago
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.
1 month ago
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>
1 month ago
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
2 months ago
Matt Clay 50604e8461
ansible-test - Update astroid for pylint sanity test (#84054) 2 months ago
Matt Clay 3cf308f672
ansible-test - Disable pylint deprecated-* rules (#84050) 2 months ago
Martin Krizek 0f4f05ebe4
Implicit flush_handlers inherit play tags (#83968) 2 months ago
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>
2 months ago
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
2 months ago
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>
2 months ago
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
2 months ago
Abhijeet Kasurde b3c4154e86
Use sentinel everywhere (#84041)
* Use sentinel everywhere

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 months ago
Matt Clay 9abc651cd6
ansible-test - Update nios-test-container to 6.0.0 (#84042) 2 months ago
Alexei Znamensky bebc192c3e
remove one ignore clause for module copy (#83643)
---------
Co-authored-by: flowerysong <junk+github@flowerysong.com>
2 months ago
Abhijeet Kasurde 79e8c4c26c
debconf: set empty password value (#83217)
Fixes: #83214

---------
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 months ago
Matt Martz fb7fd51b93
Prevent condor from being installed and fulfilling libfmt dependency (#84023) 2 months ago
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>
2 months ago
Matt Clay facf9186b4
Test entry points with editable install (#84002)
This allows collection of code coverage for the entry points.
2 months ago
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>
2 months ago
Felix Fontein f4e2e206b3
Add basic validation for action_groups (#83965)
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2 months ago
Matt Clay c0fb71a642
Move ansible-deprecated ignores for tests inline (#83989) 2 months ago
Matt Davis 1b8bfd40ab
bump devel to 2.19 (#83985) 2 months ago
Abhijeet Kasurde b5263c2c10
isidentifier: Remove Python 2 specific code (#83688)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 months ago
Matt Clay 7693c892fa
ansible-test - Use Python version in pylint contexts (#83984) 2 months ago
Martin Krizek aa24e97435
dnf5: re-introduce ``state: installed`` alias (#83961)
Fixes #83960
2 months ago
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>
2 months ago
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>
2 months ago
Brian Coca bcee35385b
timedout extended (#83953)
* timedout extended

* add timedout test
2 months ago
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>
2 months ago
Matt Clay 31d73b0645
Replace binary_modules Makefile with Python script (#83925)
Also update the platform list:

* Remove linux ppc64le
* Add darwin arm64
2 months ago
Matt Clay a84fa50096
ansible-test - Update base/default containers (#83930) 2 months ago
Matt Clay cf2a4a85da
ansible-test - Update sanity test requirements (#83921) 2 months ago
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.
2 months ago
Brian Coca 11e56d9c27
iptables, use existing validation (#83907)
also remove redundant  and wrong test
3 months ago
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
3 months ago
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>
3 months ago
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.
3 months ago
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
3 months ago
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.
3 months ago
Matt Clay 4346430003
ansible-test - Reduce scope of empty-init test (#83878) 3 months ago
Matt Clay 49490d92c3
Update boilerplate sanity test (#83879)
The `annotations` future can now be imported as `_annotations`.
3 months ago
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.
3 months ago
Matt Clay db04499f58 ansible-test - Update nios-test-container to 5.0.0 3 months ago
Martin Krizek 1f987423fd
Print the name of the option being deprecated (#83761)
Fixes #83759
3 months ago
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`
3 months ago
Brian Coca 2a676ff897
copy, fix permissions and atime on diff partitions (#83824)
we just set time also, when on diff partitions
3 months ago
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.
3 months ago