Commit Graph
54703 Commits
Author SHA1 Message Date
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
Martin KrizekandGitHub 42e2f09b97 Faster host removal from a handler (#84091)
In ``Handler.notify_host`` we ensure that ``Handler.notified_hosts`` can contain
particular host at most once. Therefore for removing a host it should be
faster to use ``list.remove`` which removes the first item in the list,
as opposed to using list comprehension removing all such items.
2024-10-17 08:33:39 +02:00
Sloane HertelandGitHub 4f6276d72d Remove configuration options that were moved to inventory plugins now that ansible-config supports plugin types. (#84130) 2024-10-16 15:39:15 -04:00
Abhijeet KasurdeandGitHub 663f7f3b56 test for gathering FIPS facts (#83266)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-16 12:35:12 -07:00
Abhijeet KasurdeandGitHub 279de623d0 Use dict comprehension instead (#83680)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-16 12:33:07 -07:00
Abhijeet KasurdeandGitHub 671c797aa1 Remove unnecessary code (#84085)
* os.setsid does not return anything, so remove code which relying
  on return value

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-15 07:59:01 -07:00
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 ClayandGitHub 48be6f8b6f ansible-test - Improve container probe error handling (#84109) 2024-10-10 22:58:38 +00:00
Brian CocaandGitHub 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 ClayandGitHub b3950bc864 Add NoReturn annotations in module_utils (#84106) 2024-10-10 16:58:27 +00:00
Matt ClayandGitHub 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 ClayandGitHub 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 ClayandGitHub 62ce21b6e4 ansible-test - Work around pylint issue on 3.11 (#84094) 2024-10-09 17:19:55 +00:00
Matt ClayandGitHub 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 ClayandGitHub 0b661438a0 ansible-test - Update base/default containers (#84089) 2024-10-08 18:33:04 -07:00
Sloane HertelandGitHub 7e57c0fb3d Fix copyright format for gather_facts and mount_facts as documented (#84087) 2024-10-08 17:11:06 -07:00
Matt ClayandGitHub 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
Abhijeet KasurdeandGitHub 18c6b40e19 Update unique filter docs (#84078)
* Correct case_sensitive example
* Add attribute docs

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-08 12:09:07 -07:00
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
TinyblargonandGitHub f3b956a7ef docs: unique add missing settings (#84076)
add the `case_sensitive` setting
2024-10-08 17:35:35 +02:00
Martin KrizekandGitHub f1f0d9bd53 PlayIterator: skip tasks from already ran roles (#83793)
... so strategies do not have to filter them.
2024-10-08 07:28:02 +02:00
Sloane HertelandGitHub 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 ClayandGitHub 50604e8461 ansible-test - Update astroid for pylint sanity test (#84054) 2024-10-04 13:18:07 -07:00
Matt ClayandGitHub 3cf308f672 ansible-test - Disable pylint deprecated-* rules (#84050) 2024-10-04 08:31:46 -07:00
Martin KrizekandGitHub 0f4f05ebe4 Implicit flush_handlers inherit play tags (#83968) 2024-10-04 09:47:28 +02:00
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 ClayandGitHub 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
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
Abhijeet KasurdeandGitHub 02e00aba3f file: simplify the code (#84043)
* Remove unnecessary code
* Make code simple to read

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-03 06:53:09 -07:00
Martin KrizekandGitHub 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 KasurdeandGitHub 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 ClayandGitHub 9abc651cd6 ansible-test - Update nios-test-container to 6.0.0 (#84042) 2024-10-02 16:37:37 +00:00
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
4c8fb12fc2 cron: return stdout and rc for cron command (#83290)
Co-authored-by: Jack Farzan <jfarzan@adobe.com>
2024-10-01 14:45:27 -07:00
Abhijeet KasurdeandGitHub 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 MartzandGitHub fb7fd51b93 Prevent condor from being installed and fulfilling libfmt dependency (#84023) 2024-09-30 11:11:22 -05:00
f97adb4c5d Add additional logging for SSH runtime output timeouts and escalation messages (#84008)
Signed-off-by: Yuri Savinkin <stkwar@gmail.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-09-30 11:26:21 -04:00
3d40db1ac0 INVENTORY_IGNORE_EXTS stop ignoring ini (#84001)
* INVENTORY_IGNORE_EXTS stop ignoring ini

Originally added to avoid configuration files for inventory scripts
now clashes with the much more common ini inventory files.

* add a note to script plugin

* Update lib/ansible/plugins/inventory/script.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-09-26 12:15:34 -07:00
Abhijeet KasurdeandGitHub 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
Martin KrizekandGitHub 21fee95af7 package/dnf action plugins: better facts failure msg (#83995) 2024-09-26 09:19:00 +02:00
Matt ClayandGitHub 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
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
林博仁 Buo-ren LinandGitHub 8caa32a558 split: Fix incorrect example result of the split builtin filter (#83982)
The following Python output proves that the second member of the resulting list should be " a", not "a":

```txt
$ python3 
Python 3.12.3 (main, Sep 11 2024, 14:17:37) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> string = "jojo is, a"
>>> string.split(',')
['jojo is', ' a']
```
2024-09-24 17:33:25 +02:00
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
Martin KrizekandGitHub 0a100c7f06 dnf5: fix tb when plugins API is not available (#83969)
Follow up on https://github.com/ansible/ansible/pull/83105
2024-09-24 10:52:20 +02:00
Matt ClayandGitHub c0fb71a642 Move ansible-deprecated ignores for tests inline (#83989) 2024-09-23 17:33:01 -07:00
Matt DavisandGitHub 491a87215a zap changelogs (#83988) 2024-09-23 16:20:13 -07:00
Matt DavisandGitHub 1b8bfd40ab bump devel to 2.19 (#83985) 2024-09-23 15:29:06 -07:00
Abhijeet KasurdeandGitHub 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 ClayandGitHub 7693c892fa ansible-test - Use Python version in pylint contexts (#83984) 2024-09-23 13:40:10 -07:00