Compare commits

...

1048 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
4bc6ffb2aa Eaiser package mgr overrides (#82629)
Added variable to override auto detection



Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Matt Martz <matt@sivel.net>
2024-04-02 16:38:05 -04:00
4bddbe69d5 Fix traceback inheriting from NetworkConnectionBase and add integration tests (#82954)
Co-authored-by: Jeroen van Bemmel <jvb127@gmail.com>
2024-04-02 11:19:07 -04:00
478e139195 remove nonexistent url from role templates (#82933)
* Remove obsolete v1 link for role platforms from the role templates
* Delete platforms block entirely
2024-04-02 11:15:12 -04:00
bcaae4c435 systemd_service: Update docs regarding required_* (#82917)
* Update the documentation regarding required_one_of and required_by
  in systemd_service

Fixes: #82914

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-02 11:06:40 -04:00
21a987b8b6 connection: update test coverage for SSH connection plugin (#82916)
* connection: update test coverage for SSH connection plugin

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-02 11:05:41 -04:00
9e08f78bd3 ansible-test - Update base/default containers (#82952) 2024-04-01 20:13:11 +00:00
31901d23e7 ansible-test - Remove FreeBSD 13.2 (#82951) 2024-04-01 18:14:32 +00:00
8280fbc776 ansible-test - Remove Alpine 3.18 (#82116)
Co-authored-by: Matt Clay <matt@mystile.com>
2024-04-01 17:54:51 +00:00
b3d8cdde5d fix handling allow_duplicates with the role cache (#82691)
allow_duplicates is not part of the role uniqueness, so the value on the cached role may not match the current role.

* remove the allow_duplicates check from Role.has_run() which operates on the deduplicated role
* check the current role's allow_duplicates value in the strategy

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2024-03-28 15:33:09 -04:00
8704b9fc29 centralize and complete the internal static vars (#82872)
* centralize and complete the internal static vars

These vars are internal and should not be overridden nor templated
from inventory nor hostvars.
2024-03-28 15:06:35 -04:00
e3f4fe4fb9 ansible-test - Remove macos/13.2 remote from ansible-test
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
2024-03-27 22:45:54 +00:00
5c804cbf6f ssh docs fixes (#82902) 2024-03-26 17:07:32 -04:00
fde206499d async support check mode (#82901)
Allow async tasks to run in check mode
Add check_mode support to async_status
Add tests, also for 'hidden' async mode in gather_facts/parallel
2024-03-26 17:06:29 -04:00
b639bd1fd4 Allow "role_name : " prefix for notifying handler listen topics (#82854)
* Allow role name prefix for handler task listen topics

For example,

- name: handler name
  debug:
  listen: topic1

can be notified using `topic1`, `role : topic1` if the handler is in a
standalone or collection role, and `ns.col.role: topic1` if the role is
in a collection, the same way handler names work.

changelog

* fix changelog and tests
2024-03-26 13:29:45 -05:00
8fec1575e6 apt: handle options while installing python3-apt (#82913)
* apt: handle options while installing python3-apt

* While installing python3-apt library, honor parameter
  such as install_recommends and dpkg_options

Fixes: #40608

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

* Review changes

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

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-26 16:16:27 +01:00
Jon
a1b6e3a258 Document sort_keys option in to_nice_json() filter (#82912)
Added by https://github.com/ansible/ansible/pull/52341.
2024-03-26 16:15:28 +01:00
5f4e332e37 Fix condition for unquoting configuration strings from ini files (#82388)
* Add prefix to `origin` when configuration variables come from ini files

Fixes ansible#82387

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

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

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

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

So as not to rely on a specific format of the `origin` string,
as suggested by @sivel in
https://github.com/ansible/ansible/pull/82388#issuecomment-1881714871
2024-03-26 09:12:17 -05:00
a870e7d0c6 Bump bundled distro version to 1.8.0 (#81765)
* Bump bundled distro version to 1.8.0

* Bump bundled distro version from to 1.8.0 from 1.6.0

Fixes: #81713

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

* Remove sanity entries

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

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-25 10:23:03 -05:00
d86ad77d6f Remove deprecated scp_if_ssh from SSH connection plugin (#82072)
* removed deprecated scp_if_ssh feature from SSH connection
  plugin

Fixes: #81715

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-25 14:50:37 +00:00
b8b12c4be3 Update sanity requirements (#82296)
* Update sanity requirements
* Drop Python 3.7 for mypy

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-22 17:17:52 -07:00
ca168eb367 ansible-test - Fix Alpine libexpat bootstrapping 2024-03-22 12:27:35 -07:00
ad0ec47fe9 first_found lookup; minor fixes (#82836)
Always process options no matter the combination
return a full normalized path (symlinks still not followed, should be specific option in future)
2024-03-22 13:00:46 -04:00
b4d67adfda ansible-test - Update distro containers to 7.1.0 2024-03-21 21:40:01 -07:00
a1ad7100df ansible-test - Handle externally managed Python (#82883)
Remove EXTERNALLY-MANAGED marker in ansible-test managed environments

Additional changes:

- Test the Alpine 3.19 container
- Stop testing Alpine 3.18 container and remote
- Add missing changelog entry the Alpine 3.19 container
2024-03-21 21:06:25 -07:00
73701004b0 ansible-test - Add alpine 3.19 (#82115) 2024-03-22 01:02:29 +00:00
c0821346fc Do not mangle plugin names in collections that start with an underscore. (#82574) 2024-03-21 19:40:46 -04:00
11d69e065f ansible-doc: restore role attributes (#82678)
* Restore role attributes.

* Add a deprecation warning for role argument specs containing attributes

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2024-03-21 17:06:15 -04:00
31bbc8334e Update container test cgroup handling
When the host uses cgroup v2 and does not use systemd,
skip container scenarios which are unsupported.
2024-03-21 13:19:38 -07:00
a192193c55 Limit Alpine 3.18 test hacks to that version 2024-03-21 12:05:05 -07:00
ddae41759c Add FreeBSD 13.3 and 14.0 to ansible-test (#82530)
Co-authored-by: Matt Clay <matt@mystile.com>
2024-03-21 17:50:51 +00:00
8eabeefa63 mypy: update code required to bump sanity requirements
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-21 09:54:24 -07:00
aecffcb896 pylint: update for use-yield-from
* With Pylint 3.1.0, use-yield-from check is enabled

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-21 09:37:18 -07:00
481d8bdc1e Unarchive get zipinfo on more OS/distros (#82873)
Not all implementations use -l as default for -Z on unzip
2024-03-21 08:43:08 -07:00
2b1a5dd7a0 Remove outdated constraint for paramiko setup 2024-03-20 19:09:05 -07:00
e659c23bf2 blockinfile: do not crash when filename has no path (#81638)
* Do not crash when filename has no path.

* Clean up file after test.
2024-03-20 18:39:19 -05:00
0c9f1989a7 Do not treat leading underscore in plugin names as attempted deprecation. 2024-03-20 14:01:50 -07:00
8aecd1f9b2 winrm - Handle task timeout (#82784)
When using winrm over HTTP with message encryption enabled and a task
has timed out the connection plugin will fail to cleanup the WinRM
command. This will change that exception into a warning as a timeout is
already an exception event and a failure to clean the operation should
not override the timeout error shown.
2024-03-21 05:19:52 +10:00
c9086061ca Allow check mode async task disabling check_mode (#82827)
* Allow check mode async task disabling check_mode

Allows running an async task with check_mode: False when the playbook is
being run in check mode.

* Add check_mode attribute to internal cleanup task
2024-03-20 11:34:57 -04:00
56fa630e47 apt: Install recommended packages while installing deb files (#82805)
* install recommended packages while installing deb files and
  install_recommends is set to true.

Fixes: #29726

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-19 08:52:50 -07:00
c5557ad872 fix wording in error msg (#82848) 2024-03-19 11:27:40 -04:00
25c0dc50a2 Fix up to_datetime timedelta seconds docs (#82826) 2024-03-19 11:04:11 -04:00
732df49e46 Update zip.yml (#82840)
Fix typo of mydcit instead of mydict.
2024-03-19 07:59:47 -07:00
2bb09bfd12 atomic_move - fix preserving extended acls (#82818)
* use copystat to copy as many attributes as possible before os.rename

update unit test mocks for updated method of attribute preservation

add integration test for lineinfile case

remove erroneous `- meta: end_play` from lineinfile test suite

* add keep_dest_attrs parameter to control whether src attributes are
copied initially, and for existing destinations, whether the src is
updated using the dest before being renamed

consolidate with copy unsetting extended attrs

ci_complete
2024-03-18 10:58:00 -04:00
7adc146e2f Fix traceback and allow installing roles with version None (#81849)
* Allow installing roles with version `None` from Galaxy

Co-authored-by: Matt Martz <matt@sivel.net>
2024-03-16 00:17:37 +00:00
4000656849 git: Rename option gpg_whitelist to gpg_allowlist (#82377)
Signed-off-by: Sebastian Endres <sebastian.endres@dlr.de>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-15 22:49:28 +00:00
3b823d908e Enable file cache for vaulted host_vars_files vars plugin (#81995)
Enable file cache for vaulted host_vars_files vars plugin

* fixes #81994
* Changed cache arg from bool to str to allow 'vaulted' only file cache
* removed unused used var
---------
Co-authored-by: Steffen Oschatz <so@ypsilon.net>
2024-03-15 14:50:38 -04:00
92df664806 [DOCS] README: update working groups link (#82254) 2024-03-15 16:49:33 +00:00
6439627ce4 test_apt: migrate from unittest to pytest (#82666)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-14 19:19:36 -07:00
2806758793 filter: Misc fixes in docs (#82823)
* misc fixes for the filter documentation

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-15 05:11:33 +10:00
1181436d54 docs: describe capture references (#82819)
* update docs and example for capture references

Fixes: #82797

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-15 05:03:50 +10:00
9a0a5d834e Fixes permission for cache json file from 600 to 644 (#82761)
Until ansible-core 2.12 the facts cache file created by this module, have permission set as 644 which allows the other users to read the cache, since ansible-core 2.13, we create the temporary file, but we do not set the permission after renaming the temporary file.  Adding the line to set the permission to allow other users/groups to read this file.
2024-03-14 10:24:09 -07:00
86f48a526a Install crun from Alpine 3.19 for known musl compatibility (#82812) 2024-03-13 13:31:59 -05:00
d9e798b48f debconf: allow a list for value when vtype is multiselect (#82757)
* allow user to specify a list for value when vtype is multiselect

Fixes: #81345

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-12 16:06:35 +00:00
f02081b391 Fix discrepancy in behaviour between apt-get clean and its equivalent ansible.builtin.apt: clean=True (#82800)
* added integration test for issue 82611 regarding discrepency between apt-get clean and ansible.builtin.apt: clean

* fixed new line issue

* Implementation of bug fix for 82611

Fixed discrepancy in behaviour between apt-get clean and its equivalent ansible.builtin.apt: clean=True

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

---------

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2024-03-12 11:10:50 -04:00
936e757478 Document no until support for meta (#82795) 2024-03-12 11:02:38 -04:00
8b0f2ad9c5 remove repetitive words (#82799)
Signed-off-by: carrychair <linghuchong404@gmail.com>
2024-03-12 07:40:27 -07:00
f1ded0f417 dnf: utilize the API for the installed checks (#82725)
Fixes #71808
Fixes #76463
Fixes #81018
2024-03-08 09:43:42 +01:00
a28709f92d dnf: fix installing a package based the file it provides (#82744)
Fixes #82461
2024-03-08 08:25:44 +01:00
e0c91af45f Remove os.environ compat for py2 and deprecate ansible.utils.py3compat (#82794) 2024-03-07 17:08:22 -06:00
5d15af3a95 Split the unified PR template into few (#82734)
Ref: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository
2024-03-07 22:22:05 +00:00
6db7a3bd64 Fix handling of ansible_loop_var and ansible_index_var inside ansible.builtin.include_tasks (#82789)
* added integration test for issue 82655 regarding ansible_loop_var and ansible_index_var inside included yml

* ensure correct handling of ansible_loop_var and ansible_index_var inside ansible builtin include_tasks Co-authored-by: Matt <matt@sivel.net>

* added changelog

* fixed new line issue
2024-03-08 05:08:29 +10:00
2cf52daa03 Handle error raised when argument validation (#82783)
* Handle error raised when argument validation with elements=int
  and value is not within choices

Fixes: #82776

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-08 05:04:58 +10:00
bb030db546 Re-enable psrp tests that were disabled (#82785) 2024-03-07 12:47:43 +10:00
942424e10b Avoid winrm hang on stdin write failure (#82766)
If the connection plugin fails to write the data to run to stdin we will
only attempt to get the output with one operation attempt. If this times
out we will consider the command to have failed and raise an exception
instead of forever attempting to get the output.
2024-03-07 08:47:04 +10:00
dd44449b6e Use of constant for 644 permission variable (#82762)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-05 16:09:58 +01:00
cdd303101e Follow fix for test_iptables (#82768)
* rename 'test_policy_table' to 'test_policy_table_flush' to remove duplicate
  test case name.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-05 12:42:08 +01:00
38006103dc Fixed typo 'must by' to 'must be' (#82769) 2024-03-04 15:31:20 -08:00
8750a1f9ac test: migrate iptables tests from unittests to pytest (#82647)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-01 09:01:33 -08:00
ca2de9e2a4 Improve documentation for replace module (#82756) 2024-02-29 11:01:26 -08:00
03246dc0ae galaxy: Skip verification for unwanted files (#82162)
Fixes: #81628

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-02-27 23:05:29 +00:00
4edd6ba04f Add MIRACLE LINUX as RedHat OS Family (#82722)
Co-authored-by: Taiki Fujiwara <taiki.fujiwara@miraclelinux>
2024-02-27 09:42:16 -08:00
77ab7afc3d dnf: obey the keepcache setting (#82735)
Fixes #81954
2024-02-27 15:22:56 +01:00
9a8be1e8c8 Disable ansible-test podman container tests on Ubuntu 22.04 (#82748) 2024-02-26 13:45:08 -06:00
79ea21a39f Fix error when templating an unsafe string leading to a type error in Python (#82675)
Fixes #82600
2024-02-26 15:39:07 +01:00
1b209d742e Galaxy trailing slash (#82732)
* fix: ensure path argument doesn't have a backslash

* feat: add changelog

* Update lib/ansible/cli/__init__.py

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

* Simplify logic and add tests

---------

Co-authored-by: dorkamotorka <teo.podobnik1234@gmail.com>
Co-authored-by: Teodor Janez Podobnik <48418580+dorkamotorka@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2024-02-22 04:09:24 +00:00
a1edb61ce7 ansible-test - Add work-around for pytest>=8 errors (#82723)
* ansible-test - Add work-around for pytest>=8 errors
* Update changelogs/fragments/ansible-test-pytest-8.yml

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2024-02-21 10:08:54 -08:00
386edc666e Add macOS 14.3 to CI and ansible-test
Additionally, this patch takes care of installing GPG within the
`ansible-galaxy-collection` test when running under macOS 14 and higher.

PR #82697

ci_complete
2024-02-16 21:26:16 +01:00
437457e6d9 Proxy more display methods (#81900) 2024-02-14 17:53:52 -06:00
5566a655ae Updates to interpreter discovery for 2.17 (#82420) 2024-02-14 13:16:54 -06:00
4bcc27ca99 add --extra-vars for ansible-galaxy role|collection init (#82605)
allow extra vars when templating j2 files in the skeleton, for example:

ansible-galaxy init --role-skeleton /path/to/skeleton --extra-vars @/path/to/vars_file.yml newrole

ansible-galaxy init --extra-vars "min_ansible_version=2.17.0" newrole
2024-02-14 13:50:36 -05:00
b88d43a029 uri: update use_netrc.yml (#82672)
Changed successfull to successful
2024-02-14 03:38:56 +00:00
6c21c545e1 Deprecate support for the v2 galaxy API (#82543)
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2024-02-13 09:31:33 -06:00
d15b77b94e fix find integration test
* original test assertion was not quoted properly and was thus silently "truthy" instead of actually functioning
2024-02-12 13:57:13 -08:00
a23ea2aef2 Reword warning if the reserved keyword _ansible_ is used (#82657)
Extend the wordings in warning if the reserved keyword _ansible_
is used as a module parameter.

Fixes: #82514

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Jordan Borean <jborean93@gmail.com>
2024-02-09 04:43:46 +00:00
c8d6f7b95e ansible-test - Fix validate-modules Python handling
The ``validate-modules`` sanity test no longer attempts to process files with unrecognized extensions as Python.

Integration tests have been added to verify Python-specific checks do not apply to these files.

The `invalid-extension` and `missing-gplv3-license` checks still apply to these files. This may change in the future.
2024-02-08 08:43:08 -08:00
e78be30baa apt_repository: Update PPA URL to point to HTTPS (#82599)
Fixes: #82463

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-02-07 11:07:35 -08:00
b6a89bff6c Add missing char 's' in exists documentation (#82651) 2024-02-07 10:45:43 -08:00
11efa5c48b Reduce complexity of Request.open (#81988) 2024-02-06 10:50:19 -06:00
eb44c77968 Remove tests for ansible-runner (#82571) 2024-02-06 09:50:54 -06:00
a452c53375 import_role - allow subdirectories with _from options (#82642)
* Allow subdirectories with import_role _from options

Add tests that tasks_from is restricted to the role

Note that a task like:

- import_role:
    name: role
    tasks_from: tasks/entrypoint.yml

will now load tasks from "{{ role_path }}/tasks/tasks/entrypoint.yml"
instead of "{{ role_path }}/tasks/entrypoint.yml". This change in
behavior matches include_role.

* better test case (filename doesn't match one in tasks/)

Fixes #82584
2024-02-06 16:13:47 +01:00
da26e2a5eb iptables: added choices in match_set_flags option (#82641)
* 'src,src', 'dst,dst' added as new option choices in
  match_set_flags option

Fixes: #81281

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-02-06 16:12:54 +01:00
a10d255e0b dnf,dnf5 - add the best option and fix nobest (#82627)
best/nobest options are one of the options whose default values are set
by an OS distribution. For example in our CI, both Fedora and RHEL set
the best option to different default values. As such we should defer to
the distributions for the default value and not change it by default but
if users wish to change it they can do so explicitly.

Currently the dnf module sets the nobest option inconsistenly and not for
all cases. This patch fixes that to reflect the behavior described
above. In addition adding the best option for both dnf and dnf5 modules
since the best option is prefer to nobest in dnf while in dnf5 nobest is
completely removed in favor of best.

Fixes #82616
2024-02-01 14:05:57 -05:00
e458cbac61 Allow for arbitrary key 'context' in argument spec (#82183)
* Allow for arbitrary key 'context' in argument spec
2024-01-30 08:59:57 -06:00
7a0c321054 Remove redundant undefined error message (#81867)
Fixes: #78703

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-01-29 17:00:53 -08:00
bec27fb4c0 prettyfy ansible-doc (#75116)
* prettify ansibile-doc output

delimiters when no color
avoid triggering color mode for existing tests
all use _format to observe nocolor
more v more info
imporoved conditional display
updated version on -v
normalize role errors
expand role data, dedupe code, fix formatting on warning
fix bug with galaxy info
role list improvements:
 lists all roles (even w/o meta/argspec)
 specs now indented under role
 role only listed once
Updated tests to reflect format changes

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-01-29 10:16:53 -05:00
6d34eb88d9 Do not ignore SyntaxError from jinja2.Environment.from_string (#82607)
Jinja may generate an invalid Python source code from a template. Trying
to compile such source code into a Python code object results in
SyntaxError being thrown. An example of such a template is providing the
same keyword argument into a lookup twice, resulting in:
`SyntaxError: keyword argument repeated`.

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

Fixes #82606
2024-01-29 10:33:33 +01:00
13e6d8487a fix loading vars_plugins in roles (#82273)
* Fix loading legacy vars plugins when the plugin loader cache is reset

* Remove extra cache layer by ensuring vars plugin names are cached (stateless or not) so that the plugin loader cache can double as the load order
2024-01-26 09:01:14 -05:00
8641144375 Adding note about implicit groups (#82580)
clarifying usage in conjunction with use_group_vars
2024-01-23 16:00:44 -05:00
8b2dd5fdd3 updated looups to use set_option in custom parse (#82425)
limit password params
  updated test error message catching
  make sure we reset params for each term
  ensure we only update options if we have em
2024-01-23 14:48:32 -05:00
f73d72e830 find: do not fail on PermissionError (#82282)
* Log and skip permission errors on files and directories

Fixes: #82027

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-01-23 10:55:13 -08:00
f024cf35d7 Remove the yum module, redirect it to dnf (#81895)
Fixes #81728
2024-01-23 10:23:43 -06:00
c7334ea92c Fix url encoded credentials in netloc (#82552)
Prior to this commit, it was impossible to use a module like dnf with a
URL that contains a username with an @ such as an email address
username, because:

  dnf:
    name: https://foo@example.com:bar@example.com/some.rpm

Would cause netloc parsing to fail. However, the following:

  dnf:
    name: https://foo%40example.com:bar@example.com/some.rpm

Would also fail because ansible would *not* URL-decode the credentials,
causing the following to be base64 encoded in the Authorization header:

  Zm9vJTQwZXhhbXBsZS5jb206YmFyCg==

Which decodes to:

  foo%40example.com:foo

Which is *not* the authorized username, and as such, *won't* pass basic
auth.

With this commit, Ansible's url lib behaves like curl, chromium, wget,
etc, and encodes the above to:

  Zm9vQGV4YW1wbGUuY29tOmJhcgo=

Which decodes to:

  foo@example.com:bar

Which will actually pass the HTTP Basic Auth, and is the same behaviour
that you will find ie. with:

  curl -vvI https://foo%40bar:test@example.com 2>&1 |grep Auth | awk '{ print $4 }'
2024-01-23 09:37:36 -06:00
06cd285901 Play recap stats and callbacks for include_role, consolidate with include_tasks (#79260)
This moves handling of callbacks and play recap stats from
_load_included_file to individual strategies so include_role tasks are
accounted for, not just include_tasks.

Fixes #77336
2024-01-23 15:57:05 +01:00
9c5d3060e5 uri: Handle the "force" parameter properly (#82187)
* uri: Two tests that demonstrate missing handling of the "force" parameter

Add unit and integration tests that demonstrate that the uri module is not
handling the "force" parameter.

The unit test demonstrates that when "force" is present in the module parameters,
it is not being passed through to fetch_url().

The integration test demonstrates that "force" does not disable caching as
documented, and calls with a "dest" parameter that points to an existing file
can result in a "304 Not Modified" response.

* uri: Handle the "force" parameter properly

The uri module documents a "force" parameter that can be used to disable caching.
The module accepted the parameter but didn't pass it through to the fetch_url() method
which implements the logic to handle setting the appropriate headers for disabling
caching. This change passes the "force" parameter through as expected, allowing caching
to be disabled when requested by the module caller.
2024-01-23 08:54:18 -05:00
aa40167f40 find - add encoding option to use in conjunction with contains (#82284)
*  when doing a 'contains' search, determine the encoding of the files to be searched

* set default encoding to None for backwards compatibility

* changelog, error handling, tests added

* add sanity ignore.txt for non-utf-8 test
2024-01-22 08:53:37 -05:00
b01f1f207c Support action_plugin in plugin_routing_schema (#82562)
now validation schema matches reality

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
2024-01-19 16:21:10 +00:00
853423c270 test_encrypt: remove unreachable assertion (#82570)
We explicitly skip tests in environments where passlib is not available.
2024-01-19 14:37:25 +01:00
a3e5546e43 🔥 Exterminate __builtin__ import from tests (#82569)
This patch removes an import fallback that was only executed under
Python 2. Now that we don't run tests against that runtime, it
generates an uncovered line. Dropping it will slightly increase the
coverage metric as a side effect.
2024-01-19 14:33:25 +01:00
6935c8e303 Ensure ANSIBLE_NO_LOG is respected (CVE-2024-0690) (#82565) 2024-01-18 15:37:39 -06:00
48bed1e15a Fix ansible.builtin.include_vars - depth (#80995)
* Changes as suggested by sivel

* Add changelog fragment and tests

Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
2024-01-18 11:56:54 -05:00
3f74bc08ce Remove crypt support from ansible.utils.encrypt (#81721)
Fixes #81717

Co-authored-by: Matt Clay <matt@mystile.com>
2024-01-18 08:23:01 +01:00
71d81e4a60 Add no-unwanted-characters sanity test for core (#82557) 2024-01-17 11:19:37 -08:00
30169c76de Replace Unicode no-break spaces with ASCII spaces 2024-01-17 10:26:30 -08:00
4aa109897f default svn URL to 127.0.0.1 for subversion integration tests (#82551)
* default svn URL to 127.0.0.1 for subversion integration tests

* svn client gives up before trying IPv4 addresses when localhost->(::1,127.0.0.1) in dual-stack envs (eg podman, most real hosts)
* svn client also requires legacy CN match on cert
* IPv6 works, but setup playbook would need a bunch more templating exceptions to conditionally manage `[::1]`

* explain IPv4 defaults
2024-01-17 09:49:47 -08:00
d9709c5ae9 module_utils/basic.py: remove PY2 compat (#81989) 2024-01-17 15:35:57 +01:00
975cf1655a modules: remove PY2 compat (#81990) 2024-01-17 09:24:35 +01:00
4a2de764ec Fix issues with ansible-playbook-callbacks test (#82407)
The timing of the async tasks was a little unpredictable, meaning that
sometimes we would get an unexpected number of v2_runner_on_async_poll
callbacks, and fail the test. This change fixes the issue by increasing
the poll interval to 2 seconds and the sleep duration to 3 seconds, such
that on a reasonably responsive system we will poll twice per task, with
the sleep ending in the middle of the two polls.

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

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

The integration tests run with ANSIBLE_HOST_PATTERN_MISMATCH=error,
meaning that the final play was never reached. Set
ANSIBLE_HOST_PATTERN_MISMATCH=warning to continue past the play and
trigger the v2_playbook_on_no_hosts_matched callback.
2024-01-17 09:22:40 +01:00
5f1b3898e8 Avoid delattr in test callback plugin (#82550)
This prevents the test plugin from tampering with the base callback plugin,
which causes issues with all other callback plugins running in the test.
2024-01-16 22:57:34 +00:00
b8c7ed39e4 Reboot timeout fix (#82526)
reboot now uses fallback as some plugins or older versions on ssh one use 'timeout' instead of 'connect_timeout'
2024-01-16 17:17:14 -05:00
0429520790 expect docs - improve responses description (#82544)
* consolidate notes describing the structure of `responses` with the option description

* include a link to Python regex syntax
2024-01-16 15:03:38 -05:00
6b9f49b6c5 Update attribute description for check_mode (#82536)
Fixes #82509
2024-01-16 16:10:11 +01:00
bf9509bf33 validate_argument_spec: fixed example syntax (#82534) 2024-01-13 08:17:21 -08:00
21247c828e ansible-test - Bypass PEP 668 checks
When ansible-test installs requirements, it now instructs pip to allow installs on externally managed environments as defined by PEP 668.

This only occurs in ephemeral environments managed by ansible-test, such as containers,
or when the `--requirements` option is used.
2024-01-11 14:10:31 -08:00
da9edd7760 expect - fix argument spec error with timeout=null (#82522)
* Fix using timeout=null to wait indefinitely

* fix error message
2024-01-12 05:21:29 +10:00
d7be3824fe [ansible-galaxy] Remove role name conversion when the repo startswith 'ansible-role' (#82508)
* Remove role name conversion based on whether the repo name starts with
ansible-role

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

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

changelog

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

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

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

---------

Co-authored-by: flowerysong <junk+github@flowerysong.com>
2024-01-12 05:11:56 +10:00
d2812aeb6f Update example in apt module docs (#82504)
All examples should use fully qualified collection names to avoid confusion.
2024-01-12 05:10:07 +10:00
a69fab86bc ansible-test - remove Fedora 38 container and remote support
Fixes: #82022

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-01-10 11:05:57 -08:00
78c9090986 Don't hard-code Alpine version in container test 2024-01-10 10:09:51 -08:00
4760dae989 document apt auto-installed dep (#82503) 2024-01-09 19:49:13 -05:00
596c75c2bc uri action plugin check_mode support update (#82484)
Also updated base action messages to be more specific
2024-01-09 12:14:00 -05:00
6c2895fd88 ansible-config dedupe ini plugin entries (#82498)
added test for ini file integrity, also ensuring no dupes
2024-01-09 12:07:03 -05:00
623e0eee42 Add Alp-Dolomite to Suse family list (#82496) 2024-01-09 10:49:49 -05:00
53ddc1648e deb822_repository: handle idempotency (#82483)
* deb822_repository: handle idempotency

Sort the parameters in order to handle idempotency

Fixes: #82454

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-01-09 10:34:18 -05:00
57a59e7194 Misc fix (#82482)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-01-09 10:33:29 -05:00
ceaf68a02c Deprecate required param in get_bin_path (#82466)
* Deprecate `required` param in get_bin_path

* The parameter `required` in process.get_bin_path API
  is deprecated. Will be removed in 2.21

Fixes: #82464


Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2024-01-09 10:25:01 -05:00
6c647aa263 Interpret double newlines as paragraph breaks in documentation strings. (#82465) 2024-01-09 10:23:08 -05:00
0a45dad884 Add VMware virt detection for hardware version of ESXi 8.0. (#82455)
* Add VMware virt detection for hardware version of ESXi 8.0.

* Add changelog for PR#82455
2024-01-09 10:10:35 -05:00
caa86cc4df Add the task info for tombstoned module/action plugins (#82451)
* Add the task info for tombstoned plugins

* Fix deprecation for 'include' by removing it from BUILTIN_TASKS which skip the plugin loader lookup

* changelog

remove obsolete unit test using 'include'

* Update changelogs/fragments/improve-tombstone-error.yml
2024-01-08 04:12:39 +00:00
b5649f9686 Remove more Python 2 handling from tests (#82449) 2024-01-08 04:00:10 +00:00
71a5212586 Add skips for encrypt unit tests for Python 3.13 2024-01-05 12:17:42 -08:00
6e4a5acfbd lineinfile, remove incorrect/unused 'others' option (#82436)
* move incorrect, unused 'others' option

 this was to document 'file' options are usable .. but we already
 import the file fragment to document those options.

* removed now bad ignore
2024-01-04 11:29:04 -08:00
8762d9e7e6 Adds details to the password_hash documentation (#82419)
fix for issue 82415

-

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2024-01-04 09:42:13 -05:00
c75624fbdc ansible-test - Enable shellcheck SC2164 2024-01-03 17:52:29 -08:00
3c432fea43 ansible-test - Update base/default test containers 2024-01-03 17:17:00 -08:00
a1958eefed Fix plugin_loader integration test error handling 2024-01-03 17:14:56 -08:00
630e5dda25 Clean up shellcheck issues in tests 2024-01-03 16:23:25 -08:00
e1bcb8a534 Remove unused unit test code 2024-01-03 14:34:20 -08:00
29b2405b84 Revert "Fix older external connection plugins without _sub_plugin declaration (#79372)" (#82473)
This reverts commit ef1e01aa8b.

broken tests
2024-01-03 17:35:03 +00:00
ef1e01aa8b Fix older external connection plugins without _sub_plugin declaration (#79372)
fixes https://github.com/ansible/ansible/issues/79371

* Check for sub=={} too
* Add a test case for older plugins that do not define '_sub_plugin'
* Add test for legacy plugins
2024-01-03 11:18:31 -05:00
55065c0042 Role fixes (#82339)
* Various fixes to roles

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-22 09:52:12 -05:00
fa92228b50 Replace unwelcoming words (#82413)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-12-18 12:05:15 -05:00
4479c9df13 Fix plugin set option (#82300)
* plugin config, ensure set_option correctly casts

  until now we relied on plugin author getting the right type, now
  the config system itself will process as it would for set_options
2023-12-14 09:41:48 -05:00
5346009d2c ansible-test - Allow multiple documents in the YAML stream for EXAMPLES (#82355)
* Allow multiple documents in the YAML stream for EXAMPLES.

* Add integration test

* linting
2023-12-14 06:18:35 +10:00
8328153121 Run all handlers with the same listen topic when notified from another handler (#82364)
Fixes #82363
2023-12-13 10:56:52 +01:00
fe81164fe5 ansible-galaxy - fix exit code for failed role import (#82193) 2023-12-12 13:59:19 -05:00
7f2ad7eea6 assemble: fixed missing parameter error (#82360)
* content is an optional parameter for _get_diff_data API

Fixes: #82359

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-12-12 11:22:23 -05:00
a9919dd7f6 lookups, make file searching use better is_role (#82290)
* lookups, make file searching use better is_role

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


* updated test to avoid main.yml
2023-12-08 11:05:40 -05:00
5573d4cde9 Scripts inventory plugin, add examples (#82361)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-08 09:51:37 -05:00
8af920c892 Add helptext to ansible-inventory's positional arg (#82332)
* Add helptext to ansible-inventory's positional arg

This explanation is already present in the documentation and
should make the usage more clear when looking at the --help output

* fix indentation

* change description of positional arg

It has no effect on --list and the docs now reflect that
2023-12-08 05:12:52 +10:00
9b002d2e63 check if there attributes to set (#78707)
Fixes: #76727
2023-12-06 09:02:51 -08:00
dd0138ba21 🧪 Replace GitHub SVN integration test with local TLS (#82334)
* Run svn integration test locally with TLS

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

Resolves #82207

* Replace GitHub SVN HTTPS URL w/ localhost over TLS

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

[1]: https://github.blog/2023-01-20-sunsetting-subversion-support/
2023-12-06 17:10:56 +01:00
6ebefaceb6 Better errors for delegate_to (#82319)
Handle empty result of templating
  Also skip work when we omit
2023-12-04 10:19:12 -05:00
3a42a00368 Targeted fix for installing roles with symlinks containing '..' (#82165)
Set the tarfile attribute to a normalized value from unfrackpath instead
of validating path parts and omiting potentially invald parts

Allow tarfile paths/links containing '..', '$', '~' as long as the
normalized realpath is in the tarfile's role directory
2023-11-30 18:05:48 -05:00
b405958f79 fixes typo in cli/ansible-pull arguments (#82316) 2023-11-30 14:13:39 -05:00
1dd0d6fad7 remote log info (#81711)
Both posix and powershell avenues updated to allow for customized string logging on remote

Co-authored-by: Jordan Borean <jborean93@gmail.com>
2023-11-30 13:12:55 -05:00
4208bdbbcd ansible-test - Update nios-test-container to 3.0.0 2023-11-30 09:59:49 -08:00
ee86dafc6e Amend doc of name= parameter to indicate a list of packages can be used (#82309)
* Amend doc of name= parameter to indicate a list of packages can be used

One of the examples here shows package installing a list of packages, but the name= parameter did not reflect this possibility.

* add dependency to underlying package manager
2023-11-30 11:09:35 -05:00
e80507af32 fact_gathering improve linux thread counts (#82261)
don't use `//` aka `floor()` as some architectures show counts of 1.9 threads per CPU and market as 2 per CPU, `round()` will be closer to that.
2023-11-28 10:49:52 -05:00
fd2d0ecfb7 Remove unneeded Task.is_static assignment (#82288)
Added in b38f746 but there is/was no Task.is_static so this just creates
a new attribute dynamically that is/was never used.
2023-11-28 10:35:31 -05:00
322eb0f884 changed the salt type from int to string (#82274) 2023-11-28 10:23:39 -05:00
265f5e724c apt_repository: Do not convert symlink repo to a normal file (#82271)
* apt_repository: Do not convert symlink repo to a normal file

* module manually writes to repo files. If the file is a symlink
  module used to re-write and convert a symlink to a normal file.
  This fix tracks the symlink and keeps the changes intact.

Fixes: #49809

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-28 10:20:57 -05:00
e6e19e37f7 validate-modules: Check for correct values in choice (#82266)
* validate-modules: Check for correct values in choice

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

Fixes: #82179

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

* Fix sanity tests

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

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-28 10:09:29 -05:00
0806da55b1 Add DCO and update CONTRIBUTING.md (#82105) 2023-11-27 10:19:37 -08:00
479949aad2 Fix broken docs RST reference. (#82286) 2023-11-27 10:02:20 -05:00
afd45aca6a ansible-test - remove rhel 9.2 test remote (#82211)
Fixes #82024
2023-11-27 10:03:42 +01:00
e0bf76e3db Issue #80267: Remove user not found warning (#80291)
Co-authored-by: Sebi94nbg <sebastian.kraetzig@4g-server.eu>
2023-11-23 15:25:35 +01:00
d664f13b4a Allow include_tasks handlers for searching role subdirs (#82248)
Fixes #82241
2023-11-22 17:42:51 +01:00
a4b00793be Update known_hosts module to better handle @cert-authority keys (#70340)
Signed-off-by: Chris Francy <zoredache@gmail.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-21 16:55:01 -08:00
7dde4901d4 unarchive: support 8 character permission strings (#81705) 2023-11-21 16:48:31 -08:00
ce9d268ab8 unarchive: force unarchive if the symlink target changes (#82253)
Fixes: #30420

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

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-21 09:11:23 -08:00
d6a8df3218 csvfile - add a keycol parameter to specify in which column to search. (#82242) 2023-11-21 10:40:31 -05:00
0a6779f6b7 docs: improve readability & scope of docs for ansible.builtin.assert (#82256)
Co-authored-by: Jonathan Biegert <jonathan.biegert@sva.de>
2023-11-21 10:24:07 -05:00
c35e0e8fd8 Re-enable "group removal" integration test for dnf5 (#82250)
Fixed in https://github.com/rpm-software-management/dnf5/pull/1013
2023-11-21 10:19:28 -05:00
fbdb666411 ansible-test: Added Fedora 39 (#82218)
* Fedora 39 remote
* Fedora 39 container

Fixes: #82018

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-17 02:30:13 +00:00
8fd1aa0d2e syslog: Handle ValueError raised while sending logs to syslog (#82225)
* ValueError exception is raised when Null Character is sent
  to syslog.syslog with Python 3.12.
* Handle this error gracefully instead of stacktrace

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

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

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

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-16 19:14:07 +00:00
6e448edc63 no_log avoid masking booleans (#82217)
* no_log avoid masking booleans

* clog

* fix issues
2023-11-17 05:04:34 +10:00
f42984eeb3 Fix ManifestControl dataclass to work with future annotations (#82215)
* Fix ManifestControl dataclass to work with future annotations

* Add tests
2023-11-17 05:02:58 +10:00
3d9e5c8b9d fix pc misuse (#82157)
use the more up to date 'task' as play_context only has the 'initial' values.
2023-11-16 09:30:18 -05:00
e2d108db2b log verbosity (#81692)
Allow users to adjust verbosity to logs at same or higher level than to callback/screen

Co-authored-by: Matt Clay <matt@mystile.com>
2023-11-15 20:57:59 -05:00
dbddabce9e Create prefix of file using ansible.builtin.tempfile (#82209)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-15 10:43:10 -08:00
8825e60add ansible-pull: expand destinantion directoy to avoid purgin in / (#82030)
* expand destinantion directoy to avoid purgin in /

  bad things could happen and help alone is not enough
2023-11-15 10:09:04 -05:00
05259aa6ce Restart a Service with Sleep Between Stop and Start (#82210)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-14 19:40:48 -08:00
0bab08ee33 ansible-test - Add RHEL 9.3 support (#82178)
Fixes #82020
2023-11-14 08:23:44 +01:00
2277d470b3 fix typo (#82202) 2023-11-13 14:59:07 -05:00
4a84a9b3db copy keep suffix on temp file for validation (#82158)
Also updated test to require suffix

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2023-11-13 10:03:58 -05:00
a8b6ef7e7c flush_handlers: handle a failure in a nested block with force_handlers (#81572)
Fixes #81532

ci_complete
2023-11-13 09:57:43 +01:00
9c09ed7392 Fix typo in validation.py (#82195)
covert -> convert
2023-11-12 06:54:53 -08:00
667526c22f Fix two misspellings of occurred (#82159) 2023-11-08 13:50:08 -08:00
f2b5c33349 fixed typos in the documentation (#82077) 2023-11-08 11:54:48 -08:00
fd009a073a Remove sefcontext support plugin
It was only used by the subversion test, but is no longer required.
2023-11-07 17:45:13 -08:00
0e6942a4d7 Remove unused unit test code (#82168) 2023-11-07 15:59:08 -08:00
c5b68ef16d Update Python3
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-07 15:43:31 -08:00
98407fc00e Remove unused validate-modules unit test code 2023-11-07 13:43:11 -08:00
dae4e2f07f Remove unused/unreachable unit test code (#82160) 2023-11-07 12:41:42 -08:00
0be33551d7 Remove unit tests dependent on systemd bindings (#82161)
These do no not run as part of our test suite.
2023-11-07 12:41:16 -08:00
78c16d983e Remove type_regex testcase
This is leftover testcase for type checker regex removed in
https://github.com/ansible/ansible/pull/82153

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-07 12:39:08 -08:00
9dd3eafa14 ansible-test - Use pylint unidiomatic-typecheck
This replaces the regex based check previously used within the validate-modules sanity test.

NOTE: The pylint check overlaps with a similar check for pep8.
      Both are used, since the pep8 based check is more nuanced than the one in pylint.
      For example, allowing `is` checks, but not `==` comparisons.
      If the pylint check is ignored, the pep8 check would still be relevant.
2023-11-07 11:04:22 -08:00
78546382b3 setup.cfg: add Programming Language :: Python :: 3.12 classifier (#82151)
ansible-core 2.16+ supports Python 3.12. This corrects missing metadata.
2023-11-07 09:23:47 -06:00
d46b042a94 Reword note on default determination on other OSes (#82147) 2023-11-07 09:20:46 -06:00
40baf5eace iptables - set jump to DSCP when set_dscp_mark or set_dscp_mark_class is set (#82145)
set_dscp_mark and set_dscp_mark_class is only valid when jump is set to
DSCP.

Fixes: #77077

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-07 09:19:25 -06:00
567c78f9a1 Update playbook responses for specific prompts (#82137)
Example is added for multiple questions with responses
2023-11-07 09:14:22 -06:00
7538668731 Check strict before failing to respect skip_broken (#80795)
Fixes #80590
2023-11-07 07:56:12 +01:00
916a20fccd Ignore coverage of test code that does not run 2023-11-06 13:17:30 -08:00
90203b841a Use functools.update_wrapper instead of a copy 2023-11-06 12:01:18 -08:00
dec9eeb2e5 Remove create_new_password parameter in CLI.build_vault_ids (#82066)
* Remove unused argument in call to build_vault_ids

* Remove obsolete build_vault_ids tests

* Change tests to account for argument removal

* Remove redundant test
2023-11-06 09:30:13 -05:00
20a54eb236 restore role param precedence (#82106)
* add test for setfact/param override
2023-11-06 09:18:35 -05:00
5ac62473b0 dnf: properly set gpg options on repos (#80777)
Fixes #80110
2023-11-06 10:22:35 +01:00
51d691bfa9 remove the obsolete TODO comments (#73116)
Co-authored-by: Zhipeng.Gao <zhipeng.gao@monash.edu>
2023-11-06 04:40:03 +00:00
ac3ae94ae1 Ignore coverage on code intended never to execute (#82128)
* Ignore coverage on code intended never to execute

* Fail collection loader test if wrong code runs

* Update boilerplate test to accommodate nocover
2023-11-02 15:28:06 -07:00
8ecc1d485b Fix the strategy plugin description in keywords (#82113)
Fixes: https://github.com/ansible/ansible-documentation/issues/762

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-02 17:17:46 -04:00
1df791cd90 Ignore code which coverage can't analyze (#82125)
* Ignore code which coverage can't analyze

Our own tracing function can't be traced.

* Use `nocover` instead of `no cover` for consistency
2023-11-02 14:14:51 -07:00
f8a9fd4758 Remove duplicate winrm test (#82124) 2023-11-03 07:08:15 +10:00
36d6860d80 ansible-test - Remove no-main-display sanity test 2023-11-02 13:34:20 -07:00
6e15fb0ebf ansible-test - Removed no-basestring sanity test 2023-11-02 12:32:01 -07:00
c349b91af3 ansible-test - Removed no-dict-* sanity tests 2023-11-02 11:55:14 -07:00
9765bb46f9 ansible-test - Remove no-unicode-literals test 2023-11-02 11:42:02 -07:00
172a010dd7 Remove unused test support plugins 2023-11-02 11:40:34 -07:00
5b1b0ce762 Remove Python 2 compat (via six) from unit tests 2023-11-01 17:05:36 -07:00
18e8401edd Remove Python 2.x compat from unit tests (#82109) 2023-11-01 16:37:08 -07:00
bea459654a pip - Add module in venv example 2023-10-31 09:14:51 -07:00
89cda0bcae pip - Add break_system_packages option (#82097) 2023-10-30 17:04:03 -07:00
3ea5304a57 add pep668 note to pip module docs (#82096) 2023-10-30 23:38:36 +00:00
f8de6caeec Reboot - delete useless parameter async, not supported (#80017)
Co-authored-by: baptch <b.jean.ch@gmail.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2023-10-28 04:14:15 +00:00
2908a2c32a corrected become same user config docs (#82059)
fixes #82057
2023-10-27 00:21:30 -07:00
b34f4a559f Add support for TLS 1.3 Post Handshake Auth (#82063)
TLS 1.3 adds a different method it can use to request a client
certificate after the handshake but Python does not allow this by
default. This commit sets the attribute needed to enable this scenario
when using client certificates on Python 3.8+, 3.7.1+.
2023-10-27 12:00:34 +10:00
f5a0c0dfc8 Ignore testing data for gitleaks (#82083) 2023-10-27 05:49:41 +10:00
9b78316687 docs(template): use unambiguous syntax for mode (#82079) 2023-10-27 05:21:25 +10:00
664fe45be9 Create a User with a Home Directory (#82078) 2023-10-27 05:20:50 +10:00
f5d7dc1a97 Legacy.psm1 - Add note telling people not to use function (#82076) 2023-10-27 05:16:05 +10:00
fb8ede22e1 don't warn about using a yescrypt hash as user password (#82071)
* dont warn about using a yescrypt hash as password

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

* add changelog

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

* add yescrypt test

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

---------

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2023-10-27 05:03:49 +10:00
e8ef6b7d7c Consolidate systemd detection logic (#81809)
* Add logic to consider the canary location for systemd files

Fixes: #80975

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-10-25 19:09:46 -07:00
bf29458726 Address nuance in key checking docs (#82058)
* Address nuance in key checking docs

  and add note to ssh plugin to let users know 'final authoritative source'.

* Update lib/ansible/plugins/connection/ssh.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-10-25 12:02:29 -04:00
b4920c83ad Fix locale related parsing error in git.py
* Fix locale related parsing error in git.py

This fixes the issue found at https://github.com/ansible/ansible/issues/77213 which got introduced by changing over to "best parseable locale" approach, but missing out the requirement of locales other than `L` having to have `LANGUAGE` specified as well. For further details, check this post within the issue discussion: https://github.com/ansible/ansible/issues/77213#issuecomment-1446919617

* Add changelog

Create 81931-locale-related-parsing-error-git.yml
2023-10-25 15:47:55 +02:00
fe94a99aa2 any_errors_fatal fixes (#78680)
Fixes #31543
Fixes #36308
Fixes #73246
Fixes #80981
Fixes #81533

ci_complete
2023-10-25 09:42:13 +02:00
c827dc0dab Remove obsolete requirements from prepare_http_tests 2023-10-24 09:19:58 -07:00
0bfc5bcf82 Fix contains example (#82067)
* Added missing round bracket

Fixes: https://github.com/ansible/ansible-documentation/issues/555

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-10-24 17:30:11 +02:00
99e0d25857 ansible-pull now handles all secret files CLI options (#82009)
* ansible-pull added missing pasthrough for secrets

 Both become and connection password file options were missing.
 Also added test
2023-10-24 09:20:25 -04:00
9ee603d1c5 Clarify some points in config lookup documentation (#81951)
Also update tests to support the format on modules/plugins

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-24 09:17:32 -04:00
b815b15362 Fix additional spelling errors in builtin modules (#82012) 2023-10-23 21:22:35 -07:00
0b7387d46c Improve filter_encryption test
- Update `data2_vaulted_string_with_id` to match the documented plaintext.
- Add a comment explaining how `data2_vaulted_string_with_id` was derived.
- Add assertions for unvaulted values to ensure they match their plaintext.
- Add round-trip tests for vault+unvault when no salt is used.
2023-10-23 15:46:00 -07:00
2d2211e4e1 Simplify filter_encryption test (#82062) 2023-10-23 19:11:31 +00:00
40263992df remove args passthru on role runme tests that use grep (#82060)
* varying verbosity was masking some first-pass test failures
2023-10-23 17:37:50 +00:00
b4566c18b3 Fix Jinja plugin deduplication (#82002)
for j2 plugins dedupe on path and  not basename
for j2 this is a container file , for other plugins file name == plugin name
2023-10-20 19:00:41 -04:00
e933d9d8a6 ansible-test - Fix parsing of cgroup entries 2023-10-19 15:30:32 -07:00
09d943445c Fix subversion integration test (#82029)
- Remove dependency on the htpasswd module (and thus passlib)
- Fix setup/teardown of the httpd process
- Fix cleanup of temporary directories
2023-10-19 13:49:00 -07:00
598a9307d7 var names not matching in example. (#82001)
Update to var name as example is not correct.
2023-10-19 12:41:51 -07:00
2e4f5d5ca0 Replace launchpad.net/api with api.launchpad.net @ apt_repository module
This patch is a refactoring change. It replaces one Launchpad endpoint URL with another on a subdomain. There is no functional effect to this whatsoever.

PR #81978

Refs:
* https://github.com/ansible/ansible/pull/81978#issuecomment-1767062178
* https://bugs.launchpad.net/launchpad/+bug/2039251/comments/12
2023-10-19 01:33:11 +02:00
37cee8bdfc ansible-test - Remove special cryptography install (#82008)
Python 3.10 is the minimum version on the controller, and it requires openssl 1.1.1 or later.

As a result, there's no need to check the openssl version any longer.
2023-10-18 10:52:18 -07:00
74f6e6a134 Update apt.py (#81975)
updating documentation
2023-10-17 11:58:04 -04:00
22568305d6 Add ignore invalid options override for mod wrapper (#81899)
Adds an option that can have an action plugin tell the module to ignore
options that do not fit its arg spec. This is to enable support for core
running modules that exist outside of the collection that may not be new
enough to support some of the options supplied to it.
2023-10-17 11:05:21 -04:00
5812cabaf5 Fix typos in builtin modules (#81969) 2023-10-13 20:37:58 -07:00
4f04df75cc Fix outdated S3 URLs (#81964)
We should always use the CloudFront backed endpoint (ci-files) not the direct S3 bucket reference (ansible-ci-files).
2023-10-12 19:28:40 -07:00
f5c742cdfd ansible-test - Clean up old Python 2 compat code (#81962)
* Update generated code __future__ import

* Remove Python 2.x compat from compile sanity test

* Remove __metaclass__ from pylint good names list

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

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

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

* Remove Python 2.x compat from validate-modules

* Remove Python 2.x compat from pylint plugins

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

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

* Remove obsolete Python 2.x comment

* Remove obsolete ansible-test Python 2.x support

* Remove unused bootstrap script functions

* Keep mypy happy

* Remove unused imports

* Keep pylint happy
2023-10-11 19:04:30 -07:00
3ae8541133 Update boilerplate in galaxy network templates (#81959) 2023-10-11 18:32:57 -07:00
3f607359de Remove obsolete compat code from integration tests (#81961)
Also fix up boilerplate for non .py extension files that contain Python code.
2023-10-11 18:22:33 -07:00
40e4c69724 Cleanup the hacking directory a bit (#81960)
* Clean up hacking/ansible-profile script

Also rename the script so it has a `.py` extension.

* Remove test-module symlink

Use the test-module.py script instead.
2023-10-11 17:44:42 -07:00
9295bb5b5d Unit test cleanup (#81958)
Remove obsolete Python 2.7 and 3.6 support code and fix up existing tests.
2023-10-11 17:31:04 -07:00
fd0f48e99d ansible-test - Update base/default containers (#81957) 2023-10-11 17:17:11 -07:00
d8484f0af7 Update default test container Python to 3.12 and support for PyLint 3.0.1 (#81953)
* temporary PyLint plugin to mask 3.12 finalizer noise

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

* ansible-test - Update pylint requirements

* ansible-test - Remove obsoleted changelog entry

* Add changelog fragment for pylint work-around
2023-10-11 13:04:22 -07:00
d2ba76c117 Remove Python < 3.5 selectors fallbacks (#81872) 2023-10-11 08:36:20 -07:00
46623b0a96 Deprecate pycompat24 (#81896) 2023-10-10 12:00:05 -04:00
350a394185 Remove Python 2 importlib.import_module compat (#81879) 2023-10-10 11:52:47 -04:00
92d2c66db2 Remove py2 support from urls.py (#81880) 2023-10-09 11:35:50 -05:00
858a3dbaad Fix example in strftime filter plugin help (#81696)
* Move the timestamp example to to_datetime.yml and be more verbose in its description
2023-10-09 08:55:06 -07:00
8a5ccc9d63 ansible-galaxy - fix traceback error for invalid req file (#81917)
Provide a better error message when encountering a YAML requirements file that is not a dictionary or list.

Fixes: #81901
2023-10-05 12:03:01 -07:00
976067c15f Add more winrm coverage (#81923) 2023-10-06 04:55:47 +10:00
282908c57e Add test coverage for winrm (#81910) 2023-10-06 01:28:12 +10:00
16b23d6779 Rename boilerplate sanity test (#81903)
The test covers more than just future boilerplate, so the shorter name is more appropriate.
2023-10-04 15:33:12 -07:00
9f899f9492 Require from __future__ import annotations (#81902) 2023-10-04 22:11:17 +00:00
921efce43a ansible-test - Remove more Python 2.7 / 3.6 support (#81898) 2023-10-04 11:32:31 -07:00
dfc62589f6 win_fetch - improve test time by not scanning Win dir (#81884) 2023-10-05 00:57:39 +10:00
c0eefa955a docs: update error message (#81554)
* Reword the error message when the module fails to parse parameters
  in JSON format
* misc typo fixes

Fixes: #81188

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-10-04 14:49:03 +00:00
d67d8bd823 Misc typo fixes in connection plugin (#81883) 2023-10-04 06:54:50 -07:00
b94ee1cefd Drop Python 2.7 and Python 3.6 support (#81866)
* Drop Python 2.7 and Python 3.6 support

* Remove obsolete _json_compat
2023-10-03 21:52:38 +00:00
c1343cc304 switch available_hosts to frozenset from list in ansible-inventory (#81870)
* major speedup large inventories, since it's consulted iteratively
2023-10-03 17:20:14 -04:00
debf2be913 optimize host_group_vars and vars plugin loading (#79945)
* Improve host_group_vars efficiency:

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

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

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

Add a test for host_group_vars and legacy plugin loading

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

* changelog

* Add a new is_stateless attribute to the vars plugin baseclass

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

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

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

refactor under a single 'if cache:' statement

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

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

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

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

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

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

* add plugin instance cache using the path to plugin loader

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

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

rename attribute again

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

* Deprecate v2 vars plugins

* Refactor to use the cache in existing plugin loader methods

Rename the attribute again

Refactor host_group_vars with requested changes

Make changelog a bugfixes fragment

Add a deprecation fragment for v2 vars plugins.

Add type hints

* unbreak group_vars

* Apply suggestions from code review

* misc tweaks

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

* handle KeyError from missing stage option

---------

Co-authored-by: Matt Davis <mrd@redhat.com>
2023-10-03 16:24:06 -04:00
9b3ed5ec68 Properly template tags in parent blocks (#81624)
When templating tags (which happens outside of standard `post_validate`) we
need to template each object in the inheritance chain and set the templated
values on those objects individually. That way when `task.tags` is called the
`extend` functionality properly picks up the templated values of all
parents into one flatten list.

Fixes #81053
2023-10-03 15:07:26 -04:00
304e63d76e Add family fallback for Amzn to register as RedHat (#81755)
* Add family fallback for Amzn to register as RedHat

Fixes: #80882

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-10-03 18:54:14 +00:00
2d5861c185 run_once: unnotify hosts on handlers that are not run (#81667)
Fixes #81666
2023-10-03 14:43:46 -04:00
000cf1dd46 Update the test containers to include Python3.12.0 final (#81858) 2023-10-03 10:46:58 -07:00
b3408ab80b Fix dnf module crash for non-existent url (#81801)
* ci_complete ci_coverage
2023-10-03 12:37:34 -04:00
116766ac3e Add intentional tests for dnf group remove (#81739)
* Add intentional tests for dnf group remove

* Copy tests from yum
2023-10-03 12:34:07 -04:00
b7903669b4 ansible-test - Update distro containers (#81851)
* ansible-test - Update distro containers

* Update the alpine3 container to Python 3.11

* Update changelog
2023-10-03 16:33:37 +00:00
20f17687da ansible-test - Invoke container sleep through env (#81853) 2023-10-03 08:27:55 -07:00
d8f791d88c Bump sanity test requirements for 3.12 (#81846) 2023-10-03 06:38:49 -07:00
ce3954ba74 Bump sanity test requirements for 3.12 (#81843) 2023-10-03 06:18:32 -07:00
ec265ec08a Bump coverage.py to v7.3.2 in ansible-test (#81844) 2023-10-02 20:45:57 +00:00
f31c287348 ansible-test - Improve compatibility with pylint 3 (#81841) 2023-10-02 13:05:39 -07:00
e756e359e0 Remove deprecated JINJA2_NATIVE_WARNING env var (#81720)
Fixes #81714
2023-10-02 15:57:17 -04:00
ab6a544e86 Import role public (#81772)
revert to previous behavior to push vars to play at compile time
add `public` parameter to allow per import control of exporting (vs just the global config)

Co-authored-by: tchernomax <maxime.deroucy@gmail.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2023-10-02 15:42:00 -04:00
e78cc1e602 Install upgraded crun from edge (#81833) 2023-10-02 14:30:31 -04:00
7fab552563 Fix reporting role as not found when remote_data is None (#81829) 2023-10-02 09:11:12 -07:00
a82dc06116 Update winrm.py (#81817)
fixes some of the issues in #81808
2023-10-02 09:33:11 -04:00
8bf1a41d58 Fixed typos in winrm.py file (#81825)
bewteen ==> between
alligns ==> aligns
2023-10-02 06:32:13 -07:00
7109d392fd fixes spelling errors (#81814) 2023-10-02 09:27:47 -04:00
4d4c50f856 Provide more info about plugin in deprecation message (#81719)
Provide more information about plugin usage which needs to be
used instead of the deprecated plugin in the deprecation message.

Fixes: #80561

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-29 18:19:16 +00:00
27bbff7c22 Add count and mandatory_count parameters in regex_replace filter (#81775) 2023-09-29 10:33:13 -04:00
01d190f3d2 Add intentional tests for module_utils/yumdnf.py (#81776) 2023-09-29 07:48:25 +02:00
d6a356d7cd ansible-test - Update sanity test requirements (#81810) 2023-09-28 14:28:35 -07:00
55f27a579e systemd_service: add a note about module rename (#81803)
* The module systemd is renamed to systemd_service to maintain
  the scope of the module. Mention this in the module description.
* Misc typo fixes.

Fixes: #80917

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-29 05:20:15 +10:00
cb8cb8936a Update ansible-test containers
* Include Python 3.12rc3 and PowerShell 7.3.7
2023-09-28 10:24:03 -04:00
f22231de20 winrm - make command input more resiliant (#81538)
* winrm - make command input more resiliant

* Expand warning message
2023-09-26 22:46:48 +00:00
60c9660952 Add intentional tests for dnf install rpm when higher version is installed (#81740)
* Add intentional tests for dnf install rpm when higher version is installed

* ci_complete ci_coverage
2023-09-26 15:49:14 -04:00
68ab02a504 Test heuristic_log_sanitize (#81730)
* Test heuristic_log_sanitize. See #81689

* Add note about what this test is doing

* grammar

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

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2023-09-26 14:23:15 -05:00
f951c64ee9 Fix typo in finished.yml (#81784)
aysnc -> async
2023-09-26 12:19:10 -07:00
4071f3b803 file: add a note about follow=false (#81788)
While creating a symlink, we apply fs attributes changes
to the destination. But in case of a non-existent destination, we warn
the user. This warning message can be suppressed by setting follow=false.
Add a note of this behavior in the `follow` parameter.

Fixes: #50543

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-26 17:14:37 +00:00
ddf0311c63 Prevent roles from using symlinks to overwrite files outside of the installation directory (#81780)
* Sanitize linkname during role installs

* Add tests

* add clog frag
2023-09-26 11:32:19 -05:00
989ea7a9f0 Misc. fixes in base.yml (#81771)
* Convert Latin short forms to English wording
* Typo fixes
* Sentence rewording

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-26 11:15:14 -04:00
51f2ddd445 Extend mount info (#81768) 2023-09-26 11:12:03 -04:00
230f956e25 Add lineinfile integration test for removing a line that has already been removed (#81762)
ci_complete ci_coverage
2023-09-26 11:07:53 -04:00
7d9889fcb3 Fix typo in action_core.py (#81763)
Fixes typo 'obeys' vs 'objeys' in doc_fragments/action_core.py
2023-09-22 09:48:10 -07:00
85adaa76f1 Add integration test for copy with force=false when dest exists (#81756)
ci_complete ci_coverage
2023-09-22 09:53:24 -04:00
Val
91f94fb59d Daemonize follow-up fixes (#81584)
* Ensure binary data transmission in daemonize

* Add changelog fragment
2023-09-22 09:41:30 -04:00
3794612832 ansible-test - Skip pylint test on Python 3.12 (#81706) 2023-09-21 21:01:58 -07:00
2aef0406d4 ansible-galaxy fix scm dependency error (#81599)
* ansible-galaxy fix scm dependency error

  also changed usage of 'virtual colleciton' to actual type
  avoid error by filtering out virtual collections that dont have
expected properties

simplified as per webknjaz

* Update lib/ansible/galaxy/collection/__init__.py
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2023-09-21 15:49:30 -04:00
7c7385521e Harden the ansiballz and respawn python templates (#81753)
Harden our python templates for respawn and ansiballz around str literal quoting
2023-09-21 12:48:48 -07:00
9edf64eaeb Deprecating paramiko options in base config (#81593)
* Deprecating paramiko options in base config

 they exist in the plugin itself since 2.14

* clog
2023-09-21 15:47:53 -04:00
1e7f7875c6 Allow for searching handler subdir for included task via include_role (#81733)
Fixes #81722
2023-09-21 12:12:04 -07:00
86fd7026a8 Handle exceptions in interpreter discovery (#81745)
* Handle exceptions like AnsibleError, AnsibleConnectionFailure
  raise while interpreter discovery.

Fixes: #78264

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-21 11:13:40 -07:00
62c10199d1 Add intentional tests for dnf list (#81738)
ci_complete ci_coverage
2023-09-21 19:52:43 +02:00
9244b2bff8 Make sure paths are treated correctly when building collection files manifest (#81619)
* Make sure paths are correct when building collection files manifest

This commit makes sure the path of the files part of
the collection build manifest are correct.

This commit uses os.path.commonprefix instead of
dealing with strings.

Signed-off-by: Carlos Camacho <ccamacho@redhat.com>

Bugfix Pull Request
Fixes: #81618

* Revert the change note type to `minor_changes`

* Clarify the change note with user-oriented details

---------

Signed-off-by: Carlos Camacho <ccamacho@redhat.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2023-09-20 20:18:37 +02:00
e4b9f9c6ae tests: update CloudStack test container to version 1.7.0. (#81732) 2023-09-20 08:34:02 -07:00
7662a05085 Always allow "no-other-choice" pre-release dependencies when resolving collection dependency tree
PR #81606.

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

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

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

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

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

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

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2023-09-20 16:35:54 +02:00
4b7705b07a Remove deprecated APIs from ansible-doc (#81729)
* Removed add_collection_plugins
* Removed find_plugins

Fixes: #81716

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-19 16:48:33 -07:00
3ec7a6e0db Fix ansible-test issues with detecting docker host and forwarding ports (#81726)
* Properly detect docker host using ssh

* Disable ControlPath when creating SSH port forwards

* typo fix

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

* Add clog frag

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2023-09-19 12:10:52 -05:00
710c0a264e Typo in documentation then -> than (#81724) 2023-09-19 17:16:32 +02:00
0ea40e09d1 vars: handle exception in combine_vars (#81700)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-19 17:03:58 +02:00
f7234968d2 bump devel to 2.17.0.dev0 (#81712) 2023-09-18 16:24:44 -05:00
3252 changed files with 77562 additions and 52064 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,14 +54,12 @@ stages:
nameFormat: Python {0}
testFormat: units/{0}
targets:
- test: 2.7
- test: 3.6
- 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:
@ -70,43 +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 13.2
test: macos/13.2
- name: RHEL 7.9
test: rhel/7.9
- name: RHEL 8.8 py36
test: rhel/8.8@3.6
- name: RHEL 8.8 py311
test: rhel/8.8@3.11
- name: RHEL 9.2 py39
test: rhel/9.2@3.9
- name: RHEL 9.2 py311
test: rhel/9.2@3.11
- name: FreeBSD 13.2
test: freebsd/13.2
- 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 13.2
test: macos/13.2
- name: RHEL 8.8
test: rhel/8.8
- name: RHEL 9.2
test: rhel/9.2
- name: FreeBSD 13.2
test: freebsd/13.2
- 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
@ -114,54 +123,58 @@ stages:
- template: templates/matrix.yml # context/controller (ansible-test container management)
parameters:
targets:
- name: Alpine 3.18
test: alpine/3.18
- name: Fedora 38
test: fedora/38
- name: RHEL 8.8
test: rhel/8.8
- name: RHEL 9.2
test: rhel/9.2
- 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
test: alpine3
- name: CentOS 7
test: centos7
- name: Fedora 38
test: fedora38
- name: openSUSE 15
test: opensuse15
- 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
test: alpine3
- name: Fedora 38
test: fedora38
- 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:
@ -170,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:
@ -181,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: []
@ -193,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:
@ -205,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

@ -7,8 +7,7 @@ Keep in mind that Azure Pipelines does not enforce unique job display names (onl
It is up to pipeline authors to avoid name collisions when deviating from the recommended format.
"""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from __future__ import annotations
import os
import re

View File

@ -4,15 +4,16 @@ Upload code coverage reports to codecov.io.
Multiple coverage files from multiple languages are accepted and aggregated after upload.
Python coverage, as well as PowerShell and Python stubs can all be uploaded.
"""
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)
@ -42,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'):
@ -56,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

@ -1,8 +1,7 @@
#!/usr/bin/env python
"""Prepends a relative timestamp to each input line from stdin and writes it to stdout."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from __future__ import annotations
import sys
import time

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,22 +4,75 @@ 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 ?
By contributing you agree that these contributions are your own (or approved by your employer) and you grant a full, complete, irrevocable copyright license to all users and developers of the project, present and future, pursuant to the license of the project. You can also read the same [CLA](https://docs.ansible.com/ansible/latest/community/contributor_license_agreement.html) on the Ansible docsite.
By contributing to this project you agree to the [Developer Certificate of Origin (DCO)](#developer-certificate-of-origin-dco).
Please review the [Community Guide](https://docs.ansible.com/ansible/latest/community/index.html) for more information on contributing to Ansible.
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/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!
## DEVELOPER CERTIFICATE OF ORIGIN (DCO)
This document was created by the Linux Kernel community and is a simple statement that you, as a contributor, have the legal right to make the contribution.
```text
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
```

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:
@ -87,7 +72,7 @@ body:
[collections org]: /ansible-collections
placeholder: dnf, apt, yum, pip, user etc.
placeholder: dnf, apt, pip, user etc.
validations:
required: true
@ -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:
@ -139,7 +123,7 @@ body:
[collections org]: /ansible-collections
placeholder: dnf, apt, yum, pip, user etc.
placeholder: dnf, apt, pip, user etc.
validations:
required: true
@ -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

@ -1,25 +0,0 @@
##### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
##### ISSUE TYPE
<!--- Pick one below and delete the rest -->
- Bugfix Pull Request
- 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
```

1
.github/PULL_REQUEST_TEMPLATE.md vendored Symbolic link
View File

@ -0,0 +1 @@
PULL_REQUEST_TEMPLATE/Unclear purpose or motivation.md

View File

@ -0,0 +1,9 @@
##### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
<!--- Add "Fixes #1234" or steps to reproduce the problem if there is no corresponding issue -->
##### ISSUE TYPE
- Bugfix Pull Request

View File

@ -0,0 +1,9 @@
##### SUMMARY
<!--- Describe the change below, including rationale -->
<!--- Add "Fixes #1234" if there is a corresponding issue -->
##### ISSUE TYPE
- Docs Pull Request

View File

@ -0,0 +1,9 @@
##### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
<!--- Add "Fixes #1234" if there is a corresponding issue -->
##### ISSUE TYPE
- Feature Pull Request

View File

@ -0,0 +1 @@
Unclear purpose or motivation.md

View File

@ -0,0 +1,9 @@
##### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
<!--- Add "Fixes #1234" if there is a corresponding issue -->
##### ISSUE TYPE
- Test Pull Request

View File

@ -0,0 +1,14 @@
##### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
<!--- Add "Fixes #1234" or steps to reproduce the problem if there is no corresponding issue -->
##### ISSUE TYPE
<!--- Pick one below and delete the rest -->
- Bugfix Pull Request
- Docs Pull Request
- Feature Pull Request
- Test Pull Request

View File

@ -1,3 +1,7 @@
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
2.14.0 C'mon Everybody

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://github.com/ansible/community/wiki),
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/latest/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.15.0
ancestor: 2.18.0
releases: {}

View File

@ -1,2 +0,0 @@
minor_changes:
- tasks - the ``retries`` keyword can be specified without ``until`` in which case the task is retried until it succeeds but at most ``retries`` times (https://github.com/ansible/ansible/issues/20802)

View File

@ -1,3 +0,0 @@
minor_changes:
- CLI argument parsing - Automatically prepend to the help of CLI arguments that support being specified multiple times.
(https://github.com/ansible/ansible/issues/22396)

View File

@ -1,2 +0,0 @@
bugfixes:
- fetch - Handle unreachable errors properly (https://github.com/ansible/ansible/issues/27816)

View File

@ -1,4 +0,0 @@
---
minor_changes:
- "ansible-vault create: Now raises an error when opening the editor without
tty. The flag --skip-tty-check restores previous behaviour."

View File

@ -1,2 +0,0 @@
bugfixes:
- user - set expiration value correctly when unable to retrieve the current value from the system (https://github.com/ansible/ansible/issues/71916)

View File

@ -1,2 +0,0 @@
bugfixes:
- Prevent running same handler multiple times when included via ``include_role`` (https://github.com/ansible/ansible/issues/73643)

View File

@ -1,3 +0,0 @@
bugfixes:
- win_fetch - Add support for using file with wildcards in file name.
(https://github.com/ansible/ansible/issues/73128)

View File

@ -1,3 +0,0 @@
bugfixes:
- modules/user.py - Add check for valid directory when creating new user homedir (allows /dev/null as skeleton) (https://github.com/ansible/ansible/issues/75063)

View File

@ -1,6 +0,0 @@
---
bugfixes:
- >-
Fixed `pip` module failure in case of usage quotes for
`virtualenv_command` option for the venv command.
(https://github.com/ansible/ansible/issues/76372)

View File

@ -1,6 +0,0 @@
---
minor_changes:
- >-
Add ``GALAXY_COLLECTIONS_PATH_WARNING`` option to disable the warning
given by ``ansible-galaxy collection install`` when installing a collection
to a path that isn't in the configured collection paths.

View File

@ -1,6 +0,0 @@
---
bugfixes:
- template - Fix for formatting issues when a template path contains
valid jinja/strftime pattern (especially line break one) and
using the template path in ansible_managed
(https://github.com/ansible/ansible/pull/79129)

View File

@ -1,2 +0,0 @@
bugfixes:
- replace - handle exception when bad escape character is provided in replace (https://github.com/ansible/ansible/issues/79364).

View File

@ -1,2 +0,0 @@
bugfixes:
- module/role argument spec - validate the type for options that are None when the option is required or has a non-None default (https://github.com/ansible/ansible/issues/79656).

View File

@ -1,2 +0,0 @@
bugfixes:
- "ansible-test local change detection - use ``git merge-base <branch> HEAD`` instead of ``git merge-base --fork-point <branch>`` (https://github.com/ansible/ansible/pull/79734)."

View File

@ -1,2 +0,0 @@
bugfixes:
- setup gather_timeout - Fix timeout in get_mounts_facts for linux.

View File

@ -1,2 +0,0 @@
minor_changes:
- 'ansible_user_module - tweaked macos user defaults to reflect expected defaults (https://github.com/ansible/ansible/issues/44316)'

View File

@ -1,5 +0,0 @@
bugfixes:
- ansiballz - Prevent issue where the time on the control host could
change part way through building the ansiballz file, potentially causing
a pre-1980 date to be used during ansiballz unpacking leading to a zip
file error (https://github.com/ansible/ansible/issues/80089)

View File

@ -1,3 +0,0 @@
bugfixes:
- file modules - Make symbolic modes with X use the computed permission, not original file (https://github.com/ansible/ansible/issues/80128)
- copy unit tests - Fixing "dir all perms" documentation and formatting for easier reading.

View File

@ -1,2 +0,0 @@
bugfixes:
- iptables - remove default rule creation when creating iptables chain to be more similar to the command line utility (https://github.com/ansible/ansible/issues/80256).

View File

@ -1,4 +0,0 @@
bugfixes:
- Display - Defensively configure writing to stdout and stderr with a custom encoding error handler that will replace invalid characters
while providing a deprecation warning that non-utf8 text will result in an error in a future version.
- module responses - Ensure that module responses are utf-8 adhereing to JSON RFC and expectations of the core code.

View File

@ -1,2 +0,0 @@
bugfixes:
- ansible-galaxy - reduce API calls to servers by fetching signatures only for final candidates.

View File

@ -1,2 +0,0 @@
bugfixes:
- "validate-modules sanity test - replace semantic markup parsing and validating code with the code from `antsibull-docs-parser 0.2.0 <https://github.com/ansible-community/antsibull-docs-parser/releases/tag/0.2.0>`__ (https://github.com/ansible/ansible/pull/80406)."

View File

@ -1,2 +0,0 @@
bugfixes:
- file modules - fix validating invalid symbolic modes.

View File

@ -1,2 +0,0 @@
bugfixes:
- include_role - expose variables from parent roles to role's handlers (https://github.com/ansible/ansible/issues/80459)

View File

@ -1,3 +0,0 @@
---
minor_changes:
- include_vars - os.walk now follows symbolic links when traversing directories (https://github.com/ansible/ansible/pull/80460)

View File

@ -1,2 +0,0 @@
bugfixes:
- Fix post-validating looped task fields so the strategy uses the correct values after task execution.

View File

@ -1,3 +0,0 @@
bugfixes:
- pip module - Update module to prefer use of the python ``packaging`` and ``importlib.metadata`` modules due to ``pkg_resources`` being deprecated
(https://github.com/ansible/ansible/issues/80488)

View File

@ -1,3 +0,0 @@
bugfixes:
- syntax check - Limit ``--syntax-check`` to ``ansible-playbook`` only, as that is the only CLI affected by this argument
(https://github.com/ansible/ansible/issues/80506)

View File

@ -1,2 +0,0 @@
bugfixes:
- The ``hostname`` module now also updates both current and permanent hostname on OpenBSD. Before it only updated the permanent hostname (https://github.com/ansible/ansible/issues/80520).

View File

@ -1,2 +0,0 @@
minor_changes:
- cli - Added short option '-J' for asking for vault password (https://github.com/ansible/ansible/issues/80523).

View File

@ -1,2 +0,0 @@
bugfixes:
- "Properly disable ``jinja2_native`` in the template module when jinja2 override is used in the template (https://github.com/ansible/ansible/issues/80605)"

View File

@ -1,3 +0,0 @@
bugfixes:
- ansible-galaxy - fix installing signed collections (https://github.com/ansible/ansible/issues/80648).
- ansible-galaxy collection verify - fix verifying signed collections when the keyring is not configured.

View File

@ -1,2 +0,0 @@
minor_changes:
- ansible-galaxy - Remove internal configuration argument ``v3`` (https://github.com/ansible/ansible/pull/80721)

View File

@ -1,2 +0,0 @@
bugfixes:
- unarchive - fix unarchiving sources that are copied to the remote node using a relative temporory directory path (https://github.com/ansible/ansible/issues/80710).

View File

@ -1,4 +0,0 @@
minor_changes:
- Add Python type hints to the Display class (https://github.com/ansible/ansible/issues/80841)
bugfixes:
- vars_prompt - internally convert the ``unsafe`` value to ``bool``

View File

@ -1,4 +0,0 @@
bugfixes:
- "From issue https://github.com/ansible/ansible/issues/80880, when notifying a
handler from another handler, handler notifications must be registered
immediately as the flush_handler call is not recursive."

View File

@ -1,3 +0,0 @@
bugfixes:
- dnf5 - Update dnf5 module to handle API change for setting the download directory
(https://github.com/ansible/ansible/issues/80887)

View File

@ -1,3 +0,0 @@
bugfixes:
- ansible-galaxy - Fix variable type error when installing subdir collections
(https://github.com/ansible/ansible/issues/80943)

View File

@ -1,2 +0,0 @@
bugfixes:
- Fix ``ast`` deprecation warnings for ``Str`` and ``value.s`` when using Python 3.12.

View File

@ -1,2 +0,0 @@
bugfixes:
- distribution facts - fix Source Mage family mapping

View File

@ -1,2 +0,0 @@
bugfixes:
- templating - In the template action and lookup, use local jinja2 environment overlay overrides instead of mutating the templars environment

View File

@ -1,2 +0,0 @@
bugfixes:
- handlers - the ``listen`` keyword can affect only one handler with the same name, the last one defined as it is a case with the ``notify`` keyword (https://github.com/ansible/ansible/issues/81013)

View File

@ -1,2 +0,0 @@
bugfixes:
- "paramiko_ssh, psrp, and ssh connection plugins - ensure that all values for options that should be strings are actually converted to strings (https://github.com/ansible/ansible/pull/81029)."

View File

@ -1,2 +0,0 @@
bugfixes:
- "``ansible.module_utils.service`` - fix inter-process communication in ``daemonize()``"

View File

@ -1,5 +0,0 @@
---
minor_changes:
- Use ``importlib.resources.abc.TraversableResources`` instead of deprecated
``importlib.abc.TraversableResources`` where available
(https:/github.com/ansible/ansible/pull/81082).

View File

@ -1,2 +0,0 @@
minor_changes:
- blockinfile - add append_newline and prepend_newline options (https://github.com/ansible/ansible/issues/80835).

View File

@ -1,2 +0,0 @@
bugfixes:
- Inventory scripts parser not treat exception when getting hostsvar (https://github.com/ansible/ansible/issues/81103)

View File

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

View File

@ -1,2 +0,0 @@
bugfixes:
- pkg_mgr.py - Fix `ansible_pkg_mgr` is unknown in Kylin Linux (https://github.com/ansible/ansible/issues/81332)

View File

@ -1,4 +0,0 @@
bugfixes:
- "ansible-console - fix filtering by collection names when a collection search path was set (https://github.com/ansible/ansible/pull/81450)."
minor_changes:
- "ansible-doc - allow to filter listing of collections and metadata dump by more than one collection (https://github.com/ansible/ansible/pull/81450)."

View File

@ -1,2 +0,0 @@
bugfixes:
- Import ``FILE_ATTRIBUTES`` from ``ansible.module_utils.common.file`` in ``ansible.module_utils.basic`` instead of defining it twice.

View File

@ -1,5 +0,0 @@
minor_changes:
- ansible-galaxy - used to crash out with a "Errno 20 Not a directory" error when extracting files from a role when hitting a file with an illegal name (https://github.com/ansible/ansible/pull/81553). Now it gives a warning identifying the culprit file and the rule violation (e.g., ``my$class.jar`` has a ``$`` in the name) before crashing out, giving the user a chance to remove the invalid file and try again. (https://github.com/ansible/ansible/pull/81555).
known_issues:
- ansible-galaxy - dies in the middle of installing a role when that role contains Java inner classes (files with $ in the file name). This is by design, to exclude temporary or backup files. (https://github.com/ansible/ansible/pull/81553).

View File

@ -1,2 +0,0 @@
bugfixes:
- lib/ansible/utils/encrypt.py - remove unused private ``_LOCK`` (https://github.com/ansible/ansible/issues/81613)

View File

@ -1,2 +0,0 @@
bugfixes:
- Replace uses of ``configparser.ConfigParser.readfp()`` which was removed in Python 3.12 with ``configparser.ConfigParser.read_file()`` (https://github.com/ansible/ansible/issues/81656)

View File

@ -1,2 +0,0 @@
bugfixes:
- "blockinfile - avoid crash with Python 3 if creating the directory fails when ``create=true`` (https://github.com/ansible/ansible/pull/81662)."

View File

@ -1,2 +0,0 @@
minor_changes:
- Remove the ``CleansingNodeVisitor`` class and its usage due to the templating changes that made it superfluous. Also simplify the ``Conditional`` class.

View File

@ -1,2 +0,0 @@
bugfixes:
- ansible-galaxy - fix installing collections from directories that have a trailing path separator (https://github.com/ansible/ansible/issues/77803).

View File

@ -1,7 +0,0 @@
bugfixes:
- >-
``ansible-galaxy`` now considers all collection paths when identifying which collection requirements are already installed.
Use the ``COLLECTIONS_PATHS`` and ``COLLECTIONS_SCAN_SYS_PATHS`` config options to modify these.
Previously only the install path was considered when resolving the candidates.
The install path will remain the only one potentially modified.
(https://github.com/ansible/ansible/issues/79767, https://github.com/ansible/ansible/issues/81163)

View File

@ -1,2 +0,0 @@
minor_changes:
- ansible-test - remove Alpine 3.17 from remotes

View File

@ -1,8 +0,0 @@
bugfixes:
- The ``ansible-config init`` command now has a documentation description.
- The ``ansible-galaxy collection download`` command now has a documentation description.
- The ``ansible-galaxy collection verify`` command now has a documentation description.
- The ``ansible-inventory`` command command now has a documentation description (previously used as the epilog).
- The ``ansible-galaxy collection install`` command documentation is now visible (previously hidden by a decorator).
- The ``ansible-galaxy role install`` command documentation is now visible (previously hidden by a decorator).
- Fix ``ansible-config init`` man page option indentation.

View File

@ -1,6 +0,0 @@
minor_changes:
- >-
ansible-galaxy - Add a plural option to improve ignoring multiple signature error status codes
when installing or verifying collections. A space-separated list of error codes can follow
--ignore-signature-status-codes in addition to specifying --ignore-signature-status-code
multiple times (for example, ``--ignore-signature-status-codes NO_PUBKEY UNEXPECTED``).

View File

@ -1,2 +0,0 @@
minor_changes:
- Add a general ``GALAXY_SERVER_TIMEOUT`` config option for distribution servers (https://github.com/ansible/ansible/issues/79833).

View File

@ -1,2 +0,0 @@
minor_changes:
- Record ``removal_date`` in runtime metadata as a string instead of a date.

View File

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

View File

@ -1,2 +0,0 @@
bugfixes:
- ansible-test - Add support for ``argcomplete`` version 3.

View File

@ -1,2 +0,0 @@
minor_changes:
- ansible-test - Use a context manager to perform cleanup at exit instead of using the built-in ``atexit`` module.

View File

@ -1,7 +0,0 @@
---
minor_changes:
- ansible-test — Python 3.8–3.12 will use ``coverage`` v7.3.0.
- ansible-test — ``coverage`` v6.5.0 is to be used only under Python 3.7.
...

View File

@ -1,2 +0,0 @@
minor_changes:
- ansible-test - Update the ``default`` containers.

View File

@ -1,5 +0,0 @@
minor_changes:
- ansible-test - Removed the deprecated ``--docker-no-pull`` option.
- ansible-test - Removed the deprecated ``--no-pip-check`` option.
- ansible-test - Removed the deprecated ``foreman`` test plugin.
- ansible-test - Removed the deprecated ``govcsim`` support from the ``vcenter`` test plugin.

View File

@ -1,2 +0,0 @@
minor_changes:
- ansible-test - The openSUSE test container has been updated to openSUSE Leap 15.5.

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