Commit Graph
54231 Commits
Author SHA1 Message Date
Martin KrizekandGitHub 2f7376ce06 flush_handlers: handle a failure in a nested block with force_handlers (#81572) (#82197)
Fixes #81532

ci_complete

(cherry picked from commit a8b6ef7e7c)
2023-11-27 08:25:54 -08:00
Maxwell GandGitHub 32aedb8bab setup.cfg: add Programming Language :: Python :: 3.12 classifier (#82152)
ansible-core 2.16+ supports Python 3.12. This corrects missing metadata.
2023-11-27 08:25:01 -08:00
Brian CocaandGitHub 71b00cefac restore role param precedence (#82106) (#82138)
* add test for setfact/param override

(cherry picked from commit 20a54eb236)
2023-11-27 08:24:25 -08:00
Abhijeet KasurdeandGitHub 6f8261bcf9 [bp-2.16] Fix the strategy plugin description in keywords (#82133)
Fixes: https://github.com/ansible/ansible-documentation/issues/762

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 8ecc1d485b)
2023-11-27 08:23:15 -08:00
Jordan BoreanandGitHub c2a3cad466 Remove duplicate winrm test (#82124) (#82127)
(cherry picked from commit f8a9fd4758)
2023-11-27 08:22:29 -08:00
Matt DavisandGitHub 75bce4b9d5 add pep668 note to pip module docs (#82096) (#82098)
(cherry picked from commit 3ea5304a57)
2023-11-27 07:38:15 -08:00
Brian CocaandGitHub e13569d0e2 ansible-pull now handles all secret files CLI options (#82009) (#82070)
* ansible-pull added missing pasthrough for secrets

 Both become and connection password file options were missing.
 Also added test

(cherry picked from commit 99e0d25857)
2023-11-27 07:37:51 -08:00
Brian CocaandGitHub 6cfa8ec021 Fix Jinja plugin deduplication (#82002) (#82053)
for j2 plugins dedupe on path and  not basename
for j2 this is a container file , for other plugins file name == plugin name

(cherry picked from commit b4566c18b3)
2023-11-27 07:37:00 -08:00
Abhijeet KasurdeandGitHub 859f2876f0 [bp-2.16] Update Python3 (#82203)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

(cherry picked from commit c5b68ef16d)
2023-11-13 13:21:46 -08:00
Matt MartzandGitHub 862c5824d0 Update Ansible release version to v2.16.0.post0. (#82144) 2023-11-06 18:41:14 +00:00
Matt MartzandGitHub 704ee70943 New release v2.16.0 (#82141) v2.16.0 2023-11-06 11:56:55 -06:00
Matt DavisandGitHub a13df22c02 remove args passthru on role runme tests that use grep (#82060) (#82061)
* varying verbosity was masking some first-pass test failures

(cherry picked from commit 40263992df)
2023-10-23 17:59:01 +00:00
Matt Clay 31aac52a72 [stable-2.16] ansible-test - Fix parsing of cgroup entries
(cherry picked from commit e933d9d8a6)

Co-authored-by: Matt Clay <matt@mystile.com>
2023-10-23 09:47:54 -07:00
Matt Clay 00f74e03b2 [stable-2.16] Fix subversion integration test (#82029)
- Remove dependency on the htpasswd module (and thus passlib)
- Fix setup/teardown of the httpd process
- Fix cleanup of temporary directories.
(cherry picked from commit 09d943445c)

Co-authored-by: Matt Clay <matt@mystile.com>
2023-10-23 09:46:55 -07:00
Matt MartzandGitHub f6fb5b2031 Update Ansible release version to v2.16.0rc1.post0. (#81987) 2023-10-16 22:07:45 +00:00
Matt MartzandGitHub 2223709bdd New release v2.16.0rc1 (#81986) v2.16.0rc1 2023-10-16 16:27:53 -05:00
Matt ClayandGitHub 33248690fe ansible-test - Update base/default containers (#81956) 2023-10-11 16:37:29 -07:00
Matt ClayandGitHub f9dfd28cff [stable-2.16] Update default test container Python to 3.12 and support for PyLint 3.0.1 (#81953) (#81955)
* temporary PyLint plugin to mask 3.12 finalizer noise

* ansible-test - Default to Python 3.12 for base/default

* ansible-test - Update pylint requirements

* ansible-test - Remove obsoleted changelog entry

* Add changelog fragment for pylint work-around.

(cherry picked from commit d8484f0af7)
2023-10-11 13:53:55 -07:00
Martin KrizekandGitHub 9c91e578d0 [stable-2.16] run_once: unnotify hosts on handlers that are not run (#81667) (#81920)
Fixes #81666
(cherry picked from commit 2d5861c)
2023-10-09 11:34:58 -05:00
Martin KrizekandGitHub f3f0e6a0f8 [stable-2.16] Properly template tags in parent blocks (#81624) (#81921)
When templating tags (which happens outside of standard `post_validate`) we
need to template each object in the inheritance chain and set the templated
values on those objects individually. That way when `task.tags` is called the
`extend` functionality properly picks up the templated values of all
parents into one flatten list.

Fixes #81053
(cherry picked from commit 9b3ed5e)
2023-10-09 11:34:48 -05:00
Jordan BoreanandGitHub e856696f09 ansible-galaxy - fix traceback error for invalid req file (#81917) (#81924)
Provide a better error message when encountering a YAML requirements file that is not a dictionary or list.

Fixes: #81901
(cherry picked from commit 8a5ccc9d63)
2023-10-09 11:34:36 -05:00
Jordan BoreanandGitHub c70f7d829f Add test coverage for winrm (#81910) - 2.16 (#81914)
* Add test coverage for winrm (#81910)

(cherry picked from commit 282908c57e)

* Add more winrm coverage (#81923)

(cherry picked from commit 976067c15f)
2023-10-09 10:59:32 -05:00
Sloane HertelandGitHub 889248bcf7 optimize host_group_vars and vars plugin loading (#79945) (#81878)
* Improve host_group_vars efficiency:

* normalize the basedir with `os.path.realpath()` once and cache it
* cache missing paths/files
* reduce the calls to `isinstance`

Add a couple more general improvements in vars/plugins.py get_vars_from_path():

* call `PluginLoader.all()` once for vars plugins and reload specific
  plugins subsequently
* don't reload legacy/builtin vars plugins that are not enabled

Add a test for host_group_vars and legacy plugin loading

Co-authored-by: Matt Davis <mrd@redhat.com>

* changelog

* Add a new is_stateless attribute to the vars plugin baseclass

update integration tests to be quieter and use the same test pattern

Fix deprecation and adjust test that didn't catch the issue (deprecation only occured when the value was False)

move realpath cache to host_group_vars (do not smuggle call state as instance data)

refactor under a single 'if cache:' statement

Call os.path.isdir instead of always calling os.path.exists first. Just call os.path.exists to differentiate between missing and non-directory.

remove call to super(VarsModule, self).get_vars()

use the entity name as the cache key instead of variable location

Remove isinstance checks and use a class attribute just in case any plugins are subclassing Host/Group

Replace startswith by checking index 0 of the name instead, since host/group names are required

* rename is_stateless to cache_instance to make it more clear what it does

* add plugin instance cache using the path to plugin loader

reduce loading stage option if a new instance isn't created

don't require a known subdir on PluginLoader instantiation for backwards
compatibility

rename attribute again

contain reading from/initializing cached instances to a plugin loader method

* Deprecate v2 vars plugins

* Refactor to use the cache in existing plugin loader methods

Rename the attribute again

Refactor host_group_vars with requested changes

Make changelog a bugfixes fragment

Add a deprecation fragment for v2 vars plugins.

Add type hints

* unbreak group_vars

* Apply suggestions from code review

* misc tweaks

* always cache instance by both requested and resolved FQ name
* add lru_cache to stage calculation to avoid repeated config consultation

* handle KeyError from missing stage option

---------

Co-authored-by: Matt Davis <mrd@redhat.com>
(cherry picked from commit debf2be913)
2023-10-09 10:59:22 -05:00
Matt DavisandGitHub 7d789de400 switch available_hosts to frozenset from list in ansible-inventory (#81870) (#81875)
* major speedup large inventories, since it's consulted iteratively

(cherry picked from commit c1343cc304)
2023-10-09 10:59:09 -05:00
Jordan BoreanandGitHub 5665eca5e9 win_fetch - improve test time by not scanning Win dir (#81884) (#81888)
(cherry picked from commit dfc62589f6)
2023-10-04 10:24:30 -07:00
Matt MartzandGitHub 4ac5b51529 Update Ansible release version to v2.16.0b2.post0. (#81868) 2023-10-03 17:37:33 -04:00
Matt MartzandGitHub 2dd22e3025 New release v2.16.0b2 (#81864) v2.16.0b2 2023-10-03 16:01:03 -04:00
Matt ClayandGitHub 2578664198 [stable-2.16] ansible-test - Update distro containers (#81851) (#81859)
* ansible-test - Update distro containers

* Update the alpine3 container to Python 3.11

* Update changelog.

(cherry picked from commit b7903669b4)
2023-10-03 18:29:45 +00:00
Brian CocaandGitHub 9a4bc7e7b3 Restore import_role variable exporting behavior (#81840)
* Import role public (#81772)

revert to previous behavior to push vars to play at compile time
add `public` parameter to allow per import control of exporting (vs just the global config)

Co-authored-by: tchernomax <maxime.deroucy@gmail.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
(cherry picked from commit ab6a544e86)

* adapted to prev version

 - removed new functionality
 - restored global config functioning overriding specific public option

* remove typoe

* quote it
2023-10-03 13:59:01 -04:00
Sloane HertelandGitHub cbae91501a Update the test containers to include Python 3.12.0 final (#81857) 2023-10-03 10:51:58 -07:00
Matt ClayandGitHub 8c4736dd76 [stable-2.16] ansible-test - Invoke container sleep through env (#81853) (#81856)
(cherry picked from commit 20f17687da)
2023-10-03 16:50:15 +00:00
Abhijeet KasurdeandGitHub a8e59b2547 [backport/2.16] Bump Pylint sanity test requirements for 3.12 (#81850)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-10-03 07:51:55 -07:00
Abhijeet KasurdeandGitHub de732ed712 [backport/2.16] Bump sanity test requirements for 3.12 (#81848) 2023-10-03 07:51:37 -07:00
Sviatoslav SydorenkoandGitHub c7793e65ec Bump coverage.py to v7.3.2 in ansible-test (#81844) (#81845)
(cherry picked from commit ec265ec08a)
2023-10-03 09:13:06 -04:00
Matt ClayandGitHub 58cf53b3c3 [stable-2.16] ansible-test - Improve compatibility with pylint 3 (#81841) (#81842)
(cherry picked from commit f31c287348)
2023-10-02 13:07:27 -07:00
Sloane HertelandGitHub 755a7c7387 Fix reporting role as not found when remote_data is None (#81829) (#81838)
(cherry picked from commit 7fab552563)
2023-10-02 19:57:23 +00:00
Matt MartzandGitHub 5008c56c50 [stable-2.16] Install upgraded crun from edge (#81833) (#81839)
(cherry picked from commit e78cc1e)
2023-10-02 18:58:19 +00:00
Matt MartzandGitHub 831dc6e444 Add compat function for parsing Content-Disposition header (#81807)
* py2 compat for get_param

* Add tests, and handle ValueError

* Add clog frag
2023-10-02 09:30:33 -04:00
Matt ClayandGitHub c2567b1d67 [stable-2.16] ansible-test - Update sanity test requirements (#81810) (#81811)
(cherry picked from commit d6a356d7cd)
2023-09-28 15:49:58 -07:00
Jordan BoreanandGitHub 9632086901 winrm - make command input more resiliant (#81538) (#81794)
* winrm - make command input more resiliant

* Expand warning message

(cherry picked from commit f22231de20)
2023-09-27 09:10:59 -05:00
Sloane HertelandGitHub 42d7a06cd8 Update test container versions for stable-2.16 (#81790) 2023-09-27 09:10:33 -05:00
Matt MartzandGitHub fffb3c403f [stable-2.16] Prevent roles from using symlinks to overwrite files outside of the installation directory (#81780) (#81783)
* Sanitize linkname during role installs

* Add tests

* add clog frag
(cherry picked from commit ddf0311)
2023-09-27 08:44:18 -05:00
Matt MartzandGitHub c6affcf7c1 Update Ansible release version to v2.16.0b1.post0. (#81779) 2023-09-26 11:19:49 -05:00
Matt MartzandGitHub 00ca6b94d0 New release v2.16.0b1 (#81778) v2.16.0b1 2023-09-26 09:37:26 -05:00
Val VandGitHub 37a0754cbf Daemonize follow-up fixes (#81584) (#81766)
* Ensure binary data transmission in daemonize

* Add changelog fragment

(cherry picked from commit 91f94fb59d)
2023-09-26 08:56:38 -05:00
Martin KrizekandGitHub 9033002a86 Allow for searching handler subdir for included task via include_role (#81733) (#81759)
Fixes #81722

(cherry picked from commit 1e7f7875c6)
2023-09-26 08:51:57 -05:00
Sviatoslav SydorenkoandGitHub e470954985 Always allow "no-other-choice" pre-release dependencies when resolving collection dependency tree (#81746)
PR #81606.

Prior to this patch, when `--pre` CLI flag was not passed, the
dependency resolver would treat concrete collection dependency
candidates (Git repositories, subdirs, tarball URLs, or local dirs or
files etc) as not meeting the requirements.

This patch makes it so pre-releases in any concrete artifact
references, and the ones being specifically pinned dependencies or
user requests, met anywhere in the dependency tree, are allowed
unconditionally.

This is achieved by moving the pre-release check from
`is_satisfied_by()` to the `find_matches()` hook, following the
Pip's example.

As a bonus, this change also fixes the situation when a collection
pre-releases weren't considered if it didn't have any stable releases.
This now works even if `--pre` wasn't requested explicitly.

Finally, this patch partially reverts commit
6f4b4c345b, except for the tests. And it
also improves the `--pre` hint warning to explain that it mostly
affects Galaxy/Automation Hub-hosted collection releases.

Ref #73416
Ref #79112
Fixes #79168
Fixes #80048
Resolves #81605

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
(cherry picked from commit 7662a05085)
2023-09-26 08:37:16 -05:00
Matt ClayandGitHub e3eecf096f [stable-2.16] ansible-test - Skip pylint test on Python 3.12 (#81706) (#81757)
(cherry picked from commit 3794612832)
2023-09-21 23:05:04 -07:00
Abhijeet KasurdeandGitHub a1a6550daf inventory_ini: Handle SyntaxWarning in ini parsing (#81707)
* handle SyntaxWarning ini inventory parsing

Fixes: #81328

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-18 10:50:50 -04:00
Abhijeet KasurdeandGitHub 2793dfa594 reboot: show last error message in verbose log (#81578)
* The last error message is now presented in a verbose log

Fixes: #81574

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-15 17:50:26 +00:00