Commit Graph

32083 Commits (9bc4fa496ca06d21b347071078b0f12343481e07)

Author SHA1 Message Date
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
Ronan f50ff1c2db
Fix Issue #78564 (#78741) 2 years ago
wnjuguna 952ee88f33
Documented connection parameters required to enable scp (OpenSSH >=9.0) (#78745) 2 years ago
Sorin Sbarnea 9f16bdbdda
Ensure syntax check errors include filenames (#77679)
This fixes bug which prevents identification of broken playbook when
passing multiple playbooks as arguments, something that is common
especially with `--syntax-check`.

Affects: ansible-lint
2 years ago
Felix Fontein 695c48957d
Fix test docs (#78756) 2 years ago
Martin Krizek 8090ee3e78
post_validate LoopControl (#75715)
avoid having to template/post_validate each part of the object
2 years ago
Sloane Hertel 563f3ecc11
Error for context-dependent redirects (#78755) 2 years ago
David Moreau Simard 86ab63f281
Recover unix load average into an ansible_loadavg fact (#75319)
* Recover unix load average into an ansible_loadavg fact

The average load is available out of the box with os.getloadavg().
It adds useful context to the existing ansible_memory_mb and ansible_mounts
facts that provide size and utilization or memory and disk space.

* Add an integration test
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
Felix Fontein fa093d8adf
ansible-doc: remove manual formatting (#78668)
* remove manual formatting and make the output align closer with the original YAML

Co-authored-by: Brian Coca <brian.coca+git@gmail.com>
2 years ago
Brian Coca eb17ab8c27
ansible-doc consistent version info ignore (#78725) 2 years ago
Johanan Liebermann fbd828673d
Fix distro fact handling for Flatcar (#77635)
* Fix distro fact handling for Flatcar

The existence of the file /etc/flatcar/update.conf depends on
bootstrap configuration typically provided by the user. For that
reason this file is unsuitable for determining distro facts for
Flatcar Container Linux.

The distribution_release fact is meaningless in the case of Flatcar
since Flatcar doesn't have named releases. The distribution_version
fact, however, IS meaningful and should contain a number such as
"3139.2.0".

- Use /etc/os-release instead of /etc/flatcar/update.conf.
- Drop the distribution_release fact.
- Set the distribution_version fact.
- Update distro test fixture for Flatcar
- Generate the fixture using gen_distribution_version_testcase.py.
- Override result.distribution and result.os_family manually as the
  generator script gives wrong values.
- Use a recent Flatcar version.

Signed-off-by: Johanan Liebermann <jliebermann@microsoft.com>
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
Martin Krizek fcfdca8e7d
Overriding AnsibleContext.resolve is not needed/allowed (#78714)
https://github.com/pallets/jinja/pull/1393
https://github.com/pallets/jinja/pull/1544

ci_complete
2 years ago
Sloane Hertel 41b62f7db4
Limit Galaxy API calls during ansible-galaxy dependency resolution (#77468)
* Limit Galaxy API calls during ansible-galaxy collection dependency resolution when possible

Installing a tarfile with a dependency from a Galaxy server (e.g. dependencies: {'ns.coll': '>=1.0.0'}) does not get the available versions of the dependency from the galaxy server if a sufficient version is already installed.

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
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
Sam Doran 8ebca4a6a3
fetch_file - properly split files with multi-part file extensions (#75257) 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 72783837c5
fix issue with legacy pugins and no docs (#78686)
* fix issue with legacy pugins and no docs
2 years ago
Sloane Hertel 5f2bb2ba93
Add the rest of the runtime keys to the example in the default collection skeleton (#78573) 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
Matt Martz f8e24e4a65
Guard urllib3 imports against all exceptions. Fixes #78648 (#78667) 2 years ago
Martin Krizek 19e7c5b0c1
_get_next_task_from_state should not mutate anyting outside of state (#78657)
Fixes #78612
2 years ago
NitrogenPointBlue 38c3b5e8f1
Fix typos in stat module examples (#78651) 2 years ago
Brian Coca 0c57734819
until is also implicit (#78632)
The until keyword templating is also implicit, this will now reflect in the docs
2 years ago
rawtaz 87ba1e29d3
doc: Correct mixed up commentary and task name (#78610)
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2 years ago
gmdmi 81813b7f23
Fixes parameter name in expect module examples (#78635) 2 years ago
Arnold Kamanzi 3b9f1871e5
Docs: fix issue-76133-apt-repository (#78586) 2 years ago
Martin Krizek 42d8a9daa8
Prevent double failing hosts for includes in loops (#76928)
Fixes #23161
2 years ago
Andrew Latham 3d6a60b481
Address inactive but legacy print calls found with code checking. (#78581)
* Address inactive but legacy print calls found with code checking.

* Per bcoca remove the inactive legacy print statements
2 years ago
Matt Martz 4c8b8a06be
Fix exit codes for role search and delete. Fixes #78516 (#78578) 2 years ago
Matt Martz deb54e4c5b
Relax minimal config to enable manifest functionality (#78574)
* Revert "Fix incorrect docs about how to enable manifest functionality (#78572)"

This reverts commit ac1ca40fb3.
2 years ago
Matt Martz d2f8099118
Use MANIFEST.in style directives to build collections (#78422) 2 years ago
Elijah DeLee f9a450551d
add required file to collection skeleton (#77418)
* add required file to collection skeleton

This file is required to be able to upload a collection.

It is present in
https://github.com/ansible-collections/collection_template/blob/main/meta/runtime.yml
but that does not get used by default.

Without this, if you use the "ansible-galaxy collection init" command
and you try and publish that collection without adding this file, you
get the error:

"ERROR! Galaxy import process failed: 'requires_ansible' in
meta/runtime.yml is mandatory, but no meta/runtime.yml found (Code:
UNKNOWN)"

Also updates relevant test and adds a changelog fragment
2 years ago
Sandra McCann 8dc097989b
add note to use package_facts module (#78484) 2 years ago
Benoît Knecht 2e8082ebb0
yum_repository: Do not set default value for async (#76750)
* yum_repository: Do not set default value for async

The `async` repository option is deprecated in RHEL 8, but Ansible sets

```ini
async = 1
```

even when it's omitted from the module options, which causes `dnf` to complain
about an unknown configuration option.

This commit removes the default value from the `async` parameter, which means
it won't be added to the repository file if omitted from the module parameters.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>

* Document the specific versions with the default True and the option deprecation for RHEL 8

Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
2 years ago
Kate Case bf1ef5a1f3
Replace get_persistent_connection_options in task_executor with get_options (#74446)
Replace get_persistent_connection_options with get_options
Remove special case for network sub_plugin in _set_plugin_options
Try to avoid mock connection pretending to be persistent
Rename variables->options to reflect what they actually are
Gather options for ssh_type_conn on network_cli
Drop reliance on sub_plugin["type"]
2 years ago
Martin Krizek 811093f022
Move handler processing into new PlayIterator state (#77955)
Fixes #46447
Fixes #52561
Fixes #54991
Fixes #64611
Fixes #64999
Fixes #65067
Fixes #72725
Fixes #72781
Fixes #77616
2 years ago
Martin Krizek 254de2a434
Templar: deprecate shared_loader_obj option (#78540) 2 years ago
Ian Wienand b6f42547f4
Targeting a small typo correction (#78531) 2 years ago
Andrew Latham 4604ea38dd
Supply some descriptions for settings used in ansible.cfg (#78536) 2 years ago
Matt Clay 69ceb31600
ansible-test - Update sanity test requirements. (#78528) 2 years ago
Matt Clay 09d0df1d87
Fix variable use before definition. (#78500)
* Fix variable use before definition.

* Include mkstemp in exception handler.

Also remove two pointless variable assignments.
2 years ago
Brian Coca 0de4480467
allow multiple types for null representation (#78451)
* allow multiple types for null representation

  '' is not Nonetype
  fixes #76493
2 years ago
Brian Coca 3a59cb25f4
add info about plugin name when ignoring abstract errors (#78465)
* add info about plugin name when ignoring abstract

  related to #78464

* added error to narrow down method
2 years ago
Matt Martz 86298b7a47
Fix --role-file arg detection (#78475)
* Fix --role-file arg detection. Fixes #78204

* Do not traceback, give better error

* Add coverage for compound shortopts to match -r. Fixes #78491
2 years ago