Commit Graph

54648 Commits (2248754de5aa7ed808de9c916869a011dd29db2a)
 

Author SHA1 Message Date
Matt Martz 2248754de5
Update Ansible release version to v2.18.1rc1.post0. (#84393) 6 days ago
Matt Martz ced97d5a0b
New release v2.18.1rc1 (#84390) 6 days ago
Martin Krizek b88f29ec6d
[stable-2.18] dnf5: fix is_installed check (#84275) (#84333)
* dnf5: fix is_installed check (#84275)

Fixes #84259

(cherry picked from commit a27a7a27d1)

* dnf5 - consolidate package resolving settings (#84335)

Fixes #84334

(cherry picked from commit c99493eb3f)
1 week ago
Brian Coca 8f2cc9d916
vars/varnames more examles more varied (#84300) (#84304)
also ref each other in seealso as they will commonly be used toghether

(cherry picked from commit c734ac2125)
1 week ago
Jordan Borean fec17efe26
Fix runas become SYSTEM logic (#84280) (#84297)
Fixes the logic when attempting to become the SYSTEM user using the
runas plugin. It was incorrectly assumed that calling LogonUser with the
SYSTEM username would produce a new token with all the privileges but
instead it creates a copy of the existing token. This reverts the logic
back to the original process and adds in new logic to avoid any tokens
that are restricted from creating new processes.

(cherry picked from commit 3befdd3d15)
1 week ago
Brian Coca 0fb9772a7b
command module, fix docs to reflect reality (#84191) (#84277)
though the previous docs were the 'intended' outcome,
the current behaviour has been active for a long time and should
not be removed due to backward compatibility issues.

One thing we can do going forward is deprecate substitution enabled by default.

(cherry picked from commit bf48b538f8)
1 week ago
Sloane Hertel 84b407cbdb
Fix returning unreachable for looped tasks (#84049) (#84204)
* Fix returning unreachable for looped tasks

Add tests for ignore_unreachable and loop

(cherry picked from commit 03acb22f99)
1 week ago
Jordan Borean 2936b80dbb
Fix CVE-2024-11079 hostvars unsafe context (#84339)
Fix to preserve an unsafe variable when accessing through an
intermediary variable from hostvars.
2 weeks ago
Matt Clay 1f88f0984f
[stable-2.18] ansible-test - Improve container network detection (#84323) (#84338)
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.

(cherry picked from commit 95e3af3e0f)
2 weeks ago
Matt Clay 3766ea2a8c
[stable-2.18] ansible-test - Fix interactive cmd traceback (#84264) (#84265)
(cherry picked from commit 68bfa37838)
4 weeks ago
Matt Martz 393c80256d
Update Ansible release version to v2.18.0.post0. (#84258) 4 weeks ago
Matt Martz ec78526b97
New release v2.18.0 (#84251) 4 weeks ago
Matt Clay b1366ce965
Update Ansible release version to v2.18.0rc2.post0. (#84198) 1 month ago
Matt Clay 00031d2d6f
New release v2.18.0rc2 (#84193) 1 month ago
Matt Davis 93c3133c2d
remove stale changelog entry (#84187)
* forward-port of a fix that was already included in 2.17.0 and backported to all supported stable branches
1 month ago
Matt Davis 23f8639a4b
[stable-2.18] Preserve `_ansible_no_log` from action result; fix `include_vars` to set properly (#84143) (#84179)
* 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
(cherry picked from commit c9ac477e53)
1 month ago
Brian Coca 3b6de811ab
user module avoid conflicts ssh pub key (#84165) (#84171)
Remove pub key if we are going to generate private
fix tests for os X

(cherry picked from commit 11e4a6a722)
1 month ago
Sviatoslav Sydorenko (Святослав Сидоренко) cfdafb9bb6
[2.18] Trim `selinux_policytype` @ integration tests (#84137)
The shell command sometimes prints a trailing whitespace which breaks
the tests on old RHELs. This patch is supposed to fix that.

(cherry picked from commit cd74c4bcd5)
1 month ago
Matt Martz eaec3748c5
Update Ansible release version to v2.18.0rc1.post0. (#84124) 2 months ago
Matt Martz 34ccdfa90a
New release v2.18.0rc1 (#84122) 2 months ago
Abhijeet Kasurde a3656b2ffb
[stable-2.18] facts: Skip path if the distribution path is directory (#84036)
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>
(cherry picked from commit 34f8f55d9e)
2 months ago
Abhijeet Kasurde 6e4732f8cd
[stable-2.18] debconf: set empty password value (#84033)
Fixes: #83214

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 79e8c4c26c)
2 months ago
Abhijeet Kasurde d9d010441f
[stable-2.18] Update unique filter docs (#84082)
* Correct case_sensitive example
* Add attribute docs

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 18c6b40e19)

Co-authored-by: Tinyblargon <76069640+Tinyblargon@users.noreply.github.com>
2 months ago
Brian Coca c068e45d8d
user module, avoid chmoding symlink'd home file (#83956) (#84080)
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>

(cherry picked from commit 0959472bc6)
2 months ago
Sloane Hertel d0f794d1f6
ansible-galaxy - fix ignoring certs when installing from git repos (#83332) (#84070)
* 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

(cherry picked from commit d0df3a174a)
2 months ago
Sloane Hertel c17149c4db
Fix error message given by ansible.module_utils.facts.timeout.timeout (#83945) (#84068)
* Update unit test

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
(cherry picked from commit ee9e6130a7)
2 months ago
Martin Krizek 371564cdc6
Reduce number of implicit meta tasks (#84007) (#84044)
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>
(cherry picked from commit d6d2251929)
2 months ago
Matt Clay d10cca984e
[stable-2.18] ansible-test - Improve container probe error handling (#84109) (#84110)
(cherry picked from commit 48be6f8b6f)
2 months ago
Matt Clay 90749dbd29
[stable-2.18] ansible-test - Work around pylint issue on 3.11 (#84094) (#84096)
(cherry picked from commit 62ce21b6e4)
2 months ago
Matt Clay e5c301bdf5
ansible-test - Update base/default containers (#84090) 2 months ago
Matt Clay 4ec023efe0
[stable-2.18] Cover unit tests with mypy (#84084) (#84086)
* 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.

(cherry picked from commit 955e310b4c)
2 months ago
Matt Clay 46c427f8be
[stable-2.18] ansible-test - Update astroid for pylint sanity test (#84054) (#84055)
(cherry picked from commit 50604e8461)
2 months ago
Matt Clay e61e1056d9
[stable-2.18] ansible-test - Disable pylint deprecated-* rules (#84050) (#84052)
(cherry picked from commit 3cf308f672)
2 months ago
Matt Clay b16cc4d2d1
[stable-2.18] ansible-test - Update sanity tests and default Python (#83998) (#84047)
* ansible-test - Update sanity test requirements
* ansible-test - Default to Python 3.13 in base/default containers
* ansible-test - Fix incorrect AnyStr type hints

(cherry picked from commit 9406ed3109)
2 months ago
Matt Martz 08683073f9
[stable-2.18] Prevent condor from being installed and fulfilling libfmt dependency (#84023) (#84024)
(cherry picked from commit fb7fd51)
2 months ago
Martin Krizek f9a11a3d6d
package/dnf action plugins: better facts failure msg (#83995) (#84013)
(cherry picked from commit 21fee95af7)
2 months ago
Martin Krizek a627b2411a
dnf5: fix tb when plugins API is not available (#83969) (#83991)
Follow up on https://github.com/ansible/ansible/pull/83105

(cherry picked from commit 0a100c7f06)
2 months ago
Brian Coca 9812e55823
Ansible Errors, Don't hide stacked messages when yaml (#83933) (#84000)
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>
(cherry picked from commit 0c8efa29b2)
2 months ago
Matt Davis 2db34fcf93
Update Ansible release version to v2.18.0b1.post0. (#84005) 2 months ago
Matt Davis 0061f342d9
New release v2.18.0b1 (#84004) 2 months ago
Matt Martz 3f444d01e0
Remove remaining 2.18 deprecations (#83949)
* Remove remaining 2.18 deprecations. Fixes #82948. Fixes #82946.

* ci_complete

* Ensure non-UTF8 error message is surfaced
2 months ago
Matt Clay 602e96908a
[stable-2.18] Move ansible-deprecated ignores for tests inline (#83989) (#83990)
(cherry picked from commit c0fb71a642)
2 months ago
Matt Davis 7fed9b06e0
[stable-2.18] forward ports of unsafe persistence fixes (#83922)
* [stable-2.17] Unsafe persistence (#82779)

* Ensure that unsafe is more difficult to lose [stable-2.16] (#82293)

* Ensure that unsafe is more difficult to lose

* Add Task.untemplated_args, and switch assert over to use it
* Don't use re in first_found, switch to using native string methods
* If nested templating results in unsafe, just error, don't continue

* ci_complete

(cherry picked from commit 270b39f6ff)

* Fix various issues in unsafe_proxy (#82326)

- Use str/bytes directly instead of text_type/binary_type
- Fix AnsibleUnsafeBytes.__str__ implementation
- Fix AnsibleUnsafeBytes.__format__ return type
- Remove invalid methods from AnsibleUnsafeBytes (casefold, format, format_map)
- Use `chars` instead of `bytes` to match stdlib naming
- Remove commented out code

(cherry picked from commit 59aa0145d2)

* Additional Unsafe fixes (#82376)

* Allow older pickle protocols to pickle unsafe classes. Fixes #82356

* Address issues when iterating or getting single index from AnsibleUnsafeBytes. Fixes #82375

* clog frag

(cherry picked from commit afe3fc184f)

* [stable-2.16] Enable directly using `AnsibleUnsafeText` with Python `pathlib` (#82510)

* Enable directly using `AnsibleUnsafeText` with Python `pathlib`. Fixes #82414

(cherry picked from commit c6a652c081)

* Prevent failures due to unsafe plugin name (#82759)

(cherry picked from commit 56f31126ad)

* Address issues from merge conflicts

---------

Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
(cherry picked from commit 9e622ddb67)

* rewrite illegal templated conditional in find test

---------

Co-authored-by: Matt Martz <matt@sivel.net>
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
Sloane Hertel bf8da52aac
ansible-galaxy - fix the usage for role/collection install (#83979) 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
Matt Martz 9ab63986ad
ansible-test no longer needs special casing in `__main__.py` (#83962) 2 months ago