Commit Graph

12339 Commits (c7334ea92cb061fc9dd8cc7ed41d0c7e15440eb9)

Author SHA1 Message Date
Abhijeet Kasurde e6e19e37f7
validate-modules: Check for correct values in choice (#82266)
* validate-modules: Check for correct values in choice

* validate-modules test now checks the length of choices and
  correct option values inside the choice.

Fixes: #82179

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

* Fix sanity tests

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

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
10 months ago
Martin Krizek afd45aca6a
ansible-test - remove rhel 9.2 test remote (#82211)
Fixes #82024
10 months ago
Sebbo94BY e0bf76e3db
Issue #80267: Remove user not found warning (#80291)
Co-authored-by: Sebi94nbg <sebastian.kraetzig@4g-server.eu>
10 months ago
Martin Krizek d664f13b4a
Allow include_tasks handlers for searching role subdirs (#82248)
Fixes #82241
10 months ago
Chris Francy a4b00793be
Update known_hosts module to better handle @cert-authority keys (#70340)
Signed-off-by: Chris Francy <zoredache@gmail.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
10 months ago
Abhijeet Kasurde ce9d268ab8
unarchive: force unarchive if the symlink target changes (#82253)
Fixes: #30420

Original PR from nrwahl2 (https://github.com/ansible/ansible/pull/30463)

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
10 months ago
Herman van Rink d6a8df3218
csvfile - add a keycol parameter to specify in which column to search. (#82242) 10 months ago
Martin Krizek c35e0e8fd8
Re-enable "group removal" integration test for dnf5 (#82250)
Fixed in https://github.com/rpm-software-management/dnf5/pull/1013
10 months ago
Abhijeet Kasurde fbdb666411
ansible-test: Added Fedora 39 (#82218)
* Fedora 39 remote
* Fedora 39 container

Fixes: #82018

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Abhijeet Kasurde 1a759659fe
Enable vendored copy of distutils in entry_point test (#82232)
* Enable use of vendored copy of distutils by removing
  the environment variable SETUPTOOLS_USE_DISTUTILS

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Brian Coca 8b102dca4a
wait_for, fallback to read for non mmapable files (#82064)
* also handle oserror, added debug jic
11 months ago
Brian Coca f6d7dd0840
displaly. log, handle when caplevel is already taken care of (#82227)
reneables ansible logging
11 months ago
Abhijeet Kasurde f8cdec6324
ansible-test: Downgrade containerd for Fedora 39 (#82231)
* containerd 1.6.23 on Fedora 39 causes issue. Downgrading
  to containered to 1.6.19-2 works.
* See: https://bugzilla.redhat.com/show_bug.cgi?id=2237396

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Abhijeet Kasurde a45dc10b8f
ansible-test: Skip modularity test for Fedora 39 and up (#82230)
* Modularity is deprecated in Fedora 39 and onwards,
  Skip modularity tests

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Brian Coca 6e448edc63
no_log avoid masking booleans (#82217)
* no_log avoid masking booleans

* clog

* fix issues
11 months ago
Matt Martz f42984eeb3
Fix ManifestControl dataclass to work with future annotations (#82215)
* Fix ManifestControl dataclass to work with future annotations

* Add tests
11 months ago
Brian Coca 3d9e5c8b9d
fix pc misuse (#82157)
use the more up to date 'task' as play_context only has the 'initial' values.
11 months ago
Brian Coca 8825e60add
ansible-pull: expand destinantion directoy to avoid purgin in / (#82030)
* expand destinantion directoy to avoid purgin in /

  bad things could happen and help alone is not enough
11 months ago
Martin Krizek 0bab08ee33
ansible-test - Add RHEL 9.3 support (#82178)
Fixes #82020
11 months ago
Brian Coca 4a84a9b3db
copy keep suffix on temp file for validation (#82158)
Also updated test to require suffix

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
11 months ago
Martin Krizek a8b6ef7e7c
flush_handlers: handle a failure in a nested block with force_handlers (#81572)
Fixes #81532

ci_complete
11 months ago
Dellucifer f2b5c33349
fixed typos in the documentation (#82077) 11 months ago
Matt Clay fd009a073a Remove sefcontext support plugin
It was only used by the subversion test, but is no longer required.
11 months ago
Matt Clay 0e6942a4d7
Remove unused unit test code (#82168) 11 months ago
Abhijeet Kasurde c5b68ef16d Update Python3
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Matt Clay 98407fc00e Remove unused validate-modules unit test code 11 months ago
Matt Clay dae4e2f07f
Remove unused/unreachable unit test code (#82160) 11 months ago
Matt Clay 0be33551d7
Remove unit tests dependent on systemd bindings (#82161)
These do no not run as part of our test suite.
11 months ago
Abhijeet Kasurde 78c16d983e Remove type_regex testcase
This is leftover testcase for type checker regex removed in
https://github.com/ansible/ansible/pull/82153

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Matt Clay 9dd3eafa14 ansible-test - Use pylint unidiomatic-typecheck
This replaces the regex based check previously used within the validate-modules sanity test.

NOTE: The pylint check overlaps with a similar check for pep8.
      Both are used, since the pep8 based check is more nuanced than the one in pylint.
      For example, allowing `is` checks, but not `==` comparisons.
      If the pylint check is ignored, the pep8 check would still be relevant.
11 months ago
Martin Krizek 7538668731
Check strict before failing to respect skip_broken (#80795)
Fixes #80590
11 months ago
Matt Clay 916a20fccd Ignore coverage of test code that does not run 11 months ago
JustinWayland dec9eeb2e5
Remove create_new_password parameter in CLI.build_vault_ids (#82066)
* Remove unused argument in call to build_vault_ids

* Remove obsolete build_vault_ids tests

* Change tests to account for argument removal

* Remove redundant test
11 months ago
Brian Coca 20a54eb236
restore role param precedence (#82106)
* add test for setfact/param override
11 months ago
Matt Clay ac3ae94ae1
Ignore coverage on code intended never to execute (#82128)
* Ignore coverage on code intended never to execute

* Fail collection loader test if wrong code runs

* Update boilerplate test to accommodate nocover
11 months ago
Matt Clay 1df791cd90
Ignore code which coverage can't analyze (#82125)
* Ignore code which coverage can't analyze

Our own tracing function can't be traced.

* Use `nocover` instead of `no cover` for consistency
11 months ago
Jordan Borean f8a9fd4758
Remove duplicate winrm test (#82124) 11 months ago
Matt Clay 36d6860d80 ansible-test - Remove no-main-display sanity test 11 months ago
Matt Clay 6e15fb0ebf ansible-test - Removed no-basestring sanity test 11 months ago
Matt Clay c349b91af3 ansible-test - Removed no-dict-* sanity tests 11 months ago
Matt Clay 9765bb46f9 ansible-test - Remove no-unicode-literals test 11 months ago
Matt Clay 172a010dd7 Remove unused test support plugins 11 months ago
Matt Clay 5b1b0ce762 Remove Python 2 compat (via six) from unit tests 11 months ago
Matt Clay 18e8401edd
Remove Python 2.x compat from unit tests (#82109) 11 months ago
Matt Clay 89cda0bcae
pip - Add break_system_packages option (#82097) 11 months ago
Jordan Borean f5a0c0dfc8
Ignore testing data for gitleaks (#82083) 11 months ago
Thomas Sjögren fb8ede22e1
don't warn about using a yescrypt hash as user password (#82071)
* dont warn about using a yescrypt hash as password

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* add changelog

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* add yescrypt test

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

---------

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
11 months ago
Martin Krizek fe94a99aa2
any_errors_fatal fixes (#78680)
Fixes #31543
Fixes #36308
Fixes #73246
Fixes #80981
Fixes #81533

ci_complete
11 months ago
Matt Clay c827dc0dab Remove obsolete requirements from prepare_http_tests 11 months ago
Brian Coca 99e0d25857
ansible-pull now handles all secret files CLI options (#82009)
* ansible-pull added missing pasthrough for secrets

 Both become and connection password file options were missing.
 Also added test
11 months ago
Brian Coca 9ee603d1c5
Clarify some points in config lookup documentation (#81951)
Also update tests to support the format on modules/plugins

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
11 months ago
Matt Clay 0b7387d46c Improve filter_encryption test
- Update `data2_vaulted_string_with_id` to match the documented plaintext.
- Add a comment explaining how `data2_vaulted_string_with_id` was derived.
- Add assertions for unvaulted values to ensure they match their plaintext.
- Add round-trip tests for vault+unvault when no salt is used.
11 months ago
Matt Clay 2d2211e4e1
Simplify filter_encryption test (#82062) 11 months ago
Matt Davis 40263992df
remove args passthru on role runme tests that use grep (#82060)
* varying verbosity was masking some first-pass test failures
11 months ago
Brian Coca b4566c18b3
Fix Jinja plugin deduplication (#82002)
for j2 plugins dedupe on path and  not basename
for j2 this is a container file , for other plugins file name == plugin name
11 months ago
Matt Clay e933d9d8a6 ansible-test - Fix parsing of cgroup entries 11 months ago
Matt Clay 09d943445c
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
11 months ago
Matt Clay 37cee8bdfc
ansible-test - Remove special cryptography install (#82008)
Python 3.10 is the minimum version on the controller, and it requires openssl 1.1.1 or later.

As a result, there's no need to check the openssl version any longer.
12 months ago
Jordan Borean 22568305d6
Add ignore invalid options override for mod wrapper (#81899)
Adds an option that can have an action plugin tell the module to ignore
options that do not fit its arg spec. This is to enable support for core
running modules that exist outside of the collection that may not be new
enough to support some of the options supplied to it.
12 months ago
Matt Clay 4f04df75cc
Fix outdated S3 URLs (#81964)
We should always use the CloudFront backed endpoint (ci-files) not the direct S3 bucket reference (ansible-ci-files).
12 months ago
Matt Clay f5c742cdfd
ansible-test - Clean up old Python 2 compat code (#81962)
* Update generated code __future__ import

* Remove Python 2.x compat from compile sanity test

* Remove __metaclass__ from pylint good names list

* Remove Python 2.x compat from ansible-test injector

* Remove Python 2.x compat from ansible-test importer

* Remove Python 2.x compat from ansible-test units

* Remove Python 2.x compat from validate-modules

* Remove Python 2.x compat from pylint plugins

* Remove more Python 2.x compat from ansible-test

* Remove Python 2.x openssl detection in ansible-test

* Remove obsolete Python 2.x comment

* Remove obsolete ansible-test Python 2.x support

* Remove unused bootstrap script functions

* Keep mypy happy

* Remove unused imports

* Keep pylint happy
12 months ago
Matt Clay 3f607359de
Remove obsolete compat code from integration tests (#81961)
Also fix up boilerplate for non .py extension files that contain Python code.
12 months ago
Matt Clay 9295bb5b5d
Unit test cleanup (#81958)
Remove obsolete Python 2.7 and 3.6 support code and fix up existing tests.
12 months ago
Matt Clay fd0f48e99d
ansible-test - Update base/default containers (#81957) 12 months ago
Matt Davis d8484f0af7
Update default test container Python to 3.12 and support for PyLint 3.0.1 (#81953)
* 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
12 months ago
Sviatoslav Sydorenko d2ba76c117
Remove Python `< 3.5` `selectors` fallbacks (#81872) 12 months ago
Sviatoslav Sydorenko 46623b0a96
Deprecate `pycompat24` (#81896) 12 months ago
Sviatoslav Sydorenko 350a394185
Remove Python 2 importlib.import_module compat (#81879) 12 months ago
Matt Martz 92d2c66db2
Remove py2 support from urls.py (#81880) 12 months ago
Jordan Borean 8a5ccc9d63
ansible-galaxy - fix traceback error for invalid req file (#81917)
Provide a better error message when encountering a YAML requirements file that is not a dictionary or list.

Fixes: #81901
12 months ago
Jordan Borean 976067c15f
Add more winrm coverage (#81923) 12 months ago
Jordan Borean 282908c57e
Add test coverage for winrm (#81910) 12 months ago
Matt Clay 16b23d6779
Rename boilerplate sanity test (#81903)
The test covers more than just future boilerplate, so the shorter name is more appropriate.
12 months ago
Matt Clay 9f899f9492
Require `from __future__ import annotations` (#81902) 12 months ago
Matt Clay 921efce43a
ansible-test - Remove more Python 2.7 / 3.6 support (#81898) 12 months ago
Jordan Borean dfc62589f6
win_fetch - improve test time by not scanning Win dir (#81884) 1 year ago
Matt Clay b94ee1cefd
Drop Python 2.7 and Python 3.6 support (#81866)
* Drop Python 2.7 and Python 3.6 support

* Remove obsolete _json_compat
1 year ago
Sloane Hertel debf2be913
optimize host_group_vars and vars plugin loading (#79945)
* 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>
1 year ago
Martin Krizek 9b3ed5ec68
Properly template tags in parent blocks (#81624)
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
1 year ago
Martin Krizek 2d5861c185
run_once: unnotify hosts on handlers that are not run (#81667)
Fixes #81666
1 year ago
Sloane Hertel 000cf1dd46
Update the test containers to include Python3.12.0 final (#81858) 1 year ago
Sloane Hertel b3408ab80b
Fix dnf module crash for non-existent url (#81801)
* ci_complete ci_coverage
1 year ago
Martin Krizek 116766ac3e
Add intentional tests for dnf group remove (#81739)
* Add intentional tests for dnf group remove

* Copy tests from yum
1 year ago
Matt Clay b7903669b4
ansible-test - Update distro containers (#81851)
* ansible-test - Update distro containers

* Update the alpine3 container to Python 3.11

* Update changelog
1 year ago
Matt Clay 20f17687da
ansible-test - Invoke container sleep through env (#81853) 1 year ago
Abhijeet Kasurde d8f791d88c
Bump sanity test requirements for 3.12 (#81846) 1 year ago
Abhijeet Kasurde ce3954ba74
Bump sanity test requirements for 3.12 (#81843) 1 year ago
Sviatoslav Sydorenko ec265ec08a
Bump `coverage.py` to v7.3.2 in `ansible-test` (#81844) 1 year ago
Matt Clay f31c287348
ansible-test - Improve compatibility with pylint 3 (#81841) 1 year ago
Brian Coca ab6a544e86
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>
1 year ago
Matt Martz e78cc1e602
Install upgraded crun from edge (#81833) 1 year ago
Abhijeet Kasurde 4d4c50f856
Provide more info about plugin in deprecation message (#81719)
Provide more information about plugin usage which needs to be
used instead of the deprecated plugin in the deprecation message.

Fixes: #80561

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 year ago
lukaslihotzki-f 27bbff7c22
Add count and mandatory_count parameters in regex_replace filter (#81775) 1 year ago
Martin Krizek 01d190f3d2
Add intentional tests for module_utils/yumdnf.py (#81776) 1 year ago
Matt Clay d6a356d7cd
ansible-test - Update sanity test requirements (#81810) 1 year ago
Sloane Hertel cb8cb8936a
Update ansible-test containers
* Include Python 3.12rc3 and PowerShell 7.3.7
1 year ago
Martin Krizek 60c9660952
Add intentional tests for dnf install rpm when higher version is installed (#81740)
* Add intentional tests for dnf install rpm when higher version is installed

* ci_complete ci_coverage
1 year ago
Matt Martz 68ab02a504
Test heuristic_log_sanitize (#81730)
* Test heuristic_log_sanitize. See #81689

* Add note about what this test is doing

* grammar

Co-authored-by: Matt Clay <matt@mystile.com>

---------

Co-authored-by: Matt Clay <matt@mystile.com>
1 year ago
Matt Martz ddf0311c63
Prevent roles from using symlinks to overwrite files outside of the installation directory (#81780)
* Sanitize linkname during role installs

* Add tests

* add clog frag
1 year ago
Hungtsetse 51f2ddd445
Extend mount info (#81768) 1 year ago