Commit Graph

10987 Commits (49f0d06bd95c486fcaaf36bc107d7e0fbc8c9410)

Author SHA1 Message Date
Sloane Hertel 01f024df79
Fix build_ignore when installing a collection from source (#75547) (#75623)
* Make individual dirs that should exist instead of using shutil.copytree

* Test build_ignore when installing collections in git repos

* changelog

* Fix assertion
Fix git directory

* Fix nested content while building the collection dir

Test installing a collection from a git repo and artifact have the same result

Refactor to use variables

(cherry picked from commit f38a97cece)
3 years ago
Sloane Hertel e4fb928b5f
[2.11] Improve ansible-galaxy error for InconsistentCandidate exception (#75462)
* Improve ansible-galaxy error for InconsistentCandidate exception (#75235)

* Improve error for InconsistentCandidate exceptions

* Add test case for installing a collection with an inconsistent version

* Add test case for installing a collection that has a dependency with an inconsistent version

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
(cherry picked from commit e24eb59de5)

* Handle extra stderr for Python 2.7
3 years ago
Brian Coca ad4d00e1db
Clarify get_bin_path error message (#75544) (#75564)
(cherry picked from commit 3ca50a2200)
3 years ago
Brian Coca 463cf9fe24
Attributes compat (#75563)
* ignore attributes in output

* ignore 'attributes' for json dump

* actually add file

* clog

* sometimtes its not a dict

* always ignore

* also allow validation to work on newer modules

* remove attributes doc

  let existing overrides display, wont be full info but still pertinent info
  though user will have to check newer versions
3 years ago
Martin Krizek a6f24c407c
Fix templating task action with host-specific vars (#75600) (#75613)
Fixes #75568

(cherry picked from commit 9c2f44b884)
3 years ago
Martin Krizek 999c2e603d
paramiko_ssh - mark connection as connected when successful (#74459) (#75614)
* Remove unused import from test

(cherry picked from commit 74b2add460)

Co-authored-by: Sam Doran <sdoran@redhat.com>
3 years ago
Sloane Hertel e1f406699b
Fix dnf test assertion (#75426) (#75427)
(cherry picked from commit e23fdee45e)
3 years ago
Sloane Hertel f0b227009c
Fix dnf package matching (#75411) (#75418)
* Fix a bug with the dnf module not using all components of a package name when filtering to determine if it's installed

* changelog

* Simplify splitting on the last '.'

* Update lib/ansible/modules/dnf.py

(cherry picked from commit b541a148d5)
3 years ago
Brian Coca de1129c8e5
Skip python interpreter discovery for 'forced local' module execution (#74824) (#75402)
mostly for use with network_os
  use 'remote is local' property as indicator
  ensure task_vars are as expected in test

(cherry picked from commit 8d41b97329)
3 years ago
Abhijeet Kasurde 7f6415ee14
[bp-2.11] unarchive - do not fail in init when trying to find required binary (#75363)
Test for the required binaries in the can_handle_archive() method and fail there. This
prevents failures for missing binaries unrelated to the archive type.

* Update missing zip binary message to match tar message
* Update unit tests
* Add integration tests
* Define packages based on the system rather than ignoring failures

(cherry picked from commit 004c33d9c5)

Co-authored-by: Sam Doran <sdoran@redhat.com>
3 years ago
Martin Krizek 71a6954b51
Globals should be accessible when importing a template without the context (#75384) (#75409)
Fixes #75371

(cherry picked from commit 5a38076568)
3 years ago
Felix Fontein e2f14d94b8
[2.11] Improve handling of AnsibleModule arguments in validate-modules (#75360)
* Improve handling of AnsibleModule arguments in validate-modules (#75332)

* Make sure AnsibleModule positional arguments are validated.

* Extract ANSIBLE_MODULE_CONSTURCTOR_ARGS with inspection.

* Remove no longer necessary return value.

* Fix PR #.

* argument_spec might not have been specified, as in community.general.xenserver_facts.

* Fix typo.

(cherry picked from commit 7726b70d9a)

* Make sure self doesn't end up in fake.args (#75403)

(cherry picked from commit 2455d82c14)

Co-authored-by: Matt Martz <matt@sivel.net>
3 years ago
Martin Krizek 66ca0abaf4
Ensure Jinja2 template header overrides are used (#75306) (#75342)
Fixes #75275

(cherry picked from commit 767b2f07b0)
3 years ago
Martin Krizek 4078765379
Fix when evaluation on Native Jinja and Python 3.10 (#75202) (#75380)
* Fix when evaluation on Native Jinja and Python 3.10

* Add unit test

* Add explaining comment

* Enable jinja2_native before tests

Co-Authored-By: Matt Martz <matt@sivel.net>

* Sanity

* Return native template module instead of modifying globals

Co-authored-by: Matt Martz <matt@sivel.net>
(cherry picked from commit 58e38044fe)
3 years ago
Sergey da1baaf485 [stable-2.11] Add packaging to requirement of ansible-test (#75356)
* Add packaging to requirement of ansible-test

Fix #75353

After requires_ansible field was added as mandatory to runtime.yml
file, ansible-test fails to check this field if it doesn't have
packaging module.

[1] https://github.com/ansible/galaxy-importer/pull/124
(cherry picked from commit 40ca87a963)

Co-authored-by: Sergey <sshnaidm@users.noreply.github.com>
3 years ago
Sam Doran 78c7721052
[stable-2.11] slurp - improve error code and test coverage (#75038) (#75045)
* Improve the error handling code

Rather than multiple return paths, have a single return and set the message based
on the type of failure.

* Add another test for non-specific failures

* Reorganize tests so failure tests are in one tasks file

* Remove os.stat() call and add changelog.
(cherry picked from commit afe6eb574e)

Co-authored-by: Sam Doran <sdoran@redhat.com>
3 years ago
Sam Doran 1f4d1dfa0b
[stable-2.11] command - remove unreachable code and achieve full test coverage (#75036) (#75044)
(cherry picked from commit 4ab791d501)
3 years ago
Sam Doran 6d2e8f7729
[stable-2.11] file integration test - cleanup testing users and group (#75037)
(cherry picked from commit 0467b1d477)

Co-authored-by: Sam Doran <sdoran@redhat.com>
3 years ago
Martin Krizek b3115e3c16
2.11: Add support for unicode in ansible-inventory CLI (#74912) (#75008)
(cherry picked from commit 5ac1b04929)
3 years ago
Sloane Hertel 35383360d2
Template suboptions in a role's arg spec (#75073) (#75094)
(cherry picked from commit ca6123e0ee)
3 years ago
Gonéri Le Bouder 1b6698aba8
ansible-test: exposes tiny_prefix variable (#75128)
ansible-test aws provider now creates and exposes a new tiny_prefix
variable to provide a shorter prefix for the AWS tests.

(cherry picked from commit 5b8fb4dcd3)
3 years ago
Brian Coca 3b5bc9b3fa
Unfrack extra vars (#75127) (#75148)
* Ensure we keep the original path as per cli

  fixes #75126

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 60c9f045cc)
3 years ago
Sam Doran a2239d8819
[stable-2.11] task_executor - use correct value for ssh connection retries (#75155) (#75191)
Since the task and connection both have the same 'retries' keyword, the task default
would override the connection value.

Do not pass 'retries' from the task to the connection options.

* Set ssh_connection retries default value back to 0
  It was 0 before the move to config and was changed to 3 by accident.
(cherry picked from commit a8de35e131)

Co-authored-by: Sam Doran <sdoran@redhat.com>
3 years ago
Felix Fontein ca1da07dda [stable-2.11] Restrict packaging to < 21.0 for Python < 3.6. (#75186)
(cherry picked from commit 67bc49e001)

Co-authored-by: Felix Fontein <felix@fontein.de>
3 years ago
Felix Fontein 37b3593720
[2.11] Use `sphinx_ansible_theme` Sphinx theme in docs (#75058)
* Use `sphinx_ansible_theme` Sphinx theme in docs (#74318)

(cherry picked from commit 346c7a765d)

* 🔥 Drop unused `core.css` file

This is a forgotten leftover from #74318 that should've been removed
earlier.

(cherry picked from commit ec408a69f1)

* Update docs requirements list (#74956)

* removes upper bound on sphinx version
* updates versions of docs build dependencies, adds known good requirements file
* adds instructions for using known_good_reqs file

(cherry picked from commit 58f26388be)

Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
Co-authored-by: Sviatoslav Sydorenko <wk@sydorenko.org.ua>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
3 years ago
Brian Coca e009cd9733
delegation fix (#74685) (#74811)
(cherry picked from commit b518aabf81)
3 years ago
David Shrewsbury f752c7f179
role argspec - tag role argspec validation task with 'always' (#74994) (#74996)
* update tag docs

(cherry picked from commit 97acb0f470)
3 years ago
Sloane Hertel 7448c2fa62
[2.11] Fix using module-specific module_defaults in action plugins (#74849)
* Use the module redirect_list when getting defaults for action plugins (#73864)

* Fix module-specific defaults in the gather_facts, package, and service action plugins.

* Handle ansible.legacy actions better in get_action_args_with_defaults

* Add tests for each action plugin

* Changelog

Fixes #72918

(cherry picked from commit 5640093f1c)

* Fix tests for < 3.8
3 years ago
Sam Doran bf6f277edd
[stable-2.11] slurp - handle error when path is a directory (#74930). (#74964)
(cherry picked from commit 0a5cc80ce2)

Co-authored-by: Sam Doran <sdoran@redhat.com>
3 years ago
Hideki Saito f92f039ea7
[2.11] Fix slurp error handling for unreadable files and directories (#74915)
- Fixes #67340
- Backport PR for #68608

Signed-off-by: Hideki Saito <saito@fgrep.org>
3 years ago
Martin Krizek 13e5c64918
Apply display_failed_stderr on loop item results (#74865) (#74898)
(cherry picked from commit 01ab6c6ec7)
3 years ago
Felix Fontein 25ac505975
Basic: don't call lstat when check_mode (#64279) (#74883)
While mode is specified in check_mode, don't call lstat.
Since file may not present.

Fixes: #61185
(cherry picked from commit 7099657dd7)

Co-authored-by: Logistic Bot <logistic-bot@protonmail.com>
3 years ago
Brian Coca 03aff644cc
fix unsafe preservation across newlines (#74960) (#74973)
CVE-2021-3583
  ensure we always have unsafe

Co-authored-by: Rick Elrod <rick@elrod.me>
(cherry picked from commit 4c8c40fd3d)
4 years ago
Sam Doran 578fa17af5
[stable-2.11] version test - improve message when value is empty (#74754) (#74789)
When an empty value is provided, no `version` attribute will exist on the `LooseVersion` or
`StrictVersion` object. We catch and handle this, but it's not immediatebly clear that an
AttributeError means an empty value was provided.

Specifically handle the case where value or version are empty and add more
helpful error messages.

Add integration tests.
(cherry picked from commit 71e33d2578)

Co-authored-by: Sam Doran <sdoran@redhat.com>
4 years ago
Yanis Guenane 8b8996cb36
Localization: Import first set of translated files (#74954)
* Localization: Import first set of translated files

(cherry picked from commit d45c2cec55)

* Ignore smart quotes in the dev guide translation.

The smart quotes are in the warning message to not use smart quotes.

(cherry picked from commit 3f694e9f02)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
4 years ago
Brian Coca 00d5a1610f
Fix pb subs collapse (#74301) (#74376)
* fix subdir parsing for plays

  fixes #74283

  Co-authored-by: Nikolaos Kakouros <nkak@kth.se>

(cherry picked from commit 6418f368e3)
4 years ago
elara-leitstellentechnik 22adad0f19
[2.11] Do not remove non-empty cron tabs (#74698)
* Only remove crontabs if they are empty

(cherry picked from commit fefda12827)

* Add integration test to ensure system cron tab doesn't get removed. Increase cron integration tests separation.

(cherry picked from commit 1e37fa86b4)

* Also detect crontab which only contains whitespace as empty.

(cherry picked from commit 4b69c8f501)

* cron integration test: Adjust system crontab path to be distribution specific.

(cherry picked from commit 70be3730db)

* Add changelog fragment for #74497.

(cherry picked from commit c606b50a3d)

Co-authored-by: Fabian Klemp <fabian.klemp@elara-gmbh.de>
4 years ago
Matt Davis 3d6c8ee3e0
Map Debian 8 to Python 2 (#74152) (#74359)
* Map Debian 8 to Python 2

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>
4 years ago
Fernando Correia 5ee1fe2665
Detect Homebrew on Mac M1 (Apple Silicon) (#74378) (#74401)
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.
4 years ago
Maxim Masiutin 71fc9ec393
[bp-2.11]: apt_key - Binary GnuPG keys downloaded via URL were corrupted (#74522)
* Binary GnuPG keys downloaded via URLs by the 'ansible.builtin.apt_key' module were corrupted so 'gpg' could not import them (https://github.com/ansible/ansible/issues/74424)
(cherry picked from commit 0375070871)
(cherry picked from commit 4cc80ef9c9)
4 years ago
Martin Krizek 5b0a3ac43d
Actually run blocks/finalized_task test (#74291) (#74312)
(cherry picked from commit 7fecb7ccc3)
4 years ago
Brian Coca 85b4c70172 defend against bad or missing crypt (#74304)
* defend against bad or missing crypt

  fixes #74279

(cherry picked from commit 4494ef3a9d)
4 years ago
Rick Elrod 02d07dcace [become] Add Solaris chmod ACL fallback
Change:
- Newer Solaris drops setfacl. Add a fallback for its chmod ACL syntax.

Test Plan:
- New units

Tickets:
- Fixes #74282

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Rick Elrod 341834fe70 [become] Fix solaris permissions regression
Change:
- Regression introduced in #70785
- When macOS chmod ACL syntax is used, Solaris-derived chmods return
  with a status of 5. This is also used for our sshpass handling,
  because sshpass will return 5 on auth failure. This means on Solaris,
  we incorrectly assume auth failure when we reach this branch of logic
  and try to run chmod with macOS syntax.
- We now wrap this specific use of chmod in an exception handler that
  looks for AnsibleAuthenticationFailure and skips over it. This adds
  another authentication attempt (something we normally avoid to prevent
  account lockout), but seems better than the regression of not allowing
  other fallbacks to be used.
- Without this patch, if setfacl fails on Solaris (and sshpass is used),
  we do not try common_remote_group or world-readable tmpdir fallbacks.

Test Plan:
- New unit

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Martin Krizek 2c9389b193
Prevent ansible_failed_task from further templating (#74290) (#74308)
Fixes #74036

* Add changelog

(cherry picked from commit 664531d7d6)
4 years ago
Brian Coca a81386fa62
fix config manager list loption with choices (#74267) (#74298)
fixes #74225

  Co-authored-by: Kim Nørring <github@norring.dk>

(cherry picked from commit b91749d671)
4 years ago
Maxim Masiutin 3aab644285
The error message about the failure to import a 'gpg' key by the 'ansible.builtin.apt_key' module was incorrect (https://github.com/ansible/ansible/issues/74423) (#74521)
Co-authored-by: Sam Doran <sdoran@redhat.com>
(cherry picked from commit e4d7fc9745)
4 years ago
Rick Elrod 3d4d43a1ce
[incidental_setup_rabbitmq] [2.11] Remove main (#74728)
Change:
- This file got missed in bcd7b61c03 /
  #74715 somehow.

Test Plan:
- If CI passes, it worked.

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Sam Doran ebf7233e35
[stable-2.11] facts - set correct OS family for Rocky Linux (#74530) (#74561)
(cherry picked from commit d101009688)

Co-authored-by: Ruairidh MacLeod <ruairidh@rkm.dev>
4 years ago
Brian Coca 45618a6f38
dont specify default for port, allow ssh/config (#74526) (#74562)
also added general note on how defaults work.

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sam Doran <sdoran@redhat.com>
(cherry picked from commit 30912b6a47)
4 years ago