Commit Graph

6247 Commits (8bbcfebd5c7e5efeb9c8dc173a3fa5ebceab3df5)

Author SHA1 Message Date
Sloane Hertel b3968340a0
[2.12] Fix collection redirects for filter and test plugins (#77210) (#77227)
* 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.
4 years ago
Martin Krizek 17836f8e65
first_found: allow spaces in names (#77141) (#77207)
* first_found: allow spaces in names

Fixes #77136

(cherry picked from commit 74a204e6f1)
4 years ago
Sloane Hertel bedff70f3e
[2.12] ansible-galaxy collection verify - display new files/dirs as modified content (#77128)
* 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)
4 years ago
Matt Martz a45c4aadb8
[stable-2.12] Use full python package for ansiballz cache filenames (#77090) (#77125)
* 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>
4 years ago
Matt Clay b801ef15c9 [stable-2.12] Update setup_pexpect to prefer pip user installs.
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
4 years ago
Matt Clay 972bcfe7eb Fix integration tests that install MarkupSafe. 4 years ago
Matt Clay 65792c3035 [stable-2.12] Remove unused task from template integration test.
(cherry picked from commit c1a271c792)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Sloane Hertel 010b143743 [stable-2.12] Use --no-deps when installing amazon.aws and not testing dependencies (#77091)
(cherry picked from commit 88bfb7193e)

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
4 years ago
Matt Clay 2a1aabed33 Fix filter_mathstuff integration test. 4 years ago
Brian Coca ce60a37683
ssh connection: use 'correct' host in all cases (#76017) (#76968)
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)
4 years ago
Brian Coca de9fb8087e
fix block var inheritance (#75287) (#76896)
* 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)
4 years ago
Matt Martz cd0ebed875
[stable-2.12] unarchive: fix non-english locales (#76542) (#76933)
* 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>
4 years ago
Brian Coca ae35fc04c3
Fix final fact delegation (#77008) (#77017)
* 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)
4 years ago
Matt Martz 613519d294
[stable-2.12] restore inadvertently deleted default for convert_data. Fixes #77004 (#77016) (#77021)
(cherry picked from commit 3779c1f)

Co-authored-by: Matt Martz <matt@sivel.net>
4 years ago
Matt Clay f574333395 [stable-2.12] ansible-test - Fix collection loader import. (#76986)
* ansible-test - Fix collection loader import.

Resolves https://github.com/ansible/ansible/issues/76960
(cherry picked from commit 0d40423f1c)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Matt Clay a9814fb3fe [stable-2.12] ansible-test - Fix import test for collections.
(cherry picked from commit e56e47faa7)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Matt Clay 5c208f0d71 [stable-2.12] ansible-test - Defer loading of completion entries. (#76852)
* 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>
4 years ago
Matt Martz 3ded47c3d3
[stable-2.12] Attempt 2: Catch errors getting filters and tests (#76806). (#76809)
(cherry picked from commit 9f46f6eb30)

Co-authored-by: Matt Martz <matt@sivel.net>
4 years ago
Matt Martz 83d7716e02
[stable-2.12] Compare FQCN also in lockstep logic. Fixes #76782 (#76787) (#76791)
(cherry picked from commit 29bdb8b)

Co-authored-by: Matt Martz <matt@sivel.net>
4 years ago
Martin Krizek 645f74732c
end_play: end the current play only (#76674) (#76730)
Fixes #76672

(cherry picked from commit f78deccec2)
4 years ago
Brian Coca 5407c953ec
ssh connection, handle 'fun' control paths (#76424) (#76693)
* 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)
4 years ago
Tadej Borovšak f88efd57cb
Fix zip content filtering in unarchive module (#76069) (#76418)
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)
4 years ago
Matt Clay 5619368075 [stable-2.12] Update dnf tests to reflect new behavior. (#76743)
* 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>
4 years ago
Matt Clay ff7fc58269 [stable-2.12] ansible-test - Hide ansible._vendor in import test (#76503)
(cherry picked from commit 82f59d4843)

Co-authored-by: Matt Clay <mclay@redhat.com>
4 years ago
Sloane Hertel 7262d38dda Disable the _distutils_hack in newer setuptools (#76600)
* 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)
4 years ago
Matt Clay 73a631911c [stable-2.12] Fix wait_for integration test.
Pin the `psutil` package to 5.8.0 since 5.9.0 is broken on macOS.
(cherry picked from commit a5f4a25d32)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Matt Clay 8bab2e309b [stable-2.12] ansible-test - Fix traceback in validate-modules test.
(cherry picked from commit 41ee4a5b12)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Sam Doran b00bdf2081 [stable-2.12] pin mongodb libraries in test
A recent release of PyMongo 4.0 caused tests to fail
4 years ago
Sloane Hertel 2556e33077
Skip recursive suboption validation if sub_parameters is not a dict (#75635) (#76190)
* 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)
4 years ago
Brian Coca 8e8c4be23f
loop/fact delegation fix (#75768) (#76187)
now set_fact and include_vars intermediate results are congruent with delegation

(cherry picked from commit 7bec196061)
4 years ago
Matt Clay 9e1ef1b21f [stable-2.12] Fix pip integration test.
- 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>
4 years ago
Matt Clay 6cba4c11d4
[stable-2.12] ansible-test - Multiple related backports. (#76136)
* [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.
4 years ago
Matt Martz 1cade8390f
[stable-2.12] Don't use output_dir in target tests (#76107) (#76110)
* 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>
4 years ago
Matt Martz 227da1ccc5
[stable-2.12] Explicitly require iptables for incidental_setup_docker on RHEL8 (#76212) (#76214)
(cherry picked from commit 27a5116)

Co-authored-by: Matt Martz <matt@sivel.net>
4 years ago
Matt Clay d0abb7e081 [stable-2.12] Fix subversion test.
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>
4 years ago
Brian Coca a22964609e
Fix lineinfile test (#75785)
* fix remote test after controller split

* other files had it too!
4 years ago
Sloane Hertel 845935f74f
Revert "Compile role with parents in the task's dependency chain (#75165)" (#75779)
This reverts commit 440cf15aeb.
4 years ago
Jordan Borean a2d4a8a9f3
PowerShell - Support optional module util imports (#75187) 4 years ago
Matt Clay 78ff1ab546 Add constraints to prepare_http_tests target. 4 years ago
Sloane Hertel 440cf15aeb
Compile role with parents in the task's dependency chain (#75165)
* 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
4 years ago
Thomas Sjögren 57359d0174
use passlib default if `password_hash` option isn't set (#75043)
* add changelog fragment
* password_hash|length == 120
* mention the new default bcrypt format in the porting guide
4 years ago
Sloane Hertel 4ab90f3afc
Re-enable old_style_cache_plugin test target (#75748)
Fix tests for cache plugins written before ConfigManager
4 years ago
Matt Clay 4ea8d9a782
ansible-test - split controller/target testing (#75605) 4 years ago
Daniel Goldman 989eeb243f
Add an `undef` global Jinja function (#75435)
* 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>
4 years ago
Rick Elrod 61f5c22551
Remove (only) user-facing use of ANSIBLE_ASYNC_DIR (#74249)
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>
4 years ago
Matt Clay 54a795896a
Integration test and sanity index generation fixes. (#75731)
* 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`.
4 years ago
Jordan Borean 097bc07b66
PowerShell - Ignore LIB env var when building C# code (#75698)
* PowerShell - Ignore environment variables when building C# code

* Just unset LIB for now

* Fix sanity issue
4 years ago
Sam Doran a11bb8b4d3
Revert "user - consistently create user home directory on Linux (#71952)" (#75704)
This reverts commit 2f7e0b8489.
4 years ago
maulikd 9558f53a58
Fix git submodules path issue (#75655)
* Fix git path used for submodules

* Fix git submodules integration test
4 years ago
hyperreality c3fc8fb99a
apt module: add option to allow package downgrades (#74852)
* 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>
4 years ago