Commit Graph

54186 Commits (0a0dbcf21f5e4c4f5e02814f67743c7664d9ef29)
 

Author SHA1 Message Date
snipfoo 0a0dbcf21f
[stable-2.16] Fix condition for unquoting configuration strings from ini files (#82388)
* Add prefix to `origin` when configuration variables come from ini files

Fixes ansible#82387

This change was suggested by @bcoca in
https://github.com/ansible/ansible/pull/82388#discussion_r1424235728 and
https://github.com/ansible/ansible/pull/82388#discussion_r1424249732

When configuration variables come from an ini file, their `origin` is
now set to `ini: <file>`. Similarly, once supported, YAML configuration
files will have their `origin` as `yaml: <file>`.

Consequently, since unquoting configuration strings should happen if and
only if they come from an ini file, this condition boils down to testing
whether their `origin` starts with `ini:`.

* Do not add prefix to `origin` but explicitly pass `origin_ftype`

So as not to rely on a specific format of the `origin` string,
as suggested by @sivel in
https://github.com/ansible/ansible/pull/82388#issuecomment-1881714871
(cherry picked from commit 5f4e332e37)

Co-authored-by: snipfoo <79416808+snipfoo@users.noreply.github.com>
4 weeks ago
Matt Clay 8ae505fa2c
Update Ansible release version to v2.16.13rc1.post0. (#84200) 1 month ago
Matt Clay 6d06996ca2
New release v2.16.13rc1 (#84195) 1 month ago
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
Matt Martz 4c97263895
Update Ansible release version to v2.16.12.post0. (#84066) 2 months ago
Matt Martz 7ad58ab11b
New release v2.16.12 (#84064) 2 months ago
Matt Martz 522e8ab76a
Update Ansible release version to v2.16.12rc1.post0. (#84029) 2 months ago
Matt Martz 8adbd8fbd3
New release v2.16.12rc1 (#84026) 2 months ago
Sloane Hertel a1cd7ee6e8
[2.16] Clarify galaxy CLI --help about install locations (#83919) (#83964)
* Clarify galaxy CLI --help about install locations (#83919)

* add descriptions for `ansible-galaxy install` and `ansible-galaxy role|collection install`

* fix the usage for installing roles and collections together and include collections in the description for -r

Closes #81159

Co-authored-by: Alan Rominger <arominge@redhat.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
(cherry picked from commit 85d9a40aac)

* ansible-galaxy - fix the usage for role/collection install (#83979)

(cherry picked from commit bf8da52aac)
2 months ago
Martin Krizek 83eeced0f7
dnf5: re-introduce ``state: installed`` alias (#83961) (#83977)
Fixes #83960

(cherry picked from commit aa24e97435)
2 months ago
Matt Clay 1c4804a69d
[stable-2.16] release.py - Include pyproject.toml in git add (#83892) (#83898)
(cherry picked from commit e3ccdaaa2e)
2 months ago
Matt Martz 69fd0b6be3
Update Ansible release version to v2.16.11.post0. (#83926) 3 months ago
Matt Martz 39fc4bd8bb
New release v2.16.11 (#83923) 3 months ago
Matt Martz 860a7fefbc
Update Ansible release version to v2.16.11rc1.post0. (#83893) 3 months ago
Matt Martz 21db2fe85a
New release v2.16.11rc1 (#83890) 3 months ago
Matt Clay 09b69fa133
[stable-2.16] release.py - Add missing setuptools arg to prepare (#83887) (#83889)
* release.py - Add missing setuptools arg to prepare

This allows the prepare command to accept the `--no-setuptools` argument.

It also fixes a traceback when using the `prepare` command.

* Use a more accurate type hint
(cherry picked from commit b544ac13ec)
3 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
Matt Martz b0c138b35e
[stable-2.16] Fix module arg parsing with respawned module on Python 2 (#83846)
* Fix module arg parsing with respawned module on Python 2. Fixes #83812

* smuggled_args should be bytes
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
Matt Martz 93ce28e51c
Update Ansible release version to v2.16.10.post0. (#83770) 4 months ago
Matt Martz 1344463a76
New release v2.16.10 (#83767) 4 months ago
Matt Martz d550c55ac1
Update Ansible release version to v2.16.10rc1.post0. (#83721) 4 months ago
Matt Martz 9427b825c7
New release v2.16.10rc1 (#83719) 4 months ago
Abhijeet Kasurde b8e011cd5f
[stable-2.16] Update any.yml (#83606)
* fixed typo in description
* fixed comment in examples

(cherry picked from commit 506d12de69)

Co-authored-by: Alex Barth <alexbarth92@outlook.com>
4 months ago
Brian Coca bff59efaaf
module compression is now again settable via var (#83573) (#83592)
Previous change overlooked 'uncommenting' the variable entry as a way to update this  to keep the functionality.

Co-authored-by: Glandos <bugs-github@antipoul.fr>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 0eeb933238)
4 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 Clay 7f5948450b
Update Ansible release version to v2.16.9.post0. (#83614) 5 months ago
Matt Clay 61e9dbac62
New release v2.16.9 (#83612) 5 months ago
Matt Clay 4f74aa1d49
[stable-2.16] Quality-of-life improvements for release tool (#83551) (#83559)
* Quality-of-life improvements for release tool

- Default devel releases to b1
- Default non-devel releases to rc1
- Default to release announcement to console
- Avoid auto-links in GH release annoucements for file sizes

(cherry picked from commit 20a815b03f)
5 months ago
Matt Davis a550dc6af0
Update Ansible release version to v2.16.9rc1.post0. (#83552) 5 months ago