Commit Graph

3286 Commits (devel)

Author SHA1 Message Date
Abhijeet Kasurde b70248eb22
Warn if the binary is unavailable using get_bin_path (#83258)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
4 days ago
Brian Coca 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>
4 days ago
Abhijeet Kasurde 036d14f1e6
Darwin: add unit tests for hardware fact gathering (#83212)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 weeks ago
Peter Whall 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
2 weeks ago
Brian Coca aed8c080f6
ansible-galaxy, clarify licensing for 'init' templates and results (#83175) 2 weeks ago
Matt Martz cd9c4eb5a6
Gather sysinfo facts on s390 (#83157) 3 weeks ago
Abhijeet Kasurde bb138b1f6e
play_context: remove deprecated PlayContext.verbosity (#82993)
Fixes: #82945

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 month ago
Sloane Hertel 971c49b711
Remove deprecated vars keyword syntax as a list of dictionaries, it is now required to be a single dictionary (#82980)
Update unit test
1 month ago
Abhijeet Kasurde 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>
1 month ago
Sloane Hertel 478e139195
remove nonexistent url from role templates (#82933)
* Remove obsolete v1 link for role platforms from the role templates
* Delete platforms block entirely
2 months ago
Abhijeet Kasurde 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>
2 months ago
snipfoo 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
2 months ago
Abhijeet Kasurde 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>
2 months ago
Abhijeet Kasurde 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>
2 months ago
Sloane Hertel 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
2 months ago
tobixx 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>
2 months ago
Abhijeet Kasurde 6439627ce4
test_apt: migrate from unittest to pytest (#82666)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 months ago
carrychair 8b0f2ad9c5
remove repetitive words (#82799)
Signed-off-by: carrychair <linghuchong404@gmail.com>
2 months ago
Matt Martz e0c91af45f
Remove os.environ compat for py2 and deprecate ansible.utils.py3compat (#82794) 2 months ago
Abhijeet Kasurde 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>
2 months ago
Jordan Borean 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.
2 months ago
Abhijeet Kasurde dd44449b6e
Use of constant for 644 permission variable (#82762)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
3 months ago
Abhijeet Kasurde 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>
3 months ago
Orion Poplawski 38006103dc
Fixed typo 'must by' to 'must be' (#82769) 3 months ago
Abhijeet Kasurde 8750a1f9ac
test: migrate iptables tests from unittests to pytest (#82647)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
3 months ago
tikfj 4edd6ba04f
Add MIRACLE LINUX as RedHat OS Family (#82722)
Co-authored-by: Taiki Fujiwara <taiki.fujiwara@miraclelinux>
3 months ago
Matt Martz 5566a655ae
Updates to interpreter discovery for 2.17 (#82420) 3 months ago
Abhijeet Kasurde 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>
3 months ago
Brian Coca 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>
4 months ago
Martin Krizek f024cf35d7
Remove the yum module, redirect it to dnf (#81895)
Fixes #81728
4 months ago
Yacht Shaver 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 }'
4 months ago
Mike Bonnet 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.
4 months ago
Martin Krizek 853423c270
test_encrypt: remove unreachable assertion (#82570)
We explicitly skip tests in environments where passlib is not available.
4 months ago
Sviatoslav Sydorenko (Святослав Сидоренко) 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.
4 months ago
Martin Krizek 3f74bc08ce
Remove crypt support from ansible.utils.encrypt (#81721)
Fixes #81717

Co-authored-by: Matt Clay <matt@mystile.com>
4 months ago
Harshvardhan Sharma 623e0eee42
Add Alp-Dolomite to Suse family list (#82496) 4 months ago
Sloane Hertel 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
4 months ago
Matt Clay 71a5212586 Add skips for encrypt unit tests for Python 3.13 4 months ago
Matt Clay e1bcb8a534 Remove unused unit test code 5 months ago
Brian Coca 29b2405b84
Revert "Fix older external connection plugins without _sub_plugin declaration (#79372)" (#82473)
This reverts commit ef1e01aa8b.

broken tests
5 months ago
J vanBemmel 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
5 months ago
Sloane Hertel fe81164fe5
ansible-galaxy - fix exit code for failed role import (#82193) 5 months ago
Brian Coca 3d9e5c8b9d
fix pc misuse (#82157)
use the more up to date 'task' as play_context only has the 'initial' values.
6 months ago
Matt Clay 0e6942a4d7
Remove unused unit test code (#82168) 6 months ago
Matt Clay 98407fc00e Remove unused validate-modules unit test code 6 months ago
Matt Clay dae4e2f07f
Remove unused/unreachable unit test code (#82160) 6 months ago
Matt Clay 0be33551d7
Remove unit tests dependent on systemd bindings (#82161)
These do no not run as part of our test suite.
6 months ago
Abhijeet Kasurde 78c16d983e Remove type_regex testcase
This is leftover testcase for type checker regex removed in
https://github.com/ansible/ansible/pull/82153

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 months ago
Matt Clay 916a20fccd Ignore coverage of test code that does not run 6 months ago
JustinWayland dec9eeb2e5
Remove create_new_password parameter in CLI.build_vault_ids (#82066)
* Remove unused argument in call to build_vault_ids

* Remove obsolete build_vault_ids tests

* Change tests to account for argument removal

* Remove redundant test
7 months ago