* ignore attributes in output
* ignore 'attributes' for json dump
* actually add file
* clog
* sometimtes its not a dict
* always ignore
* also allow validation to work on newer modules
* remove attributes doc
let existing overrides display, wont be full info but still pertinent info
though user will have to check newer versions
* Fix a bug with the dnf module not using all components of a package name when filtering to determine if it's installed
* changelog
* Simplify splitting on the last '.'
* Update lib/ansible/modules/dnf.py
(cherry picked from commit b541a148d5)
mostly for use with network_os
use 'remote is local' property as indicator
ensure task_vars are as expected in test
(cherry picked from commit 8d41b97329)
Test for the required binaries in the can_handle_archive() method and fail there. This
prevents failures for missing binaries unrelated to the archive type.
* Update missing zip binary message to match tar message
* Update unit tests
* Add integration tests
* Define packages based on the system rather than ignoring failures
(cherry picked from commit 004c33d9c5)
Co-authored-by: Sam Doran <sdoran@redhat.com>
* Improve handling of AnsibleModule arguments in validate-modules (#75332)
* Make sure AnsibleModule positional arguments are validated.
* Extract ANSIBLE_MODULE_CONSTURCTOR_ARGS with inspection.
* Remove no longer necessary return value.
* Fix PR #.
* argument_spec might not have been specified, as in community.general.xenserver_facts.
* Fix typo.
(cherry picked from commit 7726b70d9a)
* Make sure self doesn't end up in fake.args (#75403)
(cherry picked from commit 2455d82c14)
Co-authored-by: Matt Martz <matt@sivel.net>
* fix ssh cli defaults (#75245)
* fix ssh cli defaults
fixes#75221
(cherry picked from commit e5a2fe4c41)
* github conflict?
* removed retries backrpot
also removed tests since they rely on features that don't exist in this version
* fix: action _fixup_perms2 macos +a remote_paths in list() as it can be tuple
in `lib/ansible/plugin/action/__init__.py`'s `_fixup_perms2`,
`remote_paths` can be a list or tuple. however, the macos
specific attempt to use chmod +a attempts to concatenate
`remote_paths` with a list, which will fail if it is a tuple.
wrapping `remote_paths` in `list()` fixes this error.
* Update changelogs/fragments/74613-actionfixup_perms2_macos_remote_paths_ensure_list.yml
Co-authored-by: Rick Elrod <rick@elrod.me>
(cherry picked from commit df6554c4ec)
Co-authored-by: Shane St Savage <shane@axiomdatascience.com>
* Fix when evaluation on Native Jinja and Python 3.10
* Add unit test
* Add explaining comment
* Enable jinja2_native before tests
Co-Authored-By: Matt Martz <matt@sivel.net>
* Sanity
* Return native template module instead of modifying globals
Co-authored-by: Matt Martz <matt@sivel.net>
(cherry picked from commit 58e38044fe)
* Add packaging to requirement of ansible-test
Fix#75353
After requires_ansible field was added as mandatory to runtime.yml
file, ansible-test fails to check this field if it doesn't have
packaging module.
[1] https://github.com/ansible/galaxy-importer/pull/124
(cherry picked from commit 40ca87a963)
Co-authored-by: Sergey <sshnaidm@users.noreply.github.com>
* Improve the error handling code
Rather than multiple return paths, have a single return and set the message based
on the type of failure.
* Add another test for non-specific failures
* Reorganize tests so failure tests are in one tasks file
* Remove os.stat() call and add changelog.
(cherry picked from commit afe6eb574e)
Co-authored-by: Sam Doran <sdoran@redhat.com>
* module_common - handle cache directory creation collision
Occasionally multiple workers can try to create the cache directory if it exists. Catch the exception
and handle it.
* Just re-raise if it doesn't exist rather than trying again
* Use exists_ok rather than handling an exception
* Remove unused import and unused variable
* Go back to try/except but with OSError
Since we do not have split controller remote, this needs to be able to run in Python 2 in order
to be merged currently.
(cherry picked from commit 16a74b798c)
Co-authored-by: Sam Doran <sdoran@redhat.com>
ansible-test aws provider now creates and exposes a new tiny_prefix
variable to provide a shorter prefix for the AWS tests.
(cherry picked from commit 5b8fb4dcd3)
* Ensure we keep the original path as per cli
fixes#75126
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 60c9f045cc)
Since the task and connection both have the same 'retries' keyword, the task default
would override the connection value.
Do not pass 'retries' from the task to the connection options.
* Set ssh_connection retries default value back to 0
It was 0 before the move to config and was changed to 3 by accident.
(cherry picked from commit a8de35e131)
Co-authored-by: Sam Doran <sdoran@redhat.com>
* Use the module redirect_list when getting defaults for action plugins (#73864)
* Fix module-specific defaults in the gather_facts, package, and service action plugins.
* Handle ansible.legacy actions better in get_action_args_with_defaults
* Add tests for each action plugin
* Changelog
Fixes#72918
(cherry picked from commit 5640093f1c)
* Fix tests for < 3.8
* subversion - set LC_ALL for accurate command output parsing
When LC_ALL is not set, the output language of commands will differ based on locale. There
is a lot of history of trying to fix this. See the following pull requests:
https://github.com/ansible/ansible-modules-core/pull/4358https://github.com/ansible/ansible-modules-core/pull/4358
This patch attempts to fix this my setting LC_ALL to a UTF-8 locale. Setting LC_ALL to C reintroduces this bug https://github.com/ansible/ansible-modules-core/issues/4178.
I'm sure there are some problems I am not seeing with setting this to en_US.UTF-8, but that is
the only way I could find to fix this bug without reintriducing the bug mentioned above.
* Rather than setting locale, just check for matches before trying to get groups
This is a pragmatic solution to avoid the stack trace since setting the locale correctly
to ensure message parsing is accurate is problematic.
* Improve regexps for finding revision and URL
(cherry picked from commit a8cf0196f7)
Co-authored-by: Sam Doran <sdoran@redhat.com>
While mode is specified in check_mode, don't call lstat.
Since file may not present.
Fixes: #61185
(cherry picked from commit 7099657dd7)
Co-authored-by: Logistic Bot <logistic-bot@protonmail.com>
When an empty value is provided, no `version` attribute will exist on the `LooseVersion` or
`StrictVersion` object. We catch and handle this, but it's not immediatebly clear that an
AttributeError means an empty value was provided.
Specifically handle the case where value or version are empty and add more
helpful error messages.
Add integration tests.
(cherry picked from commit 71e33d2578)
Co-authored-by: Sam Doran <sdoran@redhat.com>