summaryrefslogtreecommitdiffstats
path: root/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
* try to load unqualified plugins from whitelist (#70086)Matt Davis2020-06-172-8/+29
| | | | | | | | | | | | | | | | | | | | | * try to load unqualified plugins from whitelist * necessary for backcompat loading of unqualified collectionized callback plugins redirected from <= 2.9 core * also added de-duping from actual loaded name * add tests * add warning test * group test script entries by topic * shorten warning text grep because wrapping is dumb * fix adhoc callback loading behavior * collections pass over whitelist wasn't respecting `_run_additional_callbacks` * adds regression tests for same * avoid `grep -L` in tests since it breaks the world
* Clarify blockinfile docs for insertafter/insertbefore (#69396)David Shrewsbury2020-06-161-3/+3
| | | | | | | | * Clarify blockinfile docs for insertafter/insertbefore It's not clear from the docs that these options take effect only when no marker lines are found in the document. * Add changelog fragment
* document return values of file module (#69560)Matthew Davis2020-06-161-2/+11
| | | | | | * document return values of file module * Clarify whether path or dest input is used as dest output in file module Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
* Enhance documentation around add_host bypassing the play host loop (#69692)Vincent Bernat2020-06-162-1/+12
| | | Signed-off-by: Vincent Bernat <vincent@bernat.ch>
* remove new Windows modules not present in 2.9 (#70087)Jordan Borean2020-06-161-16/+0
|
* transparent downstream vendoring (#69850)Matt Davis2020-06-162-0/+49
| | | | | | | | | | | | * builtin downstream vendoring support * allows downstream packagers to install packages to `ansible/_vendor` that will automatically be added to head of sys.path during `ansible` package load * tests * sort conflicting package names in warning text * sanity fixes * skip unnecessary comparison
* ansible-galaxy - fix collection installation with trailing slashes (#70016)Sam Doran2020-06-151-2/+19
| | | | | | | | | | | | | | | | If we fail to find a member when extracting a directory, try adding a trailing slash to the member name. In certain cases, the member in the tarfile will contain a trailing slash but the file name in FILES.json will never contain the trailing slash. If unable to find the member, handle the KeyError and print a nicer error. Also check if a directory exists before creating it since it may have been extracted from the archive. Fixes #70009 * Add unit tests * Use loop for trying to get members
* yum/dnf: check type of elements in a name (#70072)Martin Krizek2020-06-153-1/+5
|
* Fix aci_intf_policy_* redirects. (#70051)Felix Fontein2020-06-151-6/+6
|
* Avoid use of deprecated junit-xml method.Matt Clay2020-06-121-1/+10
|
* fix discovery on loop with delegation (#70013)Brian Coca2020-06-121-0/+5
| | | | | * fix discovery on loop with delegation fixes #69963
* Fix Include_vars example (#69966)Falcon Taylor-Carter2020-06-112-6/+9
| | | | * Remove incorrect var in first_found docs * Fix include_vars example using lookup
* fix configurable pipelining (#69920)Brian Coca2020-06-112-16/+26
| | | | | * fix configurable pipelining Co-authored-by: Sloane Hertel <shertel@redhat.com>
* Fix copy module file perms with remote_src (#69993)David Shrewsbury2020-06-111-0/+8
| | | | | | | | | | | | | | | | | | | | | | | When using 'remote_src: yes' and 'mode: preserve', the code handling the file modes has to be handled on the remote node because it's the one that has access to the source files. This means that the copy module itself must handle this, rather than the copy action plugin (which is where all that logic exists). The copy module handles this when we copy a single file over. But when it is a directory as the src parameter value, the mode of the files beneath it are not considered. Subdirectories are copied with shutil.copytree() which will preserve permissions automatically. Individual files are copied with shutil.copyfile() which does NOT preserve permissions. We need to add some calls to shutil.copymode() to correct that. Note: This *always* retains individial file permissions. Specifying a 'mode' other than 'preserve' when giving a source directory for the 'src' param does not make sense so will be ignored in that case only. Fixes #69783 * Add changelog and test
* config: singular ANSIBLE_COLLECTIONS_PATH (#70007)James Cassell2020-06-112-3/+17
| | | | | | | | | | | | * config: singular ANSIBLE_COLLECTIONS_PATH Every other *_PATH setting in ansible is singular, and the traditional $PATH variable is also singular despite containing a list of directories. Let's be consistent both internally and with POSIX tradition. * update all ANSIBLE_COLLECTIONS_PATHS env references to be singular * deprecate plural ANSIBLE_COLLECTIONS_PATHS setting
* Plugin/module docs: parse return values, add collection names in them ↵Felix Fontein2020-06-113-18/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (version_added_collection), and format them nicely in ansible-doc (#69796) * Tag return value docs if they are a dict (and not str/None). * Try to parse return docs as YAML. * Properly dump return values in ansible-doc. * Adjust plugin formatter. * Add changelog fragment. * Don't add 'default' for return values. * Fix plugin_formatter. * Only try to parse return docs if they are still a string. * Add tests. * Warn if RETURN cannot be parsed. * Adjust tests. Also test for warning. * if -> elif (otherwise EXAMPLE will be parsed too). * Always parse return documentation, and fail if it is invalid YAML. * Polishing. * Mostly re-enable ansible-doc tests. Listing from the local collection seems to be somewhat broken. I assume this is why the test was disabled. * Lint and make tests work with Python 2. * Keep FQCNs in plugins (not modules), i.e. restore previous state.
* Support `removed_at_date` in ansible-doc (#70002)Nilashish Chakraborty2020-06-111-3/+8
| | | | | | | | | | | | | | | | | | * Support removed_at_date in ansible-doc Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> Changes: * ansible-doc does not support `removed_at_date` and assumes that deprecated dict will either have `removed_in` or `version`. This results in ansible-doc (and hence "sanity --test=ansible-doc") failing for modules having only `removed_at_date`. * This patch adds support for `removed_at_date` and also gives it precedence over `removed_in` or `version`. * Add tests and changelog Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
* implemented 'prefix' for file based cache (#69872)Brian Coca2020-06-111-5/+13
| | | | | * implemented 'prefix' for file based cache Co-authored-by: s-hertel <shertel@redhat.com>
* galaxy - preserve symlinks on build/install (#69959)Jordan Borean2020-06-101-21/+94
| | | | | | | | | * galaxy - preserve symlinks on build/install * Handle directory symlinks * py2 compat change * Updated changelog fragment
* added more ways to config new options in url (#69950)Brian Coca2020-06-101-1/+64
| | | * added more ways to config new options in url
* ansible-galaxy - Fix role info when role is not installed (#69924)Sam Doran2020-06-101-7/+16
| | | | | | | | | | * ansible-galaxy - Fix role info when role is not installed Only report the role not found if in offline mode, otherwise query the galaxy API to get role information. Fixes #69867 * Improve error message when role is not found in Ansible Galaxy
* Raise Warning when import_playbook receives additional parameters (#64156)Kshitij Chawla2020-06-101-1/+5
| | | | | | | | * Extra whitespace around imported playbook filename are stripped. * Corrected call for display.deprecated * Changed warning type & added test * Added auto verification of raised warning * More accurate warning message
* Do not keep empty blocks after tag filtering (#69987)Martin Krizek2020-06-101-1/+3
| | | | | | | | This prevents PlayIterator having to go through empty blocks that were created in filter_tagged_tasks. This should be a performance improvement for playbooks that mostly skip tasks with tags. ci_complete
* Address linting errors in default callback (#69989)Matt Martz2020-06-101-1/+1
|
* do we really need update vars from pc? (#69952)Brian Coca2020-06-101-21/+0
| | | | * don't we really need update vars from pc
* fixed missing default (#69972)Brian Coca2020-06-101-2/+4
| | | | | | | * fixed missing default also deprecated so new options wont have to go through this
* Fix up schema for collection deprecation (#69977)Jordan Borean2020-06-102-2/+2
| | | | | | | * Fix up schema for collection deprecation * Fix up modules using wrong name * Another fix
* support hard coded module_defaults.yml groups for collections (#69919)Sloane Hertel2020-06-1011-1572/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Only allow groups which were hardcoded in module_defaults.yml only load action groups from the collection if module_defaults contains a potential group for the action * Fix tests using modules that override those whitelisted in lib/ansible/config/module_defaults.yml Third party modules should not be using group/ - use the action name instead * add externalized module_defaults tests add the missing group and collections ci_complete Co-authored-by: Matt Davis <mrd@redhat.com> * changelog ci_complete * Fix import in tests ci_complete * Update with requested changes ci_complete * don't traceback since we don't validate the contents of module_defaults ci_complete Co-authored-by: Matt Davis <mrd@redhat.com>
* Deprecation revisited (#69926)Felix Fontein2020-06-1031-97/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Allow to specify collection_name separately for deprecation. * Use new functionality in Ansible. * Use new functionality in tests. * Update tagging/untagging functions. * Update pylint deprecated sanity test. * Update validate-modules. Missing are basic checks for version_added (validate semantic version format for collections). * Improve version validation. Re-add version_added validation. * Make sure collection names are added to return docs before schema validation. * Extra checks to avoid crashes on bad data. * Make C# module utils code work, and update/extend tests. * Add changelog fragment. * Stop extracting collection name from potentially tagged versions/dates. * Simplify C# code. * Update Windows modules docs. * Forgot semicolons.
* Add intg test to repro #36045 (add_host traceback) (#69912)Brian Coca2020-06-091-11/+18
| | | | | | | * Add intg test to repro #36045 (add_host traceback) * fix raw_params usage in add_host Co-authored-by: Adrian Likins <alikins@redhat.com>
* Display parameter name in string conversion warning (#57145)Sam Doran2020-06-091-7/+33
| | | Add prefix to error message for nested options. This is helpful if a subelement key has the same name as a top level key.
* avoid constant checking controlpersist (#69910)Brian Coca2020-06-094-4/+21
| | | | * avoid constant checking controlpersist
* Add custom globals to the environment, and not per template (#69278)Matt Martz2020-06-081-10/+9
| | | | | * Add custom globals to the environment, and not per template * Add changelog fragment
* Make AnsibleVaultEncryptedUnicode work more like a string (#67823)Matt Martz2020-06-084-12/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Make AnsibleVaultEncryptedUnicode work more like a string. Fixes #24425 * Remove debugging * Wrap some things * Reduce diff * data should always result in text * add tests * Don't just copy and paste, kids * Add eq and ne back * Go full UserString copy/paste * Various version related fixes * Remove trailing newline * py2v3 * Add a test that can evaluate whether a variable is vault encrypted * map was introduces in jinja2 2.7 * moar jinja * type fix Co-Authored-By: Sam Doran <sdoran@redhat.com> * Remove duplicate __hash__ * Fix typo * Add changelog fragment * ci_complete Co-authored-by: Sam Doran <sdoran@redhat.com>
* Update bundled version of distro from 1.4.0 to 1.5.0 (#69709)Sam Doran2020-06-082-33/+31
| | | | | Includes changes we made in our version that were merged upstream ci_complete
* Auto unroll generators produced by jinja filters (#68014)Matt Martz2020-06-082-4/+57
| | | | | | | | | | | | | | | | | | | * Auto unroll generators produced by jinja filters * Unroll for native in finalize * Fix indentation Co-authored-by: Sam Doran <sdoran@redhat.com> * Add changelog fragment * ci_complete * Always unroll regardless of jinja2 * ci_complete Co-authored-by: Sam Doran <sdoran@redhat.com>
* ansible-doc: properly handle suboptions (#69795)Felix Fontein2020-06-081-10/+13
| | | * Specifically handle suboptions, contains, etc in ansible-doc.
* Revert "Revert "fixes f5 modules specific redirects (#69865)""Matt Clay2020-06-061-13/+19
| | | | This reverts commit a69c23fd5be072d5e21c85bbb9d40df1dca5533b.
* fix unvault lookup name in example (#69913)Sloane Hertel2020-06-051-1/+1
|
* various deprecation, display, warning, error fixes for collections ↵Matt Davis2020-06-058-114/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | redirection (#69822) * various deprecation, display, warning, error fixes * Update lib/ansible/utils/display.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/utils/display.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/utils/display.py Co-authored-by: Felix Fontein <felix@fontein.de> * cleanup, test fixes * add collection name to deprecated() calls * clean up redirect entries from uncommitted tests * fix dep warning/error header text to match previous Co-authored-by: Felix Fontein <felix@fontein.de>
* fix sys.modules cleanup and blacklist behavior (#69898)Matt Davis2020-06-051-1/+4
| | | | | | | | | | * fix sys.modules cleanup and blacklist behavior * fix map-as-generator py2/py3 issue * clear path_importer_cache between runs * sanity fix * don't be stupid with moving target generators
* Make add_host be idempotent/show changed status (#69897)Rick Elrod2020-06-052-6/+18
| | | | | | | | | | | | Change: - The `add_host` action now shows an accurate change status. Test Plan: - Added a plethora of integration tests. Tickets: Fixes #69881 Signed-off-by: Rick Elrod <rick@elrod.me>
* starting metadata sunset (#69454)Brian Coca2020-06-0576-683/+73
| | | | | | | | | | | | | * starting metadata sunset - purged metadata from any requirements - fix indent in generic handler for yaml content (whey metadata display was off) - make more resilient against bad formed docs - removed all metadata from docs template - remove metadata from schemas - removed mdata tests and from unrelated tests Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Rick Elrod <rick@elrod.me>
* lineinfile - Add alternative backrefs example to docs (#69844)Sam Doran2020-06-041-0/+8
| | | | | * lineinfile - Add alternative backrefs example to docs * Add changelog
* Re-add documentation for yum "install_repoquery" (#69871)Rick Elrod2020-06-041-0/+14
| | | | | | | | | | | | | | | | | | | | | Change: - This was removed in 2014 in 122a7021bc0af. - The option still exists and is enabled by default and can lead to user confusion when people aren't expecting packages (or updated dependencies for it) to get installed and they do. - Add the option documentation back with a few notes to make it clear what is happening. Test Plan: N/A, no code change, just documentation Tickets: - Refs #69497 Signed-off-by: Rick Elrod <rick@elrod.me> * Fix sanity errors Signed-off-by: Rick Elrod <rick@elrod.me>
* Only show one deprecation warning if version and date are both defined. (#69808)Nathaniel Case2020-06-041-4/+4
| | | | This prefers date to version on the basis that date will have been added in 2.10, and version retained for 2.9 compatibility
* Fix documentation for the assemble modules remote_src property. (#69845)the-antz2020-06-041-2/+2
|
* Use fqcr from command module invocation using shell module (#69790)Ganesh Nalawade2020-06-041-1/+1
| | | | | | | | | | * Use fqcr from command module invocation using shell module Fixes https://github.com/ansible/ansible/issues/69788 Use fully qualified collection reference while invoking command module from shell module * Fox review comment
* Fix IncludedFile equality check (#69524)Alex Schultz2020-06-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the case of a free style strategy, it is possible to end up with multiple hosts trying to include from the same role, however the tasks being included may be different with the use of tasks_from. Previously if you had two hosts that were included the same role when the process_include_results function tries to determine if a included needs to be run on a specific host, it would end up merging two different tasks into which ever one was processed first. This change updates the equality check to also check if the task uuid associated with the IncludedFile is the same. The previous check only checked if the task's parent uuid was the same. This breaks down when both includes have the same parent. - hosts: all strategy: free gather_facts: false tasks: - include_role: name: random_sleep - block: - name: set a fact (1) include_role: name: set_a_fact tasks_from: fact1.yml - name: set a fact (2) include_role: name: set_a_fact tasks_from: fact2.yml - name: include didn't run fail: msg: > set_a_fact didn't run fact1: {{ fact1 | default('not defined')}} fact2: {{ fact2 | default('not defined') }}" when: (fact1 is not defined or fact2 is not defined) Closes #69521
* __eq__ should be redefined if __hash__ is defined.Toshio Kuratomi2020-06-041-0/+9
|