Commit Graph

12295 Commits (6d06996ca2a7c1c710bbe5002232c51bbfc0e85f)

Author SHA1 Message Date
Matt Davis 0595e83c22
[stable-2.16] Preserve `_ansible_no_log` from action result; fix `include_vars` to set properly (#84143) (#84181)
* 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
Martin Krizek 94126e4082
Reduce number of implicit meta tasks (#84007) (#84046)
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)
1 month ago
Brian Coca 9d7312f695
[stable-2.16] user action, fix ssh-keygen issues (#84169)
* user module avoid conflicts ssh pub key (#84165)

Remove pub key if we are going to generate private
fix tests for os X

(cherry picked from commit 11e4a6a722)

* old python, no f''

* Restore test import missing from backport

---------

Co-authored-by: Matt Clay <matt@mystile.com>
1 month ago
Sviatoslav Sydorenko (Святослав Сидоренко) 6bb6b9548f
[2.16] Trim `selinux_policytype` @ integration tests (#84139)
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 Clay aa770130bd
[stable-2.16] ansible-test - Improve container probe error handling (#84109) (#84112)
(cherry picked from commit 48be6f8b6f)
2 months ago
Matt Clay 286a1b3588
[stable-2.16] ansible-test - Work around pylint issue on 3.11 (#84094) (#84098)
(cherry picked from commit 62ce21b6e4)
2 months ago
Martin Krizek 83eeced0f7
dnf5: re-introduce ``state: installed`` alias (#83961) (#83977)
Fixes #83960

(cherry picked from commit aa24e97435)
2 months ago
Felix Fontein dd62bcd957
runtime-metadata sanity test: do not fail deprecation version checks if galaxy.yml has empty `version` (#83831) (#83857)
* Do not create invalid SemanticVersion objects.
* Fix SemanticVersion.parse().
* Add basic runtime-metadata tests.

(cherry picked from commit faf446a895)
3 months ago
Jordan Borean 8d01d0d39d
Add location on include_tasks fail inside include (#83876) (#83882)
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.

(cherry picked from commit 1503805b70)
3 months ago
Sloane Hertel b0c737dc69
atomic_move - fix creating file in directory with setgid bit (#83718) (#83765)
* 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>
(cherry picked from commit 2b91c57c85)
3 months ago
Jordan Borean 40a2fbe50a
ssh and psrp - Support more complex characters in fetch_file (#83753) (#83816) (#83848)
* 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

(cherry picked from commit 520fa688ba)
3 months ago
Matt Clay 79046689b9
[stable-2.16] release.py - Auto-update setuptools upper bound (#83713) (#83743)
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.
(cherry picked from commit 4e69d83fac)
3 months ago
Brian Coca f9ac2f0e22
connection plugins: extras fix (#83353) (#83820)
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

(cherry picked from commit 718ce13673)
3 months ago
Sloane Hertel 56e39b3e72
Fix ansible-vault integration test for missing vault ids (#83777) (#83783)
* 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>
(cherry picked from commit fe7e68bfcb)
3 months ago
Jordan Borean c58b88b1dd
ssh and psrp - Support more complex characters in fetch_file (#83753) (#83816)
* 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

(cherry picked from commit 520fa688ba)
3 months ago
Jordan Borean 52599ee873
Add explicit winrm/psrp tests for HTTP and HTTPS (#83769) (#83809)
(cherry picked from commit dec49e6288)
3 months ago
Martin Krizek bba9f4d02d
Ensure skipped loop iteration register var is available (#83756) (#83789)
Fixes #83619

(cherry picked from commit 9a54ba5a39)
3 months ago
Martin Krizek e97e4239a6
Fix meta tasks breaking host/fork affinity with host_pinned (#83438) (#83779)
Fixes #83294

(cherry picked from commit 5c84220dbb)
3 months ago
Sloane Hertel 050573c256
[stable-2.16] csvfile lookup - fix giving an error when no search term is provided (#83710) (#83733)
* csvfile lookup - fix giving an error when no search term is provided (#83710)

Fixes #83689

(cherry picked from commit 26c8a28d05)

* Fix csvfile test - quote file argument (#83751)

file was intended to be a string, not an undefined variable

(cherry picked from commit 97a60c1e86)
3 months ago
Sloane Hertel c150d1ed91
Fix task-adjacent search path in roles (#83621) (#83731)
* Restore search path in the current task file’s directory for roles

(cherry picked from commit 0be66ed6dc)
3 months ago
Martin Krizek 8a5a2c581a
linear: fix included handlers executing in lockstep (#83209) (#83529)
Fixes #83019

(cherry picked from commit 775bc1110e)
4 months ago
Matt Clay 887f24d11a
[stable-2.16] tests: use keyserver with keyid while using apt_key (#83694) (#83702)
(cherry picked from commit 3daf01e270)

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
4 months ago
Abhijeet Kasurde 241c75aa44
[stable-2.16] ansible-test - Improve unknown env error message (#83678)
(cherry picked from commit 906c969b55)

Co-authored-by: Matt Clay <matt@mystile.com>
4 months ago
Matt Clay 5b35295b81
[stable-2.16] ansible-test - Remove VyOS tests and support files (#83650) (#83652)
The VyOS remote image required for running the tests is no longer functional.
(cherry picked from commit 79f819dc54)
4 months ago
Matt Clay 7bec343023
[stable-2.16] Use build instead of pep517 for integration test (#83639)
(cherry picked from commit f261a6142f)
4 months ago
Matt Davis 2ed5f661d7
Revert "dnf - arches must be the same in the is_newer_installed check (#83417) (#83505)" (#83549)
This reverts commit 58b22a3476.
5 months ago
Martin Krizek 58b22a3476
dnf - arches must be the same in the is_newer_installed check (#83417) (#83505)
Fixes #83406

(cherry picked from commit 2930a4664c)
5 months ago
Brian Coca a4499fdba0
linear strategy, show templated task name on start (#83473) (#83487)
we only templated in some cases but when queueing we could get an untemplated name for the 'on start' event.

(cherry picked from commit 0d28705ce5)
5 months ago
Brian Coca f0179c0f0c
hostvars templating fix, override serialization (#83509) (#83516)
fixes #82872
nicer implementation courtesy of nitzmahone

(cherry picked from commit 6c0f4c8a2d)
5 months ago
Martin Krizek a4ca9e5ee2
dnf, dnf5: fix installing via wildcard (#83481) (#83492)
Fixes #83373

(cherry picked from commit 0ee6e39615)
5 months ago
Martin Krizek afcaaeb9f6
[stable-2.16] Use f38 official repo for libdnf5 package (#83430)
This will make stable-2.16 testing more stable as the f38 copr repo is
going away at some point. It suffices to test against the nightly repo
in stable-2.17 and devel.
5 months ago
Sviatoslav Sydorenko (Святослав Сидоренко) c8c45cdfb4
🧪 Switch CentOS 7 yum repo mirrors to the vault (#83523)
The distro itself reached EoL on June 30, 2024, but these repository
archives live on and should remain usable for testing.

Refs:
* https://www.redhat.com/en/topics/linux/centos-linux-eol
* https://github.com/ansible/pylibssh/commit/01d3442f
* https://gist.github.com/hkneptune/4961532c2df691db79a1c6b72c251b25
* https://vault.centos.org/7.9.2009/
5 months ago
Matt Clay 3135e55dc9
[stable-2.16] ansible-test - Update PyPI test container to 3.1.0 (#83432). (#83440)
(cherry picked from commit 5af5b4b6c8)
6 months ago
Sloane Hertel 68463c2e4d
Fix task.resolved_action callbacks (#82003) (#83330)
* Fix task.resolved_action for callbacks when playbooks use action or local_action

* Fix using module_defaults with 'action' and 'local_action' task FA and add a test case

Fixes #81905

(cherry picked from commit f2435375a8)
6 months ago
Jordan Borean ae8da5eeae
powershell - Improve Add-Type tempdir handler (#83080) (#83344)
Improves the Add-Type temporary directory handler to include a retry
mechanism and not fail on an error. Deleting a temporary file used in
compilation is not a critical error and should improve the reliability
of Ansible on Windows hosts.

(cherry picked from commit b8f1add983)
6 months ago
Abhijeet Kasurde 1ef184ba2d
[stable-2.16] Fix Test failure with cowsay installed/present (#83350)
(cherry picked from commit e07b4edc54)

Co-authored-by: MajesticMagikarpKing <69774548+yctomwang@users.noreply.github.com>
6 months ago
Jordan Borean 96bacf54b2
Add version ceiling for pypsrp (#83122) (#83163)
* Add version ceiling for pypsrp

Add a version ceiling for the pypsrp requirements. This ensures that the
future v1.0.0 release won't impact existing users who install the
library using the version range specified.

* Use constraints file

* Add changelog for this change

(cherry picked from commit 2ed6c30929)
7 months ago
Matt Clay c0f7e9cc2c
ansible-test - Use PyPI proxy for centos7 (#83226) 7 months ago
Martin Krizek c93643fc4d
handlers: fix executing in lockstep using linear (#83030) (#83073)
Fixes #82307

(cherry picked from commit a3cdd831b3)
7 months ago
Matt Martz 5d3a372ef6
[stable-2.16] Issue #80267: Remove user not found warning (#80291) (#83078)
(cherry picked from commit e0bf76e)

Co-authored-by: Sebbo94BY <Sebastian-Kraetzig@gmx.de>
7 months ago
Brian Coca 40bdb2b471
inspect components, ansible_managed templatable (#83053) (#83128)
* inspect components, ansible_managed templatable

fixes #82322

(cherry picked from commit 124d03145c)
7 months ago
Sloane Hertel 59c5f776b6
Add the task info for tombstoned module/action plugins (#82451) (#83040)
* Add the task info for tombstoned plugins

* Fix deprecation for 'include' by removing it from BUILTIN_TASKS which skip the plugin loader lookup

* changelog

remove obsolete unit test using 'include'

* Update changelogs/fragments/improve-tombstone-error.yml

(cherry picked from commit caa86cc4df)
7 months ago
Martin Krizek 28092180b0
[stable-2.16] dnf fixes (#83084)
* dnf: fix installing a package based the file it provides (#82744)

Fixes #82461

(cherry picked from commit a28709f92d)

* dnf: utilize the API for the installed checks (#82725)

Fixes #71808
Fixes #76463
Fixes #81018

(cherry picked from commit f1ded0f417)

* setup_rpm_repo/create_repo: "Arch dependent binaries in noarch package" (#83108)

This fixes "Arch dependent binaries in noarch package" error cause by
including files created by make_elf function in noarch packages. While the
error only manifests itself on EL 7 and 8 it is better to use files
suitable for noarch packages to prevent the error potentially
re-occuring in the future.

(cherry picked from commit 87bead3dcf)
7 months ago
Abhijeet Kasurde 1f4eb2160b
[stable-2.16] assemble: fixed missing parameter error (#83124)
* content is an optional parameter for _get_diff_data API

Fixes: #82359

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 months ago
Sloane Hertel 72013559fe
Fix installing roles containing symlinks (#82911) (#83137)
* Fix installing roles containing symlinks

Fix sanitizing tarfile symlinks relative to the link directory instead of the archive

For example:

role
├── handlers
│   └── utils.yml -> ../tasks/utils/suite.yml

The link ../tasks/utils/suite.yml will resolve to a path outside of the link's directory, but within the role

role/handlers/../tasks/utils/suite.yml

the resolved path relative to the role is tasks/utils/suite.yml, but if the symlink is set to that value, tarfile would extract it from role/handlers/tasks/utils/suite.yml

* Replace overly forgiving test case with tests for a symlink in a subdirectory of the archive and a symlink in the archive dir when these are not equivalent.

* Build test case from role files to make it easier to add test cases

Fixes #82702
Fixes #81965
Fixes #82051

(cherry picked from commit e84240db84)
7 months ago
Matt Martz 3761e11a5c
[stable-2.16] Don't hardcode the dnf module, dynamically select one (#83183). (#83185)
(cherry picked from commit dc6b77beca)
7 months ago
Brian Coca 1b860558e3
ansible-config: ensure we get templated default (#82974) (#83009)
AKA all defaults rendered

(cherry picked from commit 46137127a2)
8 months ago
Felix Fontein e631b5b36a
Do not mangle plugin names in collections that start with an underscore. (#82574) (#82885)
(cherry picked from commit c0821346fc)
8 months ago
Abhijeet Kasurde 416517c90e
[stable-2.16] find: do not fail on PermissionError (#82880)
* Log and skip permission errors on files and directories

Fixes: #82027


(cherry picked from commit f73d72e830)

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
8 months ago
Jordan Borean edbb6d1d59
Allow check mode async task disabling check_mode (#82827) (#82861)
* Allow check mode async task disabling check_mode

Allows running an async task with check_mode: False when the playbook is
being run in check mode.

* Add check_mode attribute to internal cleanup task

(cherry picked from commit c9086061ca)
8 months ago