Commit Graph

54318 Commits

Author SHA1 Message Date
Sloane Hertel 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
Brian Coca 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
mansoor 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
Brian Coca 5c804cbf6f
ssh docs fixes (#82902) 2024-03-26 17:07:32 -04:00
Brian Coca 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
Sloane Hertel 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
Abhijeet Kasurde 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
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
2024-03-26 09:12:17 -05:00
Abhijeet Kasurde 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
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>
2024-03-25 14:50:37 +00:00
Abhijeet Kasurde 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
Matt Clay ca168eb367 ansible-test - Fix Alpine libexpat bootstrapping 2024-03-22 12:27:35 -07:00
Brian Coca 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
Matt Clay b4d67adfda ansible-test - Update distro containers to 7.1.0 2024-03-21 21:40:01 -07:00
Matt Clay 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
Abhijeet Kasurde 73701004b0
ansible-test - Add alpine 3.19 (#82115) 2024-03-22 01:02:29 +00:00
Felix Fontein c0821346fc
Do not mangle plugin names in collections that start with an underscore. (#82574) 2024-03-21 19:40:46 -04:00
Felix Fontein 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
Matt Clay 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
Matt Clay a192193c55 Limit Alpine 3.18 test hacks to that version 2024-03-21 12:05:05 -07:00
Brian Coca 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
Abhijeet Kasurde 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
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>
2024-03-21 09:37:18 -07:00
Brian Coca 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
Matt Clay 2b1a5dd7a0 Remove outdated constraint for paramiko setup 2024-03-20 19:09:05 -07:00
Felix Fontein 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
Felix Fontein 0c9f1989a7 Do not treat leading underscore in plugin names as attempted deprecation. 2024-03-20 14:01:50 -07:00
Jordan Borean 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
Jordan Borean 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
Abhijeet Kasurde 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
René Moser c5557ad872
fix wording in error msg (#82848) 2024-03-19 11:27:40 -04:00
Jordan Borean 25c0dc50a2
Fix up to_datetime timedelta seconds docs (#82826) 2024-03-19 11:04:11 -04:00
neofright 732df49e46
Update zip.yml (#82840)
Fix typo of mydcit instead of mydict.
2024-03-19 07:59:47 -07:00
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
2024-03-18 10:58:00 -04:00
Sloane Hertel 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
sedrubal 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
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>
2024-03-15 14:50:38 -04:00
Andrew Klychkov 92df664806
[DOCS] README: update working groups link (#82254) 2024-03-15 16:49:33 +00:00
Abhijeet Kasurde 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
Abhijeet Kasurde 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
Abhijeet Kasurde 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
Rudnei Bertol Junior 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
Matt Martz 86f48a526a
Install crun from Alpine 3.19 for known musl compatibility (#82812) 2024-03-13 13:31:59 -05:00
Abhijeet Kasurde 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
0x546f6d-W 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
Jordan Borean 936e757478
Document no until support for meta (#82795) 2024-03-12 11:02:38 -04:00
carrychair 8b0f2ad9c5
remove repetitive words (#82799)
Signed-off-by: carrychair <linghuchong404@gmail.com>
2024-03-12 07:40:27 -07:00
Martin Krizek f1ded0f417
dnf: utilize the API for the installed checks (#82725)
Fixes #71808
Fixes #76463
Fixes #81018
2024-03-08 09:43:42 +01:00
Martin Krizek a28709f92d
dnf: fix installing a package based the file it provides (#82744)
Fixes #82461
2024-03-08 08:25:44 +01:00