Commit Graph
54231 Commits
Author SHA1 Message Date
Matt MartzandGitHub a1e5c83223 Update Ansible release version to v2.16.5rc1.post0. (#82843) 2024-03-18 18:14:14 +00:00
Matt MartzandGitHub a1e38ba26b New release v2.16.5rc1 (#82839) v2.16.5rc1 2024-03-18 12:29:13 -05:00
Matt MartzandGitHub 4bf051486e [stable-2.16] Harden the ansiballz and respawn python templates (#81753) (#82747)
Harden our python templates for respawn and ansiballz around str literal quoting
(cherry picked from commit 7c73855)
2024-03-13 16:56:04 -05:00
Jordan BoreanandGitHub 00d6f00a43 Re-enable psrp tests that were disabled (#82785) (#82788)
(cherry picked from commit bb030db546)
2024-03-13 15:53:48 -05:00
Jordan BoreanandGitHub 075623770d Avoid winrm hang on stdin write failure (#82766) (#82782)
If the connection plugin fails to write the data to run to stdin we will
only attempt to get the output with one operation attempt. If this times
out we will consider the command to have failed and raise an exception
instead of forever attempting to get the output.

(cherry picked from commit 942424e10b)
2024-03-13 15:53:41 -05:00
627a92e34a Fix error when templating an unsafe string leading to a type error in Python (#82675) (#82745)
Fixes #82600

(cherry picked from commit 79ea21a39f)

Co-authored-by: Davide Sbetti <davide.sbetti@gmail.com>
2024-03-13 15:53:34 -05:00
Matt MartzandGitHub eb73cc488b [stable-2.16] Install crun from Alpine 3.19 for known musl compatibility (#82812) (#82814)
(cherry picked from commit 86f48a5)
2024-03-13 14:01:01 -05:00
Martin KrizekandGitHub 56f31126ad Prevent failures due to unsafe plugin name (#82759) 2024-03-06 11:17:50 -06:00
Matt ClayandGitHub b65a6cd1b2 [stable-2.16] ansible-test - Add work-around for pytest>=8 errors (#82723) (#82727)
* ansible-test - Add work-around for pytest>=8 errors
* Update changelogs/fragments/ansible-test-pytest-8.yml

(cherry picked from commit a1edb61ce7)
2024-03-04 09:08:59 -08:00
Matt MartzandGitHub 4a92114686 Update Ansible release version to v2.16.4.post0. (#82751) 2024-02-26 15:59:19 -06:00
Matt MartzandGitHub 9f6649cadc New release v2.16.4 (#82746) v2.16.4 2024-02-26 15:04:58 -06:00
Matt MartzandGitHub 6ad778c6b5 [stable-2.16] Disable ansible-test podman container tests on Ubuntu 22.04 (#82748) (#82750)
(cherry picked from commit 9a8be1e)
2024-02-26 14:24:14 -06:00
Matt MartzandGitHub f41469fe0c Update Ansible release version to v2.16.4rc1.post0. (#82710) 2024-02-19 19:08:30 +00:00
Matt MartzandGitHub 8c4aa28696 New release v2.16.4rc1 (#82709) v2.16.4rc1 2024-02-19 12:27:28 -06:00
Mark GoddardandGitHub 23d055e835 Fix issues with ansible-playbook-callbacks test (#82407) (#82630)
The timing of the async tasks was a little unpredictable, meaning that
sometimes we would get an unexpected number of v2_runner_on_async_poll
callbacks, and fail the test. This change fixes the issue by increasing
the poll interval to 2 seconds and the sleep duration to 3 seconds, such
that on a reasonably responsive system we will poll twice per task, with
the sleep ending in the middle of the two polls.

The include_me.yml file does not exist in this integration test. It has
been added.

The remote_tmp_dir.path expression is invalid - the setup_remote_tmp_dir
role uses set_fact to set remote_tmp_dir to remote_tmp_dir.path.

The integration tests run with ANSIBLE_HOST_PATTERN_MISMATCH=error,
meaning that the final play was never reached. Set
ANSIBLE_HOST_PATTERN_MISMATCH=warning to continue past the play and
trigger the v2_playbook_on_no_hosts_matched callback.

(cherry picked from commit 4a2de764ec)
2024-02-14 15:11:24 -06:00
74f99dc36c Fix ansible.builtin.include_vars - depth (#80995) (#82610)
* Changes as suggested by sivel

* Add changelog fragment and tests

Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
(cherry picked from commit 48bed1e15a)

Co-authored-by: tachyontec <92679798+tachyontec@users.noreply.github.com>
2024-02-14 14:29:17 -06:00
Martin KrizekandGitHub c93234304b Do not ignore SyntaxError from jinja2.Environment.from_string (#82607) (#82614)
Jinja may generate an invalid Python source code from a template. Trying
to compile such source code into a Python code object results in
SyntaxError being thrown. An example of such a template is providing the
same keyword argument into a lookup twice, resulting in:
`SyntaxError: keyword argument repeated`.

Since `jinja2.exceptions.TemplateSyntaxError` does not cover such a
case, as it is not a Jinja parsing error, we need to catch SyntaxError
explicitly ourselves.

Fixes #82606

(cherry picked from commit 6d34eb88d9)
2024-02-14 14:28:49 -06:00
Sloane HertelandGitHub add76f36f5 fix loading vars_plugins in roles (#82273) (#82609)
* Fix loading legacy vars plugins when the plugin loader cache is reset

* Remove extra cache layer by ensuring vars plugin names are cached (stateless or not) so that the plugin loader cache can double as the load order

(cherry picked from commit 13e6d8487a)
2024-02-14 14:09:08 -06:00
Sloane HertelandGitHub 9a07ab72b4 [2.16] expect - fix argument spec error with timeout=null (#82522) (#82608)
* expect - fix argument spec error with timeout=null (#82522)

* Fix using timeout=null to wait indefinitely

* fix error message

(cherry picked from commit da9edd7760)

* python2-ify
2024-02-14 14:08:57 -06:00
Maxwell GandGitHub 3e3c29b86e changelog: use correct spelling for possessive pronoun its (#82594) 2024-02-14 14:08:46 -06:00
Matt MartzandGitHub 10211fcf02 Update Ansible release version to v2.16.3.post0. (#82622) 2024-01-29 22:03:50 +00:00
Matt MartzandGitHub df6c5244ef New release v2.16.3 (#82619) v2.16.3 2024-01-29 14:40:01 -06:00
Matt MartzandGitHub 5bef147a5d Update Ansible release version to v2.16.3rc1.post0. (#82591) 2024-01-22 21:00:14 +00:00
Matt MartzandGitHub 19e82eca02 New release v2.16.3rc1 (#82587) v2.16.3rc1 2024-01-22 13:00:19 -06:00
Nilashish ChakrabortyandGitHub d817f5e87f Support action_plugin in plugin_routing_schema (#82562) (#82581)
now validation schema matches reality

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
(cherry picked from commit b01f1f207c)
2024-01-22 09:59:21 -06:00
Brian CocaandMatt Clay 611d0e4dcf Better errors for delegate_to (#82319)
Handle empty result of templating
  Also skip work when we omit

(cherry picked from commit 6ebefaceb6)
2024-01-19 14:52:11 -08:00
Brian CocaandMatt Clay 50736c45ba lookups, make file searching use better is_role (#82290)
* lookups, make file searching use better is_role

 The dwim function will internally try by detecting tasks/main['','.yml','.yaml]
 but this is far from optimial, the existince of role path in vars is much better
 indicator that we can use to pass a hint

* updated test to avoid main.yml

(cherry picked from commit a9919dd7f6)
2024-01-19 14:48:07 -08:00
snipfooandMatt Clay c3b4b3ebe3 Run all handlers with the same listen topic when notified from another handler (#82364)
Fixes #82363

(cherry picked from commit 8328153121)
2024-01-19 14:42:47 -08:00
Brian CocaandGitHub cfa8caff39 [stable-2.16] Role fixes (#82339) (#82452)
* Role fixes (#82339)

* Various fixes to roles

  - static property is now properly set
  - role_names and other magic vars now have full list
  - role public/private var loading is now done when adding to play.roles instead of on each var query
  - added tests

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 55065c0042)

* import_role does not get public until next version
2024-01-19 14:37:42 -08:00
Brian CocaandMatt Clay 46d9d4b17c ansible-config dedupe ini plugin entries (#82498)
added test for ini file integrity, also ensuring no dupes

(cherry picked from commit 6c2895fd88)
2024-01-19 14:17:28 -08:00
Sloane HertelandGitHub 9252584e89 ansible-galaxy - fix exit code for failed role import (#82193) (#82412)
(cherry picked from commit fe81164fe5)
2024-01-18 17:42:30 -06:00
Sloane HertelandGitHub 16c40a03ae [ansible-galaxy] Remove role name conversion when the repo startswith 'ansible-role' (#82508) (#82532)
* Remove role name conversion based on whether the repo name starts with
ansible-role

This was added in 2.3 to match the Galaxy ui behavior of truncating the
'ansible-role-' prefix automatically, but the new backend requires an
alternate name to be provided or defined in the ``galaxy_info``
metadata.

Roles that were imported using the ansible-role-$name convention will
need to use ``--role-name`` or add ``role_name`` to the ``galaxy_info``
dictionary in ``meta/main.yml``.

changelog

* Update changelogs/fragments/fix-default-ansible-galaxy-role-import-name.yml

* Update changelogs/fragments/fix-default-ansible-galaxy-role-import-name.yml

Co-authored-by: flowerysong <junk+github@flowerysong.com>

---------

Co-authored-by: flowerysong <junk+github@flowerysong.com>
(cherry picked from commit d7be3824fe)
2024-01-18 17:42:20 -06:00
Matt MartzandGitHub b9a03bbf5a [stable-2.16] Ensure ANSIBLE_NO_LOG is respected (CVE-2024-0690) (#82565) (#82566)
(cherry picked from commit 6935c8e)
2024-01-18 17:41:55 -06:00
Sloane HertelandGitHub a25fe10056 Targeted fix for installing roles with symlinks containing '..' (#82165) (#82323)
Set the tarfile attribute to a normalized value from unfrackpath instead
of validating path parts and omiting potentially invald parts

Allow tarfile paths/links containing '..', '$', '~' as long as the
normalized realpath is in the tarfile's role directory

(cherry picked from commit 3a42a00368)
2024-01-18 17:24:23 -06:00
Matt MartzandGitHub c6a652c081 [stable-2.16] Enable directly using AnsibleUnsafeText with Python pathlib (#82510)
* Enable directly using `AnsibleUnsafeText` with Python `pathlib`. Fixes #82414
2024-01-18 12:45:27 -06:00
Felix FonteinandGitHub 94ac041cb7 Fix broken docs RST reference. (#82286) (#82297)
(cherry picked from commit 479949aad2)
2024-01-18 10:19:08 -08:00
Matt MartzandGitHub 643277b976 Update Ansible release version to v2.16.2.post0. (#82404) 2023-12-11 22:09:48 +00:00
Matt MartzandGitHub 71a1f55a34 New release v2.16.2 (#82399) v2.16.2 2023-12-11 14:48:58 -06:00
Matt MartzandGitHub afe3fc184f 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
2023-12-07 17:17:14 -06:00
Sviatoslav SydorenkoandGitHub d949af5093 [backport][stable-2.16] 🧪 Replace GitHub SVN integration test with local TLS (#82368)
* [backport][stable-2.16] 🧪 Replace GitHub SVN integration test with local TLS

PR #82334

* Run svn integration test locally with TLS

This patch uses a `trustme` to make an ephemeral CA, and server, and
client TLS artifacts for testing. These are integrated into the Apache
web server via it's `mod_ssl`.

Resolves #82207

* Replace GitHub SVN HTTPS URL w/ localhost over TLS

This change gets rid of the need to use GitHub, which is just about to
drop support for SVN [[1]]. Moreover, it eliminates the need to use
external network for any SVN commands in the test.

[1]: https://github.blog/2023-01-20-sunsetting-subversion-support/

(cherry picked from commit dd0138ba21)

* Implement compat w/ opensuse15, centos7 & rhel7/8
2023-12-06 16:18:19 -06:00
Matt MartzandGitHub 94e8d99ef4 Update Ansible release version to v2.16.1.post0. (#82349) 2023-12-04 22:27:00 +00:00
Matt MartzandGitHub 6d40beeef4 New release v2.16.1 (#82346) v2.16.1 2023-12-04 15:46:24 -06:00
Matt ClayandGitHub 59aa0145d2 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
2023-12-01 09:28:05 -08:00
Matt MartzandGitHub 6655343d6d Update Ansible release version to v2.16.1rc1.post0. (#82304) 2023-11-27 22:05:00 +00:00
Matt MartzandGitHub 5007068bfe New release v2.16.1rc1 (#82301) v2.16.1rc1 2023-11-27 15:24:38 -06:00
Matt MartzandGitHub 270b39f6ff 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
2023-11-27 10:26:45 -08:00
Martin KrizekandGitHub f302b2f592 Allow include_tasks handlers for searching role subdirs (#82248) (#82268)
Fixes #82241

(cherry picked from commit d664f13b4a)
2023-11-27 17:55:57 +00:00
Brian CocaandGitHub bb787c119d ansible-pull: expand destinantion directoy to avoid purgin in / (#82030) (#82221)
* expand destinantion directoy to avoid purgin in /

  bad things could happen and help alone is not enough

(cherry picked from commit 8825e60add)
2023-11-27 17:31:33 +00:00
Brian CocaandGitHub 8a87e1c5d3 no_log avoid masking booleans (#82217) (#82235)
* no_log avoid masking booleans (#82217)

* no_log avoid masking booleans

* clog

* fix issues

(cherry picked from commit 6e448edc63)

* unused boil is hot
2023-11-27 08:29:41 -08:00
Brian CocaandGitHub fb5d254a79 wait_for, fallback to read for non mmapable files (#82064) (#82233)
* wait_for, fallback to read for non mmapable files (#82064)

* also handle oserror, added debug jic

(cherry picked from commit 8b102dca4a)

* skip problem versions
2023-11-27 08:28:03 -08:00