Commit Graph

6473 Commits (83db3015e9ac7515d4a0f3a8827b46656b50990c)

Author SHA1 Message Date
Martin Krizek 83db3015e9
Fix traceback in template action with ANSIBLE_DEBUG=1 (#79764) (#79775)
Fixes #79763

(cherry picked from commit 4f5ed24972)
2 years ago
Felix Fontein 522bdb8358
Argument spec alias handling: actually report deprecated aliases in suboptions, and fix warning message in suboptions when two aliases of the same option are used (#79740) (#79770)
* Normalize deprecation records.

* Fix alias deprecations in suboptions.

* Report in which option an alias warning happened for suboptions.

* Add deprecation tests for suboptions.

* Also test deprecation in list of dicts.

* Adjust unit tests for toplevel alias deprecation field name change.

(cherry picked from commit 8a7185c224)
2 years ago
Felix Fontein 165557df11
[2.14] fix role argument spec error for invalid suboptions & fix reporting of deprecated arguments for modules (#79738)
* fix role argument spec error for invalid suboptions (#76578)

fixes https://github.com/ansible/ansible/issues/75536

(cherry picked from commit b5b239fd71)

* Fix reporting of deprecated arguments for modules. (#79681)

(cherry picked from commit 1a47a21b65)

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2 years ago
Matt Martz 014a1a5715
[stable-2.14] Ensure we are passing ciphers to all url_get calls (#79718) (#79727)
* Ensure we are passing ciphers to all url_get calls. Fixes #79717

* Add clog frag

* Fix tests
(cherry picked from commit 2143bcd)

Co-authored-by: Matt Martz <matt@sivel.net>
2 years ago
Martin Krizek c297ee9b5d
Correctly count rescued tasks in play stats (#79724) (#79728)
Fixes #79711

ci_complete

(cherry picked from commit e38b3e64fd)
2 years ago
Jordan Borean 8e9834fde5 ansible-test - fix ps argspec check inside cmdlet (#79699)
* ansible-test - fix ps argspec check inside cmdlet

* Added error condition test

* Fix sanity problem

(cherry picked from commit ee33be9484)
2 years ago
Evgeni Golov a398724a31 [stable-2.14] validate-modules: don't fail on invalid YAML (#79682)
* validate-modules: don't fail on invalid YAML

When validate-modules encounters invalid YAML (e.g. in the EXAMPLES
section), it tries to reformat the exception to include the line number
in the Python file instead of the line number of the embedded YAML
document. However, PyYAML doesn't allow modification of the Mark object
(anymore) which leads to a new exception being raised, instead of
reporting the original exception.

As the original exception is not needed in other places anymore, we
don't have to modify it at all and can just compute the right line
number when reporting the error via ansible-test.

Fixes: #75837

* Add test for invalid module doc YAML syntax.

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

Co-authored-by: Evgeni Golov <evgeni@golov.de>
2 years ago
Matt Clay b6ded6209e [stable-2.14] Fix EPEL setup for integration tests on RHEL 7
(cherry picked from commit 1243d2ace0)

Co-authored-by: Matt Clay <matt@mystile.com>
2 years ago
Matt Clay acc8c3ccf8 [stable-2.14] 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>
2 years ago
Matt Clay 6a07424b36 [stable-2.14] Add more retries to ansible-test-container test.
(cherry picked from commit f6c0e22f98)

Co-authored-by: Matt Clay <matt@mystile.com>
2 years ago
sbettid 066054f1f2
[stable-2.14] Fix file touch check mode result (#79360) (#79422) (#79525)
* Fix file touch check mode result (#79360) (#79422)

Fixes #79360

(cherry picked from commit 3936b5c471)

* Rename changelog fragment according to PR number
2 years ago
Brian Coca d40213c32c
Removed sorting to preserve original order (#74839) (#79517)
updated tests to reflect new order

(cherry picked from commit 5b51b560d0)
2 years ago
Sviatoslav Sydorenko 022202056e
[backport][2.14][PRs #78402 #79289] Enable the `reboot` integration test in CI (#79490)
* 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>
2 years ago
Matt Clay 3ae796bdcf
[stable-2.14] ansible-test - Improve container management. (#78550) (#79507)
* [stable-2.14] ansible-test - Improve container management. (#78550)

See changelogs/fragments/ansible-test-container-management.yml for details..
(cherry picked from commit cda16cc5e9)

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

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

(cherry picked from commit 80d2f8da02)
2 years ago
Matt Davis 047affbdc5
Prevent stdio deadlock in forked children (#79522) (#79539)
* background threads writing to stdout/stderr can cause children to deadlock if a thread in the parent holds the internal lock on the BufferedWriter wrapper
* prevent writes to std handles during fork by monkeypatching stdout/stderr during display startup to require a mutex lock with fork(); this ensures no background threads can hold the lock during a fork operation
* add integration test that fails reliably on Linux without this fix

(cherry picked from commit 1424484be0)
2 years ago
Matt Clay f240f69508 [stable-2.14] Handle line wraps in jinja_plugins test.
(cherry picked from commit 31f95e201a)

Co-authored-by: Matt Clay <matt@mystile.com>
2 years ago
Matt Clay 3bcb4f267d [stable-2.14] 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>
2 years ago
Martin Krizek c5065264c2
2.14: jinja2_native: preserve quotes in strings (#79119) (#79144)
* jinja2_native: preserve quotes in strings (#79119)

Fixes #79083

(cherry picked from commit d34b578685)

* Fix test for jinja2_native preserve quotes (#79131)

Fixes https://github.com/ansible/ansible/pull/79119#discussion_r993752129

(cherry picked from commit 3a6eca6670)
2 years ago
Sloane Hertel 59f3c0238b
[2.14] ansible-galaxy - fix unnecessary api check when installing role (#79142)
* 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 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)
2 years ago
Brian Coca ffcdcef21c
copy, avoid moving non temp remote 'non' files (#79102) (#79154)
* copy, avoid moving non temp remote files that are not dirs/files
fix tests

(cherry picked from commit f66016df0e)
2 years ago
Sviatoslav Sydorenko 0f3a1d3c82
[2.14] Log `runme.sh` execution in integration tests (#79282)
* 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)
2 years ago
Matt Clay 41159432d1 [stable-2.14] 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>
2 years ago
Sviatoslav Sydorenko 51c0d50631 [stable-2.14] 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>
2 years ago
Matt Martz cd9ef334d0
[stable-2.14] Ensure that we do not squash keywords in validate (#79049) (#79062)
* [stable-2.14] Ensure that we do not squash keywords in validate (#79049)

* Ensure that we do not squash keywords in validate. Fixes #79021

* become_user: nobody should only apply to the test tasks, not the setup_test_user role

* Update how become_user is specified

* Add test to ensure keyword inheritance is working for become

* Add clog frag

* Cache fattributes to prevent re-calculation

* ci_complete

* Remove unnecessary getattr.
(cherry picked from commit 420564c5bc)

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

* Remove unneeded merge conflict changes
2 years ago
Martin Krizek cd52ae459d
Fix using FQCN for flush_handlers (#79057) (#79061)
Fixes #79023

(cherry picked from commit e1daaae42a)
2 years ago
Brian Coca b5eba64882
Omit full fix (#79024)
* omit keyword should reset to context (#78917)

* omit keyword should reset to context

  ensure we use context/inheritance when calculating value,
  using default only when context is unavailable.

  fixes #75692

(cherry picked from commit 9650ddb11c)

* fixes to FA inheritance (#78990)

finalized applies to all field attributes
fix getting parent value
also remove unused/needed extend/prepend signature
moar testing

(cherry picked from commit ff6e4da36a)

* setup role needs it's own info
2 years ago
Felix Fontein fea62e7553
Do not crash templating when filter/test name is not a valid Ansible plugin name (#78913) (#79026)
* Do not crash templating when filter/test name is not a valid Ansible plugin name.
* Store and re-raise KeyError if there was one.

Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
(cherry picked from commit 6d0aeac1e1)
2 years ago
Jordan Borean d15815c88d
Fix connection/become task loop settings (#78565) (#78935)
* Fix connection/become task loop settings

* Remove old code

(cherry picked from commit ba6da65a0f)
2 years ago
Jordan Borean 04fe7b374d
ansible-test validate-module - support sidecar docs (#78904) (#78933)
(cherry picked from commit be4807b712)
2 years ago
sbettid 0747c5c859
[stable 2.14] Fix known host changed status when removing non-existing key #78598 (#78881)
* 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>

* Rename changelog fragment for fix known hosts changed status cherry pick

* Rename changelog according to new PR number

Co-authored-by: Matt Martz <matt@sivel.net>
2 years ago
Matt Clay 4655fe6d8b [stable-2.14] 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>
2 years ago
Matt Martz eb35cf9bb7
[stable-2.14] Don't request repo updates when only testing modes (#78843) (#78848)
(cherry picked from commit 2542048)

Co-authored-by: Matt Martz <matt@sivel.net>
2 years ago
Brian Coca b1ff0f4ebc
vault secrets file, keep context when symlink (#78734)
* vault secrets file, keep context when symlink

	fixes #18319

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2 years ago
Sloane Hertel a02e22e902
Add --offline option to 'ansible-galaxy collection install' (#78678)
* Add --offline option to 'ansible-galaxy collection install' to prevent querying distribution servers

This allows installing/upgrading individual tarfiles to have dependency resolution.
Previously needed to be done manually with --no-deps or else all collections and dependencies needed to be included in the requirements.

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2 years ago
Ruediger Pluem 1d410ca700
Fix local facts unreadable (#76095)
* Catch exceptions during stat calls

If such an exception is not caught it causes the complete
local facts gathering to fail.
2 years ago
Sloane Hertel f26f3325ba
apt - fix module short-circuiting when a package is not installed and only_upgrade is True (#78790) 2 years ago
Sloane Hertel 4b45b4b09d
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
2 years ago
Sloane Hertel 86b86398f0
add ansible_name/ansible_aliases attrs to plugin objects (#78700)
*  new _fqcn attribute to plugin objects
* unbreak plugins in subdirs
* Fix inadventent changes to _load_name and use existing vars
* add plugin aliases and name property, and replace plugin._load_name where incorrect
* Fix listing plugin names

Fix listing legacy and builtin together
test deprecated plugin documentation
fix doc extensions
remove sometimes inaccurate _load_name handling from plugin.name

* Add tests for REJECT_EXTS and doc extensions

Fix unpredictable collection redirects so non-fqcns in the redirect list are guaranteed to be legacy (instead of determined by the collections keyword)

Move aliases and name properties to _update_object so all plugin types, including doc fragments, can use them

* make legacy plugin names internally consistent
* rename attributes to ansible_name and ansible_aliases
2 years ago
Sloane Hertel 563f3ecc11
Error for context-dependent redirects (#78755) 2 years ago
David Moreau Simard 86ab63f281
Recover unix load average into an ansible_loadavg fact (#75319)
* Recover unix load average into an ansible_loadavg fact

The average load is available out of the box with os.getloadavg().
It adds useful context to the existing ansible_memory_mb and ansible_mounts
facts that provide size and utilization or memory and disk space.

* Add an integration test
2 years ago
Martin Krizek a6d4c3ff7c
Print skip reason for skipped meta tasks instead of an empty msg in -vv (#78681)
Fixes #77315
2 years ago
Artur a26c325bd8
uri: added use_netrc argument to allow ignoring netrc (#74397) (#78569) 2 years ago
Matt Clay 2e5e8026cc
Improve split integration test. (#78738)
* Omit redundant fact gathering.

* Add connection type to split test.

* Add user info to split integration test.
2 years ago
Matt Martz b8025ac160
Allow selection of TLS/SSL ciphers (#78650)
* Allow selection of TLS/SSL ciphers. Fixes #78633
* Never pass None as the password. Fixes #53373
2 years ago
Felix Fontein fa093d8adf
ansible-doc: remove manual formatting (#78668)
* remove manual formatting and make the output align closer with the original YAML

Co-authored-by: Brian Coca <brian.coca+git@gmail.com>
2 years ago
Sloane Hertel 41b62f7db4
Limit Galaxy API calls during ansible-galaxy dependency resolution (#77468)
* 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>
2 years ago
Brian Coca dc2a79f1c3
ansilbe-doc fixes for filters/test listing (#78696)
* split filters
* listing fixes
* return to no docs being exception
2 years ago
Martin Krizek fd19ff2310
Propagate ansible_failed_task to an outer rescue (#78676)
Fixes #43191
Fixes #72638
Fixes #78042

Co-authored-by: Sandra McCann <samccann@redhat.com>
2 years ago
Brian Coca 72783837c5
fix issue with legacy pugins and no docs (#78686)
* fix issue with legacy pugins and no docs
2 years ago
Sloane Hertel 5f2bb2ba93
Add the rest of the runtime keys to the example in the default collection skeleton (#78573) 2 years ago