summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* New release v2.11.0b3 (#73977)v2.11.0b3Rick Elrod2021-03-204-1/+71
|
* add porting guide info for optional module_utils (#73979)Matt Davis2021-03-201-0/+2
|
* Use ArgumentSpecValidator in AnsibleModule (#73703)Sam Doran2021-03-1919-1118/+1034
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Begin using ArgumentSpecValidator in AnsibleModule * Add check parameters to ArgumentSpecValidator Add additional parameters for specifying required and mutually exclusive parameters. Add code to the .validate() method that runs these additional checks. * Make errors related to unsupported parameters match existing behavior Update the punctuation in the message slightly to make it more readable. Add a property to ArgumentSpecValidator to hold valid parameter names. * Set default values after performining checks * FIx sanity test failure * Use correct parameters when checking sub options * Use a dict when iterating over check functions Referencing by key names makes things a bit more readable IMO. * Fix bug in comparison for sub options evaluation * Add options_context to check functions This allows the parent parameter to be added the the error message if a validation error occurs in a sub option. * Fix bug in apply_defaults behavior of sub spec validation * Accept options_conext in get_unsupported_parameters() If options_context is supplied, a tuple of parent key names of unsupported parameter will be created. This allows the full "path" to the unsupported parameter to be reported. * Build path to the unsupported parameter for error messages. * Remove unused import * Update recursive finder test * Skip if running in check mode This was done in the _check_arguments() method. That was moved to a function that has no way of calling fail_json(), so it must be done outside of validation. This is a silght change in behavior, but I believe the correct one. Previously, only unsupported parameters would cause a failure. All other checks would not be executed if the modlue did not support check mode. This would hide validation failures in check mode. * The great purge Remove all methods related to argument spec validation from AnsibleModule * Keep _name and kind in the caller and out of the validator This seems a bit awkward since this means the caller could end up with {name} and {kind} in the error message if they don't run the messages through the .format() method with name and kind parameters. * Double moustaches work I wasn't sure if they get stripped or not. Looks like they do. Neat trick. * Add changelog * Update unsupported parameter test The error message changed to include name and kind. * Remove unused import * Add better documentation for ArgumentSpecValidator class * Fix example * Few more docs fixes * Mark required and mutually exclusive attributes as private * Mark validate functions as private * Reorganize functions in validation.py * Remove unused imports in basic.py related to argument spec validation * Create errors is module_utils We have errors in lib/ansible/errors/ but those cannot be used by modules. * Update recursive finder test * Move errors to file rather than __init__.py * Change ArgumentSpecValidator.validate() interface Raise AnsibleValidationErrorMultiple on validation error which contains all AnsibleValidationError exceptions for validation failures. Return the validated parameters if validation is successful rather than True/False. Update docs and tests. * Get attribute in loop so that the attribute name can also be used as a parameter * Shorten line * Update calling code in AnsibleModule for new validator interface * Update calling code in validate_argument_spec based in new validation interface * Base custom exception class off of Exception * Call the __init__ method of the base Exception class to populate args * Ensure no_log values are always updated * Make custom exceptions more hierarchical This redefines AnsibleError from lib/ansible/errors with a different signature since that cannot be used by modules. This may be a bad idea. Maybe lib/ansible/errors should be moved to module_utils, or AnsibleError defined in this commit should use the same signature as the original. * Just go back to basing off Exception * Return ValidationResult object on successful validation Create a ValidationResult class. Return a ValidationResult from ArgumentSpecValidator.validate() when validation is successful. Update class and method docs. Update unit tests based on interface change. * Make it easier to get error objects from AnsibleValidationResultMultiple This makes the interface cleaner when getting individual error objects contained in a single AnsibleValidationResultMultiple instance. * Define custom exception for each type of validation failure These errors indicate where a validation error occured. Currently they are empty but could contain specific data for each exception type in the future. * Update tests based on (yet another) interface change * Mark several more functions as private These are all doing rather "internal" things. The ArgumentSpecValidator class is the preferred public interface. * Move warnings and deprecations to result object Rather than calling deprecate() and warn() directly, store them on the result object so the caller can decide what to do with them. * Use subclass for module arg spec validation The subclass uses global warning and deprecations feature * Fix up docs * Remove legal_inputs munging from _handle_aliases() This is done in AnsibleModule by the _set_internal_properties() method. It only makes sense to do that for an AnsibleModule instance (it should update the parameters before performing validation) and shouldn't be done by the validator. Create a private function just for getting legal inputs since that is done in a couple of places. It may make sense store that on the ValidationResult object. * Increase test coverage * Remove unnecessary conditional ci_complete * Mark warnings and deprecations as private in the ValidationResult They can be made public once we come up with a way to make them more generally useful, probably by creating cusom objects to store the data in more structure way. * Mark valid_parameter_names as private and populate it during initialization * Use a global for storing the list of additonal checks to perform This list is used by the main validate method as well as the sub spec validation.
* find - set proper default based on use_regex (#73961)Brian Coca2021-03-193-2/+36
| | | | | | | | | | | | | | | | | | | | | | | | When using "use_regex: yes" and setting an excludes: without specifying a pattern: the existing code passes the file-glob '*' to the regex matcher. This results in an internal invalid-regex exception being thrown. This maintains the old semantics of a default match-all for pattern: but switches the default to '.*' when use_regex is specified. The code made sense as-is before excludes: was added (2.5). In that case, it made no sense to set use_regex but *not* set a pattern. However, with excludes: it now makes sense to only want to exclude a given regex but not specify a specific matching pattern. Closes: #50067 * moved change to new location added changelog * Update lib/ansible/modules/find.py Co-authored-by: Ian Wienand <iwienand@redhat.com>
* Fix a bug adding unrelated candidates to the plugin loader redirect_list ↵Sloane Hertel2021-03-186-6/+118
| | | | | | | | | | | | | | | (#73863) * Fix a bug adding unrelated candidates to the plugin loader redirect_list * Add tests for the redirect list * test redirect list for builtin module * test redirect list for redirected builtin module * test redirect list for collection module * test redirect list for redirected collection module * test redirect list for legacy module * changelog
* fix typoBaptiste Mille-Mathias2021-03-181-1/+1
|
* Amazon: Fix distribution facts for older releaseAbhijeet Kasurde2021-03-184-14/+62
| | | | | | | | | Ansible can gather distribution facts for older Amazon Linux with /etc/os-release data. Fixes: #73946 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Remove ini and env fields for config option CONNECTION_FACTS_MODULESs-hertel2021-03-181-3/+0
|
* clarifies docs for file module, addresses issue 72372 (#73938)Alicia Cozine2021-03-181-3/+3
|
* complex data example using value and default from list of dicts (#73937)Brian Coca2021-03-181-0/+25
|
* Update developing_inventory.rst (#73931)sgpinkus2021-03-181-6/+5
| | | | | | | | | * Update developing_inventory.rst hashes/dictionaries in JSON (JavaScript Object Notation) are represented by what JSON calls "objects", so use that established terminology instead of "hash", "dictionary", or "hash/dictionary" etc. * Update docs/docsite/rst/dev_guide/developing_inventory.rst Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
* Send callbacks directly from the TaskExecutor instead of TaskResults ↵Matt Martz2021-03-184-54/+74
| | | | masquerading as callbacks (#73927)
* Updated COLLECTIONS_4.rst to include ansible-inclusion repo link for new ↵Ompragash Viswanathan2021-03-181-2/+2
| | | | | | | | | collection submission (#73582) Co-authored-by: Sandra McCann <samccann@redhat.com> Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com> Co-authored-by: Sandra McCann <samccann@redhat.com>
* Add some dev documentation for constructed features (#73497)Sloane Hertel2021-03-182-0/+61
|
* Promote publication (#72400)Alicia Cozine2021-03-171-36/+48
| | | | | Co-authored-by: Sandra McCann <samccann@redhat.com> Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com> Co-authored-by: Sandra McCann <samccann@redhat.com>
* Rebased pr73824 (#73934)Alicia Cozine2021-03-1723-47/+50
| | | | Co-authored-by: Eugene <k.evgen61@gmail.com> Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
* ansible-pull: Run All Playbooks When Multiple Are Supplied (#73172)sommersoft2021-03-175-6/+45
| | | | | | | * ansible-pull: run all playbooks when multiple are supplied * add test for ansible-pull with multiple playbooks supplied from cli * add changelog fragment
* Add porting guide for ansible 4Toshio Kuratomi2021-03-171-0/+275
|
* Porting guide changes when adding a new ansible releaseToshio Kuratomi2021-03-172-1/+3
| | | | | * Add the ansible-4 porting guide to the index * Need to exclude the porting guide for ansible-4 from the core docs build
* Ensure task from the worker is finalized/squashed (#73881)Matt Martz2021-03-164-0/+32
| | | * Ensure task from the worker is finalized/squashed. Fixes #57399. Fixes #49942
* Update Ansible release version to v2.11.0b2.post0. (#73917)Rick Elrod2021-03-161-1/+1
|
* New release v2.11.0b2 (#73915)v2.11.0b2Rick Elrod2021-03-154-1/+109
|
* Allow for searching handler subdir for included tasks (#73809)David Shrewsbury2021-03-157-49/+83
| | | | * Allow for searching handler subdir for included tasks
* Fix typo in porting_guide_3.rst (#73871)Ikko Ashimine2021-03-151-1/+1
| | | paramater -> parameter
* setup - virtualization facts add Red Hat vendor (#72876)Martin Nečas2021-03-152-6/+20
| | | Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
* Don't match passive_interface for validate-modules (#73880)Paul Belanger2021-03-131-1/+1
| | | | | | | | | This is a follow up to: https://github.com/ansible/ansible/pull/73508 To avoid adding no_log statements to passive_interface args. Signed-off-by: Paul Belanger <pabelanger@redhat.com>
* validate-modules no_log test: extend search range, add more known ↵Felix Fontein2021-03-132-6/+6
| | | | | | | false-positives (#73882) * validate-modules no_log test: extend search range, add more known false-positives. * Mark false-positives.
* Ensure unit test paths for connection and inventory plugins are based on the ↵Mark Chappell2021-03-122-3/+7
| | | | context (#73877)
* Use virtual host style S3 bucket names in tests.Matt Clay2021-03-126-12/+12
|
* Mention that minor releases end once the next ansible release is made. (#73836)Toshio Kuratomi2021-03-113-2/+22
|
* Update the porting guide for a new ansible version (#73856)Toshio Kuratomi2021-03-111-2/+63
|
* document slurp returns (#73865)Brian Coca2021-03-111-1/+17
| | | * no path on return
* describe what ansible-core is (#73829)Sandra McCann2021-03-111-1/+7
|
* fix su localization optoinBrian Coca2021-03-112-0/+3
| | | | fixes #73837
* moved vs deprecated world readable tmp setting (#73825)Brian Coca2021-03-112-11/+5
|
* Add direct link to using multiple inventory sources (#73680)Jens Heinrich2021-03-111-2/+2
| | | | | This helps users to find the right ressources more easily and prevents them from clicking the first matching link only to be redirected to a subsection on the samepage from there Co-authored-by: Jens Heinrich <github.com/JensHeinrich>
* Docs: Updates the release and maintenance page to reflect new cadences (#73781)Alicia Cozine2021-03-111-120/+134
| | | | | | | | | Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru> Co-authored-by: John R Barker <john@johnrbarker.com> Co-authored-by: Sandra McCann <samccann@redhat.com> Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com> Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru> Co-authored-by: John R Barker <john@johnrbarker.com> Co-authored-by: Sandra McCann <samccann@redhat.com>
* Update developing_modules_general.rst (#73805)bylerbk2021-03-111-1/+1
| | | | | | | | | | ##### SUMMARY <!--- Fixing a typo. There was a double "you" in the text. --> ##### ISSUE TYPE - Docs Pull Request +label: docsite_pr
* Docs: Update installation page for package split (#73790)Alicia Cozine2021-03-111-181/+190
|
* validate-modules: make sure that options that potentially contain secret ↵Felix Fontein2021-03-117-4/+45
| | | | | | | | data have no_log set (#73508) * Catch more potential errors (and increase false-positive rate). * Flag some false-positives in lib/ansible/modules/ with no_log=False. Co-authored-by: John Barker <john@johnrbarker.com>
* add optional module_utils import support (#73832)Matt Davis2021-03-106-24/+140
| | | | | | | | | * add optional module_utils import support Treat core and collections module_utils imports nested within any Python block statement (eg, `try`, `if`) as optional. This allows Ansible modules to implement runtime fallback behavior for missing module_utils (eg from a newer version of ansible-core), where previously, the module payload builder would always fail when unable to locate a module_util (regardless of any runtime behavior the module may implement). * sanity test fixes ci_complete
* Update `resource_prefix` syntax for ansible-test.Matt Clay2021-03-104-5/+9
|
* Unify additional info + WYSIWYG as optional input in the documentation ↵Sviatoslav Sydorenko2021-03-091-10/+4
| | | | report issue form (#73796)
* Nonfatal facts (#73804)Brian Coca2021-03-087-41/+68
| | | | | | | | | | continue with local facts vs at script error actually capture execution errors better error messages in general add more local facts tests fixes #52427
* Documentation: Lay the ground for i18n work. (#73746)Yanis Guenane2021-03-055-1/+355
| | | | | | | | | | | * Documentation: Lay the ground for i18n work. * Translating both ansible-core and ansible docs requires msgcat (a program from the gettext package). If msgcat is not present, only the ansible-core index file's strings will be extracted for translation. If this is a problem, a short hacking script could be written to take the place of msgcat (merging the various index pot files into a single pot file). Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
* distribution: Add Amazon Linux distribution facts (#73767)Abhijeet Kasurde2021-03-056-3/+162
| | | | | | | | * Update Amazon Linux Distribution facts gathering logic * Update tests Fixes: #73742 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Auto cleanup of async cache file (#73760)David Shrewsbury2021-03-044-0/+52
| | | | | * Auto cleanup of async cache file * Add changelog
* feature_request: Component Name (#73787)John R Barker2021-03-041-1/+1
| | | Typo in name results in Bot shouting
* Some changelog fixes for 2.11 (#73778)Rick Elrod2021-03-031-2/+5
| | | Signed-off-by: Rick Elrod <rick@elrod.me>
* Set fact fixes (#73684)Brian Coca2021-03-034-31/+50
| | | | | | * fixes to set_fact correctly give error messages that were previously ignored corrected and expanded docs