Commit Graph

6382 Commits (c55729d3cd35f5d35cdc36e52a51ca0a3a7da04a)

Author SHA1 Message Date
Matt Clay 4aa5de7a8b
Disable failing incidental_inventory_docker_swarm (#80659)
Also remove remote incidental tests from the test matrix, as this was the last one.
3 years ago
Jordan Borean 261e5b74cc
Ansible.Basic - Improve temporary file cleanup process (#80293) (#80325)
* Ansible.Basic - Improve temporary file cleanup process

* Add comment on struct value used

(cherry picked from commit ba4505f5cb)
3 years ago
Sloane Hertel 25e77b7c98
Fetch signatures from galaxy after the dependency resolver runs (#80334) (#80399)
Reduce the number of Galaxy API calls made during dependency resolution by fetching remote signatures afterwards, since these are not used in backtracking.

Reduce the verbosity to `-vvvv` (to match other Galaxy API calls) to see this activity.

Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
(cherry picked from commit 460abe0cef)
3 years ago
Matt Clay ef0924883b
[stable-2.13] ansible-test - Fix packaging change classification (#80360). (#80362)
(cherry picked from commit 5d64024f1a)
3 years ago
Sviatoslav Sydorenko 18d6ae1e1f
Fix `entry_points` integration test for PEP 517 (#80357)
This patch pre-builds the sdist via build using the self-eliminating
in-tree build backend and then, feeds the result to a pottentially
outdated pip (below v20) so that it uses the setuptools' native
PEP 517 build backend to build a wheel on install.
3 years ago
Sviatoslav Sydorenko 77d221c0ac
[backport-2.13] 📦 Integrate manpage builds into PEP 517 build backend (#80130)
This change includes backports of the PRs #79606, #80098, #80253, #80255 and #80262, with a number of backward compatibility changes that make it work and be testable in older CI environments.

This patch creates a thin wrapper around the `setuptools`' PEP 517 build backend in-tree. It features an ability to request generating the manpage files in-memory, in the process of building a source distribution. The build is happening in an isolated temporary directory. This toggle is implemented using the `config_settings` mechanism of PEP 517.
One must explicitly pass it a CLI option to the build front-end to trigger said behavior. The packagers are expected to use the following call:

    python -m build --config-setting=--build-manpages

This option has no effect on building wheels.

🧪 The change includes integration tests

This test runs building and re-building sdists and wheels with and without the `--build-manpages` config setting under the oldest-supported and new `setuptools` pinned.

It is intended to preserve the interoperability of the packaging setup across Python runtimes.

An extra smoke test also verifies that non PEP 517 interfaces remain functional.

📦 The sdist build-system is switched to pure setuptools upon the first build from Git checkout

This patch modifies the in-tree build backend to build sdists that swap
out pointers to it in the `pyproject.toml`'s `[build-system]` section.

The effect of this is that the first build from source (for example,
from a Git checkout) uses our PEP 517 in-tree build backend. But the
produced tarball has `build-backend` set to `setuptools.build_meta`
which is the native build backend of `setuptools`. So any following
builds from that sdist will skip using the in-tree build backend,
calling the setuptools' one.
The good news is that if the first build generated the manpages, they
will be included and won't go anywhere even though, a different build
system is in place.

Combined with #80253, this makes sure not to modify the current
source checkout on that first build.

Co-Authored-By: Matt Clay <matt@mystile.com>
Co-Authored-By: Matt Davis <6775756+nitzmahone@users.noreply.github.com>

(cherry picked from commit 56036013cd)
(cherry picked from commit 67bafafbc0)
(cherry picked from commit 888abf5d6e)
(cherry picked from commit 7097df3eed)
(cherry picked from commit eebfd71a6d)
3 years ago
Felix Fontein e9603d233c
[2.13] ansible-doc: fix broken seealso links in text output (#80286)
* ansible-doc: fix broken seealso links in text output (#80280)

* Fix broken URLs.

* Also remove auto-generated description for modules outside ansible.builtin.

(cherry picked from commit fafb23094e)

* Fix URL processing. (#80295)

(cherry picked from commit 086ae42209)
3 years ago
Matt Clay 6e6b6f1a55
[stable-2.13] Fix url lookup test to use test container (#80284) (#80288)
(cherry picked from commit 054aa92158)
3 years ago
Matt Clay a5d7c73cc9 [stable-2.13] ansible-test - Fix vendoring support (#80074)
- Support loading of vendored Python packages.
- Exclude vendored Python packages from payloads.
(cherry picked from commit 6bfe6b899a)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 866d91bb7d [stable-2.13] ansible-test - Allow target prefixes to use `_` (#80021)
Integration test target prefixes defined in a `tests/integration/target-prefixes.{group}` file can now contain an underscore (`_`) character.
(cherry picked from commit e6cffce0eb)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Martz 6cffa10de0
[stable-2.13] Do not use hardcoded httpbin.org in uri tests (#80101) (#80103)
(cherry picked from commit 060a27f)
3 years ago
Matt Davis d5fd83265d
[2.13] don't ignore templated _raw_params that k=v parser failed to parse (#79913) (#79965)
* don't ignore templated _raw_params that k=v parser failed to parse (#79913)

fixes #79862

* backport test changes
3 years ago
Matt Clay 7e7908a3e1 Remove redundant RHEL extras setup. 3 years ago
Matt Clay a76adbccca [stable-2.13] Fix EPEL setup for integration tests on RHEL 7
(cherry picked from commit 1243d2ace0)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 9e3363f8b7 [stable-2.13] ansible-test - Improve container startup handling.
Also improve the ansible-test-container integration test:

 - Add coverage for the no-probe code path.
 - Add work-arounds for centos6 containers (to support backporting).
 - Avoid systemd debug when the container doesn't use cgroup.
(cherry picked from commit 04fc98c794)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay e6ac16674c [stable-2.13] Add more retries to ansible-test-container test.
(cherry picked from commit f6c0e22f98)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 000f3244a4 [stable-2.13] Improve split integration test. (#78738)
* Omit redundant fact gathering.

* Add connection type to split test.

* Add user info to split integration test.
(cherry picked from commit 2e5e802)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 1d7436935f
[stable-2.13] ansible-test - Improve container management. (#79538)
* ansible-test - More flexible become support.

(cherry picked from commit 5666c6d6a3)

* ansible-test - Add support for more remotes.

(cherry picked from commit 24d91f552c)

* ansible-test - Enable ACLs on FreeBSD remotes.

This allows integration tests to switch from one unprivileged user
to another, sharing files between the users using ACLs.

(cherry picked from commit b63812bc08)

* ansible-test - Enable ACL support on more remotes. (#78299)

(cherry picked from commit 8bb20fe06b)

* ansible-test - Install `acl` on Alpine remotes. (#78303)

(cherry picked from commit 8565deaae3)

* ansible-test - Use sudo for all remotes. (#78310)

(cherry picked from commit f3f4ad9332)

* ansible-test - Fix Ubuntu 20.04 bootstrapping. (#78551)

(cherry picked from commit d683c5bd21)

* ansible-test - Verify executables are executable. (#78606)

(cherry picked from commit ece85abbc4)

* ansible-test - Use --tmpfs to run containers. (#78605)

(cherry picked from commit 4187707f03)

* ansible-test - Remove Fedora 35 support. (#78720)

(cherry picked from commit 38a82a5cc4)

* ansible-test - Fix container error handling. (#78739)

(cherry picked from commit 79f67ed561)

* ansible-test - Improve container management. (#78550)

See changelogs/fragments/ansible-test-container-management.yml for details.

(cherry picked from commit cda16cc5e9)

* ansible-test - Fix container detection. (#79530)

(cherry picked from commit 80d2f8da02)

* Update test matrix symlinks. (#78737)

* Add remote platform symlinks.

These were already supported by ansible-test.
This change adds the symlinks for use in the CI test matrix.

* Remove obsolete AIX test symlink.

AIX was already removed from ansible-test.

(cherry picked from commit 62221a3be2)

* Use patched containers without VOLUME instruction.

* Make test suite compatible with older ansible.

* Fix compatibility with Python 3.8.
3 years ago
sbettid 0dfd6c868e
[stable-2.13] Fix file touch check mode result (backport of #79422) (#79526)
* Fix file touch check mode result (#79360) (#79422)

Fixes #79360

(cherry picked from commit 3936b5c471)

* Rename changelog fragment according to PR number
3 years ago
Sviatoslav Sydorenko 03233e676a
[backport][2.13][PRs #78402 #79289] Enable the `reboot` integration test in CI (#79491)
* Enable the `reboot` integration test in CI

Co-Authored-By: Matt Clay <matt@mystile.com>
(cherry picked from commit bb7ad0f0d8)

* [CI] Move running `reboot` integration test to group 2

PR #79289, follow-up for #78402.

It was breaking the integration-aliases sanity test, but only
became apparent post-merge. This patch fixes that.

(cherry picked from commit 26a4775611)

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
3 years ago
Matt Clay 84695c9158 [stable-2.13] Don't use color in jinja_plugins test.
This should prevent color codes from interfering with string matches.
(cherry picked from commit 31f9d60b8d)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Sviatoslav Sydorenko 99ff446a3b
[2.13] Log `runme.sh` execution in integration tests (#79283)
* Log `runme.sh` execution in integration tests (#79263)

* Log `runme.sh` execution in integration tests

This patch adds `set -x` where it's missing in the integration tests.
It also enables `pipefail` in `runme.sh` scripts that use pipes.

* Add a change note for PR #79263

(cherry picked from commit 6674c43edd)

* Delete a bad PR #79263 change note

(cherry picked from commit 9cfb3f73e8)
3 years ago
Sloane Hertel 65fd4e182b
[2.13] ansible-galaxy - fix unnecessary api check when installing role (#79143)
* ansible-galaxy install - fix unnecessary api check when installing a role from git repo (#79090)

* delay server api evaluation until a GalaxyRole needs to make an api call for info, list, and install

(cherry picked from commit cb2e434dd2)

* fix type for older python

* Fix isinstance check (#79159)

Use GalaxyAPI for isinstance check instead of RoleDistributionServer, since the latter is defined in __main__ sometimes (when running integration tests or ansible-galaxy from source) and importing from ansible.cli.galaxy won't reference the same object.

(cherry picked from commit 89d682464b)
3 years ago
Brian Coca a5480c330d
copy, avoid moving non temp remote 'non' files (#79102) (#79155)
* copy, avoid moving non temp remote files that are not dirs/files
fix tests

(cherry picked from commit f66016df0e)
3 years ago
Matt Clay a61016fb97 [stable-2.13] Fix ansible-test-git test for newer git versions.
The latest versions of `git` include a fix for CVE-2022-39253. The fix blocks the file protocol by default.

See: 45c9f05c44/Documentation/RelNotes/2.30.6.txt
(cherry picked from commit 4202acb41b)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Sviatoslav Sydorenko 2d6747bcbf [stable-2.13] Restrict `wheel` below v0.38.0 under Pythons < 3.7 (#79187)
* Restrict `wheel` below v0.38.0 under Pythons < 3.7

* Add a change note for PR #79187

* Update changelogs/fragments/79187--wheel-0.38.0.yml

Co-authored-by: Matt Clay <matt@mystile.com>

* Use constraints file when installing wheel.

Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit a76bbb18a5)

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
3 years ago
Sloane Hertel 45abd5b685
[2.13] apt - fix failure when package is not installed and only_upgrade=True (#78791)
* apt - fix failure when package is not installed and only_upgrade=True (#78781)

* apt - fix module failure when package is not installed and only_upgrade is True

* changelog

(cherry picked from commit 4b45b4b09d)

* apt - fix module short-circuiting when a package is not installed and only_upgrade is True

(cherry picked from commit 14f46845f9)
3 years ago
Sloane Hertel 551ddebeab
[2.13] Limit Galaxy API calls during ansible-galaxy dependency resolution (#78722)
* Limit Galaxy API calls during ansible-galaxy collection dependency resolution when possible

Installing a tarfile with a dependency from a Galaxy server (e.g. dependencies: {'ns.coll': '>=1.0.0'}) does not get the available versions of the dependency from the galaxy server if a sufficient version is already installed.

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
(cherry picked from commit 41b62f7db4)
3 years ago
sbettid 00d60a45fa
[stable 2.13] Fix known host changed status when removing non-existing key #78598 (#78878)
* Fix known_hosts changed status when removing non-existing key (#78748)

* Ensure no change is reported when removing missing key for host with other keys

Co-authored-by: Matt Martz <matt@sivel.net>

* Add changelog for fix known hosts wrong changed status cherry pick

* Remove old changelog for fix known hosts wrong changed status

* Rename changelog according to PR number

Co-authored-by: Matt Martz <matt@sivel.net>
3 years ago
Matt Clay fa0655228a [stable-2.13] ansible-test - Fix integration test target filter. (#78862)
- Allow disabled, unsupported, unstable and destructive integration test targets to be selected using their respective prefixes.
- Allow unstable tests to run when targeted changes are made and the ``--allow-unstable-changed`` option is specified (resolves https://github.com/ansible/ansible/issues/74213).
(cherry picked from commit d3d7785472)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Martz cd58c50b97
[stable-2.13] Don't request repo updates when only testing modes (#78843) (#78849)
(cherry picked from commit 2542048)

Co-authored-by: Matt Martz <matt@sivel.net>
3 years ago
Matt Martz 9917b9f9f9
[stable-2.13] wait_for - Read file and perform comparisons using bytes to avoid decode errors (#78317) (#78660)
* wait_for - Read file and perform comparisons using bytes to avoid decode errors. Fixes #78214

* Write non-ascii via script instead of static file

* Use contexlib.closing to support py27 context manager

* Use executable from task, instead of shebang

* Update encoded bytes to utf16
(cherry picked from commit 9d4ced1)

Co-authored-by: Matt Martz <matt@sivel.net>
3 years ago
Matt Martz 1cef724544
[stable-2.13] Fix --role-file arg detection (#78475) (#78522)
* Fix --role-file arg detection. Fixes #78204

* Do not traceback, give better error

* Add coverage for compound shortopts to match -r. Fixes #78491
(cherry picked from commit 86298b7)

Co-authored-by: Matt Martz <matt@sivel.net>
3 years ago
Sviatoslav Sydorenko 47d34ce582
Fail fast in stuck `ansible-galaxy-collection` (#78627)
This specific integration test gets stuck periodically causing the
Galaxy jobs to be killed on timeout wasting an hour of runtime. The
module that gets stuck waiting on Pulp is an in-test one, called
`setup_collections`. When it works, the task is complete in around 70
seconds but when it doesn't, it just freezes the whole play.

This patch attempts to make it fail faster by putting a reasonable
timeout value of 2 minutes.

(cherry picked from commit f1c56e988d)
3 years ago
Sloane Hertel 702eadf21b
Fix apt making changes in check mode (#78496) (#78530)
* Don't actually update the cache in check mode

Add tests for updating the cache in check mode

* Don't mark packages as manually installed in check mode and add a test for it

* changelog

* Update test/integration/targets/apt/tasks/apt.yml

* fix test

(cherry picked from commit 3add5e9321)
3 years ago
Sloane Hertel b2553d162d
apt: include apt preferences (e.g. pinning) when selecting packages (#78327) (#78462)
Fixes #77969

(cherry picked from commit 04e8927579)

Co-authored-by: Patrick Hemmer <phemmer@users.noreply.github.com>
3 years ago
Matt Martz 046c59d851
Filter on any Fedora-Cloud-Base image (#78669) 3 years ago
Sviatoslav Sydorenko 8071f014f6
[2.13] Disable `connection_paramiko_ssh` under FreeBSD 13.0 (#78643) 3 years ago
Matt Clay 45b064f3fd
[stable-2.13] Fix file integration test chattr/lsattr check. (#78614) (#78618)
On BusyBox systems such as Alpine, chattr on a tmpfs fails with a status of 0 and output only on stderr.

This change updates the test to not assume output on stdout.

(cherry picked from commit 2e536c0afb)
3 years ago
Matt Clay d6b40a5bc6
[stable-2.13] ansible-test - Fix ansible-doc sanity test FQCN. (#78518). (#78519)
(cherry picked from commit 2b63fdd1b8)
3 years ago
Sloane Hertel 2efb33d200
Fix listing collections that are missing the metadata required by build (#76596) (#78411)
* Rethread pr/70185 through the dependency resolver

Hang optional metadata toggle on the ConcreteArtifactsManager instead of threading it through whole list codepath

Don't error while listing collections if a collection's metadata is missing keys required for building a collection.

Give an informative warning if metadata has been badly formatted.

Co-authored-by: Sam Doran <sdoran@redhat.com>
(cherry picked from commit 05608b20e8)
3 years ago
Sloane Hertel 253c30441b
Fix removing existing dir/files with `ansible-galaxy collection init --force` (#78403) (#78412)
* Remove collection contents when re-initializing with --force

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>

(cherry picked from commit a2174fc6d9)
3 years ago
Sloane Hertel d6555399b8
[ansible-galaxy] Fix listing collections with null namespace/name/version metadata (#77014) (#78410)
* Fall back to implicit namespace.name from the path if the metadata is invalid

* Test listing a collection with null namespace/name/version fields in its galaxy.yml

(cherry picked from commit f8ec660e62)
3 years ago
Brian Coca ced2b93697
config error origin (#78407) (#78409)
(cherry picked from commit 9b79d6ba35)
3 years ago
Matt Davis ff4bb5500a
PluginLoader now installs module-to-be-imported in sys.modules before exec (as Python import does). (#78364) (#78367)
(cherry picked from commit 1368bfa348)
3 years ago
Matt Clay 426e4899a3
[stable-2.13] ansible-test - Parse content config only once. (#78418) (#78426)
(cherry picked from commit f2abfc4b3d)
3 years ago
Martin Krizek 2aa3cc9e40
2.13: template module/lookup: fix convert_data for macros (#78259) (#78269)
* template module/lookup: fix convert_data for macros (#78259)

Fixes #78141

(cherry picked from commit 9afdb7fec1)

* Fix templating nested vars with convert_data=False (#78273)

Regression introduced in #78259.

(cherry picked from commit d070b03ad8)
3 years ago
Nicolas Karolak bf1e031eb2
honor use_proxy parameter (#77312) (#78261)
* honor use_proxy parameter
* fix uri test with "use_proxy: no"
* fix urls.py module

Co-authored-by: Carlos <Juan.Carlos.Cardenas.Viera@ibm.com>
(cherry picked from commit 1d9c68d27e)

Co-authored-by: h4rr21 <juankchess13@hotmail.com>
3 years ago
Martin Krizek fc82d215a6
yum: fix releasever for latest (#78066) (#78242)
Fixes #78058

(cherry picked from commit 2bc2153c01)
3 years ago
Matt Clay 24359537bb [stable-2.13] ansible-test - Fix TTY and output handling. (#78350).
(cherry picked from commit a3c90dd0bc)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago