Commit Graph

4255 Commits (56d142350d62fb674e1c6874b3ace2cf5cb933a7)

Author SHA1 Message Date
Matt Martz 56d142350d
Add support for importlib.resources (#78915)
* Add support for importlib.resources

* Remove the importlib.resources imports

* return the correct data

* Some code comments, and re-order for consistency

* Disallow traversing packages below an individual collection

* Add a traversable class for namespaces

* Re-use variable

* Utilize itertools.chain.from_iterable

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

* Simplify logic to check for packages from ansible loaders

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

* Just a generator expression, instead of a generator

* docstrings

* Add comment about find_spec for our namespaces

* Add some initial unit tests for importlib.resources

* normalize

* Utilize importlib.resources for listing collections

* collections_path is already in config, just use config

* install uses a different default for collections_path

* Remove unused import

* Remove duplicate __truediv__

* Bring back TraversableResources

* Apply some small suggestions from code review

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>

* Remove cross contamination between plugin loader code and CLI code

* Remove unused import

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
1 year ago
Sloane Hertel b5b239fd71
fix role argument spec error for invalid suboptions (#76578)
fixes https://github.com/ansible/ansible/issues/75536
1 year ago
evangelionlion 6f8c1da0c8
correct the mistake of example repeat_original (#79659)
there is a little mistake 


##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
1 year ago
Jonathan Rietveld 4a29591b98
Fix a typo in the warning message (#79635) 1 year ago
jbreitwe-rh 38cedc7f1a
Fixed incorrect spelling of the word overridden. (#79620) 1 year ago
Brian Coca b7e948e623
filter/test plugin listing, fix bug on file sorting (#79591)
* filter/test plugin listing, fix bug on file sorting

avoid legacy/builtin special casing for 'all'
1 year ago
Rafał Osiecki 0f01c69f1e
Update split.yml (#79570)
typo fix
2 years ago
Matt Martz 1998521e2d
Always create new role (#78661)
Don't use role cache for determining whether to create a new instance of role
2 years ago
Gaudenz Steinlin c33a782a9c
Fix password lookup rewrites file when using encrypt (#79431)
* Remove unused mock from test_password_already_created_encrypt

The _get_paths mock is never used in the
test_password_already_created_encrypt test case.

* Add test to assert the password file is not rewritten

If the password file already contains the salt and the hasing algorithm
does not use the ident parameter, the password lookup should not write
to the password file.

* Fix "changed" if using "encrypt" in password lookup

When using the "encrypt" parameter to the password lookup without the
ident parameter, the password file was always marked as "changed". This
caused the file to be rewritten with the same content. This is fixed by
only marking the file as changed, if an "ident" value needs to be added
to the file.

Fixes #79430.

Add changelog entry
2 years ago
Brian Coca 5f3a6b78db
local connection: avoid tb when running in container with invalid user (#79414)
* local connection: avoid tb when running in container with invalid user

* clog

* cannot use uid, leave empty and ~/ will resolve itself

* get back to what it did
2 years ago
Brian Coca 505b29b2a9
more strftime docs (#79417)
* more strftime docs

fixes #79397
Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: Don Naro <dnaro@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2 years ago
Brian Coca 1bda6750f5
fix reject list (#79391) 2 years ago
seachanged 6cec31574f
Update fileglob.py (#78887)
Improve documentation for relative file paths
2 years ago
Joseph Shraibman f089aae5ee
Clarify that b64decode does not work with binary output (#79294) 2 years ago
Brian Coca 3448fcabc5
file lookup now works with general lookup error framework (#79339)
* file lookup now works with general lookup error framework
2 years ago
Felix Fontein 2a03c8028e
Fix typo 'Ansbile'. (#79318) 2 years ago
Alex Willmer 6d9e2bc5e9
De-duplicate initialisation of ConnectionBase._connected (#79256)
The same value is unconditionally set 4 lines down.
2 years ago
Brian Coca 0f18ddca9f
mention acl in permissions errors (#79209)
as chmod/mode is not the only thing we attempt and Ubuntu not shipping acl
  in newer versions can lead to some confusion

  fixes #79146
2 years ago
Brian Coca aaab0791d9
File lookup handle missing file more gracefully (#79230)
previously it would have a 2nd tb due to bad error raising
 also remove superfluous warning
2 years ago
Kenyon Ralph 0bacea70c4
plugins/lookup/pipe: docs typo fixes (#79222) 2 years ago
Brian Coca 5d253a1380
fix password lookup's use of f=v settings (#76551)
update tests
2 years ago
Abhijeet Kasurde a48c442275
Misc Typo fixes (#79088) 2 years ago
Martin Krizek e1daaae42a
Fix using FQCN for flush_handlers (#79057)
Fixes #79023
2 years ago
Joel McGuire ae66d9a1f4
Fixed spelling (#78911) 2 years ago
Felix Fontein 3423a6609f
Fix docs for new commonpath and normpath filters (#78897) 2 years ago
Oskar Ahner 3515b3c5fc
winrm - fix reducing 'Read timed out' error (#78869)
* winrm - fix reducing 'Read timed out' error

This fix reduces the exceptiopn 'Read timed out. (read timeout=nnn)' occurring seemingly randomly and
unpredictable on some networks (which have long latency and/or many hops or other problems). The fix
ensures that the involved timeout is set to a value so this issue is reduced.

* Add changelog fragment

Co-authored-by: Jordan Borean <jborean93@gmail.com>
2 years ago
Shivam Durgbuns 6e949d8f5d
Added normpath filter (#78894)
Signed-off-by: Shivam Durgbuns <sdurgbun@redhat.com>
2 years ago
Brian Coca 7c4d5f5099
documented windows filters (#78876)
* documented windows filters

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Sandra McCann <samccann@redhat.com>
2 years ago
Shivam Durgbuns 8444d47b11
Adding two new os.path filters and its docs (#78794)
* Adding two new os.path filters and its docs

Signed-off-by: Shivam Durgbuns <sdurgbun@redhat.com>
2 years ago
Brian Coca 4115ddd135
plugin loader fix existing config testing (#78859)
create specific function to find config entry to avoid repopulating constantly
2 years ago
Felix Fontein 9aa9b4eac0
Improve filter docs (#78839) 2 years ago
Matt Martz 76b746655a
Add `use_rsa_sha2_algorithms` option for paramiko (#78789)
Fixes #76737
Fixes #77673

Co-authored-by: Matt Clay <matt@mystile.com>
2 years ago
Matt Martz 1b47def5ed
Add ssh_args and friends back, add var for proxy_command (#78826)
Fixes #78750
2 years ago
Brian Coca 3b937123d2
final docs for filters (#78800)
Co-authored-by: Felix Fontein <felix@fontein.de>
2 years ago
Felix Fontein 9b8e60c36d
While the Python function is called ismount, the filter has the names mount and is_mount. (#78792) 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
Felix Fontein cbffb77f57
Document some more filters (#78548) 2 years ago
wnjuguna 952ee88f33
Documented connection parameters required to enable scp (OpenSSH >=9.0) (#78745) 2 years ago
Felix Fontein 695c48957d
Fix test docs (#78756) 2 years ago
Sloane Hertel 563f3ecc11
Error for context-dependent redirects (#78755) 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 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
Brian Coca 77ba025a13
document tests (#78685)
Document the builtin test plugins

Co-authored-by: Felix Fontein <felix@fontein.de>
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 4260b71cc7
refactor and fixes for doc parsing (#77719)
* refactor and remove redundant code in documentation

  allow location and building api to be more accessible
  fix issues with displaying ansible.legacy and ansible.builtin
  ensure we don't x2 process tokens (some modules reference them also) fixes #77764
  move to constants vs hardcoded
  more informative errors and comments
  now have actual filter/test plugins, which expose the filter/test functions
  moved filter/test loading/finding logic into jinja2pluginloader, removed dupe implementations
  added tests for case in which we unique by basename when listing

Update lib/ansible/utils/plugin_docs.py
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2 years ago
Sloane Hertel 2464e1e91c
Fix vars plugin code and documentation mismatch (#78562)
* Add a warning for collections that are attempting to be autoloaded to no effect
* Deprecate REQUIRES_WHITELIST and add support for REQUIRES_ENABLED so the docs are accurate
* Fix documentation
* add more vars plugin tests
* Simplify code and add a FIXME for another bug
* fix precedence
* Make setting the class attr at all a warning, even if it's True
* Add fun parsing for _load_name
* include _load_name in messages
2 years ago
Martin Krizek 19e7c5b0c1
_get_next_task_from_state should not mutate anyting outside of state (#78657)
Fixes #78612
2 years ago
Martin Krizek 42d8a9daa8
Prevent double failing hosts for includes in loops (#76928)
Fixes #23161
2 years ago