Commit Graph

32275 Commits (4ea50cef23c3dc941b2e8dc507f37a962af6e2c8)

Author SHA1 Message Date
Felix Fontein 4ea50cef23
validate-modules: check_mode attribute and compare with supports_check_mode parameter (#80090)
Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
1 year ago
Matt Martz 2ae013667e
ansible-galaxy collection install retry improvements (#80180)
* clog frag

* Fix retries so that each explicit call to _call_galaxy is retried for the correct number of attempts. Fixes #80174

* Extend retry logic to common URL related connection errors. Fixes #80170

* Extend retries to downloading artifacts

* Extend param docs for change

* Rework the exception handling

* Don't be overly broad, reduce to TimeoutError, and BadStatusLine for now

* _download_file needs to raise AnsibleError.orig_exc

* Remove unused import

* Add IncompleteRead

* Add socket.timeout for py39

* Add 502 to retry codes

* Move http error code checking first

* Use itertools.tee to replay the backoff_iterator instead of using a callable

* Actually set a CLI default of 60s for timeout, to prevent implicit galaxy from using 10s as default from Request.open

* Import typing

* fix type hints

* Use http.HTTPStatus instead of int HTTP error codes where feasible

* Split exception handling

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

* Add missing import

---------

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
1 year ago
Felix Fontein a2dc5fcc7d
Implement semantic markup support for Ansible documentation in ansible-doc. (#80242) 1 year ago
Ken Dreyer fc8203168e
uri: improve force_basic_auth documentation (#80211)
Add more details about what "true" and "false" mean for the
force_basic_auth setting. Give example scenarios when clients may want
to use this setting.
1 year ago
Sumanth Lingappa 0a6333f7d0
corrected class documentation (#80241) 1 year ago
Ikko Eltociear Ashimine 516cb9a52e
fix typo in plugin_docs.py (#80195)
lable -> label
1 year ago
Hugo van Kemenade 1c156c0d16
Replace deprecated BadZipfile with BadZipFile (#80198)
* Replace deprecated BadZipfile with BadZipFile

* Retain support for Python 2.7
1 year ago
Sloane Hertel 6165dfea40
ansible-galaxy role info - fix unhandled AttributeError
* catch GalaxyError instead of its base class to ensure it will have a http_error attribute
1 year ago
Harmdhast cb2180e286
Fixed typo (#80184)
`uvault` should be `unvault`
1 year ago
Sloane Hertel b7a0e0d792
copy - fix check mode with remote_src=True (#78624)
* Don't create dest directory in check mode

uncomment existing test

Fix checking for file attribute changes in check mode and add a test
1 year ago
Martin Krizek cfa7acbc19
Raise an error on invalid FA.isa value (#80040)
Avoids bad definitions of playbook classes
1 year ago
Brian Coca a1bff416ed
paramiko connection now uses the correct source of data (#79704)
* paramiko connection now uses the correct source of data

* keep orig name

* added missing port to docs

* Update changelogs/fragments/paramiko_config.yml

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>

* test ansible_host templating

* added missing private_key_file

* removed all play_context fallbacks

* Update lib/ansible/plugins/connection/paramiko_ssh.py

Co-authored-by: Jordan Borean <jborean93@gmail.com>

* Update lib/ansible/plugins/connection/paramiko_ssh.py

Co-authored-by: Jordan Borean <jborean93@gmail.com>

---------

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Jordan Borean <jborean93@gmail.com>
1 year ago
Martin Krizek 694f12d01b
Avoid redundant unsafe wrapping in ansible_eval_concat (#80143)
The wrap_var is done in do_template for all concat functions after their
return.
1 year ago
Zachary Peschke 12c1891ce6
Fix spelling and grammar in subelements filter doc (#80137) 1 year ago
Brian Coca ca604513db
apt_repository, dont assume only missing apt-key will populate stderr (#79827)
fixes #79825
1 year ago
Brian Coca ff3ee9c4bd
ansible-inventory prevent duplicating host entries (#80059)
this happened after implementing limits we introduced a bug that a host would be duplicated if it existed in a group's children
1 year ago
Klaus Frank 809727a7c7
improve password lookup syntax in examples (#80092) 1 year ago
Sam Doran 292c70368b
unarchive - log errors from underlying commands (#75329)
* unarchive - log errors from underlying commands

When a command run by the module fails, log the errors if debugging is enabled.

* Use debug() method
1 year ago
Sam Doran a56428de11
unarchive - properly handle relative path for `dest` (#75267)
* unarchive - properly handle relative path for dest

* Add integration test

* Return output of underlying commands with increased verbosity

* Revert "Return output of underlying commands with increased verbosity"

This reverts commit a2790c8275cdc5697b65670a0beffdc74b741bf6.

* Warn when a relative destination path was provided
1 year ago
Sloane Hertel b981a9dfcd
add a worker queue to get updates from the main results thread (#79886)
* Create a queue per WorkerProcess to receive intra-task updates
* Update `pause` action to use the worker queue
* Deprecate ConnectionBase()._new_stdin
* Add new `Display`  convenience method `prompt_until` to manage both controller- and worker-sourced prompting without cross-fork stdin sharing, in-worker mechanism to handle request-response over new worker queue.
1 year ago
Klaus Frank 39fd899d83
Clarify combine filter examples (#80078) 1 year ago
Yaakov Selkowitz c028006aaf
Define all processor facts on s390x (#19755) (#79806)
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
1 year ago
Martin Krizek 3fd0e12571
Introduce Delegatable and Notifiable mixin classes (#80077)
* Introduce Delegatable and Notifiable mixin classes

* fix sanity

* fix sanity
1 year ago
Desmond Obisi 43aa47c2af
package_facts requires python-rpm on SUSE systems in ansible 2.12.1 (#80041) 1 year ago
Martin Krizek 6c3d2a4e51
Use FAs with inheritance only when applicable (#80026)
... and set default value of an attribute on an object
only in NonInheritableFA.

Fixes #79777

ci_complete
1 year ago
devon-mar 2f8f7fba4c
Update lookup to use positional only arg for name to avoid conflicts (#79839) 1 year ago
Miklos Sagi b7ef2c1589
ansible-playbook -K breaks when passwords have quotes (#79837)
Now only 'unquote' when ini config file is the source
1 year ago
Matt Clay 21fc699b77
Remove trailing spaces from lines in YAML (#80032) 1 year ago
Jordan Borean 1e6b8249e7
Add condition that causes a when to skip a task to output msg (#78918)
* Add condition that causes a when to skip a task

* Fix up tests

* Use false_condition instead of failed_condition

* Remove formatting accidentially added

* Fix sanity
1 year ago
Martin Krizek bd329dc543
Make using blocks as handlers a parser error (#79993)
Fixes #79968
1 year ago
Sloane Hertel 556dadba6d
user - fix comparing existing group names to group IDs (#79981) 1 year ago
Matt Clay 715ab99462
ansible-test - Improve code formatting (#79983)
* ansible-test - Add blank lines after docstrings

* ansible-test - Preserve formatting of arg pairs

* ansible-test - Remove unused string

* ansible-test - Remove pointless dict() usage

* ansible-test - Clean up initial func arg indenting

* ansible-test - Clean up constructor arg indenting

* ansible-test - Clean up func arg wrapping

* ansible-test - Clean up comma and paren placement
1 year ago
Brian Coca e2f147bcec
ansible-inventory, add --limit option (#79596)
* ansible-inventory, add --limit option

* also graph

* optimize the when not providing limit

* added tests and clog

* avoid empty groups, fix tests

* i swear there as an ignore_errors there already!!?!?!?

* Fix stdout test fallback

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>

* simpler approach using subset against inventory directly

* tyupose

* renamed funciton to what it actuall does
got yaml in line with others about removing empty groups

* have graph ignore limts, also note same for --host

* fixed typo long line

* better test

* cause hosvars are not a thing

---------

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
1 year ago
Matt Clay 71f2e777ed
Update mypy to version 1.0.0 (#79963) 1 year ago
Sebastian Gumprich b5ff981369
Change `yes` to `true` in uri-module (#79934) 1 year ago
Martin Krizek d43d8274b1
Remove unneeded fallback code for nested defined/undefined tests (#79960)
* Remove unneeded fallback code for nested defined/undefined tests

The code used to handle defined/undefined tests on objects containing
nested undefined variables. Due to changes in lazy evalution of Jinja2
expressions it is no longer needed, see #56116.
1 year ago
Matt Martz 243d1b5e3d
Replace deprecated stacked `@classmethod` and `@property` (#79952) 1 year ago
Martin Krizek 09e0fb3516
Change ansible_job_id format (#79951)
* Change ansible_job_id format

...to be something that does not resemble float or other type which
value could be changed by literal_eval that jinja2_native uses.

Specifically the format of '%d.%d' is converted from str to float and
then back to float which may result in truncating the number resulting
in the job not being found because the job id does not exist.
1 year ago
Matt Davis e1d298ed61
don't ignore templated _raw_params that k=v parser failed to parse (#79913)
fixes #79862
1 year ago
Matt Clay 2525d0a136
basic.py - Perform Python version check earlier (#79954) 1 year ago
Matt Clay e6900f5cad
pycompat24 - Remove support for Python <= 2.5 (#79953) 1 year ago
Sloane Hertel fcdd7493ae
improve password_hash warning for unsupported algorithms (#79872)
* password_hash - give a warning for unsupported algorithms (that raise a TypeError)

* add suggested changes, a test and changelog
1 year ago
Matt Clay 9d65e122ff
Fix detection of available hashlib algorithms (#79946)
* Fix detection of available hashlib algorithms

Detection of hashlib algorithms now works on Python 3.x.
The new implementation works on Python 2.7 and later.

Test coverage is provided by both integration and unit tests.

* Add additional details about hashlib in docs
1 year ago
Matt Clay 716631189c
Fix "pointless" strings detected by pylint (#79943)
Convert these strings to comments, since they are not valid docstrings.
1 year ago
Matt Clay 02f6e40534
Clean up pointless statements (#79941)
* Add ignores for intentional pointless statements

* Remove redundant docstring

* Fix function docstring placement
1 year ago
Sloane Hertel fa1564c548
include_vars - document hash_behaviour + dir (#79790)
* document that hash_behaviour does not apply to individual files of variables when using the dir option

* add tests
1 year ago
Mateus Rangel 32672c6326
Improving the RETURN and its docs on the apt_repository module (#79658)
* Improving the documentation on how we generate the default value of the filename parameter

* fix pep8

* removing unnecessary documentation and improving the module's return

* making the RETURN docs

* pep8

* version_added and changelog

* module._diff

* module._diff fix

* add rudimentary tests for new outputs

---------

Co-authored-by: Matt Davis <mrd@redhat.com>
1 year ago
Sloane Hertel ce6e53e1f6
Remove another unwanted comma from pause action (#79926) 1 year ago
Matt Clay 379058e10f
Update collections.abc imports (#79911)
* Update `collections.abc` imports

- Use `six.moves` for modules and module_utils
- Use `collections.abc` for controller code

This avoids using `ansible.module_utils.common._collections_compat`,
which was added before the vendored `six` was updated to provide these
imports.

* Update _collections_compat to use six.moves

Also update the custom pylint rule to reflect this change.
1 year ago
Matt Clay 3b4f3c066a
Ignore necessary unused imports in module_utils (#79904) 1 year ago