Compare commits

...

705 Commits

Author SHA1 Message Date
ac8c66d431 Bump devel version to 2.20.0.dev0 (#85409) 2025-06-30 23:31:20 +00:00
3511299e1e Fix deprecated pylint plugin version parsing (#85402) 2025-06-30 14:18:49 -07:00
7216e04139 Remove deprecation warning caused by automatic role argument spec validation (#85401) 2025-06-30 12:19:57 -07:00
54ccad9e46 Limit askpass prompts to single attempt (#85364)
* Limit askpass prompts to single attempt

OpenSSH client option NumberOfPasswordPrompts defaults to 3 so in case
an incorrect connection password is provided it is excessively tried 3
times. Not only that but running the `_ssh_askpass` entry point multiple
times (via ssh) results in `json.decoder.JSONDecodeError` as after the
first run the shared memory is zero'd and the subsequent runs end up
calling `json.loads` on empty data.

`json.decoder.JSONDecodeError` does not happen prior to Python 3.13 as
the share memory is unlinked automatically on `.close()` and the
`_ssh_askpass` entry point exits with return code 1 before attempting to
load zero'd memory.

Fixes #85359

* changelog and tests

* Update changelogs/fragments/85359-askpass-incorrect-password-retries.yml

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>

* Update lib/ansible/cli/_ssh_askpass.py

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>

* Avoid race condition in second unlink

---------

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-28 02:01:33 +00:00
fcffd707c6 Test multiple inheritance in _utils get_all_subclasses (#85396)
Should bring code coverage in _utils.py to 100%.
Ensures get_all_subclasses won't enter infinite recursion.
2025-06-26 17:14:20 -07:00
73369f53af Remove redundant vars FA on PlaybookInclude (#85395)
* The redundant FA declaration was not static, which broke a number of automatic validation behaviors.
* Added tests to assert deferred validation and lack of templating on `import_playbook.vars`.

Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-26 11:34:29 -07:00
29cdba1fee unified Marker propagation for all Jinja plugin/call ops (#85391)
* Errors raised in most Jinja operations and plugin invocations are now propagated as Markers, allowing template pipeline to continue execution when a Marker-aware consumer is present.
* Added ability to inspect ExceptionMarkers to Protomatter `dump_object` filter.
* Added tests.

Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-26 01:17:18 +00:00
649c9ec443 Encryptedstring redact fixes (#85390)
* misc DTFIX/docstring cleanup

* fix EncryptedString redaction, add tests

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

* Fix test failures

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-26 00:42:23 +00:00
db819d2514 ensure transform_to_native_types converts keys (#85389)
* added basic key visitor support to variable visitor (off by default)
* transform_to_native_types enables new key visit/conversion
* add test

Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-25 19:43:57 +00:00
4a03ccbd41 Use codecov-cli for uploads (#85386)
ci_coverage
ci_complete
2025-06-25 10:04:15 -07:00
66a7cfe77d Docs: fix small typo (#85388) 2025-06-25 08:43:07 -04:00
11f5563895 Jinja sandbox refinement (#85385)
* DTFIX recategorize

* fix ansible-console generated task dict

* use non-deprecated task shape

* switch Jinja from ImmutableSandboxedEnvironment to SandboxedEnvironment

* Restore ability to call collection mutation methods.
* Restore ability to directly call integer bitwise operator methods.
* Adjust tests.

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

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-25 03:37:21 +00:00
e7c7df7074 Add test coverage to ansiballz builder source mapping (#85382)
Should bring code coverage in _builder.py to 100%.
2025-06-24 13:41:06 -07:00
547c64f326 deprecate esoteric/undocumented playbook syntaxes (#85378)
Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-24 17:00:37 +00:00
1f8937b57e restore playbook import DS rewrite (#85379)
* add tests for FQ "action" aliases
* add validation for multiple directives

Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-24 01:36:50 +00:00
3c52b14c9e deprecate invalid variable names in inventory (#85377)
* deprecate invalid variable names in inventory

* was previously a hard error for `Host`
* added missing check to `Group`
* swapped blanket Python keyword prohibition with Jinja singleton and `not` check

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

* fix invalid variable name test

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-23 16:55:53 -07:00
578d25f286 Add type annotations to the Role.__init__() method
PR #85346

This patch adds type-checking to the `Role.__init__()` method. 

Context: https://github.com/ansible/ansible/pull/85249#issuecomment-2956115486

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
Co-authored-by: Nils Brinkmann <nils.brinkmann@rheinmetall.com>
2025-06-23 16:31:59 +00:00
ef9d92b31d Test both original and latest dnf versions (#85342)
Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-19 08:19:32 +02:00
dde10a9afb import_playbook validation cleanup (#85358)
* use declarative FA validation
* deleted redundant/broken imperative validation
* added test case to ensure templating

Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-19 00:38:23 +00:00
3354d0d4e2 Add ticket stub for minor changes (#85350) 2025-06-18 17:05:23 -07:00
fa9f286096 display wrap/format arg cleanup (#85352)
Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-18 14:50:45 -07:00
34abc83822 Remove Python 2 mentions (#85353) 2025-06-18 19:14:16 +02:00
46abcfcc82 feature-flag experimental module metadata (#85351)
* added ansible-test integration env/set directive for aliases
* applied to module-serialization-profiles test to enable feature flag

Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-17 23:15:55 +00:00
8e9f5fb9d5 password lookup - re-attempt acquiring lock file regardless of locale (#85318)
* Fix handling FileExistsError, instead of only handling OSError when the human-readable error message is "File exists".

Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-17 16:37:25 -04:00
d922398c4d Show context for reserved variable warnings (#85324)
* Show context for reserved variable warnings

* Update integration test

* Use var origin not value origin

* Use a list

* Ensure tagged varname is used
2025-06-17 13:21:27 -07:00
678c6abc98 Update test-pause (#85347) 2025-06-17 09:15:58 -07:00
83fcaeaa8b Spelling fixes (#85345)
A few grammar fixes too.
2025-06-17 05:26:36 +00:00
eec57ec396 Misc callback fixes/cleanup (#85344)
* Misc callback fixes/cleanup

* Fix v1 callback method dispatch, fully deprecate v1 methods, add missing tests.
* Clean up callback plugin init/setup code, remove redundancies, improve error messaging.
* Remove unused callback method definitions from base class.

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

* switch callback bypass to instance-level from class-level

* preserves any instance-level method magic that implementations were using

* add missing handler dispatch entry

* add tests to ensure all methods are covered

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-16 20:03:06 -07:00
778fdcbef1 Fix Typo in Variable Name and Update Test Data for Identifier Validation (#85338) 2025-06-16 12:02:16 +02:00
FT
f6be5ab224 Fix Typos in Comments and Task Names (#85330)
* Update windows.yml

* Update test_manifest.yml
2025-06-14 14:50:20 -07:00
093ac8df2d ansible-test - Fix relative import resolution (#85328) 2025-06-14 16:11:03 +00:00
025e9cfae6 Add type annotations to set_module_args (#85329) 2025-06-14 15:48:22 +00:00
ed90a424a9 fix script failed_when bypass (#85326)
* fix script failed_when bypass

* misuse of AnsibleActionFail for a retryable/alterable error case
* add tests

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

* type annotation fixes

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-14 00:36:59 +00:00
f7e0612a85 Fix Typos in Integration Test Comments and Documentation (#85322)
* Update specific-revision.yml

* Update main.yml
2025-06-13 10:09:29 -07:00
2991883672 ansible-test - Fix ansible-test debug from remote shell (#85321) 2025-06-13 03:58:55 +00:00
cace19f365 apt: Consider timeout while invoking apt-get command (#85219)
* apt: Consider timeout while invoking apt-get command

* Apply timeout specified by user to apt-get command
  using '-o DPkg::Lock::Timeout=' syntax

Fixes: #78658

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-06-12 17:37:21 -05:00
7ef13cb29e ansible-test - Add remote debugging support (#85317) 2025-06-12 18:57:36 +00:00
137036e96f wait_for module - document self match avoidance (#85251)
When using static string to search system log, avoid matching self execution
logged by Ansible by default.

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-06-12 18:30:32 +00:00
02c21742a3 Assemble add check mode (#85094)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-06-12 16:13:15 +00:00
a09b25a356 Minor Documentation and Comment Corrections (#85313)
* Update New-AnsiblePowerShellSignature.ps1

* Update ultimatequestion.yml
2025-06-12 08:47:24 -07:00
8ec403a3b9 ansible-doc don't show empty paths (#85294)
If no path is given, it can only mean that it is a Jinja plugin, display Jinja as 'provider' then.
2025-06-12 15:05:02 +00:00
4b0a5c5c63 ansible-test - Relocate internal CLI args (#85308)
This improves consistency by locating them with other global options.
2025-06-12 03:24:50 +00:00
76ad0b636f ansible-test - Move metadata to environment (#85307) 2025-06-12 00:18:09 +00:00
7e495f4b20 ansible-doc display docs for modules w/o ext (#85299)
Fixed case in which listing modules for docs failed to get sidecar

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-06-11 14:20:05 -07:00
56de597fc7 Fix typos in documentation and test ignore list (#85303)
* Update ignore.txt

* Update invalid_choice_value.py
2025-06-11 11:19:47 -07:00
c8324aa01a Fix bool filter for non-hashable types (#85300) 2025-06-11 11:18:12 -07:00
d3977ebc88 fix handler include_tasks templating (#85015)
* Add test for a handler including tasks from a variable filename

* Add FieldAttributeBase attribute to indicate if the object should be post validated

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2025-06-11 11:27:00 -04:00
2cfb158536 module_utils/basic.py: properly deprecate importing text_type (#85293) 2025-06-11 07:44:40 +02:00
bdc6c8e16a ansible-test - Code cleanup (#85297) 2025-06-11 01:30:30 +00:00
1d1bbe3424 Fix post-fork deadlock from early Python writers like pydevd (#85296) 2025-06-11 01:08:48 +00:00
714f796384 Fix nested include with templating (#85295) 2025-06-10 22:37:32 +00:00
45dd2c0647 AnsiballZ refactoring and remote debug support (#85289) 2025-06-10 14:11:19 -07:00
aa8d58a174 get_url - check for incomplete data read (#85164) 2025-06-10 15:17:22 -05:00
532edf4c35 Fix templating tags on plays and roles (#82314)
Fixes #69903

ci_complete
2025-06-10 20:49:05 +02:00
4956619ac2 Fix deprecation versions in template lookup (#85288) 2025-06-09 16:38:55 +00:00
2bed98bd20 fix Marker handling on Jinja macro invocations (#85280)
* always allow Marker args to pass through
* always disable pre-emptive trip-on-retrieval for Macro JinjaCallContext
* add macro-callable template expression result test cases

Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-06 13:26:45 -07:00
600c1e67b4 Exceptions clean up (#85176)
* replace usage of `IOError` as it is an alias to `OSError`
* replace usage of `socket.error` as it is an alias to `OSError`
* use subclasses of `OSError` rather than inspecting `errno`s
* utilize `exist_ok` parameter of `os.makedirs` rather than ignoring
  `FileExistsError`

Make the following changes to the exception handling this patch already
updates to be consistent with the new code:
* use `ex` as a name for exception being handled
* use `from ex` when re-raising exception for additional context
* use f-strings and `!r` for quoting
* pass exceptions to the `exception` parameter of `fail_json`
* use `display.error_as_warning` rather than passing stringified
  exception into `display.warning`

Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-06 07:59:01 +02:00
43c0132caa adjust PluginInfo to use PluginType enum (#85277)
* normalization fixups

Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-06 00:50:09 +00:00
9f0a8075e3 Prevent template lookup and action from masking ansible_managed value (#85075)
* deprecate DEFAULT_MANAGED_STR and prevent masking of ansible_managed var

* adjust public API behavior

* restore backward-compatible behavior on existing public API
2025-06-05 17:21:48 -07:00
2b7204527b Restore 2.18 vault tag YAML dump behavior (#85275)
* Doing conditional redaction/formatting needs other bits that aren't ready for 2.19.

Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-05 19:21:46 +00:00
ea7ad90c31 Fix calls to deprecated() to include help_text arg (#85262)
Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-05 08:46:17 +02:00
051f7e5944 Add missing docs for sftp_batch_mode (#85270) 2025-06-05 05:33:40 +00:00
1c06c46cc1 Fix YAML loading/dumping and filters (#85266)
- from_yaml/from_yaml_all filters now preserve trust
- YAML dumping can once again handle undecryptable vaulted values
- increased test coverage

Co-authored-by: Matt Davis <nitzmahone@redhat.com>
2025-06-05 01:59:23 +00:00
6198c7377f Fix incorrect behavior when a Jinja test returns Marker (#85264)
* Avoid Marker trip in plugin wrapper that causes unnecessary early template bailout.
* Remove spurious non-boolean result deprecation warning.
* Add test.

Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-04 18:20:24 +00:00
7da24ca7b0 Fix logic error in ansible-galaxy (#85258)
Co-authored-by: OpenRefactory, Inc <56681071+openrefactory@users.noreply.github.com>
Co-authored-by: Munawar <munawar.hafiz@gmail.com>
2025-06-04 06:37:33 +00:00
0bbd8847c4 Use a Specific Package Manager (#82050)
* Use a Specific Package Manager

* Update the name of package manager from yum to dnf

* Update lib/ansible/modules/package.py

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>

* Update lib/ansible/modules/package.py

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>

---------

Co-authored-by: Aditya Putta <puttaa@skiff.com>
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-03 23:18:42 -07:00
bbbfbd57e2 fix key conversion on legacy JSON profiles (#85253)
* fix key conversion on legacy JSON profiles

* restore stdlib silent str conversion behavior for int/float/bool/None dict key types
* remove most conversions for non-scalar keys
* add key conversion cases to JSON profile test suite

* typo

* Fix sanity test failures

* Fix _handle_key_str_fallback implementation

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-03 15:11:27 -07:00
d7c4d0119f Deprecate ShellModule.checksum() (#85216)
The methods have not been used, updated or tested since
b9d0662faf.
2025-06-03 11:14:55 -04:00
df0b417f2d Resolve misc DTFIX0/1 (#85247)
* complete DTFIX0 after eval

* sunder-prefix Marker.concrete_subclasses

* re-home Jinja plugin decorators public API

* low-hanging/already fixed DTFIX cases

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

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-03 01:31:20 +00:00
8f2622c39f doc - Dynamically document jinja builtins (#85215)
* doc - Dynamically document jinja builtins

This change has `ansible-doc` dynamically generate the documentation for
any Jinja builtin filter and test plugins. These dynamic stubs will
point to the official Jinja documentation pages for more information.

* Fix sanity issues

* Add tests

* Update Jinja builtin doc gen

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

---------

Co-authored-by: Matt Davis <nitzmahone@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-02 13:23:30 -07:00
01bb9393d7 Merge dnf and dnf5 integration tests (#85199) 2025-06-02 09:52:38 +02:00
3505572470 Deprecate ansible.compat.importlib_resources (#85226)
Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-02 09:51:03 +02:00
487d699226 Deprecate module_utils.common.collections.count (#85233)
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Matt Clay <matt@mystile.com>
2025-06-02 09:49:42 +02:00
b4741fc495 Exclude ansible._protomatter from ansible-doc output by default (#85115)
* Exclude ansible._protomatter from ansible-doc output by default

* Added changelog
2025-05-30 15:12:45 -07:00
0ee1c36779 local connection always passes str to Popen (#85239) 2025-05-30 14:39:45 -07:00
2a24633964 Misc ssh agent fixes (#85238)
* Misc ssh-agent fixes

* Replace manual SIGALRM handling with new alarm_timeout context manager
* Misc error handling fixes to ssh-agent startup
* Add SSH_AGENT_EXECUTABLE config to ease failure mode testing
* 100% test coverage on agent startup failure code

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

* make SSH Agent support internal

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-30 13:38:59 -07:00
eafe5fc739 Add missing warning methods and args (#85225) 2025-05-30 11:36:21 -07:00
cbcefc53a3 Clean up TE error handling, wrap sigalrm handler (#85232)
* Clean up TE error handling, wrap sigalrm handler

* Preserve error detail on AnsibleAction and Connection exceptions.
* Remove multiple layers of unreachable or redundant error handling.
* Wrap manual alarm signal/timeout handling into a context manager, add tests.

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

* update error message check in test

* update test timeout message assertions

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-30 10:45:10 -07:00
d41a3430b7 async handling changed to use 'true' booleans(#85074)
async_status and async_wrrapper now use booleans instead of 0/1 for 'thruthyness'
gather_facts also updated

Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-30 08:32:49 -07:00
0e2f770a24 jinja2.__version__ is deprecated (#85221)
Prepare for its removal in Jinja 3.3.

See https://github.com/pallets/jinja/pull/2098
2025-05-30 11:40:10 +02:00
91453e30af Added _TEMPLAR_SANDBOX_MODE config (#85222)
* Added _TEMPLAR_SANDBOX_MODE config

* allows unsafe attribute checks to be disabled in Jinja sandbox

* Update lib/ansible/_internal/_templating/_jinja_bits.py

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

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-30 01:37:58 +00:00
e2a5377b9a ansible-test - Fix incorrect use of InferenceContext (#85230) 2025-05-29 23:20:39 +00:00
b71d9aa4a5 Decouple SSH client verbosity from Ansible display (#85224)
* decouple SSH client verbosity from Ansible display

* remove failing false-coverage unit test
2025-05-29 09:58:16 -07:00
356bf336bd fix from_yaml_all filter inconsistent None handling (#85223)
* fix from_yaml_all filter inconsistent None handling

* always returns empty list for None or empty string input

* deprecate non-string inputs for from_yaml and from_yaml_all
2025-05-29 09:50:01 -07:00
f05b1d1ccf Improve SUSE distribution detection using VARIANT_ID with fallback (#85152)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-05-29 09:20:15 -07:00
99a3346de6 dnf5 - handle all specific libdnf5 exceptions (#85175)
Fixes #84634
2025-05-29 11:51:12 +02:00
a0132fec0b dnf5 tests: do not remove attr (#85218)
On RHEL 10, the attr package is in the dependency tree of dnf itself
and cannot be removed.
2025-05-28 20:23:28 +02:00
3b66150cc3 Recognize virtualization type correctly on Linode (#85184) 2025-05-27 17:27:01 +02:00
068157618c service: Remove py2 specific code (#85191)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-05-27 16:29:54 +02:00
f635a22d81 apt_repository: remove Python 2 support (#85212) 2025-05-27 16:24:23 +02:00
17cee7a982 win coverage - Fix untrusted coverage collection (#85197)
Fixes the logic when running a module through App Control when the
module is not trusted to run in Full Language Mode. This ensures
coverage will still run as expected and that the trust verification only
happens in the wrappers that actually run/prepare the code.

Also expands on a comment to clarify why only that branch is set to set
the internal file encoding to UTF-8.
2025-05-21 20:14:56 +00:00
359173c006 Include message in captured tracebacks (#85196)
This matches the formatting of tracebacks from exceptions.
2025-05-21 13:12:28 -07:00
e226294855 display - Replace CRNL with NL (#85194) 2025-05-21 17:42:22 +00:00
53b0f1645b ansible-test - Add RHEL 10.0 remote (#85189)
* ansible-test - Add RHEL 10.0 remote

* Update tests for RHEL 10
* Fix iptables test
* Rework rpm_key integration test
2025-05-21 10:21:27 -07:00
c6a2e5ea75 csvfile lookup: remove Python 2 compat (#85186) 2025-05-21 09:54:24 -07:00
6a1c24ca99 Limit SSH agent DSA testing to RHEL 9 (#85193) 2025-05-21 15:53:38 +00:00
75f7b2267d Add support for Windows App Control/WDAC (#84898)
* Add support for Windows App Control/WDAC

Adds preview support for Windows App Control, formerly known as WDAC.
This is a tech preview feature and is designed to test out improvements
needed in future versions of Ansible.

* Use psd1 and parse it through the Ast to avoid any unexpected execution results

* Add tests for various manifest permutations

* Ignore test shebang failure

* Apply suggestions from code review

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>

* Use more flexible test expectations

* Add type annotations for shell functions

---------

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2025-05-21 12:28:58 +10:00
e82be177cd ansible-test - Improve deprecated checking type inference (#85159)
* ansible-test - Improve deprecated checking type inference

Also disabled the ``bad-super-call`` pylint rule due to false positives.

* Add type comment support

* Try without using register_transform
2025-05-20 11:23:06 -07:00
feda0a5c6e ansible-test - Fix option filtering (#85182) 2025-05-20 11:11:45 -07:00
1e64707592 Remove unnecessary module shebang (#85183) 2025-05-20 05:41:33 +00:00
242bb9ebab DTFIX recategorization and error/warning refactor (#85181)
Co-authored-by: Matt Davis <nitzmahone@redhat.com>
2025-05-20 00:48:00 +00:00
40c919d7bd Integration tests clean up (#85130)
* Integration tests clean up

* more

* we only test with Ubuntu 24.04 on the controller
2025-05-16 08:25:18 -07:00
97dd5f104c Expand scope of black sanity test (#85169) 2025-05-16 06:28:07 +00:00
14bf64ddf8 Code formatting for .azure-pipelines/ (#85166) 2025-05-16 06:14:44 +00:00
ebd022ee42 Mark integration tests as needs/root (#84487)
For calling setup_test_user, which adds a user to the system (and thus requiring
root):
- become
- become_su
- become_sudo
- slurp

And also:
- apt, which installs/removes system packages
- deb822_repository, which adds/removes apt repos
- hardware_facts calls losetup, which requires root
- package_facts, which installs/removes system packages

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
2025-05-15 23:13:55 -07:00
930ffd1a83 Code formatting for packaging/cli-doc/ (#85167) 2025-05-16 05:52:24 +00:00
ed0e78fd9c Code formatting for packaging/release.py (#85168) 2025-05-16 05:44:59 +00:00
460343510c Code formatting for test/sanity/code-smell/ (#85165) 2025-05-16 05:44:15 +00:00
fe2d9e316a Fix constructable inventory default keyed group (#85002)
Fix the logic for a constructable inventory `keyed_groups` entry to use
the `default_value` if the ``key` expression result is `None` or `omit`
and not just an empty string. This bug was introduced with the changes
in data tagging and goes back to the original behaviour.

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2025-05-15 09:52:47 -04:00
7ac74ab591 ansible-test - Update default containers (#85161) 2025-05-15 02:38:59 +00:00
588410fe50 ansible-test - Update sanity requirements (#85160) 2025-05-15 01:30:59 +00:00
f5a85493c1 recategorize pass over DTFIX-MERGE entries post b4 (#85155) 2025-05-13 23:24:18 +00:00
567fda6906 Add missing cache plugin test scenarios (#85154) 2025-05-13 14:18:32 -07:00
e5476972da ensure builtin tests always return bool (#85149)
* added unit test validation and coverage enforcement

Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-13 02:53:23 +00:00
7be1359841 misc changelog and docstring cleanup (#85148)
* deferred listify_lookup_plugin_terms deprecation

Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-13 00:11:04 +00:00
93aa611435 release.py - Remove email announcement support (#85060)
Also add missing git and run overloads.
2025-05-12 10:29:42 -07:00
9a426fe303 fix ensure_type to support vaulted values (#85129)
* restored parity with 2.18

Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-10 05:05:56 +00:00
fc8a227647 ensure that all config return values are Origin-tagged (#85127)
Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-09 22:10:55 +00:00
9efba4f972 apply trust to declarative plugin config (#85126)
* trust strings in loaded doc fragments
* added tests
* added hard_fail_context test mechanism

Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-09 19:33:33 +00:00
8a4fb78988 facts: CloudStack KVM Hypervisor to Linux virtual fact (#85117)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-05-09 11:52:27 -07:00
7b69cf3266 ansible-test - Relax some deprecation checks (#85122) 2025-05-08 17:08:18 -07:00
4fe9606530 template module - render None as empty string (#85121)
* template module - render `None` as empty string

* Update changelogs/fragments/template-none.yml

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>

---------

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2025-05-08 22:45:53 +00:00
d33bedc48f Misc config type coercion fixes (#85119)
* remove dead config comment noise

* update `list` typed config defaults to be lists

* fix tag preservation/propagation in config
* numerous other ensure_type bugfixes
* 100% unit test coverage of ensure_type
* emit warnings on template_default failures
* fix unhandled exception in convert_bool on unhashable inputs

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

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-08 13:06:18 -07:00
dcc5dac184 sysvinit: make examples consistent (#85108) 2025-05-08 12:08:14 -07:00
471c5229a7 Fix typos (#85107) 2025-05-08 12:05:12 -07:00
8b9ddf5544 Passing warnings to exit/fail_json is deprecated. (#85109) 2025-05-07 11:02:04 -07:00
7e00053a30 add fuzzy matching to package_data sanity (#85103)
* add fuzzy matching to package_data sanity

* relaxes exact directory matches for license files to allow setuptools > 72 to pass

* sanity
2025-05-07 11:00:21 -07:00
107842fd7d dnf5: skip pkgs that don't satisfy bugfix/security when specified (#85111) 2025-05-07 10:52:23 -07:00
1c29910087 get_url: missing closing brace in docs (#85096) 2025-05-06 07:29:18 -07:00
ff6998f2b9 Switch to stackwalk caller ID (#85095)
* See changelog fragment for most changes.
* Defer early config warnings until display is functioning, eliminating related fallback display logic.
* Added more type annotations and docstrings.
* ansible-test - pylint sanity for deprecations improved.
* Refactored inline legacy resolutions in PluginLoader.

Co-authored-by: Matt Clay <matt@mystile.com>
2025-05-05 18:00:02 -07:00
e4cac2ac33 Add win_script become tests (#85079) 2025-05-01 06:46:15 +10:00
9f894b81c2 ensure predictable permissions on module artifacts (#84948)
and test it!
2025-04-30 10:09:06 -04:00
cff49a62ec dnf5: avoid generating excessive history entries (#85065)
Fixes #85046
2025-04-29 16:51:22 +02:00
dbf131c07d async_status: fix example to use finished test (#85066)
Fixes #85048
2025-04-29 08:52:57 -05:00
0aa8afbaf4 ansible-test - Use -t for container stop timeout (#85019) 2025-04-28 21:06:12 -07:00
aab732cb82 show internal but not hidden config options, while still hiding test options (#84997) 2025-04-24 12:48:12 -04:00
8ab342f8cc These actions do not support until (#84847) 2025-04-24 09:50:13 -04:00
03181ac87b Implement TaskResult backward compatibility for callbacks (#85039)
* Implement TaskResult backward compatibility for callbacks
* general API cleanup
* misc deprecations

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

* fix v2_on_any deprecation exclusion for base

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2025-04-24 00:59:46 +00:00
2033993d89 restore parsing/utils/jsonify.py (#85032) 2025-04-22 19:31:45 +00:00
1daa8412d5 comment: raise an exception when an invalid option is provided (#84984)
Co-authored-by: Matt Clay <matt@mystile.com>
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-04-18 20:40:28 -07:00
2cbb721f6f normalize error handler choices (#84998)
use existing to avoid deprecation cycle
normalize test too
2025-04-18 16:06:17 -04:00
e6dc17cda4 Increase galaxy test publish timeout (#85016) 2025-04-18 17:14:22 +00:00
5f6aef95ac Fix test_range_templating on 32-bit architectures (#85007)
* Fix test_range_templating on 32-bit architectures

32-bit archtectures like i386, armel, armhf will fail with the error

ansible._internal._templating._errors.AnsibleTemplatePluginRuntimeError: The
filter plugin 'ansible.builtin.random' failed: Python int too large to convert
to C ssize_t

So just pick sys.maxsize (2**31 - 1) so it works on 32 bit machines.

---------

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
Co-authored-by: Matt Clay <matt@mystile.com>
2025-04-17 17:56:01 -07:00
1b6b910439 Miscellaneous fixes (#85012)
* Add help_text to play_hosts deprecation

* clean up TaskResult type handling
2025-04-17 15:14:01 -07:00
f7d03474a5 Disable retries on ansible-galaxy-collection (#85013) 2025-04-17 21:55:21 +00:00
93e6f012cb Remove unused local function _get_plugin_vars from vars manager (#85008) 2025-04-17 15:16:30 -04:00
6cc97447aa Miscellaneous DT fixes (#84991)
* Use `_UNSET` instead of allowing `ellipsis`

* Fix deprecation warning pre-check

* Deprecation warnings from modules can now be disabled.
* Deprecation warnings from modules get the "can be disabled" notice.

* Include help text in pre-display fatal errors

* Simplify lookup warning/debug messaging

* Fix return type of `timedout` test plugin

* Use `object` for `_UNSET`

* Remove obsolete `convert_data` tests

* Remove unnecessary template from test

* Improve legacy YAML objects backward compat

* Fix templar backward compat for None overrides
2025-04-15 21:45:28 +00:00
e094d48b1b Disable parallel publish in galaxy test (#85000) 2025-04-15 13:26:59 -07:00
500a4aba08 filter_core integration test - remove Python 2.6 related dead code (#84985)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-04-15 11:23:30 -04:00
4868effc71 get_bin_path('ssh-agent'): required is deprecated (#84995) 2025-04-15 16:30:29 +02:00
352d8ec33a ansible-doc: fix indent and line wrapping for first line of (sub-)option and (sub-)return value descriptions (#84690)
* Fix initial indent for descriptions of suboptions.
* Fix line width for initial line of option descriptions.
2025-04-14 16:38:21 -04:00
9ddfe9db39 Convert DT issue template to pre-release template (#84982) 2025-04-14 09:36:10 -07:00
35750ed321 Templating overhaul, implement Data Tagging (#84621)
Co-authored-by: Matt Davis <mrd@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2025-04-14 08:54:36 -07:00
6fc592df9b Fix uninstall tests (#84973)
match file name to package_manager detection of dnf5
2025-04-11 18:55:08 -04:00
3d30e05bb4 ansible-test - Improve runme.sh error handling (#84972) 2025-04-11 20:56:34 +00:00
c54ff7de41 Filter: add support for URL-safe encoding/decoding in b64* (#84949)
* Added support for URL-safe decoding into b64decode
* Added support for URL-safe encoding into b64encode

Fixes: #84147

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-04-11 09:08:02 -07:00
244c2f06ed Add ssh-agent launching, and ssh-agent python client (#84754)
* Add ssh-agent launching, and ssh-agent python client

* Move things around, is this better??

* docs

* postpone creating dir after bin lookup

* fix method name

* changelog ssh agent

* address reviews

* fix typing

* do not redefine public_key

* typing

* more typing

* Catch OSError when starting ssh agent

* likely copy pasted old code

* var type fix

* why is this needed?

ci_complete

* ignoring the change for now

* write out pub key file atomically

* defensive timeout for the socket

* _populate_agent docstring

* do not allow setting these in config

* check expected length before slicing blobs

* test all key types

* remove lock/unlock functionality

* docstring

* private _ssh_agent

* .

* launch agent in cli and ansible_ssh_*

* additional info for ssh-agent comment

* Add tests for remove and remove_all

* comment on os.rename

* hopefully mitigate agent startup/delays problems

* exceptions

* unused import

* fix sanity

* perf

---------

Co-authored-by: Matt Martz <matt@sivel.net>
2025-04-10 15:30:34 -07:00
fcdf0b80b3 git: Document security risk involved in embedding user creds (#84963)
* Provide warning to user about the potential risk involved in
  embedding username and password in git URL while checking out the source.

Fixes: #84557

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-04-10 15:15:42 -04:00
82e4b469f6 respawn: Update ENV dict copy with PYTHONPATH value (#84962)
* Use shallow copy of os.environ to update PYTHONPATH value
  instead of using '|' operator

Fixes: #84954

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-04-10 15:14:24 -04:00
4bc4030988 ansible-pull fix adhoc output inconsistencies on changed (#84869)
Two fixes for single bug:
  - ignore callback changes for adhoc
  - allow 'yaml' change matching
---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-04-10 14:56:52 -04:00
fd76cc2821 Revert "basic: remember the user sensitive information to use later (#84699)" (#84959)
This reverts commit 19e9f3dae2.
2025-04-10 11:19:11 -05:00
16db3fe6c9 fix typo (#84955) 2025-04-10 15:54:40 +00:00
5347d4d4fc distro: detect debian for OS_FAMILY for LMDE 6 (#84941)
Fixes: #84934

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-04-09 16:22:20 -04:00
8b0c4825ae Pin wheel to resolve build issues (#84943) 2025-04-08 22:31:23 -07:00
72909599f6 pipelining fxies (#78111)
Moved check to connection as it should be the final decider
Added property to become plugins to indicate support
Also removed hardcoded su exception
Added tty detection logic for ssh (pipelining won't work if tty is needed or forced)

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2025-04-08 15:53:38 -04:00
a01e58cae3 Support prompt matching with ssh_askpass (#84927) 2025-04-08 10:18:18 -05:00
19e9f3dae2 basic: remember the user sensitive information to use later (#84699)
* Git allows embedding username and password in repo URL for
  https authentication. This may lead to exposing the user sensitive
  information to logs and unautheticated users.
  Adding no_log will partially solve this.
* Added documentation warning user about URL embedded with username
  and password.
* Added logic to remember user sensitive information for later sanitization

Fixes: #84557

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-04-08 09:53:36 -05:00
6a274d8456 Handle forwarded exceptions from dnf5-5.2.13 (#84933) 2025-04-08 09:35:32 -05:00
462affa7c4 Clean up interpreter discovery (#84394)
* Clean up interpreter discovery

- Deprecated `auto_legacy` and `auto_legacy_silent`
- Removed obsolete platform fallback config and logic
- Replaced unit tests with integration tests
- Increased test coverage
2025-04-03 18:07:36 +00:00
b7d76a93b2 Fix up coverage with async on Windows (#84917)
Fixes the coverage collection for Windows and async tasks. This ensures
the async task still has access to the PSHost so that it can access the
runspace debugger tasks on the host.
2025-04-03 12:56:51 +10:00
390e112822 Support download_url without a scheme:host (#84767)
* Support download_url without a scheme:host. Fixes #84213

* Support properly rebuilding pagination links. #84765

* Don't permit non absolute pagination links

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2025-04-02 20:21:41 +00:00
183c695be1 Fix errant warning about client_secret and access_token (#84916) 2025-04-02 10:34:09 -05:00
399d2841c8 Add fallible 2025.4.1 to issue template (#84915) 2025-04-01 23:25:59 +00:00
2a4b1c8248 ansible-config: Dump galaxy server config in proper JSON format (#84912)
Fixes: #84840

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-04-01 11:36:15 -04:00
7d0886457a Windows Exec Runner Update (#84868)
Updates the Windows exec runner in preparation for the WDAC changes.
This new process is designed to improve the way modules are run by
Windows and expose common functionality to run PowerShell code in a
common environment. It also includes futher changes to improve the error
handling to make it easier to see where an error occurred in the running
code.
2025-04-01 11:24:35 +10:00
b3d21e3ad2 Fix apt and dpkg_selections tests (#84900)
* Fix apt and dpkg_selections tests

The tests now support aarch64.
They also have reduced dependencies on URLs hosted on third-party servers.

* Skip tests on unsupported platforms

* Use same package version for both tests

* Fix multi-arch support for Ubuntu 22.04
2025-03-27 09:05:25 -07:00
87422526f5 Expand tests for apt_repository (#84904) 2025-03-27 04:52:24 +00:00
b9e35d66c4 Fix markup for config variable reference. (#84901) 2025-03-26 16:28:31 -04:00
3607f01521 Improve vault filter documentation with clearer examples (#84896)
Fixes: #83583

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-03-26 02:14:48 +00:00
e66aaa66a5 Improve performance of including tasks into the play (#84445)
* Improve performance of including tasks into the play

PlayIterator.add_tasks is used to insert tasks from an include into the
play for particular host. It makes a copy of the current block including
the tasks within the block and inserts the new tasks from the include
into the copied block. But there is no need to make copies of tasks
within the block, what we want is a "shallow" copy of the block. This
PR changes that to copy the block excluding the tasks within.

On a contrived playbook with 50 include_role tasks, each role has 1 task,
running on 10 hosts the running time is reduced from ~55s to ~44s in my
environment.

ci_complete

* Add changelog
2025-03-24 09:39:17 -05:00
5280850130 find: skip ENOENT while enumerating files (#84877)
* skip 'no such file or directory' error code while files and
  directories and report them.

Fixes: #84873

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-03-24 07:37:01 -07:00
1e5aac7b4f Set IPv4 and IPv6 simultaneously (#84829) 2025-03-21 16:19:58 -04:00
e53c12fe2b ansible-test - Update base/default containers (#84874) 2025-03-20 13:25:55 -07:00
3690819ee8 Fix wait_for examples (#84870)
connection: local is wrong as configured remote python does not always match controller
missing the timeout to wait 300s before error
2025-03-20 16:03:26 -04:00
f4aafe1a94 ansible-test - Update pylint requirement (#84872) 2025-03-20 17:18:03 +00:00
35665db4ed Miscellaneous integration test fixes (#84871) 2025-03-20 16:48:02 +00:00
091994a477 ansible-test - Update sanity test requirements (#84866) 2025-03-20 01:21:56 +00:00
b7a5411d8b ansible-test - Improve pep8 compat with black (#84867) 2025-03-20 01:17:01 +00:00
7e7946b60d Require Jinja2 3.1.0 or later (#84864) 2025-03-20 00:21:26 +00:00
ad5cf37625 Add typing_extensions for core unit tests on <3.11 (#84865) 2025-03-20 00:00:07 +00:00
0d4f00f5c8 needed intesect, not difference (#84839)
fixes #84750

Added tests to verify output when using smart + others
2025-03-19 10:41:30 -04:00
61a6222e0e uri: form location correctly from relative redirect (#84541)
* uri: form location correctly from relative redirect

Previously, the original URL would be combined with the relative location incorrectly, especially for URL of any complexity.

Add simple tests demonstrating the problem that fail without the fix

* fix pylint error, import the method similar to other uri methods

* add changelog fragment

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-03-18 15:54:48 -04:00
101e2eb19a windows async - refactor async wrapper code (#84712)
Refactor the async wrapper and watchdog scripts for Windows. This
attempts to avoid WMI on connection plugins that allow breaking away
from a job like winrm and ssh as an optimisation and changes how WMI is
used so that we can get the error details on a failed process more
easily.

These changes are being made also in preparation for the WDAC
implementation that requires this new execution model where input needs
to be provided through stdin.
2025-03-19 04:47:32 +10:00
611d8bdde3 doc-build: fix doc builds (#84852)
Fixes: #84849

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-03-18 16:20:50 +01:00
ac43e40904 darwin: simplify the fact code (#84848)
* Follow up for code review on #84779

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-03-18 14:21:30 +00:00
8127abbc29 Don't inherit stdio (#82770) 2025-03-17 10:08:11 -05:00
3684b4824d Remove reliance on sshpass and utilize SSH_ASKPASS (#83936)
* Add SSH_ASKPASS as an alternative means to provide ssh with passwords
2025-03-17 10:07:44 -05:00
2e7e5b65e7 🧪 Drop venv when making coverage XML @ CI
This deletes the fallback that would use `--venv` when `--docker` is
unavailable in `ansible-test`. But this option is present in all
supported versions of Ansible as it was added in v2.12 which is EOL
already.

PR #84819
2025-03-13 12:24:37 +01:00
9821a4de2f pipe/lines: simplify explanation for need for quotes (#84816)
* do not mention subprocess.Popen, it is an implementation detail
* use "shell injection vulnerability" to describe the problem that is
  well-known, or easily searched for on $search_engine and do not link
  to a 3rd-party site that is also specific to a tool for Python
2025-03-12 17:04:31 +01:00
4efb01c2f3 ansible-test - Replace FreeBSD 13.4 with 13.5 (#84812) 2025-03-11 15:21:38 -07:00
f11dfa7cce dnf5: use new pkg_gpgcheck option, fallback to deprecated one (#84791) 2025-03-11 18:11:57 +01:00
44966cb8e2 Update Fallible issue template (#84808) 2025-03-11 16:32:17 +00:00
df08ed3ef3 🔥 Remove Python 2 datetime compat fallbacks
This patch marks the `ansible.module_utils.compat.datetime` module as deprecated, including `UTC`, `utcfromtimestamp()`  and `utcnow` shims that it provides, scheduling its removal for v2.21.

It also replaces any uses of the compatibility helpers with non-deprecated calls to CPython stdlib.

PR #81874

Co-authored-by: Matt Clay <matt@mystile.com>
2025-03-11 17:19:40 +01:00
50b4e0d279 facts: use pagesize for darwin (#84779)
Fixes: #84773

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-03-11 15:40:46 +00:00
fc71a5befd Added Popen warning to lines.py documentation (#84806) 2025-03-11 16:38:13 +01:00
7fbaf6cfcf dnf5: fix is_installed check for provided packages (#84802)
Fixes #84578
2025-03-11 16:27:13 +01:00
7e0d8398ff Implement an informative reporter for resolvelib
Prior to this change, when the dependency resolver started looping over multiple versions of the same collection due to backtracking, it might take a lot of time to consider and disregard tens or hundreds of versions. But to the end-user, it looks like “nothing is happening, the program is *stuck*”. Even worse if such a time-consuming backtracking hits multiple collections and it “hangs” for longer cumulative period of time.

This patch improves the perceived responsiveness by printing out informational messages with the current status whenever the backtracking for a collection happens for the first, the eighth and the thirteenth times. The last message also reminds them that they can interrupt the process and attempt to adjust the constraints.

In debug mode, it also shows what caused conflicts leading up to candidate rejections. But this is only available with `resolvelib >= 0.9.0`.

The improvement is heavily inspired by https://github.com/pypa/pip/commit/9731131.

PR #81709

Co-Authored-By: Jordan Borean <jborean93@gmail.com>
2025-03-10 12:57:09 +01:00
09391f38f0 dnf tests: unique environment/group name (#84785)
Prevents `Group state for \"customenvgroup\" not found` error which may
or may not be a regression in dnf5. Just name groups/envs uniquely to
workaround the issue.
2025-03-06 11:28:19 +01:00
c02ad3516f Adjust fallible issue template (#84776)
This should provide missing details the bot is looking for.
2025-03-04 23:16:45 -08:00
532e3ea3ec test: error handling in include_role (#84737)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-03-04 15:17:01 +00:00
9bed0413ec Deprecate the paramiko connection plugin. Fixes #83757 (#84727) 2025-03-04 09:05:28 -06:00
00067f1d2e Limit respawn to supported python versions (#83662)
* Limit respawn to supported python versions
2025-03-04 08:43:39 -06:00
96a8c04207 Add issue template for Fallible Data Tagging (#84766) 2025-03-03 11:47:58 -08:00
9ef623a517 Integration test cleanup (#84763)
This brings in integration test fixes from the data tagging PR which are unrelated to DT changes.
2025-03-01 03:11:46 +00:00
650ee5abf8 core: update b64encode and b64decode doc (#84757) 2025-02-28 17:37:38 +01:00
4a710587dd 🧪 Add macOS 15.3 to CI and ansible-test (#84665) 2025-02-25 18:55:03 +01:00
5ff8d093f0 ansible-test - Code style cleanup (#84749)
* ansible-test - Minor style cleanup (add blank lines)

* ansible-test - Use `"""` instead of `'''`
2025-02-25 04:47:45 +00:00
e9e6001263 winrm - Remove pexpect kinit code (#84735)
Removes the use of pexpect in the winrm connection plugin and rely on
just subprocess. In the past pexpect was used for macOS compatibility so
that it could handle the TTY prompt but after testing it seems like
subprocess with `start_new_session=True` is enough to get it reading
from stdin on all platforms. This simplifies the code as there's no
longer an optional library changing how things are called and will work
out of the box.
2025-02-25 04:59:04 +10:00
bddb9a7490 ansible-test - Support target testing with black (#84744) 2025-02-24 17:09:38 +00:00
989e583356 ansible-test - Initial support for black in core (#84741) 2025-02-24 08:39:59 +00:00
2a3c93f593 Deprecate strategy plugins (#84728)
* Deprecate strategy plugins. Fixes #84725
2025-02-19 14:28:55 -06:00
e5ec1ee76c Windows - Support WDAC Audit Mode (#84730)
Fix up bug when attempting to run any module on a Windows host that has
been configured with WDAC and Dynamic Code Security in audit mode. This
does not enable WDAC support with signed scripts so Ansible will still
not pass the audit events but it no longer fails to run.
2025-02-20 05:13:29 +10:00
a742e20fca ansible-test validate-modules - fix ps util checks (#84610)
* ansible-test validate-modules - fix ps util checks

Fix the module util import checks done by `ansible-test sanity --test
validate-modules` to support the newer `#AnsibleRequires` import
statement and `-Optional` flag.

* Fix sanity issues
2025-02-19 07:42:22 +10:00
d21788a9b4 Fix integration tests on debian (#84379)
* Simplify conditional for service_facts integration test

This test requires systemd, so just test for that. Also fixes running this on
Debian testing/unstable releases, where ansible_distribution_version is "n/a".

* Clean up after service_facts integration test

* Simplify set_fact in interpreter_discovery_python test

Those vars are always set, either to something discovered, or "n/a". There are
no evaluations against the value "unknown".

* interpreter_discovery_python: Fix Debian test

Debian doesn't set VERSION_ID in /etc/os-release on pre-releases, see
https://bugs.debian.org/1008735

ansible 2.17 onwards does not support python 2.7 anyway.

* fix deb822_repository integration test failure on Debian

* Fix integration test hostname for Debian

* Fix integration test mount_facts

Some VMs might only have a single mount point, so they only have a single UUID.

* Add package deps for integration test subversion

/usr/bin/htpasswd is shipped in apache2-utils and needed by the main playbook.

* Fix integration test "service" on Debian sid

Debian sid does not set ansible_distribution_version, as such any tests assuming
it's a numeric value will fail. Since this is ancient test code that predates
ansible_service_mgr, remove the error-prone heuristic and rely on that var
instead.

* Fix service integration tests not running on *BSD

---------

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
2025-02-18 13:33:24 -08:00
7a091bf486 Ensure implicit flush_handlers have a parent block (#84709)
* Ensure implicit flush_handlers have a parent block

To avoid getting tracebacks when calling methods like ``get_play()`` on
them.

* task needs to be copied

* copy only when necessary
2025-02-18 08:42:36 -06:00
55e9e21ded better error message for malformed documentation (#84705)
No the file name that caused the error will be apparent
---------

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-02-17 16:12:14 -05:00
cc30f25c42 Make timeout on become an unreachable error (#84589)
* Make timeout on become an unreachable error

Fixes #84468
2025-02-17 08:49:50 -06:00
478806e668 Minor typo fixes (#84714)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-02-14 16:47:18 -05:00
5d7b8288f8 Fix local connection and become issues (#84700)
* Fixed various become-related issues in `local` connection plugin.
* Fixed various issues in `sudo` and `su` become plugins.
* Added unit and integration test coverage.

Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Matt Davis <nitzmahone@redhat.com>
2025-02-13 09:17:57 -08:00
a4d4315d37 non-confrontational by default (#84707) 2025-02-12 09:40:36 -06:00
ea2fe793aa Extend description for meta refresh_inventory (#84691)
* Link to amazon.aws.aws_ec2 inventory plugin.

* Mention that refresh_inventory does not update the selected hosts for a play.

* Address comments by bcoca.

* Apply suggestions from code review

---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-02-11 12:00:42 -08:00
fd30ba8ce0 clarify check_mode (#84703)
fixes #84701
2025-02-11 16:54:06 +00:00
b27b8068f9 re: maxsplit is now keyword argument (#84702)
* Passing maxsplit and flags as positional arguments is deprecated in
  3.13.

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-02-11 10:45:02 -05:00
21492e27fa Add openSUSE MicroOS to SUSE family list (#84685)
* Add openSUSE MicroOS to SUSE family list

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-02-11 10:27:10 -05:00
411b7985a5 test: Enable group tests for Alpine (#84652)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-02-11 10:10:08 -05:00
d0110ff691 test: enable user test for alpine (#84644)
* test: enable user test for alpine

* Disable user home update tests

* Disable some more tests which are not applicable for Alpine

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-02-11 10:09:29 -05:00
d049e7b1b3 fix broken ansible-galaxy-collection resolvelib test (#84626) 2025-02-11 10:03:58 -05:00
a086c34a91 linear - don't treat end_role as a run_once task (#84673) 2025-02-11 08:54:39 -06:00
8d65900974 template: update links to docs (#84689)
Changed the URL to Jinja project
2025-02-10 07:43:49 -08:00
cdb1ce000a Fix is_pinned property of Requirement (#81812)
Previously, requirement version specs starting with `!=` were
incorrectly considered as pinned release requests because the
comparison was being made against a one-char string while the
operator is two-char. This patch changes the check to test against `!`
which is enough to detect this case.
2025-02-08 00:01:23 +01:00
333ee8d010 Test include_vars reserved variable matching (#84678)
* Add test case for include_vars

* Revise test to catch erroneous warnings
2025-02-07 16:15:59 -05:00
ee49adfaf4 🧪🔥 Delete the egg-info integration test (#84686)
Previously, the integration test depended on luck. `setuptools` used
to be bundled in Python stdlib's `ensurepip`. Python 3.12 and newer no
longer include it. This test imports `pkg_resources` that is a part of
`setuptools`, meaning that it'll run out of luck at some point, under
newer Python runtimes.

This test does not seem to be useful to us so instead of fixing it, we
remove it from the repo [[1]].

Supersedes #84681.

[1]: https://github.com/ansible/ansible/pull/84681#discussion_r1945525317
2025-02-07 19:43:29 +01:00
6724e076dd Fix 1GB example in human_to_bytes.yml
Fixed an incorrect example, where the expected output given had evidently been copied from an earlier example accidentally.

PR #84684
2025-02-07 18:30:23 +01:00
f3ccd78cce ansible-test - Update base/default containers (#84670) 2025-02-05 02:09:06 +00:00
cd881bf71e ansible-test - Add pytest-mock to mypy sanity test (#84669) 2025-02-05 00:58:48 +00:00
7594243fc0 ansible-test - Update sanity test requirements (#84667) 2025-02-04 15:03:34 -08:00
21bc1d915d ansible-test - Fix warning message grammar (#84666) 2025-02-04 19:58:21 +00:00
4b38456e4f ansible-test - Correct CLI arg type and annotation (#84664) 2025-02-04 17:53:14 +00:00
4cc47307ef Use separate venvs for each release command (#84641)
This avoids requirements conflicts between different commands invoked by the release tool.
2025-01-30 08:31:36 -08:00
a6b5861c53 add lightweight core issue template for bot-ignored issues (#84638) 2025-01-29 18:18:48 -08:00
48d71ba3aa [fix] warn_if_reserved expects a list (#84624)
Fixes #84623
2025-01-28 18:46:10 +00:00
8290912eb1 service_facts: skip unwanted lines in openrc output (#84622)
* rc-status commands returns unwanted lines with service names
  and their status. Skip such lines while parsing service names

Fixes: #84512

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-28 16:19:46 +01:00
6db6d1967e connection: raise exception return by SSH (#84592)
Fixes: #58133

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-28 16:05:37 +01:00
ce392dd86e Revert "generator: add support for extra vars usage (#84544)" (#84619)
This reverts commit 186c716af1.
2025-01-27 17:59:29 -08:00
e6adddcaf8 debug: hide loop variables while using var (#84597)
Fixes: #65856

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-23 15:00:32 -08:00
03d6209862 apt_key: fix module names in docs (#84588)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-22 08:46:04 -06:00
c9097f73a2 uri: Handle HTTP exception raised (#84015)
* Handle HTTP exceptions raised when reading the content
  such as IncompleteRead

Fixes: #83794

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-21 21:39:28 +00:00
186c716af1 generator: add support for extra vars usage (#84544)
* generator: add support for extra vars usage

Fixes: #83270

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

* CI green

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

* Review requests

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

* Review requests II

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

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-21 15:20:51 -05:00
4953fc7b26 Apt key bye (#84555)
* apt-key module updates due to debian removal

Still kept for now for backwards compat, but removing from testing when not present
And adding more explicit mesasges to errors to point to new module

* added docs and error msg

* clog

* aslkdfj

* no docs to document doc changes

* also add warning to apt_repository

* clog on apt_repo too

* fix string concat

* Apply suggestions from code review

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-21 14:45:38 -05:00
689c047e3a Update win_dirname and win_basename docs (#84587)
* Updated docs and examples for win_dirname and win_basename for UNC path

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-21 09:57:14 -08:00
b51ec9412e cache: deprecated API first_order_merge (#84568)
* deprecated legacy method first_order_merge

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-21 09:33:22 -08:00
df7e1befb4 stdout callback first comment (#84533)
so we know its a rule, not just implementation accident
2025-01-21 11:02:03 -05:00
3b6d086f5e targets/handlers: fix incorrect test cmd (#84567) 2025-01-21 10:38:03 -05:00
8c5e33cd3a Ansible.Basic - Fix required_if check (#84562)
Fixes the Ansible.Basic `required_if` check when the option to check is
either unset or explicitly set to null.
2025-01-21 05:00:03 +10:00
f86c58e2d2 ssh - Improve CLIXML stderr parsing (#84569)
Improves the logic for parsing CLIXML values in the stderr returned by
SSH. This fixes encoding problems by having a fallback in case the
output is not valid UTF-8. It also can now extract embedded CLIXML
sequences in all of stderr rather than just at the start.
2025-01-21 04:42:12 +10:00
3398c102b5 reserved vars, avoid gather_subset (#84575) 2025-01-17 21:33:25 -05:00
675d7201d8 fix template (#84563)
also fix gather_subset warning and add some comments/notes
---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-16 16:33:43 -05:00
35a712588e filters/flatten: fix input documentation (#84477)
Flatten input is a list, not a dictionary.
2025-01-15 14:26:29 -05:00
ad93b96750 host_group_vars - remove unnecessary os.path.join cache (#84549) 2025-01-14 14:55:33 -05:00
3030c79331 user: Fix homedir permissions when UMASK is unset in /etc/login.defs
When a user doesn't exist and user module is used to create the user and the
homedir, adduser is called which parses HOME_MODE from /etc/login.defs, and when
not set calculates the mode from UMASK from the same file.

When a user already exists without homedir, and the user module is used to add a
home dir, it incorrectly ignores HOME_MODE, resulting in a world-readable home
dir when UMASK is not set. This is for example the case in Debian trixie and
later, and likely Ubuntu 25.04 and later.


Signed-off-by: Lee Garrett <lgarrett@rocketjump.eu>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-14 11:44:16 -08:00
5623a386c1 Fix unit and integration tests (#84554)
This is a follow-up to https://github.com/ansible/ansible/pull/84473
2025-01-14 09:27:39 -08:00
7677bf1c9b ansible-test - Use urllib intead of curl (#84551)
Also added automatic retries on HTTP request exceptions, since all currently implemented methods (GET/PUT/DELETE) are idempotent.
2025-01-14 08:59:42 -08:00
a046ef5a95 fix incongruent ansible-vault cli options (#84494)
prompt now only errors if stdin is specifically triggered and not due to lack of other args

fixes #84489
---------

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2025-01-14 10:46:52 -05:00
73180c0630 ansible-vault integration test fix (fixes: #83837) (#84486)
Correct the test that expects an error when using ansible-vault to write against
a non-writeable dir. Skip the test as root, as root can always write.

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
2025-01-14 15:46:31 +00:00
5b0d170496 get_url: add support for BSD-style digest (#84485)
* Added support for BSD-style digest file to test
  checksum of downloaded file.

Fixes: #84476

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-14 15:44:29 +00:00
f727d74fc2 Allows iptables chain creation with wait parameter (#84491)
* Allows iptables chain creation with wait parameter

Fixes #84490

* Add the changelog fragment for 84490
2025-01-14 10:43:08 -05:00
8588401387 User: Update prompt for SSH key passphrase prompt (#84521)
* update prompt for SSH key passphrase prompt
* introduce timeout in SSH key passphrase interaction

Fixes: #84484

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-14 10:35:31 -05:00
d79b706c06 fix[doc.py]: path will be undefined (#84464)
* fix[doc.py]: path will be undefined and a direct reference will throw an UnboundLocalError.

If none of the files in files exists, path will be undefined and a direct reference will throw an UnboundLocalError.
Repair function file parameter type annotation is inaccurate

* Update changelogs/fragments/fix-cli-doc-path_undefined.yaml

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>

---------

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2025-01-14 15:33:43 +00:00
e151cd765d with_dict type error include value in error message (#84473)
* with_dict better error message

* include type in error message

* changelog fragment

* Update lib/ansible/plugins/lookup/dict.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

* specific wording

---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-14 10:21:56 -05:00
4c30e8b6cf .github: simplify PR templates (#84536)
It is rare that we need to provide information like "before and after
the change". In majority of cases we just ignore "Additional
information" when submitting PRs. We can just put the needed information
into the summary if needed and remove the section from the template,
simplifying it.
2025-01-14 15:04:43 +01:00
ae55f874a0 Enforce FQCNs in seealso plugin/module entries. (#84325) 2025-01-13 17:24:09 -05:00
508c4dc93e Update ticketing stubs (#84535)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-13 12:04:50 -08:00
60e2135c2b Bump acme test container to 2.3.0 (#84547) 2025-01-13 11:24:56 -08:00
40d364985d host_group_vars - fix Python API traceback caused by undefined 'key' variable (#84488)
Fixes:

Traceback (most recent call last):
  File "/home/shertel/ansible/lib/ansible/plugins/vars/host_group_vars.py", line 139, in get_vars
    FOUND[key] = found_files = loader.find_vars_files(opath, entity_name)
          ^^^
UnboundLocalError: cannot access local variable 'key' where it is not associated with a value

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/shertel/ansible/lib/ansible/plugins/vars/host_group_vars.py", line 151, in get_vars
    raise AnsibleParserError(to_native(e))
ansible.errors.AnsibleParserError: cannot access local variable 'key' where it is not associated with a value
2025-01-13 11:51:49 -05:00
eb475e23f7 ansible-test - Update utility containers (#84545) 2025-01-11 01:09:48 +00:00
20baf29a2a fix warnings about reserved variable names to cover all sources (#84432)
Also remove redundant check from tqm
Now covers module output (set_fact/include_vars)
Includes play objects at any stage (tasks that error were not covered)
Added tests, moved them to role structure
2025-01-10 18:03:18 +00:00
96f7090acc Use ECR Public for container test (#84537) 2025-01-09 21:16:01 -08:00
477433c5ba constructed, let users know some limitations (#84510)
* constructed, let users know some limitations

reasons https://forum.ansible.com/t/debugging-constructed-inventory-constructing-group-from-values-of-host-variables/39443

* fix indent

* Update lib/ansible/plugins/doc_fragments/constructed.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* updated as per fb

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-01-09 16:18:23 -05:00
64cbb71e6e FIX get_options function for CallbackBase (#84496) 2025-01-08 11:26:42 -05:00
ed250ecd0a 📝 Update the outdated WGs+community links in GH issues (#84523)
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2025-01-08 13:07:04 +00:00
ecadbc6354 📝 Drop drop-down default note from issue forms (#84524)
Co-authored-by: flowerysong <junk+github@flowerysong.com>
2025-01-08 14:00:26 +01:00
3b77277428 ansible-test - Fix FreeBSD instance CA certs (#84529)
Some versions and architectures come with `ca_root_nss` pre-installed.
However, at least FreeBSD 13.4 on aarch64 does not.
This change ensures the certificates will always be installed.
2025-01-07 19:17:35 -08:00
1b3face065 ansible-test - Replace FreeBSD 14.1 with 14.2 (#84527)
* ansible-test - Replace FreeBSD 14.1 with 14.2

* Remove cron faketime testing from FreeBSD
2025-01-07 17:15:27 -08:00
f552fe2c15 ansible-test - Replace RHEL 9.4 with 9.5 (#84526) 2025-01-07 15:11:33 -08:00
35c4b58c11 ansible-test - Replace Alpine 3.20 with 3.21 (#84525) 2025-01-07 14:37:35 -08:00
648dcd3a6a ansible-test - Replace Fedora 40 with 41 (#84281)
* ansible-test - Replace Fedora 40 with 41

Also update other distro containers to remove unnecessary packages:

* apache2
* subversion
* ruby

* Fix subversion test on Ubuntu

Also remove obsolete vars files from subversion test.

* Skip dnf test on Fedora 41+

The dnf5 test is all that is needed.

* Support dnf5 for the package test

* Extend unix-chkpwd work-around for Fedora
2025-01-07 13:46:48 -08:00
3a33d8a4c1 Add Keycloak service account auth capability to ansible-galaxy (#83145) 2025-01-07 12:02:22 -06:00
91f4b71d40 Fix uri integration test on Python 3.13 (#84518) 2025-01-06 17:50:34 -08:00
eb6d581286 ansible-test - Update nios-test-container to 7.0.0 (#84517) 2025-01-06 15:59:58 -08:00
5ec236b564 Fix result_pickle_error integration test (#84506)
The test has been updated to use a custom type which does not support pickling,
instead of relying on Jinja's `Undefined` type. As of Jinja 3.1.5 that type now
supports pickle, which breaks the original implementation of the test.
2025-01-02 19:59:16 -08:00
f72aa1dc0c test: Update regex for required and default in FieldAttributes (#84209)
Fixes: #61460

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-03 02:14:56 +00:00
db44fc58ec Added docstrings to V2 methods in the CallbackBase Class (4 & 5 of 27) (#83507)
* Added docstrings to V2 methods in the CallbackBase Class (4 & 5 of 27)

* Made corrections as requested by webknjaz.

* Cleaned up whitespace issues.

* Corrections to customization note for review by webknjaz.

* Added rtype to return in docstrings.

* Simplified docstrings.


Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
2024-12-30 21:58:10 +01:00
cae4f90b21 Add documentation for non-numeric cron scheduling values (#84396)
- Document vixie cron compatible non-numeric values
- State which parameters cannot be used together with special_time
2024-12-17 12:48:58 -05:00
c64c389007 gather_facts, fix 'smart' handling with network os and 'setup' (#84425)
gather_facts, fix network_os and smart logic and defaults

setup will be default for smart only if network_os is not set, now you get warnings and errors when missing a valid facts module for a network os

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-17 10:19:43 -05:00
01ca9b1d0e uri: move follow_redirects to module_utils (#84442)
* url lookup and uri module shares follow_redirects parameter,
  moving it module_utils code.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-10 08:08:24 -08:00
106909db8b adding option for form-multipart data to switch multipart encoding (#80566)
* adding option for form-multipart data to switch multipart encoding from default base64 to 7or8bit encoding

Co-authored-by: davlas <david.lassig@bwi.de>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2024-12-10 07:54:23 -08:00
3fffddc183 Added None/empty notes to regex_search (#84437) 2024-12-10 07:51:49 -08:00
73d8f4ad46 Make sure we are always using Lock from our multiprocessing context (#84453)
* Make sure we are always using Lock from our multiprocessing context

* add clog frag
2024-12-10 10:38:57 -05:00
563906687b Fix a debug message error (#84426) 2024-12-10 10:13:22 -05:00
3c91eab0d8 copy, prevent internal options in task (#84422)
* copy, prevent internal options in task

fixes #84367
2024-12-10 10:07:12 -05:00
f0f5d7f88b simplify copy module (#84313)
* simplify redundancy with AnsibleModule set_*_if_different methods

* simplify copying a source directory to a dest directory without modifying behavior
2024-12-10 09:09:15 -05:00
363c57b311 csvfile - let the config system do the typecasting (#82263)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-06 16:15:17 +00:00
ac110eb012 lookup_template: added trim_blocks option (#84254)
* Allow user to control the trimming of blocks while templating
* Added tests
* Updated documentation and example

Fixes: #75962

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-06 15:44:08 +00:00
0f466bb75f test: Remove dead code (#84436)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-05 14:52:12 -08:00
d500354798 unarchive: Clamp zip timestamps on 32-bit time_t (#84409)
Clamp zip timestamps to representible values when unpacking zip files on
platforms that use 32-bit time_t (e.g.  Debian i386). This is a
non-issue in practice (in 2024), but should allow the test suite to pass
on Debian i386.

We use a round value of 2038-01-01 00:00:00 for simplicity, and to avoid
running into timezone offsets closer to the actual limit.

MR #81520 introduced sanity-checking tests that used dates not
representable with a 32-bit time_t.
2024-12-05 17:26:58 -05:00
af2bb2c182 wait_for_connection - test connection=local does not emit warning (#84438)
Add test for PR 84421
2024-12-05 17:24:48 -05:00
59d9737788 fix reset_connection with templated connection variables (#84240)
* ssh: Test reset_connection with templated ansible_ssh_executable

Add failing test to confirm subsequent fixes are necessary & sufficient.

* ssh: Fix reset_connection with templated ansible_ssh_executable

Signed-off-by: Alex Willmer <alex@moreati.org.uk>
2024-12-05 15:54:46 -05:00
Fil
eed6d48046 Fix failed_when string in the second ansible.builtin.uri example (#84382)
Open the double quotes at the beginning of the entire `failed_when` value.

Individual conditions work well, yet fail each time they are combined with a logic `or` (as per the example).

Double quoting the entire string solved the problem.
2024-12-05 20:20:27 +00:00
e2b454f4e3 wait_for_connection: fix errant warning for local connection(s) (#84421)
This prevents "[WARNING]: Reset is not implemented for this connection" when
using wait_for_connection with localhost or other local hosts.

It's arguable (from a consistency/correctness perspective) that
`ansible.plugins.connection.local.Connection.reset()` should call
`Connection.close()`. I went for a no-op on the basis of "if it aint broke
don't fix it", and erred on the side of keeping existing semantics. However
either option would be fine with me.
2024-12-05 14:56:14 -05:00
5208cffd91 document decrypt also works on strings (#84412) 2024-12-05 14:54:23 -05:00
b154e38e54 config lookup, fixes and tests (#84398)
* Integration tests for lookup_config

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-05 11:19:34 -08:00
6d21e28c73 Fix non-root integration tests failure (#84378)
* Fix callback_default integration test for non-root users

This test compares the test output to previously collected output. However, this
previously assumed that the tests are run as root, even though needs/root in
aliases is not set.

So instead parameterize the output, and use sed to replace the value that
diverge when running it as different users.

* integration tests: Ensure temp file removal doesn't fail as non-root user

* Don't fail when ansible-galaxy integration test runs as non-root

* Update integration test callback list

---------

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
2024-12-05 14:17:29 -05:00
1ad0c404ef Coverage for virtual/sunos.py (#84357)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-03 09:11:49 -08:00
2ca086c993 Coverage for virtual/hpux.py (#84362)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-03 10:41:56 -05:00
5b231bbbdb test coverage for virtual/sysctl.py (#84356)
* test coverage for virtual/sysctl.py

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-03 10:33:30 -05:00
df0fe81383 Changed human_to_bytes input to a string (#84336)
For it to be a human readable description it can't be an int.
2024-12-03 10:18:37 -05:00
27aa60b8b4 Added examples for password_hash (#84322)
Fixes: #84318

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-03 15:14:48 +00:00
5100aa3977 fix documentation about avoiding apt_key (#84326) 2024-12-03 10:14:37 -05:00
803cf7df41 Add ansible_uptime_seconds support for AIX (#84321)
Added ansible_uptime_seconds fact for AIX

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-03 10:12:39 -05:00
92cf41aa46 Additional tests for lookup_sequence (#84315)
* Additional tests for lookup_sequence

* Follow up for https://github.com/ansible/ansible/pull/83758,
  to add tests for stride parameter.
---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-03 10:06:29 -05:00
9588215601 Removed deprecated include_delegate_to param (#84306)
* Removed deprecated include_delegate_to param

* Remove deprecated include_delegate_to param from
  get_vars API in manager.py

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

* Make ignore.txt

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-03 10:04:32 -05:00
cf4276f560 package_facts: extend note about python3-rpm to cover Fedora 41+ (#84373)
Fedora 41 no longer has python3-rpm installed by default either,
so package_facts blows up on Fedora 41 hosts unless you make sure
python3-rpm is installed first. Not sure we can do a lot about
this besides extending this note.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-11-29 11:19:07 -05:00
f9b58fa13f ansible-test - fix coverage for test modules (#84366)
Fixes the coverage path translation for modules located in integration
test paths. Instead of trying to match by the unique temporary path name
that the module is executed as, the reporting tool will translate it to
the static path that the module is actually located under.
2024-11-27 13:43:06 +10:00
f2a77b071e Test aliases fix (#84377)
* integrity tests: Tag (destructive) root tests as such

- apt_key needs root to touch the apt key database
- debconf needs root to change debconf values of system packages
- gathering writes to /etc/ansible/*, writeable only to root
- group creates system groups
- noexec mounts/umounts a ramdisk
- systemd requires root to start/stop services

Mark all except noexec as "destructive" as they change the state of the system.

* integration test cron requires root, as it calls setup_cron

* integration test dpkg_selection runs dpkg as root

* integration test facts_linux_network requires root

It adds/removes IP addresses from network interfaces, requiring root for that.

* integration test package requires root

installs/removes system packages

* Integration test service requires root

Creates/starts/stops/removes systemd services

* integration test user requires root to create users

* integration tests using setup_test_user require root

---------

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
2024-11-25 16:43:40 -08:00
2a53b851fe dnf5,apt: add auto_install_module_deps option (#84292)
* dnf5,apt: add auto_install_module_deps option

Fixes #84206
2024-11-21 10:06:18 -06:00
95e3af3e0f ansible-test - Improve container network detection (#84323)
When detection of the current container network fails, a warning is now issued and execution continues.
This simplifies usage in cases where the current container cannot be inspected, such as when running in GitHub Codespaces.
2024-11-19 10:49:24 -08:00
c99493eb3f dnf5 - consolidate package resolving settings (#84335)
Fixes #84334
2024-11-19 18:00:35 +01:00
a27a7a27d1 dnf5: fix is_installed check (#84275)
Fixes #84259
2024-11-19 09:32:04 +01:00
3e82ed307b include_vars - fix including new hash variables when hash_behaviour is set to merge (#84303) 2024-11-14 13:50:14 -05:00
e14f9fe725 Sequence query fix (#83758)
Co-authored-by: flowerysong <junk+github@flowerysong.com>
2024-11-13 19:46:57 -08:00
c734ac2125 vars/varnames more examles more varied (#84300)
also ref each other in seealso as they will commonly be used toghether
2024-11-12 16:05:37 -05:00
32eacecca9 Deprecated libvirt_lxc_noseclabel config (#84287)
* Deprecated libvirt_lxc_noseclabel config

* deprecate moved libvirt_lxc_noseclabel config

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

* Make CI green I

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

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-11-12 16:13:45 +01:00
ca0810da85 Add tests for deprecations (#84284)
* Check for module deprecation
* Check for module option deprecation
* Check for plugin deprecation

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-11-12 16:09:39 +01:00
e404bc17f7 package_facts fix empty packages on foreign mgr (#83855)
* package_facts fix empty packages on foreign mgr

return the first package manager that provides output

add tests with fake rpm on apt machines
2024-11-12 08:36:26 -05:00
3befdd3d15 Fix runas become SYSTEM logic (#84280)
Fixes the logic when attempting to become the SYSTEM user using the
runas plugin. It was incorrectly assumed that calling LogonUser with the
SYSTEM username would produce a new token with all the privileges but
instead it creates a copy of the existing token. This reverts the logic
back to the original process and adds in new logic to avoid any tokens
that are restricted from creating new processes.
2024-11-12 09:16:22 +10:00
52ecd3664a ansible-test - align 2025 connection defaults to CI matrix (#84291) 2024-11-11 09:07:35 +10:00
9d249432c4 Increase scope of mypy sanity test (#84288)
* Increase scope of mypy sanity test

* Fix issues reported by mypy
2024-11-09 02:58:29 +00:00
7501bbec20 Add support for Windows Server 2025 (#84285)
Adds Windows Server 2025 to the testing matrix.
2024-11-08 12:28:20 +10:00
bf48b538f8 command module, fix docs to reflect reality (#84191)
though the previous docs were the 'intended' outcome,
the current behaviour has been active for a long time and should
not be removed due to backward compatibility issues.

One thing we can do going forward is deprecate substitution enabled by default.
2024-11-07 16:22:40 -05:00
a98801903d ansible-test - Replace FreeBSD 13.3 with 13.4 (#84236)
* ansible-test - Replace FreeBSD 13.3 with 13.4
* ansible-test - Fix typos in bootstrap.sh
* Skip libfaketime on FreeBSD except FreeBSD 14
2024-11-07 13:19:26 -08:00
1d61f2a4fd remove ignore clauses for module uri (#83642)
Co-authored-by: flowerysong <junk+github@flowerysong.com>
2024-11-07 14:56:51 +00:00
31cde0ebd1 user: create Buildroot subclass as alias to Busybox (#83666)
Fixes: #83665
2024-11-07 14:45:32 +00:00
157ef04b1e Add --flush-cache option to ansible-pull (#84211) 2024-11-06 11:40:15 -05:00
771f7ad29c update ansible-galaxy resolvelib requirement to >= 0.5.3, < 2.0.0 (#84218)
* Update resolvelib upperbound to 2.0.0

Minor SemVer releases should not contain breaking changes

* Test the latest minor release and reduce number of resolvelib versions tested for efficiency
2024-11-06 10:20:26 -05:00
68bfa37838 ansible-test - Fix interactive cmd traceback (#84264) 2024-11-05 23:50:34 +00:00
9cdd6e58b3 Fixed ipv6 pattern in parse_address (#84237) 2024-11-05 08:05:21 -08:00
a99d66e6c7 Removed deprecated STRING_CONVERSION_ACTION (#84245)
Fixes: #84220

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-11-05 16:27:12 +01:00
49b22d4d6b Python binary should not be python at first try for env-setup.fish (#84212) 2024-11-05 16:13:52 +01:00
abf6036bb2 Link to role argspec docs. Fixes #84164 (#84192) 2024-11-04 17:06:58 -06:00
f92e99fd8f test: fix check_required_by (#84153)
* Update the documentation for check_required_by
* Fix return value for check_required_by (now returns empty list on success)

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-11-02 10:36:45 -07:00
c49e94017a Improvements for the create-bulk-issues.py script (#84235)
* Improve error handling for create-bulk-issues.py

* Add support for setting assignee

* Add example YAML to feature --help output.

* Add additional help message for token issues.
2024-11-01 15:15:59 -07:00
32ae3ce117 Remove encrypt unit tests for undocumented algorithms, which are disallowed in 2.19. (#84219) 2024-11-01 13:21:24 -04:00
8784469b4c encrypt: raise error on passing unsupported passlib hashtype (#84186)
* Raise an AnsibleFilterError when unsupported passlib hashtype is
  provided in do_encrypt.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-31 15:27:37 +00:00
2c6b78f516 Add --flush-cache option for ansible and ansible-console (#84149)
* Allow CLIs that accept inventory options to flush the inventory cache(s) and fact cache

Fixes #83749
2024-10-30 14:59:01 -04:00
03acb22f99 Fix returning unreachable for looped tasks (#84049)
* Fix returning unreachable for looped tasks

Add tests for ignore_unreachable and loop
2024-10-30 10:35:23 -04:00
a3b58fb67c Add a test using ignore_errors as a variable (#84175)
* Add a regression test for https://github.com/ansible/ansible/issues/32384
2024-10-29 16:32:17 +01:00
3a40ba3b2c Remove deprecated pycompat24 and importlib (#84161)
* Removed deprecated pycompat24 and importlib

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

* Make CI green

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

* Ignore basic.py

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

* Make CI green III

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

* Make CI green IV

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

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-29 16:14:01 +01:00
1b46b5923e Change changelog type from bugfixes to removed_features (#84158)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-29 16:09:20 +01:00
f29b46e438 Remove deprecated plural form of collection path (#84156)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-29 16:07:20 +01:00
d662a8d088 Enable file module to disable diff_mode (#83700)
Several tasks within the modification_time.yml and state_link.yml task
lists have explicitly enabled diff_mode because these tests previously
assumed a diff attribute would always be returned from the file module.
2024-10-25 18:32:11 +00:00
ab1a8cb3b3 docs: print deprecation collection name (#84126)
While showing the deprecation message, mention the collection name
from which the module is removed.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-25 11:20:11 -07:00
c9ac477e53 Preserve _ansible_no_log from action result; fix include_vars to set properly (#84143)
* 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
2024-10-24 22:56:54 +00:00
11e4a6a722 user module avoid conflicts ssh pub key (#84165)
Remove pub key if we are going to generate private
fix tests for os X
2024-10-24 14:39:51 -04:00
b1816880cb Remove deprecated compat.selector (#84155)
* Removed files related to selector compat

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-23 14:54:40 +00:00
1e6ffc1d02 Fixed broken tests (#84088)
* Add `match=` in pytest.raises
* Remove redundant assert statements

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2024-10-18 14:11:33 -07:00
1727bbecce test: Remove unreachable tests (#83696)
variable_manager unit tests are unreachable. These tests
are already covered in integration tests.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-18 12:23:40 -07:00
53ceb74e84 Use open with context manager (#83337)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-18 10:53:11 -07:00
f7766cf843 Trim selinux_policytype @ integration tests (#84136)
The shell command sometimes prints a trailing whitespace which breaks
the tests on old RHELs. This patch is supposed to fix that.
2024-10-18 09:25:40 -07:00
c6e166319a test: use password to generate random string instead of range (#84129)
* Use password lookup instead of range
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-17 19:17:42 +00:00
42e2f09b97 Faster host removal from a handler (#84091)
In ``Handler.notify_host`` we ensure that ``Handler.notified_hosts`` can contain
particular host at most once. Therefore for removing a host it should be
faster to use ``list.remove`` which removes the first item in the list,
as opposed to using list comprehension removing all such items.
2024-10-17 08:33:39 +02:00
4f6276d72d Remove configuration options that were moved to inventory plugins now that ansible-config supports plugin types. (#84130) 2024-10-16 15:39:15 -04:00
663f7f3b56 test for gathering FIPS facts (#83266)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-16 12:35:12 -07:00
279de623d0 Use dict comprehension instead (#83680)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-16 12:33:07 -07:00
671c797aa1 Remove unnecessary code (#84085)
* os.setsid does not return anything, so remove code which relying
  on return value

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-15 07:59:01 -07:00
58cb8ca4fa feat: checksum_algo param for find module (#83014)
Co-authored-by: shirann <shirannx@gmail.com>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <webknjaz@redhat.com>
2024-10-11 11:02:39 -07:00
48be6f8b6f ansible-test - Improve container probe error handling (#84109) 2024-10-10 22:58:38 +00:00
6aaac6cab3 service_facts: add FreeBSD support (#82556)
new freebsd scanner using 'their version' of service cli tool
also avoid loading the linuxy service scanner when freebsd
2024-10-10 14:22:21 -04:00
b3950bc864 Add NoReturn annotations in module_utils (#84106) 2024-10-10 16:58:27 +00:00
56bab1d097 Enable bad-docstring-quotes pylint rule for core (#84100)
* Enable bad-docstring-quotes pylint rule for core

* Ignore previously bulk update in git blame
2024-10-09 21:57:05 +00:00
a0495fc314 Update triple single quotes to triple double quotes (#84099)
* Update triple single quotes to triple double quotes

This change was fully automated.

The updated Python files have been verified to tokenize the same as the originals, except for the expected change in quoting of strings, which were verified through literal_eval.

* Manual conversion of docstring quotes
2024-10-09 21:22:35 +00:00
62ce21b6e4 ansible-test - Work around pylint issue on 3.11 (#84094) 2024-10-09 17:19:55 +00:00
83671ecb39 ansible-test - Enable pylint docstyle for tests (#84092)
This cleans up the implementation of the pylint sanity test and enables the docstyle extension rule `bad-docstring-quotes` for tests.

The rule will be enabled for the rest of ansible-core once automated cleanup has been performed on existing docstrings.
2024-10-09 15:38:32 +00:00
0b661438a0 ansible-test - Update base/default containers (#84089) 2024-10-08 18:33:04 -07:00
7e57c0fb3d Fix copyright format for gather_facts and mount_facts as documented (#84087) 2024-10-08 17:11:06 -07:00
955e310b4c Cover unit tests with mypy (#84084)
* Added support for testing unit tests with mypy.
* Added support for ignoring individual mypy error codes.
* Added missing assert on unit tests and marked xfail.
* Added type hints for some unit tests.
* Added ignores for unit tests not passing mypy.
* Fixed incorrect autouse argument in unit test fixtures.
* Fixed minor issues causing problems with mypy in unit tests.
2024-10-08 13:29:37 -07:00
18c6b40e19 Update unique filter docs (#84078)
* Correct case_sensitive example
* Add attribute docs

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-08 12:09:07 -07:00
0959472bc6 user module, avoid chmoding symlink'd home file (#83956)
also added tests

---------
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2024-10-08 13:15:34 -04:00
f3b956a7ef docs: unique add missing settings (#84076)
add the `case_sensitive` setting
2024-10-08 17:35:35 +02:00
f1f0d9bd53 PlayIterator: skip tasks from already ran roles (#83793)
... so strategies do not have to filter them.
2024-10-08 07:28:02 +02:00
d0df3a174a ansible-galaxy - fix ignoring certs when installing from git repos (#83332)
* Fix installing collections|roles from git repos with GALAXY_IGNORE_CERTS

* Fix installing collections from git repos with --ignore-certs

* Update unit test

* Add test case
2024-10-07 18:42:49 -04:00
50604e8461 ansible-test - Update astroid for pylint sanity test (#84054) 2024-10-04 13:18:07 -07:00
3cf308f672 ansible-test - Disable pylint deprecated-* rules (#84050) 2024-10-04 08:31:46 -07:00
0f4f05ebe4 Implicit flush_handlers inherit play tags (#83968) 2024-10-04 09:47:28 +02:00
ee9e6130a7 Fix error message given by ansible.module_utils.facts.timeout.timeout (#83945)
* Update unit test

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2024-10-03 21:54:54 +00:00
9406ed3109 ansible-test - Update sanity tests and default Python (#83998)
* ansible-test - Update sanity test requirements
* ansible-test - Default to Python 3.13 in base/default containers
* ansible-test - Fix incorrect AnyStr type hints
2024-10-03 09:59:56 -07:00
d6d2251929 Reduce number of implicit meta tasks (#84007)
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>
2024-10-03 16:02:02 +02:00
02e00aba3f file: simplify the code (#84043)
* Remove unnecessary code
* Make code simple to read

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-03 06:53:09 -07:00
f593eb42a3 get_url: properly parse filename in content-disposition (#83748)
Since we don't really care about the type we don't have to
query for it and just retrieve the filename value.
Unfortunately we cannot use module_utils.urls.get_response_filename
as we don't have the response object, so just utilize
email.message.Message to parse the filename
instead of manually doing the work ourselves.

Fixes: #83690
2024-10-03 15:36:42 +02:00
b3c4154e86 Use sentinel everywhere (#84041)
* Use sentinel everywhere

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-02 15:49:35 -07:00
9abc651cd6 ansible-test - Update nios-test-container to 6.0.0 (#84042) 2024-10-02 16:37:37 +00:00
bebc192c3e remove one ignore clause for module copy (#83643)
---------
Co-authored-by: flowerysong <junk+github@flowerysong.com>
2024-10-02 13:53:58 +00:00
4c8fb12fc2 cron: return stdout and rc for cron command (#83290)
Co-authored-by: Jack Farzan <jfarzan@adobe.com>
2024-10-01 14:45:27 -07:00
79e8c4c26c debconf: set empty password value (#83217)
Fixes: #83214

---------
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-01 11:48:57 -04:00
fb7fd51b93 Prevent condor from being installed and fulfilling libfmt dependency (#84023) 2024-09-30 11:11:22 -05:00
f97adb4c5d Add additional logging for SSH runtime output timeouts and escalation messages (#84008)
Signed-off-by: Yuri Savinkin <stkwar@gmail.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-09-30 11:26:21 -04:00
3d40db1ac0 INVENTORY_IGNORE_EXTS stop ignoring ini (#84001)
* INVENTORY_IGNORE_EXTS stop ignoring ini

Originally added to avoid configuration files for inventory scripts
now clashes with the much more common ini inventory files.

* add a note to script plugin

* Update lib/ansible/plugins/inventory/script.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-09-26 12:15:34 -07:00
34f8f55d9e facts: Skip path if the distribution path is directory (#84012)
* facts: Skip path if the distribution path is directory

Skip path if the distribution path is directory instead of file.
Handle exception raised while handling distribution path.

Fixes: #84006

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

* Review requests

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-09-26 15:05:57 -04:00
21fee95af7 package/dnf action plugins: better facts failure msg (#83995) 2024-09-26 09:19:00 +02:00
facf9186b4 Test entry points with editable install (#84002)
This allows collection of code coverage for the entry points.
2024-09-24 11:23:20 -07:00
0c8efa29b2 Ansible Errors, Don't hide stacked messages when yaml (#83933)
Also remove redundant msg now that we fixed yaml case
So no more need to %s % e.

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-09-24 13:58:41 -04:00
8caa32a558 split: Fix incorrect example result of the split builtin filter (#83982)
The following Python output proves that the second member of the resulting list should be " a", not "a":

```txt
$ python3 
Python 3.12.3 (main, Sep 11 2024, 14:17:37) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> string = "jojo is, a"
>>> string.split(',')
['jojo is', ' a']
```
2024-09-24 17:33:25 +02:00
f4e2e206b3 Add basic validation for action_groups (#83965)
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2024-09-24 17:15:43 +02:00
0a100c7f06 dnf5: fix tb when plugins API is not available (#83969)
Follow up on https://github.com/ansible/ansible/pull/83105
2024-09-24 10:52:20 +02:00
c0fb71a642 Move ansible-deprecated ignores for tests inline (#83989) 2024-09-23 17:33:01 -07:00
491a87215a zap changelogs (#83988) 2024-09-23 16:20:13 -07:00
1b8bfd40ab bump devel to 2.19 (#83985) 2024-09-23 15:29:06 -07:00
b5263c2c10 isidentifier: Remove Python 2 specific code (#83688)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-09-23 20:41:08 +00:00
7693c892fa ansible-test - Use Python version in pylint contexts (#83984) 2024-09-23 13:40:10 -07:00
bf8da52aac ansible-galaxy - fix the usage for role/collection install (#83979) 2024-09-23 10:04:45 -04:00
aa24e97435 dnf5: re-introduce `state: installed` alias (#83961)
Fixes #83960
2024-09-23 09:33:38 +02:00
6efb30b43e Do not convert floats to ints when there is truncation (#83864)
Adjusted error messages
fixed tests
removed py2 compat tests, since no more py2

Co-authored-by: Matt Clay <matt@mystile.com>
2024-09-20 10:06:15 -04:00
40ade1f84b Add mount_facts module (#83508)
* Add a mount_facts module capable of gathering mounts skipped by default
fact gathering

* By default, collect mount facts from standard locations including
/etc/mtab, /proc/mounts, /etc/fstab, /etc/mnttab, /etc/vfstab, and on AIX,
/etc/filesystems.

When no file-based source for the current mounts can be found
(like /proc/mounts), the module falls back to using mount as a source.
This allows BSD and AIX to collect the existing mounts by default, without
causing Linux hosts to use both /proc/mounts and mount output.

* Non-standard locations and "mount" can be configured as a sources.

* Support returning an aggregate list of mount points in addition to first
found.

When there are multiple mounts for the same mount point in an
individual source, a warning is given if the include_aggregate_mounts
option is not configured.

* Add options to filter on fstypes and devices (supporting UNIX shell
wildcards).

* Support configuring a timeout and timeout behavior to make it easier
to use the module as a default facts module without risking a hang.

* Include the source and line(s) corresponding to a mount for easier
debugging.

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2024-09-19 15:05:05 -04:00
9ab63986ad ansible-test no longer needs special casing in __main__.py (#83962) 2024-09-19 09:56:46 -05:00
85d9a40aac 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>
2024-09-18 15:07:21 -04:00
bcee35385b timedout extended (#83953)
* timedout extended

* add timedout test
2024-09-18 09:58:30 -05:00
f00e3d7762 Update communication links for the forum (#83862)
* update communication details in README

* update comms details in contributing

* update comms details in issue templates

* add link to contributors guide

* point to devel for comms
2024-09-16 12:43:29 +01:00
b5ae8a382b runas - create new SYTEM token for become (#83827)
Instead of re-using the token used in impersonation, this change will
create a new token for the SYSTEM account as returned by LogonUser. The
benefits of this is that the token will contain the full privileges for
the SYSTEM account rather than potentially one that has restricted
privileges we used during impersonation. It should also help avoid
problems on Windows that fails on status 0x0000016F when the
impersonated token during become was from a process that is restricted
from creating sub processes.
2024-09-13 14:25:58 +10:00
33d4ba8fa2 file module: Clarify the docs that the force parameter works for hardlinks too (#83913) 2024-09-11 11:05:16 +02:00
47e64dc371 service_facts, fix systemd/ubuntu failed reporting (#83424)
Avoid check description, better comments
2024-09-10 13:32:52 -04:00
d58988d8ff fact gathering, mounts, fixes for single proc code and tests (#83866)
* Fact gathering fix 'no shm' branhc

* Use concurrent.futures instead of multiprocessing

This entirely avoids the need for fallback logic since the concurrent.futures thread pool does not depend on `/dev/shm`.

Co-authored-by: Matt Clay <matt@mystile.com>
2024-09-10 12:15:29 -04:00
31d73b0645 Replace binary_modules Makefile with Python script (#83925)
Also update the platform list:

* Remove linux ppc64le
* Add darwin arm64
2024-09-09 15:06:36 -07:00
a84fa50096 ansible-test - Update base/default containers (#83930) 2024-09-09 20:54:02 +00:00
cf2a4a85da ansible-test - Update sanity test requirements (#83921) 2024-09-09 11:22:28 -07:00
cd342f76b4 release.py - Use changelog requirements (#83920)
Use the changelog sanity test requirements instead of the package-data sanity test requirements.

This enables removal of most package-data sanity test requirements, as they are no longer used by the test itself.
The additional requirements were being maintained only to provide pinned requirements for building the changelog during a release.
2024-09-09 10:49:04 -07:00
11e56d9c27 iptables, use existing validation (#83907)
also remove redundant  and wrong test
2024-09-06 16:57:05 -04:00
59b3e49d70 Stop suggesting easy_install in hacking (#83909)
It's been discouraged for the past decade. And CPython actually ships
with pip nowadays, that is bundled within the built-in `ensurepip`
stdlib module.
2024-09-06 17:13:06 +02:00
9c49fdd86d delay keyword changed from int to float (#83901)
* delay keyword changed from int to float

* draft test

* fixed test

* expanded test, fixed 'name' tests also

* cleanup

* fix
2024-09-06 14:50:35 +10:00
0f6b58b5f2 Update subset.yml (#83908)
Typo error in examples
2024-09-06 05:52:38 +10:00
4fa512406b loop_control "early exit" feature (#62151)
* add a loop_control break_when directive to break out of a loop after any item

* remove loop var as normal exit would

* example usage:

- name: generate a random password up to 10 times, until it matches the policy
  set_fact:
    password: "{{ lookup('password', '/dev/null', chars=character_set, length=length) }}"
  loop: "{{ range(0, 10) }}"
  loop_control:
    break_when:
      - password is match(password_policy)

Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
2024-09-05 10:16:23 -04:00
e3ccdaaa2e release.py - Include pyproject.toml in git add (#83892) 2024-09-03 21:27:50 -07:00
b544ac13ec release.py - Add missing setuptools arg to prepare (#83887)
* 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
2024-09-03 15:05:26 -05:00
24e5b0d4fc Add DaemonThreadPoolExecutor impl (#83880)
* Add DaemonThreadPoolExecutor impl
* Provide a simple parallel execution method with the ability to abandon timed-out operations that won't block threadpool/process shutdown, and without a dependency on /dev/shm (as multiprocessing Thread/Process pools have).
* Create module_utils/_internal to ensure that this is clearly not supported for public consumption.
2024-09-03 11:23:38 -07:00
1a4644ff15 psrp - Remove extras lookups (#83760)
* psrp - Remove extras lookups

Removed the extras variable lookups for the psrp connection plugin. All
valid options are already documented and the extras functionality is
slated to be deprecated at a future point in time. This should have
affect on existing user's playbooks.

* Fix up sanity tests and add explicit boolean conversion test
2024-09-02 11:58:46 +10:00
1503805b70 Add location on include_tasks fail inside include (#83876)
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.
2024-09-02 06:21:30 +10:00
4346430003 ansible-test - Reduce scope of empty-init test (#83878) 2024-08-30 16:46:45 -07:00
49490d92c3 Update boilerplate sanity test (#83879)
The `annotations` future can now be imported as `_annotations`.
2024-08-30 16:36:20 -07:00
8b8a249d26 Remove references to IRC or Google Groups (#83875) 2024-08-30 05:25:17 +10:00
9d42b34ed3 Fix Windows entries in test matrix (#83873)
The display names need to be set so code coverage reporting works.
2024-08-29 11:07:01 -07:00
9a5a9e48fc Improve testing for Windows SSH and other connection plugins (#83834)
Expands the test matrix used for testing on Windows to cover the three
connection plugins we support for all the tasks. This change also
changes how raw commands are run over SSH to avoid starting a
`powershell.exe` process that was uneeded in the majority of cases used
in Ansible. This simplifies our code a bit more by removing extra
Windows specific actions in the ssh plugin and improves the efficiency
when running tasks.
2024-08-29 06:27:16 +10:00
db04499f58 ansible-test - Update nios-test-container to 5.0.0 2024-08-28 10:58:40 -07:00
1f987423fd Print the name of the option being deprecated (#83761)
Fixes #83759
2024-08-27 11:59:10 +02:00
c6a391c8d8 fix delegate_to integration test (#83865)
* the test was previously passing erroneously due to the `timeout` elapsing in CI, and that the `failed` test does not encompass `unreachable`
2024-08-26 17:54:08 -07:00
2a676ff897 copy, fix permissions and atime on diff partitions (#83824)
we just set time also, when on diff partitions
2024-08-26 14:22:15 -04:00
faf446a895 runtime-metadata sanity test: do not fail deprecation version checks if galaxy.yml has empty version (#83831)
* Do not create invalid SemanticVersion objects.
* Fix SemanticVersion.parse().
* Add basic runtime-metadata tests.
2024-08-26 13:59:34 -04:00
bed9a9597a galaxy-cli tasking polling interval from environment variable (#83803)
Added configuration options, including environment variables to control the polling 
No-Issue

---------
Signed-off-by: James Tanner <tanner.jc@gmail.com>
Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Jordan Borean <jborean93@gmail.com>
2024-08-26 10:14:50 -04:00
b5e0293645 powershell - Improve CLIXML parsing (#83847)
Improves the logic used when parsing CLIXML to support all escaped
character sequences and not just newlines.
2024-08-23 11:10:12 +10:00
9b0d2decb2 Handle authentication errors and token expiration (#83695)
Fixes #70019
2024-08-22 13:57:02 -05:00
5ab5f23487 dnf: stop filtering exceptions by matching on text (#83297)
* Rely on dnf.base.remove, no special handling isn't needed,
  let the dnf internals figure out what is needed to be done.
  This is more in line with what dnf cli does.

* "already installed" in Exception (if it is even a thing) should be
  caught by special exceptions like MarkingError or CompsError. This
  appears to be a historic check that is no longer needed.

Supersedes: #83295
2024-08-21 15:45:28 +02:00
69fb629355 Fix up raw_params for ansible.windows modules (#83830)
* Fix up raw_params for ansible.windows modules

Fixes up the logic for detecting if using ansible.windows.win_command or
ansible.windows.win_shell with _raw_params. These two modules are
special in that they can be referenced in 4 different ways but the
ansible.windows collection specific prefix needs to be manually added to
the list.

* Fix up sanity issue
2024-08-20 08:59:07 +10:00
718ce13673 connection plugins: extras fix (#83353)
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
2024-08-19 11:20:34 -04:00
90de03be50 Gather mount facts, fallback for when multiproc is not feasable (#83750)
* fallback to 'single threaded gathering' for when multiproc fails

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2024-08-19 10:25:29 -04:00
520fa688ba ssh and psrp - Support more complex characters in fetch_file (#83753)
* 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
2024-08-19 04:21:24 +10:00
dec49e6288 Add explicit winrm/psrp tests for HTTP and HTTPS (#83769) 2024-08-16 08:30:33 +10:00
430aaa1960 Fix tests when running against SSH target 2024-08-15 13:40:42 -07:00
81e025b414 ansible-test - Add Windows remote connection option 2024-08-15 13:40:42 -07:00
a3ee846a64 Use a venv in more integration tests (#83799)
* Use venv for pause test
* Use venv for debugger test
* Use venv for builtin_vars_prompt test
2024-08-14 17:10:05 -07:00
6eb16faed2 ansible-test - Update base/default containers (#83796) 2024-08-14 20:40:10 +00:00
da02611c48 ansible-test - Update sanity test requirements (#83795)
* Remove PyYAML pin for yamllint sanity test
* Freeze sanity test requirements
2024-08-14 19:00:59 +00:00
ab624ad031 ansible-test - Remove generation of egg-info (#83786)
Also remove egg-info generation from hacking/env-setup scripts.
2024-08-14 09:03:51 -07:00
26375e7f12 fix copy module update atime/mtime (#83235)
Ensure we force mtime/atime update when using copystat

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2024-08-14 14:43:12 +00:00
89137cb5a0 Add end_role meta task (#83263)
ci_complete
2024-08-13 16:48:59 -05:00
fe7e68bfcb Fix ansible-vault integration test for missing vault ids (#83777)
* 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>
2024-08-13 17:20:39 -04:00
9a54ba5a39 Ensure skipped loop iteration register var is available (#83756)
Fixes #83619
2024-08-13 12:48:49 -05:00
5c84220dbb Fix meta tasks breaking host/fork affinity with host_pinned (#83438)
Fixes #83294
2024-08-13 10:39:00 -05:00
a0f9bbf3f3 ini lookup: add new interpolation option (#83773)
Fixes #83755
2024-08-13 11:04:42 -04:00
b25afbb4e9 Suppress cryptography warnings for paramiko (#83772) 2024-08-12 17:28:27 -07:00
68515abf97 Drop use of setup.py and setup.cfg (#81443) 2024-08-12 13:54:29 -05:00
2b91c57c85 atomic_move - fix creating file in directory with setgid bit (#83718)
* 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>
2024-08-12 10:34:20 -04:00
0d6b034103 Enable validation of subkeys in rpm key module (#83716)
* Enable validation of subkeys in rpm key module

A gpg subkey may change while the primary key remains the same. Due to
this behavior, there are situations where validation of the primary gpg
key fingerprint is not sufficient because the desired target is actually
the gpg subkey. This change allows the user to validate against either
the fingerprint of the primary gpg key or its subkey.

Signed-off-by: Kellin <kellin@retromud.org>

* Improve tests, add multi-fingerprint

- Improve tests to cover all cases
- add multi fingerprint validation

Signed-off-by: Kellin <kellin@retromud.org>
2024-08-12 10:13:39 -04:00
7b74de069c fix: COLOR_INCLUDED to colorize included output (#83711)
adds color included configuration and applies to include message

Co-authored-by: Achille Myette <amyette@drw.com>
2024-08-09 10:26:21 -04:00
e4d7286298 use diff intermediate var to preserve functionality (#83738)
add tests
2024-08-08 15:18:00 -04:00
797e6bb220 Add vaulted_file test (#83717)
* Add vaulted_file test
* fix is_encrypted_file while we are here
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2024-08-08 15:14:05 -04:00
97a60c1e86 Fix csvfile test - quote file argument (#83751)
file was intended to be a string, not an undefined variable
2024-08-08 13:06:53 -04:00
d9f1866249 Deprecate remaining safe evals (#83293) 2024-08-08 08:41:52 +02:00
59ca05b709 ansible-test - Update default and distro containers (#83736) 2024-08-06 19:47:43 -07:00
a301ae876e try disabling negative values win_reboot test (#83735)
* hoping to improve CI stability
2024-08-06 18:34:57 -07:00
70be017f02 ansible-test - Update mypy and package-data tests (#83734)
* package-data - Test min/max setuptools version

* Fix multi-version abstraction

* Convert mypy test to script based test

* Fix f-string in pymarkdown test

* Sanity test fixes
2024-08-06 17:48:02 -07:00
717f1092e3 ansible-test - Update venv management and sanity requirements (#83729)
* ansible-test - Update venv management
* Upgrade from pip 24.0 to 24.2
* Omit `wheel` and `setuptools` from ansible-test managed virtual environments
* Drop pre-release hacks
* Update mypy requirements
* Freeze sanity test requirements
* Update sanity test configuration
* Update sanity ignores
2024-08-06 14:53:40 -07:00
0be66ed6dc Fix task-adjacent search path in roles (#83621)
* Restore search path in the current task file’s directory for roles
2024-08-06 17:53:23 -04:00
26c8a28d05 csvfile lookup - fix giving an error when no search term is provided (#83710)
Fixes #83689
2024-08-06 17:50:51 -04:00
885e3766a8 core: raw params better error msg (#83726)
* less confusing error msg
* also remove 'removed' include
2024-08-06 16:18:41 -04:00
c5210ad3eb Fix display to log severity mapping (#83712)
add caplevel to display to pass through
also reverse dict order as 'last update wins'
added tests ... and also log severity to log

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2024-08-06 16:18:03 -04:00
ac5ed40a21 Fix type hints and misc mypy/pylint issues (#83724) 2024-08-05 19:30:37 -07:00
6019f3f425 ansible-test - Update coverage to 7.6.1 (#83723) 2024-08-05 15:27:49 -07:00
4e69d83fac release.py - Auto-update setuptools upper bound (#83713)
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.
2024-08-05 16:59:26 -05:00
207a5fbebb test: Handle Singleton Display class (#83673)
Fixes: #83538

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-08-01 23:21:08 -07:00
91f680a749 Remove extraneous get_bin_path call (#83675)
ip_path is already calculated before calling get_interfaces_info

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2024-08-02 00:12:57 +00:00
5ae8b5b3a6 Remove EXTERNALLY-MANAGED marker in apt test (#83706)
The marker is removed in ansible-test managed environments, but the apt test restores it
by installing/upgrading packages. To avoid breaking later tests, the marker needs to be
removed again.

ci_complete
2024-08-01 13:31:47 -07:00
245885177c systemd facts: Handle AttributeError (#83684)
* Handle AttributeError raised while running systemd facts on
  non-systemd hosts

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-08-01 12:09:02 -07:00
31ad786de1 ansible-doc: handle on_fail (#83676)
Handle errors raised when role doc has errors

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-08-01 12:08:11 -07:00
20465ba11a Add UID and GID min/max keys (#81770)
Fixes: #72183
2024-08-01 09:04:59 -07:00
6bf6844a1c add error handling when parsing values in ini files (#82718)
Fixes: #82717

Co-authored-by: Karl A. Grindley <kgrindley@ll.mit.edu>
2024-08-01 02:34:42 +00:00
c6d5be5cac test: update tests (#83686)
* Remove commented code
* Enable disabled tests
* Formatting

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-31 17:32:11 -07:00
3daf01e270 tests: use keyserver with keyid while using apt_key (#83694)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-31 15:52:12 -07:00
bbf96c250f winrm - quota retry handling (#83656)
* winrm - quota retry handling

Add a retry attempt when receiving ERROR_WSMAN_QUOTA_MAX_OPERATIONS when
starting a command. This can occur when running a loop with multiple
iterations or an action plugin that runs multiple commands.

* Update pywinrm constraint for test

* Add verbose hint and mark test as destructive
2024-08-01 04:12:31 +10:00
ff5deaf62f fix module_defaults group incorrectly giving deprecation warnings (#83510)
don't display deprecation warnings for actions/modules as a result of using an action_group containing a deprecated plugin
2024-07-30 13:45:25 +00:00
d23a2de5f2 Remove selinux import (#83674)
Remove selinux import which was kept for backward compatibility

Fixes: #83657

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-29 16:58:54 +00:00
07a1d6a3fd dnf/setup_rpm_repo: simplify dummy testing repos (#83624)
This change simplifies construction and footprint of testing rpm
repository created by rpmfluff:
* all packages default to noarch
* only when necessary build package for a specific architecture(s)
* do not build several repositories each for specific arch
* remove duplicate "incompatible arch" test
* skip_broken_and_nobest: move testing packages from an external repo
  into our dummy repo for transparency
* remove compatibility code from create_repo.py for versions no longer
  needed
* remove support for old OS versions from setup_rpm_repo
* simplify representation of an rpm in create_repo.py to allow easier
  changes

Notes
* there is one more external testing repo used at
https://ci-files.testing.ansible.com/test/integration/targets/setup_rpm_repo/repo-with-updateinfo
2024-07-29 10:41:23 +02:00
3d4bd79574 validate-modules: detect names set mismatch between argument spec and documentation (#83599) 2024-07-28 15:39:01 +00:00
7e3916b767 Typo fixes and other bits and bobs (#83672)
Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
2024-07-27 09:16:34 -07:00
8e74cdc7b2 Set LANGUAGE env variable is set to a non-English locale (#83671)
Fixes: #83608

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-26 15:50:23 -07:00
a3a92bcc13 Remove explicit shell environment docs (#83649)
Removes the docs for the environment keyword in the shell base plugins
as they are a no-op in the plugins themselves. The environment value is
provided by the action base which gets it from the action base on the
task.environment value. This should avoid confusion around how its being
set and removes some code that is not used at all.
2024-07-26 15:21:33 +10:00
fe1183f8ac Replace random with secrets (#83668)
Use secrets library instead of random.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-25 14:31:41 -07:00
504f5b1230 apt: Report change when package is removed (#83547)
While upgrade process removes a package, module should
report changed=True instead of changed=False

Fixes: #46314

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-25 15:01:46 +00:00
33565f3774 increase timeout downloading galaxy role URLs (#83562)
* Update the timeout to download role archive to 60 seconds to match collections
TODO: in future make a configurable 'artifact download timeout'
2024-07-23 21:56:15 +00:00
cd105d479a display: warn user about empty log path value (#83381)
Fixes: #79959

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-23 21:21:23 +00:00
6371a883d4 Added info about MacOS targets for cron module (#83620)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-23 18:37:57 +00:00
79f819dc54 ansible-test - Remove VyOS tests and support files (#83650)
The VyOS remote image required for running the tests is no longer functional.
2024-07-22 13:42:06 -07:00
d36dc70afc remove ignore clauses for module find (#83575)
add testcase for expanding home dir names
2024-07-22 10:10:49 -04:00
a60fb178b1 docs adjustments (batch 1) (#83341) 2024-07-21 08:31:19 -07:00
46ff7594a4 env: update examples for setting default values to variable (#83370) 2024-07-21 08:12:55 -07:00
f261a6142f Use build instead of pep517 for integration test 2024-07-19 10:03:29 -07:00
b90c3a8de5 Revert "🧪 Use setuptools [core] @ collections_runtime_pythonpath (#83627)"
This reverts commit 0d5460df16.
2024-07-19 10:03:29 -07:00
0d5460df16 🧪 Use setuptools [core] @ collections_runtime_pythonpath (#83627) 2024-07-19 16:22:33 +02:00
eeb9b50669 remove ignore clauses for module lineinfile (#83595) 2024-07-18 15:51:08 -04:00
c904bffc7d debconf: handle boolean value representation consistently (#83601)
* 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>
2024-07-18 12:50:31 -07:00
4408b2c3e1 replace - fix documentation and remove ignore clauses (#83574) 2024-07-18 15:14:23 -04:00
906c969b55 ansible-test - Improve unknown env error message (#83610) 2024-07-15 16:37:40 +00:00
506d12de69 Update any.yml (#83588)
* fixed typo in description
* fixed comment in examples
2024-07-15 08:05:28 -07:00
0eeb933238 module compression is now again settable via var (#83573)
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>
2024-07-12 11:38:50 -04:00
08de64076a remove ignore clauses for module blockinfile (#83577) 2024-07-11 08:56:05 -07:00
7cf7dff3a6 Ensure that we are handling DownloadError properly in the dnf module (#83543)
Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>
2024-07-10 10:02:51 -06:00
28cef00576 dnf: follow-up on is_newer_installed arches fix (#83556)
* 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

---------

Co-authored-by: Matt Davis <nitzmahone@redhat.com>
2024-07-09 20:26:29 +00:00
293bba7533 fix misc. documentation typos and formatting for modules starting with u-y (#83422) 2024-07-09 15:29:15 -04:00
313f9d9f69 fix misc. documentation typos and formatting for modules starting with s (#83420) 2024-07-09 15:26:54 -04:00
9cdfcd9aed ansible-test - Update nios-test-container to 4.0.0 (#83539) 2024-07-09 10:37:11 -07:00
10997ab3aa ansible-test - Update base/default containers (#83553) 2024-07-09 17:25:20 +00:00
20a815b03f Quality-of-life improvements for release tool (#83551)
* 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
2024-07-09 10:17:28 -07:00
4a1775acd3 review modules docs - batch(fragments) (#83431)
Co-authored-by: flowerysong <junk+github@flowerysong.com>
2024-07-09 17:13:10 +00:00
9472005dee update distro version to 1.9.0 (#83540) 2024-07-09 16:48:43 +00:00
4f6a4534a7 known_hosts: don't modify AnsibleModule.params (#83517)
Using this dictionary to store the return values results in
the return values showing up in the returned
`invocation['module_args']`, which is confusing. It also causes all
module arguments to be returned, which is preserved by this change but
should ideally be removed in the future.
2024-07-09 09:07:45 -06:00
83a0975611 Add dinit as a service_mgr (#83489) 2024-07-08 22:30:10 +00:00
43346f1fdc Add SL-Micro to Suse family list (#83541) 2024-07-07 21:37:32 -07:00
edce798713 Fix Creating user directory using tilde always reports "changed" (#83113)
Fixes: #82490
2024-07-07 19:26:14 +00:00
e5309ba29f validate-modules: reject option/alias names equal up to casing belonging to different options (#83530)
* Reject option/alias names equal up to casing belonging to different options.

* Update test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2024-07-05 19:35:54 -04:00
63538f7779 package_facts: fix warning logic (#83520)
* package_facts: fix warning logic

* Refactor so that warnings can work
2024-07-05 13:27:45 -04:00
775bc1110e linear: fix included handlers executing in lockstep (#83209)
Fixes #83019
2024-07-04 09:33:37 +02:00
571e2a9551 Fix incorrect rc when executing end_host in rescue (#83522)
Fixes #83447
2024-07-04 09:19:56 +02:00
6c0f4c8a2d hostvars templating fix, override serialization (#83509)
fixes #82872
nicer implementation courtesy of nitzmahone
2024-07-02 14:27:17 -04:00
7d678cbd96 Fix require_only_one. (#83511) 2024-07-02 09:36:23 -04:00
00ddc27d69 actually show plugin config warnings/deprecations (#82593)
previouslly we recorded but did not show to avoid spam
since we could not dedup from forks, that was already
fixed in another PR so now we can show/display them.

Also:
  * funcitonalize deprecation msg construct from docs
  * reuse formatting func in cli
  * normalize alternatives: most of the code used intended plural
    but some and most data/tests used the singular
  * update schemas and tests

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2024-07-01 19:56:19 -04:00
101f017ef5 Replace references to archived ansible/ansible-examples repository (#83500)
* Replace references to archived ansible/ansible-examples repository

* Update examples to reference ansible repository

* Include HTTPS among SSH references in examples
2024-07-01 12:06:53 +00:00
a8e4106c47 Fix tb for when env var contains % (#83499)
Fixes #83498

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2024-06-28 16:50:45 +02:00
665d2e15d7 dnf: remove legacy code (#83298) 2024-06-28 15:49:42 +02:00
41ba6536cf facts/hardware: Fix support_discard block device fact (#83480)
Previously, `support_discard` simply returned the value of
`/sys/block/{device}/queue/discard_granularity`. When its value is `0`, then
the block device doesn't support discards; _however_, it being greater than
zero doesn't necessarily mean that the block device _does_ support discards.

But another indication that a block device doesn't support discards is
`/sys/block/{device}/queue/discard_max_hw_bytes` being equal to `0` (with the
same caveat as above). So if either of those are `0`, set `support_discard` to
zero, otherwise set it to the value of `discard_granularity` for backwards
compatibility.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
2024-06-28 09:40:14 -04:00
2930a4664c dnf - arches must be the same in the is_newer_installed check (#83417)
Fixes #83406
2024-06-28 11:45:40 +02:00
7a3f9384cf Fix simmilar branches (#83497)
Identical branches in conditional node: 'elif name != permanent_hostname' and 'else'. First bruch is not nessesary

Co-authored-by: mar.s <marchenkov.s.d@gmail.com>
2024-06-27 12:30:13 -07:00
0ee6e39615 dnf, dnf5: fix installing via wildcard (#83481)
Fixes #83373
2024-06-26 16:36:12 +02:00
8f1fddb161 Enable Ubuntu 24.04 group 6 in CI (#83466)
* Enable Ubuntu 24.04 group 6 in CI

* Disable rootfull Podman on Ubuntu

* Disable unix-chkpwd AppArmor profile on Ubuntu for Fedora 40 tests

* Document AppArmor and rootfull issues
2024-06-25 08:42:51 -07:00
0d28705ce5 linear strategy, show templated task name on start (#83473)
we only templated in some cases but when queueing we could get an untemplated name for the 'on start' event.
2024-06-25 09:24:24 -04:00
339452c105 Ensure the correct connection name is shown in results (#83354) 2024-06-24 09:52:06 -04:00
f7dee8aaf8 add support for inactive option (#83355)
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2024-06-21 14:31:31 -04:00
a121a169e3 ansible-test - Replace FreeBSD 14.0 with 14.1 (#83477) 2024-06-20 15:20:10 -07:00
c93af4e148 unarchive: handle content and size differences (#83454)
Consider content differs and size differs while unarchiving
the same tar.gz file

Fixes: #29610

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-20 10:50:27 -07:00
c2c6005842 get_url: Verify checksum using tmpsrc, not dest (#64092)
Previously, if the checksum of the downloaded file did not match the
specified checksum, the *destination* file was removed. This possibly
leaves the system that is being provisioned in an invalid state.

Instead, the checksum should be calculated on the temporary file only.
If there's a mismatch, delete the *temporary* file, not the destination
file.

This requires checking the checksum before moving the file.
2024-06-20 10:55:59 -04:00
96c04e9d1d ansible-test - Update PyPI and utility container (#83475) 2024-06-19 01:31:33 +00:00
1b42af5004 ansible-test: update http-test-container to 3.2.0 (#83469) 2024-06-18 13:46:52 -07:00
d62496fe41 human_to_bytes: strictly parse strings (#83403)
Fixes: #82075
2024-06-18 09:21:04 -07:00
df29852f3a Update the dnf5 copr repo (#83459)
The dnf-nightly is the official nightly repo now.
2024-06-18 11:08:19 -04:00
224853b684 replace: update after/before example (#83453)
Fixes: #83390

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-18 11:03:49 -04:00
dc31b6cf55 service_facts on OpenBSD: Don't crash on '=' in rcctl flags. (#83458)
Splitting on all '=' characters produced too many values.
2024-06-18 10:00:09 -04:00
dad6f07731 ansible-test - Update tested platforms (#83446)
* ansible-test - Update tested platforms

* Add work-around for Alpine tests

* Fix prepare_http_tests on Fedora

* Fix deb-src setup for Ubuntu 24.04+

* Set multiarch_test_pkg for Ubuntu 24.04

* Update AZP test matrix
2024-06-17 23:17:04 +00:00
c1a082c697 Added docstrings to V2 methods in the CallbackBase Class (2 & 3 of 27) (#83342) 2024-06-17 18:33:46 -04:00
44f22162cb Remove timezone support module and tests (#83465)
The timezone support module was used only for changing the timezone in the user module integration tests.

Changing the timezone for the tests is unecessarily complex for the purpose of asserting proper parsing of user expiration times.
2024-06-17 15:06:39 -07:00
f4751766db selinux compat - add ignore, proper ex chaining (#83460) 2024-06-17 13:26:41 -07:00
b2a289dcbb Remove Python 3.10 support for the controller (#83221)
Fixes #83094
2024-06-17 09:03:41 +02:00
6382ea168a vault: Handle directory value to vault password file (#83384)
When vault password file env variable is set to blank,
this value is converted to CWD and passed for further
processing.
Check if ANSIBLE_VAULT_PASSWORD_FILE is not a directory.

Fixes: #42960

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-14 18:40:30 -07:00
1ed29416db dnf: update use_backend documentation (#83429)
* add note about backwards compatibility
2024-06-14 18:12:36 -07:00
e64c6c1ca5 unarchive: Better handling of files with an invalid timestamp in zip file (#81520)
Fixes: #81092

Signed-off-by: gilsongpfe <gilson.gpf@gmail.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-13 14:30:37 -07:00
a0aad17912 Adds limit parameter to ansible.builtin.find (#83153)
* Explicitly guarantee topdown search.
* Makes max matches unlimited == None.
2024-06-13 16:12:51 -04:00
1c156e2b70 review modules docs - batch(klmpr) (#83418) 2024-06-13 12:03:46 -07:00
5af5b4b6c8 ansible-test - Update PyPI test container to 3.1.0 (#83432) 2024-06-13 08:52:43 -07:00
738180d240 ansible-test - Fix unit test coverage collection (#83433) 2024-06-12 15:47:58 -07:00
72a5957720 Fix Linux Sector count Fact (#81246)
* Use sectorsize fact in disk size calc rather than hardcoded 512

* Added conversion for sysfs sectorcount to real sector count
2024-06-12 18:35:03 -04:00
a9b902f579 ansible-test action-plugin-docs sidecar (#83325)
Fix to have ansible-test sanity --test action-plugin-docs to check for
action plugin documentation inside a sidecar file rather than a Python
module.
2024-06-13 06:16:15 +10:00
6e8a7ed327 Revert warning message in setup/gather_facts (#83427)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-11 12:01:29 -07:00
cf265eb14d Add Python 3.13 support (#83416)
* Add Python 3.13 support

* Add temporary work-around for yamllint test
2024-06-11 11:36:10 -07:00
126ffc7947 Specify -O in windows ssh tests as needed for scp to work with openssh 9+ (#83426) 2024-06-11 10:59:17 -07:00
5022415887 Clarify documentation for INJECT_FACTS_AS_VARS (#83404) 2024-06-11 08:12:31 -07:00
c6ba5a3560 docs adjustments - batch(ghi) (#83399)
* review modules docs - batch(ghi)

* fix option markup in gather_facts
2024-06-11 08:02:50 -07:00
14df8c2cf2 ansible-test - Prepare for Python 3.13 (#83414)
Includes an update to `coverage` and pinned Python requirements.
2024-06-10 19:33:33 -07:00
d16ad25e4b Remove extraneous pylint ignore (#83257)
* Pylint issue 511 is closed, remove ignore related to that.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-10 19:23:49 -07:00
4f73d2ff7a docs adjustments (#83369) 2024-06-11 02:16:59 +00:00
531bc9891f Fix issues reported by mypy (#83413) 2024-06-10 18:18:33 -07:00
6ab26707de Fix quoting in fork_safe_stdio test (#83412) 2024-06-10 17:13:15 -07:00
cbbf06893e Validate and process Handler.listen only once (#83400)
Fixes #83392
2024-06-10 10:46:12 -05:00
2e60bef855 Update azure-pipelines-test-container (#83302) 2024-06-06 17:19:57 -07:00
bdc1cdfa54 Revert "bool filter, add booleanization strategy option (#83362)" (#83391)
This reverts commit 655a8ff38f.
2024-06-06 14:30:15 -07:00
93b8b86067 Properly quote all needed components of shell commands (#83365)
* Properly quote all needed components of shell commands

* Use self.quote, add new self.join
2024-06-06 15:14:18 -05:00
68638f4710 fix any_errors_fatal tests (#83389)
* 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'
2024-06-06 12:25:49 -07:00
70c2b35210 docs adjustments (batch 2) (#83368)
* docs adjustments

* Update lib/ansible/modules/assemble.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-06 12:04:48 -07:00
655a8ff38f bool filter, add booleanization strategy option (#83362)
also make the YAML booleanization the same as spec/JSON/module function
 previous 'aproximation' was missing several options.

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-05 17:26:01 -07:00
16ebeb7d21 facts: add facts about x86_64 flags to detect microarchitecture (#83356)
Fixes: #83331

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-04 13:35:07 -07:00
0a311f6669 additional timeout info (#83364) 2024-06-04 14:11:54 -04:00
c77ed376c4 timeout give extra info (#83206)
the new field shows the python code in execution when it timed out, 99% of the time it will be on a selector waiting for output from ssh to remote.
2024-06-04 11:42:15 -04:00
e07b4edc54 Fix Test failure with cowsay installed/present (#83347) 2024-06-03 06:51:32 -07:00
b8f1add983 powershell - Improve Add-Type tempdir handler (#83080)
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.
2024-06-03 13:17:36 +10:00
347a822a42 Documented v2_runner_on_failed method in Callback class (#83267)
* Documented v2_runner_on_failed method in Callback class

* Added changes requested by @bcoca.
2024-05-31 17:22:34 -04:00
454dd9e91d The extension returned by the splitext contains the dot (#82803)
Fixed examples for splitext filter plugin
2024-05-31 08:29:33 -07:00
153c979662 test: Cleanup facts/network/* tests (#83256)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-30 09:23:18 -07:00
f2435375a8 Fix task.resolved_action callbacks (#82003)
* 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
2024-05-30 10:20:54 -04:00
46168c8cc2 file module, follow symlink when doing hardlink (#34228)
Fixes: #33911
2024-05-29 22:22:19 -07:00
000bac9a3e gather_facts, mention ansible_facts_parallel var (#83278) 2024-05-29 18:11:43 -04:00
949c503f2e config, integrate dynamic galaxy servers (#83129)
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2024-05-29 15:42:21 -04:00
375d3889de ansible-doc: make color configurable (#83311)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-29 09:44:54 -07:00
3253189b33 get_url: update docs for checksum (#83305)
If user provides checksum URL which requires basic auth,
then module parameter username and password is used to
download the checksum file.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-28 11:23:52 -04:00
3af9d0f189 apt_*: add more info message while updating apt cache (#83230)
Fixes: #77941

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-23 16:15:02 -07:00
c1d41ee44e filter: update the documentation for win_splitdrive (#83301)
Fixes: #83299

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-23 12:12:29 -07:00
10f9b8e655 Correct code comment in PBE to reflect current behavior (#83269)
Correct a code comment in the PlaybookExecutor class that explains
the host failure condition under which the PBE breaks out of the
run. This comment previously stated that the maximum failure
percentage was checked, but that logic has been refactored into
the linear strategy plugin.
2024-05-21 11:14:29 -04:00
560d3af097 ansible-test - Update http-test-container (#83272)
* Disable cipher suite integration tests

When the client and server both support TLS 1.3, cipher suite selection is effectively a no-op.

Python provides no way to disable TLS 1.3 cipher suites, and no way to prefer user-selected cipher suites.
Since TLS 1.3 includes a mandatory cipher suite, this makes it impossible to induce a cipher suite related error when using TLS 1.3.

* Update multipart form-data integration test

* Fix netrc integration tests

* Update HTTP test host substring

* ansible-test - Update http-test-container
2024-05-19 12:36:00 -07:00
b8483adb33 ansible-test - Update pypi-test-container (#83273) 2024-05-19 12:35:44 -07:00
930f18ea65 ansible-test - Update ansible-test-utility-container (#83274) 2024-05-19 12:35:32 -07:00
a7e666829e MUNI tech writers: timeout documentation. (#83152)
* Documentation on the timeout keyword

* wording changes

* keyword description wording edit

* removed whitespace at the end of lines.

* Changed to more accurate wording

---------

Co-authored-by: Niko Mlynarčik <536617@mail.muni.cz>
2024-05-17 09:38:03 -04:00
c5114e1819 Remove deprecated VariableManager._get_delegated_vars (#83259)
Fixes #82950
2024-05-17 09:32:38 +02:00
b70248eb22 Warn if the binary is unavailable using get_bin_path (#83258)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-16 02:32:22 +00:00
7e0a476ba2 setup module, make missing sysctl minor issue (#81297)
Signed-off-by: Brian Coca <brian.coca+git@gmail.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-15 15:19:14 -07:00
ac6200b597 Refactor dmidecode fact gathering code (#83211)
* Code now bails out early if dmidecode command is unavailable

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-14 17:18:59 +02:00
65638b4d01 remove old install info when installing collections (#83194)
* Fix cleaning up galaxy server info from previous installations

* changelog
2024-05-14 17:09:55 +02:00
f7d7890df9 Use inclusive word: logical (#83232)
Use word 'logical' instead of non-inclusive word

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-10 15:49:53 +00:00
8ad68f12ee Refactor yum_repository, deprecate yum only options (#83116) 2024-05-09 11:27:27 +02:00
3c280e6c1b dnf5: implement enable_plugin and disable_plugin options (#83105)
80cfea9c25
2024-05-09 10:54:40 +02:00
036d14f1e6 Darwin: add unit tests for hardware fact gathering (#83212)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-07 15:33:13 -07:00
523745e02e dnf: integration tests cleanup (#83203)
* remove no longer needed tasks
* remove workarounds
* consolidate conditionals
* remove distros/versions from conditionals that are no longer present
  in CI
2024-05-07 08:42:55 +02:00
45a30ab093 package_facts: apk fix when cache is empty (#83132) 2024-05-06 22:43:28 +00:00
504bdae894 added examples for systemd service usage (#83192)
mostly how to filter/manipulate the results
---------

Co-authored-by: flowerysong <junk+github@flowerysong.com>
2024-05-06 17:53:19 -04:00
57a8eca3af pymarkdown: update docs (#83150)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-06 21:52:50 +00:00
417db213c0 facts: Update RAID devices regex for FreeBSD (#82081)
Added support FreeBSD RAID devices and regex to match partitions as well as slices. 
RAID device list is taken from here: https://github.com/freebsd/freebsd-src/blob/main/usr.sbin/bsdconfig/share/device.subr
2024-05-06 13:41:37 -07:00
aed8c080f6 ansible-galaxy, clarify licensing for 'init' templates and results (#83175) 2024-05-06 16:22:52 -04:00
f5b945bf6a ansible-doc: fix typo in output (#83205) 2024-05-06 20:04:21 +00:00
eb3ea3ce5c Fix order of CLI arguments on FreeBSD (#81377)
When passing arguments on FreeBSD to service command the order is
important, otherwise the service command will ignore the arguments.
2024-05-06 19:32:36 +00:00
6aa8192131 Multi-arch support for container test (#83196) 2024-05-03 18:15:37 -07:00
3461f1d757 Build test modules for aarch64 (#83195) 2024-05-03 17:42:59 -07:00
f4bbd75a3c git: Check if version is populated or not (#82173)
Before usage check if the git version is populated or not.

Fixes: #72321

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-03 22:17:36 +00:00
2816922cd6 display: fix log verbosity (#83179)
* display, ensure we have a logger before we log
2024-05-03 10:38:41 -04:00
889012e29e clean up ansible-connection (#82992)
* clean up ansible-connection stuff

* eliminate unnecessary usage of pty/termios
* always use default pickle protocol
* remove unnecessary wire hashing

Co-authored-by: Kate Case <this.is@katherineca.se>
2024-05-02 21:37:19 +00:00
ad777cba5a package_facts add alias support (#83149)
* package_facts add alias support

fixes #83143

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-02 14:33:12 -04:00
dc6b77beca Don't hardcode the dnf module, dynamically select one (#83183) 2024-05-02 12:22:56 -05:00
2b65166a29 uri: deprecate 'yes' or 'no' value in follow_redirects param (#83169)
* uri (module and lookup): deprecate 'yes' or 'no' value in follow_redirects param

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-02 02:43:22 +00:00
cd9c4eb5a6 Gather sysinfo facts on s390 (#83157) 2024-05-01 11:10:58 -07:00
585ef6c55e Show examples in role entrypoint argument specs. (#82671) 2024-05-01 11:27:50 -04:00
e3d4c20f6e Correctly treat separate paragraphs in top-level descriptions as separate paragraphs. (#83155) 2024-04-30 17:15:35 +02:00
2ed6c30929 Add version ceiling for pypsrp (#83122)
* 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
2024-04-30 10:09:35 +10:00
dfc559866a minor fix for misspelling (#83156)
This change fixes a minor spelling error, indivudually ==> individually.
2024-04-29 15:45:21 +00:00
802e95f580 distro: remove pep8 ignore
* Remove unnecessary pep8 from ignore.txt

Fixes: #80840

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-25 12:23:01 -07:00
628ce5a62e assemble: update argument_spec with 'decrypt' option
* decrypt option is used by assemble action plugin.
  Add this parameter to remove failure raised by
  validate-modules:nonexistent-parameter-documented

Fixes: #80840

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-25 12:22:19 -07:00
d5edb77db4 Add description of ansible.utils.path.unfrackpath() basedir argument 2024-04-25 12:11:38 -07:00
c18e755b82 removed extra ansible_managed 2024-04-25 12:11:09 -07:00
e84240db84 Fix installing roles containing symlinks (#82911)
* 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
2024-04-24 11:07:29 -04:00
124d03145c inspect components, ansible_managed templatable (#83053)
* inspect components, ansible_managed templatable

fixes #82322
2024-04-23 12:43:47 -04:00
718edde465 Update distro version in __init__.py (#83114)
Update the bundled package distro from 1.6.0 to 1.9.0 in __init__.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-23 08:26:42 -07:00
33d1224e83 password_hash: update docs about bcrypt (#81675)
Signed-off-by: Sven Kieske <kieske@osism.tech>
2024-04-23 01:20:04 +00:00
87bead3dcf setup_rpm_repo/create_repo: "Arch dependent binaries in noarch package" (#83108)
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.
2024-04-22 09:10:42 +02:00
7f93f6171d add systemd version and features fact (#83083)
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2024-04-18 21:22:56 -04:00
5dac5d365a systemd_service: handle failure when mask operation fails (#83079)
* Handle the mask operation failure instead of just
  marking state changed.

Fixes: #81649

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-18 16:28:30 +00:00
ae2234f185 add countme option to yum_repository (#82831)
* add countme option to yum_repository

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

* Update lib/ansible/modules/yum_repository.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

* add changelog fragment

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

* add version_added

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

* Update lib/ansible/modules/yum_repository.py

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>

* Update lib/ansible/modules/yum_repository.py

* Update lib/ansible/modules/yum_repository.py

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>

* Update lib/ansible/modules/yum_repository.py

---------

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2024-04-18 13:51:22 +02:00
6b3bab6476 plugin: fixed examples of csv lookup plugin (#83068)
Fixes: #83031

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-17 15:08:22 -07:00
8c3c694472 test: remove ansible-examples.git repo (#81600)
* test: remove ansible-examples.git repo

* To speed up git tests remove reference to ansible-examples.git

Fixes: #81327

* Make CI green

Signed-off-by: Ansible Test Runner <noreply@example.com>
Co-authored-by: Ansible Test Runner <noreply@example.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2024-04-17 17:15:42 -04:00
0c51a30d93 ansible-config: add 'validate' option (#83007)
We can now validate both ansible.cfg and 'ANSIBLE_' env vars
match either core (-t base), installed plugin(s) (-t <plugin_type>) or both (-t all)
2024-04-17 16:26:05 -04:00
8bc0d809a6 Update sdist path in release tool
The latest setuptools package uses a normalized package name for the sdist.
2024-04-16 10:13:40 -07:00
a3cdd831b3 handlers: fix executing in lockstep using linear (#83030)
Fixes #82307
2024-04-16 17:45:18 +02:00
82d91f0952 Make inventory --list help text wording consistent (#83035) 2024-04-15 10:21:28 -04:00
57750e2cf7 Fallbacks for brand new APIs that don't exist in released dnf5 (#83022) 2024-04-12 10:15:49 +02:00
3a6f825a8e dnf - honor installroot and substitutes in paths (#83011)
In #80094 support for var substitution for cachedir was added but there
are more options that should be supported. Using an API for
prepend_installroot which should be done anyway provide that feature
so use that. In addition, perform the operation once all substitutes
are in place (releasever as well).
2024-04-12 09:34:46 +02:00
4e57249d59 dnf5: replace removed API calls (#83020)
* dnf5: replace removed API calls

bfb6f32e15
96c9188f9c

* call set_group_with_name instead of setting group_with_name

c7b88428f3

---------

Co-authored-by: Matt Martz <matt@sivel.net>
2024-04-11 14:57:44 -05:00
cb81801124 facts: Add a generic detection for VMware product name (#83012)
* Use startswith instead of hardcoded values in VMWare product
  detction

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-11 15:07:36 -04:00
3076478892 Extend systemctl is-enabled check to handle "enabled-runtime" too. (#77754)
In general the existence of a runtime-enabled unit should not prevent
a persistent enable being set.

Specifically this handles the case where there is an entry in fstab
for a mount point (which is retained to allow manual mount/umount to
take place) and yet a systemd mount unit needs to be deployed to
handle other unit options. There will be a generator-created unit file
which shows the unit as enabled-runtime and the persistent enable of
the mount unit will fail.

Additionally improve the comments and modify the code to use rsplit()
and the "in" notation since "systemctl is-enabled" is documented to
return specific values in the cases of interest.

---------

Signed-off-by: David Greaves <david@dgreaves.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-10 10:09:04 -04:00
d304fd86c2 modules/dnf: Substitute variables in DNF cache path (#80094)
The cache directory can be specified with variables that are expanded by DNF, for example,

```
cachedir=/var/cache/yum/$basearch/$releasever
```

But the `dnf` module would use that path literally, instead of replacing
`$basearch` and `$releasever` with their values.

This commit ensures that variables in `cachedir` are properly substituted.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
2024-04-09 13:11:43 -07:00
46137127a2 ansible-config: ensure we get templated default (#82974)
AKA all defaults rendered
2024-04-09 14:57:26 -04:00
bb138b1f6e play_context: remove deprecated PlayContext.verbosity (#82993)
Fixes: #82945

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-09 11:08:52 -04:00
cd365057d3 Remove more Python 2.x compat code 2024-04-08 12:55:52 -07:00
5187061939 ansible-test - Update base/default containers 2024-04-08 10:09:58 -07:00
61e18572bb Play - remove deprecated ROLE_CACHE in favor of role_cache (#82979) 2024-04-04 23:07:25 +00:00
92feda2e13 paramiko_ssh: remove deprecated ssh_*_args parameters (#82988)
* removed ssh_args parameter
* removed ssh_extra_args parameter
* removed ssh_common_args parameter

Fixes: #82939
Fixes: #82940
Fixes: #82941

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-04 12:51:22 -07:00
14a2f6e2ab Remove Python 2 traces from dnf/dnf5 modules (#82985) 2024-04-04 12:39:11 -07:00
971c49b711 Remove deprecated vars keyword syntax as a list of dictionaries, it is now required to be a single dictionary (#82980)
Update unit test
2024-04-04 12:34:54 -07:00
e03fcda6da Remove deprecated configs for DEFAULT_FACT_PATH, DEFAULT_GATHER_SUBSET, and DEFAULT_GATHER_TIMEOUT (#82978)
Instead, set module_defaults at the play level, which will apply to the
gather_facts keyword as well as any
ansible.builtin.setup/ansible.builtin.gather_facts tasks.

- hosts: all
  gather_facts: yes
  module_defaults:
    ansible.builtin.setup:
      fact_path: /path/to/facts.d/
      gather_subset: '!all,!min,local'
      gather_timeout: 20
  tasks:
    # also applies to:
    - ansible.builtin.setup:
    - ansible.builtin.gather_facts:

If you wish to only apply these to the gather_facts keyword, set as play keywords.
2024-04-04 12:32:25 -07:00
52529f0b8e plugins: remove deprecated features (#82976)
* Remove deprecated REQUIRE_WHITELIST
* Remove deprecated module_blacklist

Fixes: #82947

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-04 12:29:50 -07:00
5f36fc9a46 to_nice_json: document the indent option (#82973)
Specifying indent as an option to `to_nice_json` has been possible in
contrary to what documentation states.

Follow-up to https://github.com/ansible/ansible/pull/82912
2024-04-04 12:27:50 -07:00
179bc1dabd fetch - add error check on calculated dest (#82970)
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.
2024-04-04 12:26:21 -07:00
ea55dddc6a Remove deprecated 'loader' argument (#82968)
* remove deprecated 'loader' argument from listify_lookup_plugin_terms API

Fixes: #82949

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-04 12:23:18 -07:00
208168ee4c apt: add a note about extraneous quotes in package name (#82960)
* add a note for user to not to include extraneous single or double
  quotes while specifying package name with a specific version.

Fixes: #82763

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-04 12:12:53 -07:00
1c17fe2d53 Drop Python 3.7 support (#82982) 2024-04-04 09:41:14 -07:00
c12d42577e Remove missed changelog fragments (#82975) 2024-04-03 09:25:49 -05:00
76fe4e8a71 Bump devel to 2.18.0.dev0 (#82934)
* Bump devel to 2.18.0.dev0

* Add ignores for 2.18 deprecations
2024-04-02 21:18:18 +00:00
85d8673860 Follow up to #82933 - remove platforms from templates (#82961) 2024-04-02 17:06:39 -04:00
2580 changed files with 66758 additions and 36065 deletions

View File

@ -31,7 +31,7 @@ variables:
- name: fetchDepth
value: 500
- name: defaultContainer
value: quay.io/ansible/azure-pipelines-test-container:4.0.1
value: quay.io/ansible/azure-pipelines-test-container:6.0.0
pool: Standard
@ -54,12 +54,12 @@ stages:
nameFormat: Python {0}
testFormat: units/{0}
targets:
- test: 3.7
- test: 3.8
- test: 3.9
- test: '3.10'
- test: 3.11
- test: 3.12
- test: 3.13
- stage: Windows
dependsOn: []
jobs:
@ -68,39 +68,54 @@ stages:
nameFormat: Server {0}
testFormat: windows/{0}/1
targets:
- test: 2016
- test: 2019
- test: 2022
- name: 2016 WinRM HTTP
test: 2016/winrm/http
- name: 2019 WinRM HTTPS
test: 2019/winrm/https
- name: 2022 WinRM HTTPS
test: 2022/winrm/https
- name: 2022 PSRP HTTP
test: 2022/psrp/http
- name: 2022 SSH Key
test: 2022/ssh/key
- name: 2025 PSRP HTTP
test: 2025/psrp/http
- name: 2025 SSH Key
test: 2025/ssh/key
- stage: Remote
dependsOn: []
jobs:
- template: templates/matrix.yml # context/target
parameters:
targets:
- name: macOS 14.3
test: macos/14.3
- name: RHEL 9.3 py39
test: rhel/9.3@3.9
- name: RHEL 9.3 py311
test: rhel/9.3@3.11
- name: FreeBSD 13.3
test: freebsd/13.3
- name: FreeBSD 14.0
test: freebsd/14.0
- name: macOS 15.3
test: macos/15.3
- name: RHEL 9.5 py39
test: rhel/9.5@3.9
- name: RHEL 9.5 py312
test: rhel/9.5@3.12
- name: RHEL 10.0
test: rhel/10.0
- name: FreeBSD 13.5
test: freebsd/13.5
- name: FreeBSD 14.2
test: freebsd/14.2
groups:
- 1
- 2
- template: templates/matrix.yml # context/controller
parameters:
targets:
- name: macOS 14.3
test: macos/14.3
- name: RHEL 9.3
test: rhel/9.3
- name: FreeBSD 13.3
test: freebsd/13.3
- name: FreeBSD 14.0
test: freebsd/14.0
- name: macOS 15.3
test: macos/15.3
- name: RHEL 9.5
test: rhel/9.5
- name: RHEL 10.0
test: rhel/10.0
- name: FreeBSD 13.5
test: freebsd/13.5
- name: FreeBSD 14.2
test: freebsd/14.2
groups:
- 3
- 4
@ -108,48 +123,58 @@ stages:
- template: templates/matrix.yml # context/controller (ansible-test container management)
parameters:
targets:
- name: Alpine 3.19
test: alpine/3.19
- name: Fedora 39
test: fedora/39
- name: RHEL 9.3
test: rhel/9.3
- name: Ubuntu 22.04
test: ubuntu/22.04
- name: Alpine 3.21
test: alpine/3.21
- name: Fedora 41
test: fedora/41
- name: RHEL 9.5
test: rhel/9.5
- name: RHEL 10.0
test: rhel/10.0
- name: Ubuntu 24.04
test: ubuntu/24.04
groups:
- 6
- stage: Docker
dependsOn: []
jobs:
- template: templates/matrix.yml
- template: templates/matrix.yml # context/target
parameters:
testFormat: linux/{0}
targets:
- name: Alpine 3.19
test: alpine319
- name: Fedora 39
test: fedora39
- name: Ubuntu 20.04
test: ubuntu2004
- name: Alpine 3.21
test: alpine321
- name: Fedora 41
test: fedora41
- name: Ubuntu 22.04
test: ubuntu2204
- name: Ubuntu 24.04
test: ubuntu2404
groups:
- 1
- 2
- template: templates/matrix.yml
- template: templates/matrix.yml # context/controller
parameters:
testFormat: linux/{0}
targets:
- name: Alpine 3.19
test: alpine319
- name: Fedora 39
test: fedora39
- name: Ubuntu 22.04
test: ubuntu2204
- name: Alpine 3.21
test: alpine321
- name: Fedora 41
test: fedora41
- name: Ubuntu 24.04
test: ubuntu2404
groups:
- 3
- 4
- 5
- template: templates/matrix.yml # context/target (dnf-oldest, dnf-latest)
parameters:
testFormat: linux/{0}
targets:
- name: Fedora 41
test: fedora41
groups:
- 7
- stage: Galaxy
dependsOn: []
jobs:
@ -158,9 +183,9 @@ stages:
nameFormat: Python {0}
testFormat: galaxy/{0}/1
targets:
- test: '3.10'
- test: 3.11
- test: 3.12
- test: 3.13
- stage: Generic
dependsOn: []
jobs:
@ -169,9 +194,9 @@ stages:
nameFormat: Python {0}
testFormat: generic/{0}/1
targets:
- test: '3.10'
- test: 3.11
- test: 3.12
- test: 3.13
- stage: Incidental_Windows
displayName: Incidental Windows
dependsOn: []
@ -181,9 +206,20 @@ stages:
nameFormat: Server {0}
testFormat: i/windows/{0}
targets:
- test: 2016
- test: 2019
- test: 2022
- name: 2016 WinRM HTTP
test: 2016/winrm/http
- name: 2019 WinRM HTTPS
test: 2019/winrm/https
- name: 2022 WinRM HTTPS
test: 2022/winrm/https
- name: 2022 PSRP HTTP
test: 2022/psrp/http
- name: 2022 SSH Key
test: 2022/ssh/key
- name: 2025 PSRP HTTP
test: 2025/psrp/http
- name: 2025 SSH Key
test: 2025/ssh/key
- stage: Incidental
dependsOn: []
jobs:
@ -193,8 +229,6 @@ stages:
targets:
- name: IOS Python
test: ios/csr1000v/
- name: VyOS Python
test: vyos/1.1.8/
- stage: Summary
condition: succeededOrFailed()
dependsOn:

View File

@ -1 +0,0 @@
network.sh

View File

@ -6,6 +6,8 @@ declare -a args
IFS='/:' read -ra args <<< "$1"
version="${args[1]}"
connection="${args[2]}"
connection_setting="${args[3]}"
target="shippable/windows/incidental/"
@ -26,11 +28,7 @@ if [ -s /tmp/windows.txt ] || [ "${CHANGED:+$CHANGED}" == "" ]; then
echo "Detected changes requiring integration tests specific to Windows:"
cat /tmp/windows.txt
echo "Running Windows integration tests for multiple versions concurrently."
platforms=(
--windows "${version}"
)
echo "Running Windows integration tests for the version ${version}."
else
echo "No changes requiring integration tests specific to Windows were detected."
echo "Running Windows integration tests for a single version only: ${single_version}"
@ -39,14 +37,10 @@ else
echo "Skipping this job since it is for: ${version}"
exit 0
fi
platforms=(
--windows "${version}"
)
fi
# shellcheck disable=SC2086
ansible-test windows-integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
"${platforms[@]}" \
--docker default --python "${python_default}" \
--remote-terminate always --remote-stage "${stage}" --remote-provider "${provider}"
--controller "docker:default,python=${python_default}" \
--target "remote:windows/${version},connection=${connection}+${connection_setting},provider=${provider}" \
--remote-terminate always --remote-stage "${stage}"

View File

@ -6,7 +6,9 @@ declare -a args
IFS='/:' read -ra args <<< "$1"
version="${args[1]}"
group="${args[2]}"
connection="${args[2]}"
connection_setting="${args[3]}"
group="${args[4]}"
target="shippable/windows/group${group}/"
@ -31,11 +33,7 @@ if [ -s /tmp/windows.txt ] || [ "${CHANGED:+$CHANGED}" == "" ]; then
echo "Detected changes requiring integration tests specific to Windows:"
cat /tmp/windows.txt
echo "Running Windows integration tests for multiple versions concurrently."
platforms=(
--windows "${version}"
)
echo "Running Windows integration tests for the version ${version}."
else
echo "No changes requiring integration tests specific to Windows were detected."
echo "Running Windows integration tests for a single version only: ${single_version}"
@ -44,17 +42,13 @@ else
echo "Skipping this job since it is for: ${version}"
exit 0
fi
platforms=(
--windows "${version}"
)
fi
for version in "${python_versions[@]}"; do
for py_version in "${python_versions[@]}"; do
changed_all_target="all"
changed_all_mode="default"
if [ "${version}" == "${python_default}" ]; then
if [ "${py_version}" == "${python_default}" ]; then
# smoketest tests
if [ "${CHANGED}" ]; then
# with change detection enabled run tests for anything changed
@ -80,7 +74,7 @@ for version in "${python_versions[@]}"; do
fi
# terminate remote instances on the final python version tested
if [ "${version}" = "${python_versions[-1]}" ]; then
if [ "${py_version}" = "${python_versions[-1]}" ]; then
terminate="always"
else
terminate="never"
@ -88,7 +82,8 @@ for version in "${python_versions[@]}"; do
# shellcheck disable=SC2086
ansible-test windows-integration --color -v --retry-on-error "${ci}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
"${platforms[@]}" --changed-all-target "${changed_all_target}" --changed-all-mode "${changed_all_mode}" \
--docker default --python "${version}" \
--remote-terminate "${terminate}" --remote-stage "${stage}" --remote-provider "${provider}"
--changed-all-target "${changed_all_target}" --changed-all-mode "${changed_all_mode}" \
--controller "docker:default,python=${py_version}" \
--target "remote:windows/${version},connection=${connection}+${connection_setting},provider=${provider}" \
--remote-terminate "${terminate}" --remote-stage "${stage}"
done

View File

@ -9,11 +9,11 @@ from __future__ import annotations
import argparse
import dataclasses
import pathlib
import shutil
import shlex
import subprocess
import tempfile
import typing as t
import urllib.request
import venv
@dataclasses.dataclass(frozen=True)
@ -43,6 +43,27 @@ def parse_args() -> Args:
return Args(**kwargs)
def run(*args: str | pathlib.Path) -> None:
cmd = [str(arg) for arg in args]
print(f'==> {shlex.join(cmd)}', flush=True)
subprocess.run(cmd, check=True)
def install_codecov(dest: pathlib.Path) -> pathlib.Path:
package = 'codecov-cli'
version = '11.0.3'
venv_dir = dest / 'venv'
python_bin = venv_dir / 'bin' / 'python'
codecov_bin = venv_dir / 'bin' / 'codecovcli'
venv.create(venv_dir, with_pip=True)
run(python_bin, '-m', 'pip', 'install', f'{package}=={version}', '--disable-pip-version-check')
return codecov_bin
def process_files(directory: pathlib.Path) -> t.Tuple[CoverageFile, ...]:
processed = []
for file in directory.joinpath('reports').glob('coverage*.xml'):
@ -57,45 +78,43 @@ def process_files(directory: pathlib.Path) -> t.Tuple[CoverageFile, ...]:
return tuple(processed)
def upload_files(codecov_bin: pathlib.Path, files: t.Tuple[CoverageFile, ...], dry_run: bool = False) -> None:
def upload_files(codecov_bin: pathlib.Path, config_file: pathlib.Path, files: t.Tuple[CoverageFile, ...], dry_run: bool = False) -> None:
for file in files:
cmd = [
str(codecov_bin),
'--name', file.name,
'--file', str(file.path),
codecov_bin,
'--disable-telem',
'--codecov-yml-path',
config_file,
'upload-process',
'--disable-search',
'--disable-file-fixes',
'--plugin',
'noop',
'--name',
file.name,
'--file',
file.path,
]
for flag in file.flags:
cmd.extend(['--flags', flag])
cmd.extend(['--flag', flag])
if dry_run:
print(f'DRY-RUN: Would run command: {cmd}')
continue
cmd.append('--dry-run')
subprocess.run(cmd, check=True)
run(*cmd)
def download_file(url: str, dest: pathlib.Path, flags: int, dry_run: bool = False) -> None:
if dry_run:
print(f'DRY-RUN: Would download {url} to {dest} and set mode to {flags:o}')
return
with urllib.request.urlopen(url) as resp:
with dest.open('w+b') as f:
# Read data in chunks rather than all at once
shutil.copyfileobj(resp, f, 64 * 1024)
dest.chmod(flags)
def main():
def main() -> None:
args = parse_args()
url = 'https://ci-files.testing.ansible.com/codecov/linux/codecov'
with tempfile.TemporaryDirectory(prefix='codecov-') as tmpdir:
codecov_bin = pathlib.Path(tmpdir) / 'codecov'
download_file(url, codecov_bin, 0o755, args.dry_run)
with tempfile.TemporaryDirectory(prefix='codecov-') as tmpdir:
config_file = pathlib.Path(tmpdir) / 'config.yml'
config_file.write_text('')
codecov_bin = install_codecov(pathlib.Path(tmpdir))
files = process_files(args.path)
upload_files(codecov_bin, files, args.dry_run)
upload_files(codecov_bin, config_file, files, args.dry_run)
if __name__ == '__main__':

View File

@ -12,6 +12,6 @@ if ! ansible-test --help >/dev/null 2>&1; then
pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check
fi
# Generate stubs using docker (if supported) otherwise fall back to using a virtual environment instead.
# The use of docker is required when Powershell code is present, but Ansible 2.12 was the first version to support --docker with coverage.
ansible-test coverage xml --group-by command --stub --docker --color -v || ansible-test coverage xml --group-by command --stub --venv --color -v
# Generate stubs using docker.
# The use of docker is mandatory when Powershell code is present.
ansible-test coverage xml --group-by command --stub --docker --color -v

View File

@ -2,3 +2,5 @@
# Bulk PowerShell sanity fixes
6def4a3180fe03981ba64c6d8db28fed3bb39c0c
716631189cb5a3f66b3add98f39e64e98bc17bf7
# Bulk update of strings from triple single quotes to triple double quotes
a0495fc31497798a7a833ba7406a9729e1528dd8

View File

@ -4,9 +4,14 @@ Hi! Nice to see you here!
## QUESTIONS ?
Please see the [Community Guide](https://docs.ansible.com/ansible/latest/community/index.html) for information on how to ask questions on the [mailing lists](https://docs.ansible.com/ansible/latest/community/communication.html#mailing-list-information) and IRC.
If you have questions about anything related to Ansible, get in touch with us!
See [Communicating with the Ansible community](https://docs.ansible.com/ansible/devel/community/communication.html) to find out how.
The GitHub issue tracker is not the best place for questions for various reasons, but both IRC and the mailing list are very helpful places for those things, as the community page explains best.
The [Community Guide](https://docs.ansible.com/ansible/devel/community/index.html) also explains how to contribute
and interact with the project, including how to submit bug reports and code to Ansible.
Please note that the GitHub issue tracker is not the best place to ask questions for several reasons.
You'll get more helpful, and quicker, responses in the forum.
## CONTRIBUTING ?
@ -14,15 +19,18 @@ By contributing to this project you agree to the [Developer Certificate of Origi
The Ansible project is licensed under the [GPL-3.0](COPYING) or later. Some portions of the code fall under other licenses as noted in individual files.
The Ansible project accepts contributions through GitHub pull requests. Please review the [Community Guide](https://docs.ansible.com/ansible/latest/community/index.html) for more information on contributing to Ansible.
The Ansible project accepts contributions through GitHub pull requests.
Please review the [Community Guide](https://docs.ansible.com/ansible/devel/community/index.html) for more information on contributing to Ansible.
## BUG TO REPORT ?
First and foremost, also check the [Community Guide](https://docs.ansible.com/ansible/latest/community/index.html).
First and foremost, also check the [Community Guide](https://docs.ansible.com/ansible/devel/community/index.html).
You can report bugs or make enhancement requests at the [Ansible GitHub issue page](http://github.com/ansible/ansible/issues/new/choose) by filling out the issue template that will be presented.
You can report bugs or make enhancement requests at
the [Ansible GitHub issue page](http://github.com/ansible/ansible/issues/new/choose) by filling out the issue template that will be presented.
Also please make sure you are testing on the latest released version of Ansible or the development branch; see the [Installation Guide](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) for details.
Also please make sure you are testing on the latest released version of Ansible or the development branch.
See the [Installation Guide](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) for details.
Thanks!

View File

@ -19,13 +19,14 @@ body:
Also test if the latest release and devel branch are affected too.
**Tip:** If you are seeking community support, please consider
[starting a mailing list thread or chatting in IRC][ML||IRC].
**Tip:** If you are seeking community support, please see
[Communicating with the Ansible community][communication] to
get in touch and ask questions.
[ML||IRC]:
https://docs.ansible.com/ansible-core/devel/community/communication.html?utm_medium=github&utm_source=issue_form--bug_report.yml#mailing-list-information
[communication]:
https://docs.ansible.com/ansible/devel/community/communication.html
[issue search]: ../search?q=is%3Aissue&type=issues
@ -46,23 +47,7 @@ body:
- type: dropdown
attributes:
label: Issue Type
description: >
Please select the single available option in the drop-down.
<details>
<summary>
<em>Why?</em>
</summary>
We would do it by ourselves but unfortunatelly, the curent
edition of GitHub Issue Forms Alpha does not support this yet 🤷
_We will make it easier in the future, once GitHub
supports dropdown defaults. Promise!_
</details>
# FIXME: Once GitHub allows defining the default choice, update this
description: This is a marker for our automatic bot. Do not change it.
options:
- Bug Report
validations:
@ -151,7 +136,7 @@ body:
attributes:
label: Steps to Reproduce
description: |
Describe exactly how to reproduce the problem, using a minimal test-case. It would *really* help us understand your problem if you could also pased any playbooks, configs and commands you used.
Describe exactly how to reproduce the problem, using a minimal test-case. It would *really* help us understand your problem if you could also provide any playbooks, configs and commands you used.
**HINT:** You can paste https://gist.github.com links for larger files.
value: |
@ -258,7 +243,7 @@ body:
description: |
Read the [Ansible Code of Conduct][CoC] first.
[CoC]: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--bug_report.yml
[CoC]: https://docs.ansible.com/ansible/devel/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--bug_report.yml
options:
- label: I agree to follow the Ansible Code of Conduct
required: true

View File

@ -2,7 +2,7 @@
blank_issues_enabled: false # default: true
contact_links:
- name: 🔐 Security bug report 🔥
url: https://docs.ansible.com/ansible/latest/community/reporting_bugs_and_features.html?utm_medium=github&utm_source=issue_template_chooser
url: https://docs.ansible.com/ansible/devel/community/reporting_bugs_and_features.html?utm_medium=github&utm_source=issue_template_chooser
about: |
Please learn how to report security vulnerabilities here.
@ -11,15 +11,15 @@ contact_links:
a prompt response.
For more information, see
https://docs.ansible.com/ansible/latest/community/reporting_bugs_and_features.html
https://docs.ansible.com/ansible/devel/community/reporting_bugs_and_features.html
- name: 📝 Ansible Code of Conduct
url: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_template_chooser
url: https://docs.ansible.com/ansible/devel/community/code_of_conduct.html?utm_medium=github&utm_source=issue_template_chooser
about: ❤ Be nice to other members of the community. ☮ Behave.
- name: 💬 Talks to the community
url: https://docs.ansible.com/ansible/latest/community/communication.html?utm_medium=github&utm_source=issue_template_chooser#mailing-list-information
- name: 💬 Talk to the community
url: https://docs.ansible.com/ansible/devel/community/communication.html?utm_medium=github&utm_source=issue_template_chooser#forum
about: Please ask and answer usage questions here
- name: ⚡ Working groups
url: https://github.com/ansible/community/wiki
url: https://forum.ansible.com/g?utm_medium=github&utm_source=issue_template_chooser
about: Interested in improving a specific area? Become a part of a working group!
- name: 💼 For Enterprise
url: https://www.ansible.com/products/engine?utm_medium=github&utm_source=issue_template_chooser

View File

@ -22,12 +22,14 @@ body:
Also test if the latest release and devel branch are affected too.
**Tip:** If you are seeking community support, please consider
[starting a mailing list thread or chatting in IRC][ML||IRC].
**Tip:** If you are seeking community support, please see
[Communicating with the Ansible community][communication] to
get in touch and ask questions.
[ML||IRC]:
https://docs.ansible.com/ansible-core/devel/community/communication.html?utm_medium=github&utm_source=issue_form--documentation_report.yml#mailing-list-information
[communication]:
https://docs.ansible.com/ansible/devel/community/communication.html
[issue search]: ../search?q=is%3Aissue&type=issues
@ -82,20 +84,7 @@ body:
- type: dropdown
attributes:
label: Issue Type
description: >
Please select the single available option in the drop-down.
<details>
<summary>
<em>Why?</em>
</summary>
_We will make it easier in the future, once GitHub
supports dropdown defaults. Promise!_
</details>
# FIXME: Once GitHub allows defining the default choice, update this
description: This is a marker for our automatic bot. Do not change it.
options:
- Documentation Report
validations:
@ -205,7 +194,7 @@ body:
description: |
Read the [Ansible Code of Conduct][CoC] first.
[CoC]: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--documentation_report.yml
[CoC]: https://docs.ansible.com/ansible/devel/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--documentation_report.yml
options:
- label: I agree to follow the Ansible Code of Conduct
required: true

View File

@ -21,8 +21,7 @@ body:
If unsure, consider filing a [new proposal] instead outlining your
use-cases, the research and implementation considerations. Then,
start a discussion on one of the public [IRC meetings] we have just
for this.
start a discussion in the [Ansible forum][forum].
<details>
@ -44,21 +43,22 @@ body:
Also test if the devel branch does not already implement this.
**Tip:** If you are seeking community support, please consider
[starting a mailing list thread or chatting in IRC][ML||IRC].
**Tip:** If you are seeking community support, please see
[Communicating with the Ansible community][communication] to
get in touch and ask questions.
[contribute to collections]:
https://docs.ansible.com/ansible-core/devel/community/contributing_maintained_collections.html?utm_medium=github&utm_source=issue_form--feature_request.yml
[IRC meetings]:
https://docs.ansible.com/ansible-core/devel/community/communication.html?utm_medium=github&utm_source=issue_form--feature_request.yml#irc-meetings
[communication]:
https://docs.ansible.com/ansible/devel/community/communication.html
[issue search]: ../search?q=is%3Aissue&type=issues
[ML||IRC]:
https://docs.ansible.com/ansible-core/devel/community/communication.html?utm_medium=github&utm_source=issue_form--feature_request.yml#mailing-list-information
[forum help]:
https://forum.ansible.com/c/help/6
[new proposal]: ../../proposals/issues/new
@ -101,23 +101,7 @@ body:
- type: dropdown
attributes:
label: Issue Type
description: >
Please select the single available option in the drop-down.
<details>
<summary>
<em>Why?</em>
</summary>
We would do it by ourselves but unfortunatelly, the curent
edition of GitHub Issue Forms Alpha does not support this yet 🤷
_We will make it easier in the future, once GitHub
supports dropdown defaults. Promise!_
</details>
# FIXME: Once GitHub allows defining the default choice, update this
description: This is a marker for our automatic bot. Do not change it.
options:
- Feature Idea
validations:
@ -185,7 +169,7 @@ body:
description: |
Read the [Ansible Code of Conduct][CoC] first.
[CoC]: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--feature_request.yml
[CoC]: https://docs.ansible.com/ansible/devel/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--feature_request.yml
options:
- label: I agree to follow the Ansible Code of Conduct
required: true

View File

@ -0,0 +1,10 @@
---
name: Internal Issue
about: Free-form issue creation for core maintainer use only.
title: ''
labels: [core-internal]
assignees: ''
---
@ansibot bot_skip

42
.github/ISSUE_TEMPLATE/pre_release.yml vendored Normal file
View File

@ -0,0 +1,42 @@
name: Pre-Release Bug Report
description: File a bug report against a pre-release version
labels:
- bug
- pre_release
assignees:
- nitzmahone
- mattclay
body:
- type: markdown
attributes:
value: |
## Bug Report
- type: textarea
attributes:
label: Ansible Version
description: Paste the full output from `ansible --version` below.
render: console
placeholder: $ ansible --version
validations:
required: true
- type: textarea
attributes:
label: Summary
description: Describe the issue with any relevant steps to reproduce.
validations:
required: true
- type: dropdown
attributes:
label: <!-- Bot instructions (ignore this) -->
options:
- |
<!--
### Component Name
bin/ansible
### Issue Type
Bug Report
### Configuration
### OS / Environment
-->
validations:
required: true

View File

@ -2,19 +2,8 @@
<!--- Describe the change below, including rationale and design decisions -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
<!--- Add "Fixes #1234" or steps to reproduce the problem if there is no corresponding issue -->
##### ISSUE TYPE
- Bugfix Pull Request
##### ADDITIONAL INFORMATION
<!--- Include additional information to help people understand the change here -->
<!--- A step-by-step reproduction of the problem is helpful if there is no related issue -->
<!--- Paste verbatim command output below, e.g. before and after your change -->
```paste below
```

View File

@ -2,18 +2,8 @@
<!--- Describe the change below, including rationale -->
<!--- HINT: Include "Closes #nnn" if you are fixing an existing issue -->
<!--- Add "Fixes #1234" if there is a corresponding issue -->
##### ISSUE TYPE
- Docs Pull Request
##### ADDITIONAL INFORMATION
<!--- Include additional information to help people understand the change here -->
<!--- Paste verbatim command output below, e.g. before and after your change -->
```paste below
```

View File

@ -2,18 +2,8 @@
<!--- Describe the change below, including rationale and design decisions -->
<!--- HINT: Include "Resolves #nnn" if you are fixing an existing issue -->
<!--- Add "Fixes #1234" if there is a corresponding issue -->
##### ISSUE TYPE
- Feature Pull Request
##### ADDITIONAL INFORMATION
<!--- Include additional information to help people understand the change here -->
<!--- Paste verbatim command output below, e.g. before and after your change -->
```paste below
```

View File

@ -2,19 +2,8 @@
<!--- Describe the change below, including rationale and design decisions -->
<!--- HINT: Include "Closes #nnn" if you are fixing an existing issue -->
<!--- Add "Fixes #1234" if there is a corresponding issue -->
##### ISSUE TYPE
- Test Pull Request
##### ADDITIONAL INFORMATION
<!--- Include additional information to help people understand the change here -->
<!--- A step-by-step reproduction of the problem is helpful if there is no related issue -->
<!--- Paste verbatim command output below, e.g. before and after your change -->
```paste below
```

View File

@ -2,7 +2,7 @@
<!--- Describe the change below, including rationale and design decisions -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
<!--- Add "Fixes #1234" or steps to reproduce the problem if there is no corresponding issue -->
##### ISSUE TYPE
@ -12,14 +12,3 @@
- Docs Pull Request
- Feature Pull Request
- Test Pull Request
##### ADDITIONAL INFORMATION
<!--- Include additional information to help people understand the change here -->
<!--- A step-by-step reproduction of the problem is helpful if there is no related issue -->
<!--- Paste verbatim command output below, e.g. before and after your change -->
```paste below
```

View File

@ -1,3 +1,6 @@
2.20.0 TBD
2.19.0 What Is and What Should Never Be
2.18.0 Fool in the Rain
2.17.0 Gallows Pole
2.16.0 All My Love
2.15.0 Ten Years Gone

5
.gitignore vendored
View File

@ -92,9 +92,14 @@ Vagrantfile
/lib/ansible_base.egg-info/
# First used in the `devel` branch during Ansible 2.11 development.
/lib/ansible_core.egg-info/
# First used in the `devel` branch during Ansible 2.18 development.
/ansible_core.egg-info/
# vendored lib dir
lib/ansible/_vendor/*
!lib/ansible/_vendor/__init__.py
# PowerShell signed hashlist
lib/ansible/config/powershell_signatures.psd1
*.authenticode
# test stuff
/test/integration/cloud-config-*.*
!/test/integration/cloud-config-*.*.template

View File

@ -1,11 +1,10 @@
include COPYING
include bin/*
include changelogs/CHANGELOG*.rst
include changelogs/changelog.yaml
include licenses/*.txt
include requirements.txt
recursive-include packaging *.py *.j2
recursive-include test/integration *
recursive-include test/sanity *.in *.json *.py *.txt
recursive-include test/sanity *.in *.json *.py *.txt *.ini
recursive-include test/support *.py *.ps1 *.psm1 *.cs *.md
recursive-include test/units *

View File

@ -1,9 +1,9 @@
[![PyPI version](https://img.shields.io/pypi/v/ansible-core.svg)](https://pypi.org/project/ansible-core)
[![Docs badge](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://docs.ansible.com/ansible/latest/)
[![Chat badge](https://img.shields.io/badge/chat-IRC-brightgreen.svg)](https://docs.ansible.com/ansible/latest/community/communication.html)
[![Chat badge](https://img.shields.io/badge/chat-IRC-brightgreen.svg)](https://docs.ansible.com/ansible/devel/community/communication.html)
[![Build Status](https://dev.azure.com/ansible/ansible/_apis/build/status/CI?branchName=devel)](https://dev.azure.com/ansible/ansible/_build/latest?definitionId=20&branchName=devel)
[![Ansible Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-Ansible-silver.svg)](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)
[![Ansible mailing lists](https://img.shields.io/badge/mailing%20lists-Ansible-orange.svg)](https://docs.ansible.com/ansible/latest/community/communication.html#mailing-list-information)
[![Ansible Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-Ansible-silver.svg)](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html)
[![Ansible mailing lists](https://img.shields.io/badge/mailing%20lists-Ansible-orange.svg)](https://docs.ansible.com/ansible/devel/community/communication.html#mailing-list-information)
[![Repository License](https://img.shields.io/badge/license-GPL%20v3.0-brightgreen.svg)](COPYING)
[![Ansible CII Best Practices certification](https://bestpractices.coreinfrastructure.org/projects/2372/badge)](https://bestpractices.coreinfrastructure.org/projects/2372)
@ -40,21 +40,33 @@ features and fixes, directly. Although it is reasonably stable, you are more lik
breaking changes when running the `devel` branch. We recommend getting involved
in the Ansible community if you want to run the `devel` branch.
## Get Involved
## Communication
* Read [Community Information](https://docs.ansible.com/ansible/latest/community) for all
Join the Ansible forum to ask questions, get help, and interact with the
community.
* [Get Help](https://forum.ansible.com/c/help/6): Find help or share your Ansible knowledge to help others.
Use tags to filter and subscribe to posts, such as the following:
* Posts tagged with [ansible](https://forum.ansible.com/tag/ansible)
* Posts tagged with [ansible-core](https://forum.ansible.com/tag/ansible-core)
* Posts tagged with [playbook](https://forum.ansible.com/tag/playbook)
* [Social Spaces](https://forum.ansible.com/c/chat/4): Meet and interact with fellow enthusiasts.
* [News & Announcements](https://forum.ansible.com/c/news/5): Track project-wide announcements including social events.
* [Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn): Get release announcements and important changes.
For more ways to get in touch, see [Communicating with the Ansible community](https://docs.ansible.com/ansible/devel/community/communication.html).
## Contribute to Ansible
* Check out the [Contributor's Guide](./.github/CONTRIBUTING.md).
* Read [Community Information](https://docs.ansible.com/ansible/devel/community) for all
kinds of ways to contribute to and interact with the project,
including mailing list information and how to submit bug reports and
code to Ansible.
* Join a [Working Group](https://docs.ansible.com/ansible/devel/community/communication.html#working-groups),
an organized community devoted to a specific technology domain or platform.
including how to submit bug reports and code to Ansible.
* Submit a proposed code update through a pull request to the `devel` branch.
* Talk to us before making larger changes
to avoid duplicate efforts. This not only helps everyone
know what is going on, but it also helps save time and effort if we decide
some changes are needed.
* For a list of email lists, IRC channels and Working Groups, see the
[Communication page](https://docs.ansible.com/ansible/devel/community/communication.html)
## Coding Guidelines
@ -67,7 +79,7 @@ We document our Coding Guidelines in the [Developer Guide](https://docs.ansible.
* The `devel` branch corresponds to the release actively under development.
* The `stable-2.X` branches correspond to stable releases.
* Create a branch based on `devel` and set up a [dev environment](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html#common-environment-setup) if you want to open a PR.
* Create a branch based on `devel` and set up a [dev environment](https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html#common-environment-setup) if you want to open a PR.
* See the [Ansible release and maintenance](https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html) page for information about active branches.
## Roadmap

View File

@ -1 +0,0 @@
../lib/ansible/cli/scripts/ansible_connection_cli_stub.py

View File

@ -1,2 +1,2 @@
ancestor: 2.16.0
ancestor: 2.18.0
releases: {}

View File

@ -1,3 +0,0 @@
---
bugfixes:
- apt_repository - do not modify repo files if the file is a symlink (https://github.com/ansible/ansible/issues/49809).

View File

@ -1,2 +0,0 @@
bugfixes:
- check if there are attributes to set before attempting to set them (https://github.com/ansible/ansible/issues/76727)

View File

@ -1,3 +0,0 @@
---
bugfixes:
- iptables - set jump to DSCP when set_dscp_mark or set_dscp_mark_class is set (https://github.com/ansible/ansible/issues/77077).

View File

@ -1,2 +0,0 @@
bugfixes:
- "``include_role`` - properly execute ``v2_playbook_on_include`` and ``v2_runner_on_failed`` callbacks as well as increase ``ok`` and ``failed`` stats in the play recap, when appropriate (https://github.com/ansible/ansible/issues/77336)"

View File

@ -1,3 +0,0 @@
---
bugfixes:
- Do not print undefined error message twice (https://github.com/ansible/ansible/issues/78703).

View File

@ -1,2 +0,0 @@
bugfixes:
- ansible-galaxy - ensure path to ansible collection when installing or downloading doesn't have a backslash (https://github.com/ansible/ansible/pull/79705).

View File

@ -1,5 +0,0 @@
bugfixes:
- Cache host_group_vars after instantiating it once and limit the amount of repetitive work it needs to do every time it runs.
- Call PluginLoader.all() once for vars plugins, and load vars plugins that run automatically or are enabled specifically by name subsequently.
deprecated_features:
- Old style vars plugins which use the entrypoints `get_host_vars` or `get_group_vars` are deprecated. The plugin should be updated to inherit from `BaseVarsPlugin` and define a `get_vars` method as the entrypoint.

View File

@ -1,2 +0,0 @@
bugfixes:
- dnf - properly set gpg check options on enabled repositories according to the ``disable_gpg_check`` option (https://github.com/ansible/ansible/issues/80110)

View File

@ -1,2 +0,0 @@
minor_changes:
- ansible.builtin.user - Remove user not found warning (https://github.com/ansible/ansible/issues/80267)

View File

@ -1,2 +0,0 @@
minor_changes:
- "Add ``dump`` and ``passno`` mount information to facts component (https://github.com/ansible/ansible/issues/80478)"

View File

@ -1,3 +0,0 @@
---
bugfixes:
- Provide additional information about the alternative plugin in the deprecation message (https://github.com/ansible/ansible/issues/80561).

View File

@ -1,2 +0,0 @@
bugfixes:
- dnf - properly skip unavailable packages when ``skip_broken`` is enabled (https://github.com/ansible/ansible/issues/80590)

View File

@ -1,2 +0,0 @@
bugfixes:
- Interpreter discovery - Add ``Amzn`` to ``OS_FAMILY_MAP`` for correct family fallback for interpreter discovery (https://github.com/ansible/ansible/issues/80882).

View File

@ -1,3 +0,0 @@
---
bugfixes:
- Consolidate systemd detection logic into one place (https://github.com/ansible/ansible/issues/80975).

View File

@ -1,2 +0,0 @@
bugfixes:
- include_vars - fix calculating ``depth`` relative to the root and ensure all files are included (https://github.com/ansible/ansible/issues/80987).

View File

@ -1,2 +0,0 @@
bugfixes:
- Properly template tags in parent blocks (https://github.com/ansible/ansible/issues/81053)

View File

@ -1,3 +0,0 @@
---
bugfixes:
- Reword the error message when the module fails to parse parameters in JSON format (https://github.com/ansible/ansible/issues/81188).

View File

@ -1,2 +0,0 @@
bugfixes:
- flush_handlers - properly handle a handler failure in a nested block when ``force_handlers`` is set (http://github.com/ansible/ansible/issues/81532)

View File

@ -1,2 +0,0 @@
bugfixes:
- "``ansible.module_utils.service`` - ensure binary data transmission in ``daemonize()``"

View File

@ -1,16 +0,0 @@
---
bugfixes:
- >-
ansible-galaxy - started allowing the use of pre-releases
for dependencies on any level of the dependency tree that
specifically demand exact pre-release versions of
collections and not version ranges.
(https://github.com/ansible/ansible/pull/81606)
- >-
ansible-galaxy - started allowing the use of pre-releases
for collections that do not have any stable versions
published.
(https://github.com/ansible/ansible/pull/81606)
...

View File

@ -1,3 +0,0 @@
---
bugfixes:
- galaxy - skip verification for unwanted Python compiled bytecode files (https://github.com/ansible/ansible/issues/81628).

View File

@ -1,2 +0,0 @@
bugfixes:
- "blockinfile - when ``create=true`` is used with a filename without path, the module crashed (https://github.com/ansible/ansible/pull/81638)."

View File

@ -1,3 +0,0 @@
---
bugfixes:
- vars - handle exception while combining VarsWithSources and dict (https://github.com/ansible/ansible/issues/81659).

View File

@ -1,2 +0,0 @@
bugfixes:
- Fix ``run_once`` being incorrectly interpreted on handlers (https://github.com/ansible/ansible/issues/81666)

View File

@ -1,2 +0,0 @@
bugfixes:
- unarchive - add support for 8 character permission strings for zip archives (https://github.com/ansible/ansible/pull/81705).

View File

@ -1,3 +0,0 @@
---
bugfixes:
- distro - bump bundled distro version from 1.6.0 to 1.8.0 (https://github.com/ansible/ansible/issues/81713).

View File

@ -1,2 +0,0 @@
removed_features:
- Remove deprecated JINJA2_NATIVE_WARNING environment variable (https://github.com/ansible/ansible/issues/81714)

View File

@ -1,3 +0,0 @@
---
removed_features:
- Remove deprecated APIs from ansible-docs (https://github.com/ansible/ansible/issues/81716).

View File

@ -1,2 +0,0 @@
removed_features:
- Remove deprecated crypt support from ansible.utils.encrypt (https://github.com/ansible/ansible/issues/81717)

View File

@ -1,2 +0,0 @@
bugfixes:
- Allow for searching handler subdir for included task via include_role (https://github.com/ansible/ansible/issues/81722)

View File

@ -1,3 +0,0 @@
---
minor_changes:
- ansible-test - Updated the CloudStack test container to version 1.7.0.

View File

@ -1,3 +0,0 @@
---
minor_changes:
- filter plugin - Add the count and mandatory_count parameters in the regex_replace filter

View File

@ -1,2 +0,0 @@
bugfixes:
- ansible-galaxy - Provide a better error message when using a requirements file with an invalid format - https://github.com/ansible/ansible/issues/81901

View File

@ -1,3 +0,0 @@
---
bugfixes:
- Fix setting proper locale for git executable when running on non english systems, ensuring git output can always be parsed.

View File

@ -1,2 +0,0 @@
bugfixes:
- "dnf - fix an issue when cached RPMs were left in the cache directory even when the keepcache setting was unset (https://github.com/ansible/ansible/issues/81954)"

View File

@ -1,3 +0,0 @@
---
minor_changes:
- apt_repository.py - use api.launchpad.net endpoint instead of launchpad.net/api

View File

@ -1,2 +0,0 @@
bugfixes:
- Enable file cache for vaulted files during vars lookup to fix a strong performance penalty in huge and complex playbboks.

View File

@ -1,3 +0,0 @@
---
bugfixes:
- find - do not fail on Permission errors (https://github.com/ansible/ansible/issues/82027).

View File

@ -1,3 +0,0 @@
---
minor_changes:
- removed the unused argument ``create_new_password`` from ``CLI.build_vault_ids`` (https://github.com/ansible/ansible/pull/82066).

View File

@ -1,2 +0,0 @@
bugfixes:
- ansible-galaxy role import - exit with 1 when the import fails (https://github.com/ansible/ansible/issues/82175).

View File

@ -1,6 +0,0 @@
---
bugfixes:
- ansible.builtin.uri - the module was ignoring the ``force`` parameter and always
requesting a cached copy (via the ``If-Modified-Since`` header) when downloading
to an existing local file. Disable caching when ``force`` is ``true``, as
documented (https://github.com/ansible/ansible/issues/82166).

View File

@ -1,2 +0,0 @@
bugfixes:
- Fix issue where an ``include_tasks`` handler in a role was not able to locate a file in ``tasks/`` when ``tasks_from`` was used as a role entry point and ``main.yml`` was not present (https://github.com/ansible/ansible/issues/82241)

View File

@ -1,4 +0,0 @@
---
minor_changes:
- ansible-test - sanity test allows ``EXAMPLES`` to be multi-document YAML (https://github.com/ansible/ansible/issues/82353).
- ansible-test - document block name now included in error message for YAML parsing errors (https://github.com/ansible/ansible/issues/82353).

View File

@ -1,3 +0,0 @@
---
bugfixes:
- assemble - fixed missing parameter 'content' in _get_diff_data API (https://github.com/ansible/ansible/issues/82359).

View File

@ -1,2 +0,0 @@
bugfixes:
- Run all handlers with the same ``listen`` topic, even when notified from another handler (https://github.com/ansible/ansible/issues/82363).

View File

@ -1,3 +0,0 @@
---
minor_changes:
- git module - gpg_allowlist name was added in 2.17 and we will eventually deprecate the gpg_whitelist alias.

View File

@ -1,2 +0,0 @@
bugfixes:
- Fix condition for unquoting configuration strings from ini files (https://github.com/ansible/ansible/issues/82387).

View File

@ -1,2 +0,0 @@
bugfixes:
- "facts - detect VMware ESXi 8.0 virtualization by product name VMware20,1"

View File

@ -1,2 +0,0 @@
bugfixes:
- dnf - fix an issue when installing a package by specifying a file it provides could result in installing a different package providing the same file than the package already installed resulting in resolution failure (https://github.com/ansible/ansible/issues/82461)

View File

@ -1,2 +0,0 @@
minor_changes:
- "ansible-doc - treat double newlines in documentation strings as paragraph breaks. This is useful to create multi-paragraph notes in module/plugin documentation (https://github.com/ansible/ansible/pull/82465)."

View File

@ -1,2 +0,0 @@
bugfixes:
- distribution.py - Recognize ALP-Dolomite as part of the SUSE OS family in Ansible, fixing its previous misidentification (https://github.com/ansible/ansible/pull/82496).

View File

@ -1,2 +0,0 @@
bugfixes:
- "ansible-test ansible-doc sanity test - do not remove underscores from plugin names in collections before calling ``ansible-doc`` (https://github.com/ansible/ansible/pull/82574)."

View File

@ -1,2 +0,0 @@
bugfixes:
- "ansible-test validate-modules sanity test - do not treat leading underscores for plugin names in collections as an attempted deprecation (https://github.com/ansible/ansible/pull/82575)."

View File

@ -1,2 +0,0 @@
minor_changes:
- "constructed inventory plugin - Adding a note that only group_vars of explicit groups are loaded (https://github.com/ansible/ansible/pull/82580)."

View File

@ -1,2 +0,0 @@
bugfixes:
- templating - ensure syntax errors originating from a template being compiled into Python code object result in a failure (https://github.com/ansible/ansible/issues/82606)

View File

@ -1,2 +0,0 @@
bugfixes:
- ansible.builtin.apt - calling clean = true does not properly clean certain cache files such as /var/cache/apt/pkgcache.bin and /var/cache/apt/pkgcache.bin (https://github.com/ansible/ansible/issues/82611)

View File

@ -1,6 +0,0 @@
minor_changes:
- dnf - add the ``best`` option
- dnf5 - add the ``best`` option
bugfixes:
- dnf - the ``nobest`` option only overrides the distribution default when explicitly used, and is used for all supported operations (https://github.com/ansible/ansible/issues/82616)
- dnf5 - the ``nobest`` option only overrides the distribution default when used

View File

@ -1,2 +0,0 @@
bugfixes:
- include_tasks - include `ansible_loop_var` and `ansible_index_var` in a loop (https://github.com/ansible/ansible/issues/82655).

View File

@ -1,2 +0,0 @@
bugfixes:
- template - Fix error when templating an unsafe string which corresponds to an invalid type in Python (https://github.com/ansible/ansible/issues/82600).

View File

@ -1,2 +0,0 @@
deprecated_features:
- "ansible-doc - role entrypoint attributes are deprecated and eventually will no longer be shown in ansible-doc from ansible-core 2.20 on (https://github.com/ansible/ansible/issues/82639, https://github.com/ansible/ansible/pull/82678)."

View File

@ -1,2 +0,0 @@
bugfixes:
- Fixes permission for cache json file from 600 to 644 (https://github.com/ansible/ansible/issues/82683).

View File

@ -1,2 +0,0 @@
bugfixes:
- Fix check for missing _sub_plugin attribute in older connection plugins (https://github.com/ansible/ansible/pull/82954)

View File

@ -1,2 +0,0 @@
bugfixes:
- ansible-galaxy role install - fix installing roles from Galaxy that have version ``None`` (https://github.com/ansible/ansible/issues/81832).

View File

@ -1,5 +0,0 @@
minor_changes:
- >-
``ansible-galaxy role|collection init`` - accept ``--extra-vars`` to
supplement/override the variables ``ansible-galaxy`` injects for templating
``.j2`` files in the skeleton.

View File

@ -1,2 +0,0 @@
bugfixes:
- ansible-galaxy role install - normalize tarfile paths and symlinks using ``ansible.utils.path.unfrackpath`` and consider them valid as long as the realpath is in the tarfile's role directory (https://github.com/ansible/ansible/issues/81965).

View File

@ -1,3 +0,0 @@
minor_changes:
- ansible-test - Add Fedora 39 remote.
- ansible-test - Add Fedora 39 container.

View File

@ -1,6 +0,0 @@
---
minor_changes:
- ansible-test - Added a macOS 14.3 remote VM.
...

View File

@ -1,2 +0,0 @@
bugfixes:
- ansible-test - The ``libexpat`` package is automatically upgraded during remote bootstrapping to maintain compatibility with newer Python packages.

View File

@ -1,2 +0,0 @@
bugfixes:
- ansible-test - Fix parsing of cgroup entries which contain a ``:`` in the path (https://github.com/ansible/ansible/issues/81977).

View File

@ -1,3 +0,0 @@
minor_changes:
- ansible-test - When invoking ``sleep`` in containers during container setup, the ``env`` command is used to avoid invoking
the shell builtin, if present.

View File

@ -1,6 +0,0 @@
---
bugfixes:
- ansible-test — Python 3.8–3.12 will use ``coverage`` v7.3.2.
...

View File

@ -1,2 +0,0 @@
minor_changes:
- ansible-test - Special handling for installation of ``cryptography`` has been removed, as it is no longer necessary.

View File

@ -1,3 +0,0 @@
minor_changes:
- ansible-test - Update the base and default containers to use Ubuntu 22.04 for the base image.
This also updates PowerShell to version 7.4.0 with .NET 8.0.0 and ShellCheck to version 0.8.0.

View File

@ -1,4 +0,0 @@
minor_changes:
- ansible-test - Updated the distro test containers to version 6.3.0 to include coverage 7.3.2 for Python 3.8+.
The alpine3 container is now based on 3.18 instead of 3.17 and includes Python 3.11 instead of Python 3.10.
- ansible-test - Updated the distro test containers to version 7.1.0.

View File

@ -1,5 +0,0 @@
bugfixes:
- ansible-test - Properly detect docker host when using ``ssh://`` protocol for connecting to the docker daemon.
- ansible-test - Explicitly supply ``ControlPath=none`` when setting up port forwarding over SSH to address
the scenario where the local ssh configuration uses ``ControlPath`` for all hosts, and would prevent
ports to be forwarded after the initial connection to the host.

Some files were not shown because too many files have changed in this diff Show More