If Python 3 is installed on Debian 8 Ansible cannot run, as the version
is too old (3.4)
* Add integration test for python interpreter discovery on Debian 8
* fix test issue on Debian 9, add changelog
* un"fix" not broken test :D
Co-authored-by: Fabian Klemp <fabian.klemp@elara-gmbh.de>
Co-authored-by: Matt Davis <mrd@redhat.com>
(cherry picked from commit 437a08eb6d)
Co-authored-by: elara-leitstellentechnik <elara-leitstellentechnik@users.noreply.github.com>
Homebrew's default install location for macOS on ARM is /opt/homebrew.
Source: https://docs.brew.sh/FAQ
On a Mac M1 (Apple Silicon), homebrew will be installed at
/opt/homebrew/bin/brew.
When FIPs mode is enable on centos-8, we are not able to load md5
functions.
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
(cherry picked from commit a95213d2f5)
Co-authored-by: Paul Belanger <pabelanger@redhat.com>
Co-authored-by: Paul Belanger <pabelanger@redhat.com>
For connection units tests, if the `__init__.py` file is modified, the trailing separator was
not added, making the target invalid.
(cherry picked from commit 7b79b69369)
Co-authored-by: Sam Doran <sdoran@redhat.com>
continue with local facts vs at script error
actually capture execution errors
better error messages in general
add more local facts tests
fixes#52427
(cherry picked from commit 9db557e431)
When using "use_regex: yes" and setting an excludes: without
specifying a pattern: the existing code passes the file-glob '*' to
the regex matcher. This results in an internal invalid-regex
exception being thrown.
This maintains the old semantics of a default match-all for pattern:
but switches the default to '.*' when use_regex is specified.
The code made sense as-is before excludes: was added (2.5). In that
case, it made no sense to set use_regex but *not* set a pattern.
However, with excludes: it now makes sense to only want to exclude a
given regex but not specify a specific matching pattern.
Closes: #50067
* moved change to new location
added changelog
* Update lib/ansible/modules/find.py
Co-authored-by: Ian Wienand <iwienand@redhat.com>
(cherry picked from commit 089d0a0508)
* Fix up bad rebase, nuke duplicate "elements:" lines
Signed-off-by: Rick Elrod <rick@elrod.me>
Co-authored-by: Rick Elrod <rick@elrod.me>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Sam Doran <sdoran@redhat.com>
* fix error msg on bad subset
* added test
* handle more raised but not handled fact exceptions
(cherry picked from commit 4a82e2c486)
* Update fix_setup_bad_subset.yml
Co-authored-by: Rick Elrod <rick@elrod.me>
Treat core and collections module_utils imports nested within any Python block statement (eg, `try`, `if`) as optional. This allows Ansible modules to implement runtime fallback behavior for missing module_utils (eg from a newer version of ansible-core), where previously, the module payload builder would always fail when unable to locate a module_util (regardless of any runtime behavior the module may implement).
* sanity test fixes
(cherry picked from commit 3e1f6484d7)
* Add tests for the redirect list
* test redirect list for builtin module
* test redirect list for redirected builtin module
* test redirect list for collection module
* test redirect list for redirected collection module
* test redirect list for legacy module
* changelog
(cherry picked from commit 48c0fbd1cb)
* Ensure task from the worker is finalized/squashed. Fixes#57399. Fixes#49942
(cherry picked from commit 832631b)
Co-authored-by: Matt Martz <matt@sivel.net>
* move firewalld to ansible.posix (#70692)
Signed-off-by: Adam Miller <admiller@redhat.com>
(cherry picked from commit b479adddce)
* Update changelogs/fragments/73689-move-firewalld-to-ansible-posix.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Adam Miller <admiller@redhat.com>
Change:
- Fix regression: unhandled exception when given inventory directory
is empty or contains empty subdirectories.
- Fix unhandled exception when limit file is actually a directory
instead of a file.
- Fix inventory tests which previously could never fail due to missing
`set -e`. Fixed up tests that failed after `set -e` was added. Added
several tests.
Test Plan:
- New tests
- Fixed existing tests which previously could never fail
Tickets:
- Fixes#73658
Signed-off-by: Rick Elrod <rick@elrod.me>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit fa046d302c)
Co-authored-by: Rick Elrod <rick@elrod.me>
* [stable-2.10] Normalize ConfigParser between Python2 and Python3 (#73715)
* Normalize config parser between py2 and py3
* Add tests and changelog
* Use different config entry, since we supply certain env vars
(cherry picked from commit 950ab74)
* Update config entry
* galaxy: restore left hand slicing in assignment
Fix 'ansible-galaxy role init --role-skeleton=role-skeleton' when the role skeleton
contains an ignored directory.
The issue was because the 'dirs' variable was changed to reference a different list,
but needs to be mutated instead to stop os.walk from traversing ignored directories.
Fixes: #71977
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit eb72c36a71)
Co-authored-by: manas-init <70483021+manas-init@users.noreply.github.com>
* find module - stop traversing directories with os.walk when depth is already exceeded (#73718)
(cherry picked from commit 8628c12f30)
* Update tests since there are fewer prior tasks creating files/directories
Ensure `yamllint`'s `check_assignment()` correctly ignore the
attribute assignment. Those don't have any `.id` attribute and will
trigger an `AttributeError` exception.
See: https://github.com/ansible/ansible/pull/73322
(cherry picked from commit 0a8d5c0983)
Until now, the lookup plugin returned a byte string.
Changed this to output a unicode string instead.
(cherry picked from commit d0fda3e901)
Co-authored-by: Alexander Sowitzki <asowitzk@redhat.com>
Change:
- podman > 2 && < 2.2 does not support "images --format {{json .}}"
- podman also now outputs images JSON differently than docker
- Work around both of the above.
Test Plan:
- Tested with podman 2.0.6 in Fedora 31.
Signed-off-by: Rick Elrod <rick@elrod.me>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
(cherry picked from commit 0332046699)
Co-authored-by: Rick Elrod <rick@elrod.me>
Only add data when there is data to add
also avoid clobbering existing data with empty file
fixes#45843
* remove redundant code, update comments
* fix mock dataloader, original does not return None
* added test
(cherry picked from commit ec8a556538)
* Add changelog and fixtures for AlmaLinux support
Co-authored-by: Christoph Schug <com+github@schug.net>
(cherry picked from commit 2f5c83dfb1)
Co-authored-by: Sam Doran <sdoran@redhat.com>
When the pause module is run in the background and seconds parameter is provided,
do not warn.
* Add tests
* Fix existing tests
The test wasn't failing when it should have.
(cherry picked from commit 0e6c334115)
Co-authored-by: Sam Doran <sdoran@redhat.com>