Commit Graph
54002 Commits
Author SHA1 Message Date
Sloane HertelandGitHub 230f956e25 Add lineinfile integration test for removing a line that has already been removed (#81762)
ci_complete ci_coverage
2023-09-26 11:07:53 -04:00
mschmooklerandGitHub 7d9889fcb3 Fix typo in action_core.py (#81763)
Fixes typo 'obeys' vs 'objeys' in doc_fragments/action_core.py
2023-09-22 09:48:10 -07:00
Sloane HertelandGitHub 85adaa76f1 Add integration test for copy with force=false when dest exists (#81756)
ci_complete ci_coverage
2023-09-22 09:53:24 -04:00
ValandGitHub 91f94fb59d Daemonize follow-up fixes (#81584)
* Ensure binary data transmission in daemonize

* Add changelog fragment
2023-09-22 09:41:30 -04:00
Matt ClayandGitHub 3794612832 ansible-test - Skip pylint test on Python 3.12 (#81706) 2023-09-21 21:01:58 -07:00
Brian CocaandGitHub 2aef0406d4 ansible-galaxy fix scm dependency error (#81599)
* ansible-galaxy fix scm dependency error

  also changed usage of 'virtual colleciton' to actual type
  avoid error by filtering out virtual collections that dont have
expected properties

simplified as per webknjaz

* Update lib/ansible/galaxy/collection/__init__.py
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2023-09-21 15:49:30 -04:00
Matt MartzandGitHub 7c7385521e Harden the ansiballz and respawn python templates (#81753)
Harden our python templates for respawn and ansiballz around str literal quoting
2023-09-21 12:48:48 -07:00
Brian CocaandGitHub 9edf64eaeb Deprecating paramiko options in base config (#81593)
* Deprecating paramiko options in base config

 they exist in the plugin itself since 2.14

* clog
2023-09-21 15:47:53 -04:00
Martin KrizekandGitHub 1e7f7875c6 Allow for searching handler subdir for included task via include_role (#81733)
Fixes #81722
2023-09-21 12:12:04 -07:00
Abhijeet KasurdeandGitHub 86fd7026a8 Handle exceptions in interpreter discovery (#81745)
* Handle exceptions like AnsibleError, AnsibleConnectionFailure
  raise while interpreter discovery.

Fixes: #78264

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-21 11:13:40 -07:00
Martin KrizekandGitHub 62c10199d1 Add intentional tests for dnf list (#81738)
ci_complete ci_coverage
2023-09-21 19:52:43 +02:00
9244b2bff8 Make sure paths are treated correctly when building collection files manifest (#81619)
* Make sure paths are correct when building collection files manifest

This commit makes sure the path of the files part of
the collection build manifest are correct.

This commit uses os.path.commonprefix instead of
dealing with strings.

Signed-off-by: Carlos Camacho <ccamacho@redhat.com>

Bugfix Pull Request
Fixes: #81618

* Revert the change note type to `minor_changes`

* Clarify the change note with user-oriented details

---------

Signed-off-by: Carlos Camacho <ccamacho@redhat.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2023-09-20 20:18:37 +02:00
René MoserandGitHub e4b9f9c6ae tests: update CloudStack test container to version 1.7.0. (#81732) 2023-09-20 08:34:02 -07:00
7662a05085 Always allow "no-other-choice" pre-release dependencies when resolving collection dependency tree
PR #81606.

Prior to this patch, when `--pre` CLI flag was not passed, the
dependency resolver would treat concrete collection dependency
candidates (Git repositories, subdirs, tarball URLs, or local dirs or
files etc) as not meeting the requirements.

This patch makes it so pre-releases in any concrete artifact
references, and the ones being specifically pinned dependencies or
user requests, met anywhere in the dependency tree, are allowed
unconditionally.

This is achieved by moving the pre-release check from
`is_satisfied_by()` to the `find_matches()` hook, following the
Pip's example.

As a bonus, this change also fixes the situation when a collection
pre-releases weren't considered if it didn't have any stable releases.
This now works even if `--pre` wasn't requested explicitly.

Finally, this patch partially reverts commit
6f4b4c345b, except for the tests. And it
also improves the `--pre` hint warning to explain that it mostly
affects Galaxy/Automation Hub-hosted collection releases.

Ref #73416
Ref #79112
Fixes #79168
Fixes #80048
Resolves #81605

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2023-09-20 16:35:54 +02:00
Abhijeet KasurdeandGitHub 4b7705b07a Remove deprecated APIs from ansible-doc (#81729)
* Removed add_collection_plugins
* Removed find_plugins

Fixes: #81716

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-19 16:48:33 -07:00
3ec7a6e0db Fix ansible-test issues with detecting docker host and forwarding ports (#81726)
* Properly detect docker host using ssh

* Disable ControlPath when creating SSH port forwards

* typo fix

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

* Add clog frag

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2023-09-19 12:10:52 -05:00
WebcrétaireandGitHub 710c0a264e Typo in documentation then -> than (#81724) 2023-09-19 17:16:32 +02:00
Abhijeet KasurdeandGitHub 0ea40e09d1 vars: handle exception in combine_vars (#81700)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-19 17:03:58 +02:00
Matt MartzandGitHub f7234968d2 bump devel to 2.17.0.dev0 (#81712) 2023-09-18 16:24:44 -05:00
Abhijeet KasurdeandGitHub a1a6550daf inventory_ini: Handle SyntaxWarning in ini parsing (#81707)
* handle SyntaxWarning ini inventory parsing

Fixes: #81328

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-18 10:50:50 -04:00
Abhijeet KasurdeandGitHub 2793dfa594 reboot: show last error message in verbose log (#81578)
* The last error message is now presented in a verbose log

Fixes: #81574

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-15 17:50:26 +00:00
Sloane HertelandGitHub 81c83c623c Add an example for cleaning up the async job cache, and clarify how that works (#81697) 2023-09-15 05:11:28 +10:00
Abhijeet KasurdeandGitHub 6f65397871 galaxy: check if the target for symlink exists (#81586)
* Symlinks in the collection might be pointing to non-existent
  targets. Check and report the failure to the user.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-12 16:05:51 -07:00
Felix FonteinandGitHub 7f0baabbe0 blockinfile: avoid crash on Python 3 when creating directory fails (#81662)
* Avoid crash on Python 3.

* Add a test for the crash on Python 3
2023-09-12 15:46:44 -04:00
Abhijeet KasurdeandGitHub 3b608f97b1 sanity: update requirements (#81680)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-12 11:33:08 -04:00
Abhijeet KasurdeandGitHub e4468dc944 copy: print correct dest path when content + diff is used (#81678)
* when --diff is used with content parameter, print destination
  path instead of temporary file path.

Fixes: #79749

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-12 11:32:41 -04:00
Sam DoranandGitHub 243197f2d4 env-setup.fish: Correct syntax errors (#81677)
- Single quote regular expression values to avoid shell expansion
- Properly test if the $QUIET variable is set and non-zero
2023-09-12 11:31:19 -04:00
Sloane HertelandGitHub 67cdaa49f8 ansible-galaxy-collection - fix config permissions for galaxy-importer (#81679)
* Fix permissions for the galaxy-importer config, previously only root had
read/write

* fix ownership instead
2023-09-12 08:43:46 -05:00
Matt ClayandGitHub 7d3d4572ed Fix set filters to use set operations (#81639)
* Fix set filters to use set operations

* Fix integration tests

* Update filter documentation
2023-09-11 09:32:32 -07:00
b1b029c6b5 ansible-doc: allow to filter by more than one collection (#81450)
Make collection filters more flexible for listing collections.
Co-authored-by: Maxwell G <maxwell@gtmx.me>
2023-09-11 09:31:52 -04:00
Sloane HertelandGitHub 8034651cd2 Only mark a role as complete once a task in it executes for the target host (#81565)
* If all tasks in the role are skipped or unreachable, the role is not marked as complete for the host.

* Only mark the role as complete if a task in the role succeeds or fails for the host.
2023-09-08 12:11:48 -04:00
Martin KrizekandGitHub 3eb96f2c68 Lazy load Templar for [changed,failed]_when (#81650)
The `handler_templar` in `StrategyBase._process_pending_results` was
used for templating handler names which is no longer the case. Now it is
only used for templating `changed_when`/`failed_when`. To prevent
re-creating templars each time results are processed, just create it
on-demand when whens are processed.
2023-09-08 10:06:58 +02:00
Abhijeet KasurdeandGitHub cd0aa35c19 encrypt: deprecate passlib_or_crypt (#81571)
* deprecate passlib_or_crypt in favor of do_encrypt

Fixes: #55839
2023-09-07 14:44:26 -07:00
Abhijeet KasurdeandGitHub 6177888cf6 ansible-vault: Check if the destination is writable (#81660)
* Before performing shredding the original file, check if the
  destination file location is writable or not. This will
  prevent corruption of original file.

Fixes: #81455

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-07 15:30:05 -04:00
Martin KrizekandGitHub a861b1adba Replace ConfigParser.readfp() with read_file() (#81657)
* Replace ConfigParser.readfp() with read_file()

readfp was removed in Python 3.12.

Fixes #81656

* py2?

* Use PY3 for the python check
2023-09-07 15:24:50 -04:00
Edwin GuelfandbeinandGitHub a65c331e8e Corrected a typo In options list (#81655)
There was a typo in the word "container", it was spelled "contianer"
2023-09-07 15:23:46 -04:00
Tony FandGitHub 45f4fc8389 Update user.py (#81653)
The phrase `Does nothing when used with other platforms.` sometimes appears before the supported platforms. Combine this phrase with the supported platform line.
2023-09-07 15:23:26 -04:00
rakeshkhopade12andGitHub dedc48bda4 Improve ansible-pull documentation (#81646)
* Improve ansible-pull documentation

* chnaged description from local/remote to target
2023-09-07 15:13:23 -04:00
Matt MartzandGitHub 3ec0850df9 Support packaging and importlib.metadata for pip module (#80881) 2023-09-05 16:11:18 -05:00
Matt DavisandGitHub dd79c49a4d fix various Jinja plugin caching issues (#79781)
* fix various Jinja plugin caching issues

* consolidate the wrapper plugin cache
* remove redundant cache in J2 filter/test interceptor

* intra-template loader bypass

* fix early exits swallowing some exception detail

* misc comment cleanup
2023-09-05 13:32:36 -07:00
4d40988876 Add type hints to ansible.utils.display::Display (#81400)
* Add type hints to ansible.utils.display::Display

Fixes #80841

* Avoid circular import

* Fix sanity

* type hint some of the functions of the module?

* Fix units

* Not sure about this

* Fix some of the issues from reviews

* Add changelog

* ...

* Update lib/ansible/utils/display.py

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

* remove py2 boilerplate

---------

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2023-09-05 12:08:13 -07:00
48d8e067bf changed link ‘Risks of becoming an unprivileged user’ (#81623)
* changes made in become linkœ

* change become link

* Update lib/ansible/plugins/action/__init__.py

---------

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2023-09-05 17:45:57 +02:00
Martin KrizekandGitHub 24aac50369 utils/encrypt.py: remove unused private _LOCK (#81614)
Added in #15299, unused since #30160.

Fixes #81613
2023-09-05 17:02:56 +02:00
David GriesandGitHub 786a8abee6 yum/dnf/dnf5/zypper documentation - fix grammatical error (#81601) 2023-08-31 15:14:27 -04:00
kpincandGitHub 0f20540e96 Docs: Clarify copy module's purpose; tweak wording (#81592) 2023-08-31 15:03:10 -04:00
1cc5efa77b tarfile: Handle deprecation warning for extract and extractall (#81545)
* Python 3.11.4 introduces a new parameter 'filter' in extract and
extractall in tarfile. Handle deprecation warning message emitted
in Python 3.12.
* added probing mechanism in ansible-galaxy code to detect broken
data filter implementation in tarfile.

Fixes: #80832

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2023-08-31 12:02:48 -07:00
Matt ClayandGitHub 5a059b81c8 ansible-test - Fix Python coverage stub generation (#81611)
As of coverage 7.1.0, files without arcs are not generated.

To work around this, an empty (0, 0) arc is used for each file instead.

This is a follow-up to https://github.com/ansible/ansible/pull/81077

ci_coverage
ci_complete
2023-08-31 10:53:10 -07:00
Steffen FrömerandGitHub ae69b280ad Add short option for --ask-vault-pass (#80527)
Fixes: #80523
2023-08-31 09:43:26 -07:00
Matt ClayandGitHub e1e0e2709c ansible-test - Enable thread code coverage (#81604)
ci_complete
ci_coverage
2023-08-30 14:39:47 -07:00
Matt ClayandGitHub 261e5ce381 ansible-test - Update mypy to 1.5.1 (#81602) 2023-08-30 10:39:25 -07:00