Commit Graph

12466 Commits (d954d155434ba21975ad3bdff0e27b24bf2ec847)

Author SHA1 Message Date
Martin Krizek 08d32bc3a2
dnf5: re-introduce ``state: installed`` alias (#83961) (#83976)
Fixes #83960

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

(cherry picked from commit faf446a895)
3 months ago
Jordan Borean 0200ccb586
Add location on include_tasks fail inside include (#83876) (#83883)
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 f35a9f2db3
Fix ansible-vault integration test for missing vault ids (#83777) (#83782)
* 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 d6c188fd37
powershell - Improve CLIXML parsing (#83847) (#83849)
Improves the logic used when parsing CLIXML to support all escaped
character sequences and not just newlines.

(cherry picked from commit b5e0293645)
3 months ago
Brian Coca 40d7c06fc2
connection plugins: extras fix (#83353) (#83819)
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
Jordan Borean 898d210b62
ssh and psrp - Support more complex characters in fetch_file (#83753) (#83817)
* 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 bf2ba2ce1a
Add explicit winrm/psrp tests for HTTP and HTTPS (#83769) (#83810)
(cherry picked from commit dec49e6288)
3 months ago
Martin Krizek cc7daa9ab2
Ensure skipped loop iteration register var is available (#83756) (#83788)
Fixes #83619

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

(cherry picked from commit 5c84220dbb)
3 months ago
Sloane Hertel c9cdbe32fa
Fix task-adjacent search path in roles (#83621) (#83730)
* Restore search path in the current task file’s directory for roles

(cherry picked from commit 0be66ed6dc)
3 months ago
Sloane Hertel 52cd7c7cc3
[2.17] csvfile lookup - fix giving an error when no search term is provided (#83710) (#83732)
* 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
Matt Clay 68b4e139a1
[stable-2.17] release.py - Auto-update setuptools upper bound (#83713) (#83742)
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
Sloane Hertel b078cb62ed
atomic_move - fix creating file in directory with setgid bit (#83718) (#83764)
* 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
Martin Krizek d33bb8ebfd
linear: fix included handlers executing in lockstep (#83209) (#83528)
Fixes #83019

(cherry picked from commit 775bc1110e)
4 months ago
Abhijeet Kasurde 99c2b11153
[stable-2.17] debconf: handle boolean value representation consistently (#83628)
* 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>
(cherry picked from commit c904bffc7d)

Co-authored-by: Peter A. Bigot <pab@pabigot.com>
4 months ago
Matt Clay a719ba7d8e
[stable-2.17] tests: use keyserver with keyid while using apt_key (#83694) (#83701)
(cherry picked from commit 3daf01e270)

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

Co-authored-by: Matt Clay <matt@mystile.com>
4 months ago
Matt Clay 03446c7f23
[stable-2.17] ansible-test - Remove VyOS tests and support files (#83650) (#83651)
The VyOS remote image required for running the tests is no longer functional.
(cherry picked from commit 79f819dc54)
4 months ago
Matt Clay f02fd32fe0
[stable-2.17] Use build instead of pep517 for integration test (#83638)
(cherry picked from commit f261a6142f)
4 months ago
Matt Davis 7a9f14b19e
Revert #83504 (#83566)
* Revert "[stable-2.17] dnf: follow-up on is_newer_installed arches fix (#83556) (#83563)"

This reverts commit fa40503191.

* Revert "[stable-2.17] dnf - arches must be the same in the is_newer_installed check (#83417)"

This reverts commit 6966b53b5b.
5 months ago
Matt Clay fa40503191
[stable-2.17] dnf: follow-up on is_newer_installed arches fix (#83556) (#83563)
* 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

---------


(cherry picked from commit 28cef00576)

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
5 months ago
Abhijeet Kasurde d1c94fe110
[stable-2.17] package_facts: ignore warnings by apk on stderr (#83519)
* [stable-2.17] package_facts: ignore warnings by apk on stderr

Ignore warnings sent by apk cli on stderr

Partial backport of https://github.com/ansible/ansible/pull/83149

Fixes: #83501

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

* CI fixes

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

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 months ago
Martin Krizek 6966b53b5b
dnf - arches must be the same in the is_newer_installed check (#83417) (#83504)
Fixes #83406

(cherry picked from commit 2930a4664c)
5 months ago
Brian Coca 850da817c5
linear strategy, show templated task name on start (#83473) (#83486)
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 e90cfa4ed9
hostvars templating fix, override serialization (#83509) (#83515)
fixes #82872
nicer implementation courtesy of nitzmahone

(cherry picked from commit 6c0f4c8a2d)
5 months ago
Martin Krizek ddadca052f
Fix tb for when env var contains % (#83499) (#83506)
Fixes #83498

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
(cherry picked from commit a8e4106c47)
5 months ago
Martin Krizek 022b425d86
dnf, dnf5: fix installing via wildcard (#83481) (#83491)
Fixes #83373

(cherry picked from commit 0ee6e39615)
5 months ago
Martin Krizek e8c6eb1f6f
Update the dnf5 copr repo (#83459) (#83471)
The dnf-nightly is the official nightly repo now.

(cherry picked from commit df29852f3a)
5 months ago
Matt Clay d055381c4a
[stable-2.17] ansible-test - Update PyPI test container to 3.1.0 (#83432). (#83439)
(cherry picked from commit 5af5b4b6c8)
6 months ago
Sloane Hertel f3251c2f44
fix any_errors_fatal tests (#83389) (#83398)
* fix any_errors_fatal test to exit on non-zero rc

Use a typo in the debug msg to avoid matching play recap

* remove duplicate 'set -ux'

(cherry picked from commit 68638f4710)
6 months ago
Matt Martz a47a6ebc62
[stable-2.17] Properly quote all needed components of shell commands (#83365) (#83396)
* [stable-2.17] Properly quote all needed components of shell commands (#83365)

* Properly quote all needed components of shell commands

* Use self.quote, add new self.join
(cherry picked from commit 93b8b86)

Co-authored-by: Matt Martz <matt@sivel.net>

* remove new function
6 months ago
Jordan Borean cad5663af1
powershell - Improve Add-Type tempdir handler (#83080) (#83345)
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 92630e54ff
[stable-2.17] Fix Test failure with cowsay installed/present (#83351)
(cherry picked from commit e07b4edc54)

Co-authored-by: MajesticMagikarpKing <69774548+yctomwang@users.noreply.github.com>
6 months ago
Sloane Hertel 76c7dfd968
Fix task.resolved_action callbacks (#82003) (#83329)
* 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
Martin Krizek 8976724d89
setup_rpm_repo/create_repo: "Arch dependent binaries in noarch package" (#83108) (#83231)
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
Felix Fontein a7258d9bdc
Correctly treat separate paragraphs in top-level descriptions as separate paragraphs. (#83155) (#83173)
(cherry picked from commit e3d4c20f6e)
7 months ago
Jordan Borean d9fa3b225f
Add version ceiling for pypsrp (#83122) (#83164)
* 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
Brian Coca 7b9aa6ca0d
display: fix log verbosity (#83179) (#83191)
* display, ensure we have a logger before we log

(cherry picked from commit 2816922cd6)
7 months ago
flowerysong ee3dfd2d4a
ansible-doc: fix typo in output (#83205) (#83207)
(cherry picked from commit f5b945bf6a)
7 months ago
Matt Martz f44d26f74c
[stable-2.17] Don't hardcode the dnf module, dynamically select one (#83183) (#83184)
(cherry picked from commit dc6b77b)
7 months ago
Sloane Hertel 7768360a03
Fix installing roles containing symlinks (#82911) (#83136)
* 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
Brian Coca 07ad1b2641
inspect components, ansible_managed templatable (#83053) (#83130)
* inspect components, ansible_managed templatable

fixes #82322

(cherry picked from commit 124d03145c)
7 months ago
Martin Krizek 86b1946b33
handlers: fix executing in lockstep using linear (#83030) (#83072)
Fixes #82307

(cherry picked from commit a3cdd831b3)
8 months ago
Brian Coca 065918698d
ansible-config: ensure we get templated default (#82974) (#83008)
AKA all defaults rendered

(cherry picked from commit 46137127a2)
8 months ago
Jordan Borean fb01c69021
fetch - add error check on calculated dest (#82970) (#82991)
Add explicit error when the calculated dest path for fetch becomes a
local directory. The existing behaviour will not be checked unlike when
the path did not end with a trailing slash.

(cherry picked from commit 179bc1dabd)
8 months ago
Matt Clay 48b93c0c2f ansible-test - Use stable-2.17 default containers 8 months ago
Matt Martz 9e622ddb67
[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>
8 months ago
Brian Coca 4bc6ffb2aa
Eaiser package mgr overrides (#82629)
Added variable to override auto detection



Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Matt Martz <matt@sivel.net>
8 months ago
Sloane Hertel 4bddbe69d5
Fix traceback inheriting from NetworkConnectionBase and add integration tests (#82954)
Co-authored-by: Jeroen van Bemmel <jvb127@gmail.com>
8 months ago