* Fix collection redirects for filter and test plugins (#77210)
* Fix collection redirects for jinja2 filters/tests
* Handle recursive redirects
Co-authored-by: Matt Martz <matt@sivel.net>
(cherry picked from commit 8063643b4c)
* The error message is only capitalized on 2.13. Make test more flexible.
* Fix 'ansible-galaxy collection verify' to report files/directories not listed in the FILES.json
(cherry picked from commit a1d467dbb2)
* changelog
(cherry picked from commit 3d49d6f69e)
* Use full python package for ansiballz cache filenames
* Be a little more explicit about test goals
(cherry picked from commit 8cbe143)
Co-authored-by: Matt Martz <matt@sivel.net>
This works around issues on RHEL 7.9 when an old version of pexpect is installed from an OS package.
(cherry picked from commit 27fe26edbf)
Co-authored-by: Matt Clay <matt@mystile.com>
ci_complete
ssh plugin, use 'correct' information source in all cases
* still fallback to pc
* added inventory to new test
* undef var can still show as parser error on pc
now task_exectuer has a more accurate error handling
(cherry picked from commit be19863e44)
* updated tests to conform to new block inheritance
Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
(cherry picked from commit b1d6750e8b)
* unarchive: fix non-english locales
For GNU Gettext, the LANGUAGE environment variable takes precedence over LANG or LC_ALL. On systems where LANGUAGE was set to a non-english locale, the output of the tar command therefore not understood and the module failed silently ("changed": false, but the archive was not extracted).
* add tests
* changelog
(cherry picked from commit 49e1cb9)
Co-authored-by: Jonathan Neuhauser <jonathan.hofinger@gmx.de>
Co-authored-by: Jonathan Neuhauser <jonathan.hofinger@gmx.de>
* fix facts delegation loop overwrite
partial revert of change to allow facts to be present in each loop iteration
was not needed in final results as result processing alreayd had the disctiontion
and ended up breaking the assumptions in the calling code.
fixes#76676
(cherry picked from commit c9d3518d2f)
* ansible-test - Defer loading of completion entries.
This avoids a traceback when running ansible-test outside of a supported directory.
(cherry picked from commit e9ffcf3c85)
Co-authored-by: Matt Clay <mclay@redhat.com>
* handle 'fun' control paths by quoting the option when passed to ssh cli
Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit aa022dba2d)
When we introduced an include parameter to the unarchive module, we
inadvertenly flipped the exclusion logic. This flip meant that the
unarchive module started rejecting files that should be extracted.
This commit flips the bad logic and adds some tests that will make
sure things do not go bad again.
(cherry picked from commit f92830d16e)
* Update dnf tests to reflect new behavior.
Previously dnf would report there was nothing to do when trying to install a package from the cache when it was not present.
A recent update to dnf has changed this behavior to match yum, resulting in a failure instead.
* Allow dnf to fail or report no changes.
(cherry picked from commit c1df36e3ae)
Co-authored-by: Matt Clay <mclay@redhat.com>
* Disable the _distutils_hack in newer setuptools. Doesn't fix the underlying issue of the venv finding the _distutils_hack of a setuptools that is not its own.
ci_complete
* re-throw blanket
(cherry picked from commit fa617fcd7b)
* Skip recursive suboption validation if sub_parameters is not a dictionary
* Ensure sub parameter elements is a sequence to prevent iterating over string characters and causing duplicate error messages for the same param
(cherry picked from commit b5ed41edb3)
- Use `fallible==0.0.1a2` instead of `black==19.10b`
- Test on both Python 2 and 3.
(cherry picked from commit b6725ec6c9)
Co-authored-by: Matt Clay <matt@mystile.com>
* [stable-2.12] ansible-test - Fix Python real prefix detection.
(cherry picked from commit b4cbe1adcf)
* ansible-test - Remove duplicate code.
(cherry picked from commit b9694ce4fb)
* Overhaul ansible-test integration tests. (#76111)
* Overhaul ansible-test integration tests.
* ansible-test - Fix import test pyyaml usage.
* ansible-test - Remove unused import.
* ansible-test - Fix traceback when pip is unavailable.
* ansible-test - Fix typo in port forwarding message.
* ansible-test - Fix controller logic in requirements install.
* Fix unit tests in ansible-test integration test.
Unit tests are now run for available Python versions which
provide `virtualenv` (Python 2.x) or `venv` (Python 3.x).
(cherry picked from commit cae7d2a671)
* ansible-test - Fix import test on old Pythons. (#76137)
(cherry picked from commit cd64e0b070)
* Skip ansible-test tests on Python 2.6.
* Don't use output_dir in user tests
* Move blockinfile tests from using output_dir to depending on setup_remote_tmp_dir
* Don't use output_dir in git tests
* Don't use output_dir in uri tests
(cherry picked from commit e40a0e5)
Co-authored-by: Matt Martz <matt@sivel.net>
Switch to a different repo that isn't giving 503 errors since GitHub hasn't fixed the issue yet.
(cherry picked from commit 319b50f04c)
Co-authored-by: Matt Clay <matt@mystile.com>
* Use the task dependency chain to compile the role instead of the parent role's _parents list
* keep existing role inheritance, but limit it to roles in the current task dependency chain
* Test getting role parents recursively by using the current task dependency chain
* changelog
* add tests for fail filter
also tests that fail does not block inspectability
* add fail filter
fallback message is a bit clunky,
since you can't invoke a filter without specifying an input.
That is, "{{ fail }}" doesn't work,
so you have to do "{{ None | fail }}"
* document 'fail' filter
* add changelog fragment
* fail filter uses default message on Undefined or emptystring
makes it slightly easier to use the default message:
```diff
- "{{ None | fail }}"
+ "{{ '' | fail }}"
```
and the user sees a slightly more relevant message
if the message itself is undefined:
```diff
- The error was: {{ failmsg | fail }}: 'failmsg' is undefined
+ The error was: {{ failmsg | fail }}: Mandatory variable has not been overridden
```
* rebuild as the builtin `Undefined`
* harmonise `hint` parameter for make_undefined with jinja
* use code block for documentation item
[ref](https://github.com/ansible/ansible/pull/75435#discussion_r707661035)
* rename to `undef` to expose less Python into the Jinja
[ref](https://github.com/ansible/ansible/pull/75435#pullrequestreview-757799031)
* explicitly instantiate undefined value now that it's possible
see I knew we would break something with reflection
* preserve test coverage of undefined variable
Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
Change:
- Remove only user-facing use of ANSIBLE_ASYNC_DIR.
- Remove two comments saying to change things that, apparently, we
aren't going to change...
Test Plan:
- ci_complete
Tickets:
- Fixes#74139
- Fixes#74138
- Refs #74226
Signed-off-by: Rick Elrod <rick@elrod.me>
* Fix test usage of `which python`.
Also use `command -v` instead of `which` where needed.
* Fix testing_formatter.sh file checking.
The index is longer expected to exist when generating it.
The generation script is run with `set -eux`.
* apt module: add option to allow package downgrades
* Add new option to module so users don't have to force downgrades which
is insecure and dangerous
* Add integration tests similar to upgrade integration tests
* Changelog
* Update changelog fragment
* Update changelogs/fragments/74852-apt-allow-downgrade.yaml
Co-authored-by: Amin Vakil <info@aminvakil.com>
* Update lib/ansible/modules/apt.py
Co-authored-by: Amin Vakil <info@aminvakil.com>
* Update lib/ansible/modules/apt.py
Co-authored-by: Amin Vakil <info@aminvakil.com>
Co-authored-by: Amin Vakil <info@aminvakil.com>