* Add intentional coverage for an async_wrapper case (#70593)
Change:
- Test async_wrapper when the module it runs has stderr output
Test Plan:
- CI
- Looked at coverage report and saw green for a few lines that weren't
previously green.
Signed-off-by: Rick Elrod <rick@elrod.me>
* sigh
Signed-off-by: Rick Elrod <rick@elrod.me>
* Get m_u.facts.utils coverage up to 100%
Change:
- Add tests to 'gathering_facts' integration target to get
module_utils.facts.utils coverage up to 100%.
- This also clears incidental coverage from incidental_selinux.
Test Plan:
- CI
Signed-off-by: Rick Elrod <rick@elrod.me>
pipe lookup plugin uses Popen with shell=True intentionally.
This is considered a security issue if user input is not validated.
Updated docs to reflect this information for the user. Also, added
Bandit B602 documentation link for further reading.
Fixes: #70159
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit e5649ca3e8)
- ensure we preserve the typeerror part of the exception so loop defereed error handling
can postpone those caused by undefined variables until the when check is done.
- fix tests to comply with the 'new normal'
- human_to_bytes and others can issue TypeError not only on 'non string'
but also bad string that is not convertable.
Co-authored-by: Sloane Hertel <shertel@redhat.com>
Co-authored-by: Sloane Hertel <shertel@redhat.com>
(cherry picked from commit cf89ca8a03)
* ansible-doc: include collection name in text output (#70401)
* ansible-doc: include collection name in text output
* Be more careful to not accidentally pass ansible.builtin for user-supplied modules.
(cherry picked from commit f4c89eab23)
* plugin loader: return collection name; ansible-doc: handle ansible.builtin correctly (#70026)
* Determine collection in plugin loader.
* Fix test.
* Use PluginPathContext objects in PluginLoader._plugin_path_cache instead of tuples.
(cherry picked from commit 24dcaf8974)
* Do not pass decrypt parameter to assemble module
* Add integration tests where decrypt=True
* Add changelog #70465
(cherry picked from commit 71c378e139)
* ansible-doc man formatter: do not crash when description isn't there.
* Change to report a better error message when description is not there.
* Add test.
(cherry picked from commit 9164b96774)
Include error from apt Python library in module error output
Co-authored-by: Andreas Schleifer <aschleifer@bigpoint.net>
(cherry picked from commit 7d7f15fc9b)
Co-authored-by: Andreas Schleifer <a.schleifer@bigpoint.net>
Co-authored-by: Andreas Schleifer <a.schleifer@bigpoint.net>
The ssh_args were sometimes not correctly applied to the connection
when using _play_context. Use get_option() instead to ensure the
correct ssh_args are always applied.
(cherry picked from commit b4184aa50e)
Co-authored-by: Sam Doran <sdoran@redhat.com>
* misc collection metadata fixes
* parse collection meta with libyaml if available
* require only Mapping for validation
* add explanatory text for _meta_yml_to_dict
* ignore custom pylint rule
* this code shouldn't import a bunch of stuff from ansible, since it's run under the import sanity test
(cherry picked from commit b9e38e8b55)
Fixes#70168
ci_complete
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit b05e00e99a)
* Suggest ansible ad-hoc command while developing module (#70308)
If a local module has no documentation, the doc command will fail without any hints of what is wrong. Add another way to confirm the presence of a local module.
* Update docs/docsite/rst/dev_guide/developing_locally.rst
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 82e5d03bdb)
* Update AWS Integration test docmentation (#70454)
(cherry picked from commit e1ba7dc52a)
* Update hacking/shippable docs.
The `--all` option downloads more than is needed for analyzing code coverage.
(cherry picked from commit fb7740ae3b)
* Document that subversion module requires subversion (#70537)
(cherry picked from commit 64c2cb273f)
* update documentation link to python 3 (#70509)
update the docs link for strftime on the filters page to point to the python3 docs
(cherry picked from commit f7db428375)
* Update windows_winrm.rst (#70306)
gcc also needed to be installed alongside python-devel, krb5-devel, krb5-libs, and krb5-workstation.
(cherry picked from commit f4ea43c4a0)
* updated requirements file for docs build (#70609)
(cherry picked from commit 38ccfb4a3e)
* Clarify that index_var is 0 indexed (#70548)
A little further down the page is another index, ansible_loop.index, which shares a similar description but is 1 indexed.
Its zero indexed twin has a 0 suffix.
``ansible_loop.index`` The current iteration of the loop. (1 indexed)
``ansible_loop.index0`` The current iteration of the loop. (0 indexed)
To remove ambiguity around the usage of index_var, explicitly mention that this variable is 0 indexed.
(cherry picked from commit c410311f55)
* docs: update module development docs (#70594)
Update module development docs for flattened modules directory.
Fixes: #70261 (at least partially)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 20209c508f)
* Doc: fix examples of changelog entries. (#70551)
(cherry picked from commit edcd1a1a70)
* Document tags are not supported with task meta. (#70590)
fixes#70338
(cherry picked from commit 40591d5fbb)
* docs: update date format in removed_at_date (#70597)
removed_at_date requires YYYY-MM-DD format.
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 375c6b4ae4)
* partial update of community docs to reflect collections transition (#70488)
(cherry picked from commit f1f782fc37)
Co-authored-by: Michael Ritsema <michaelritsema@users.noreply.github.com>
Co-authored-by: Mark Chappell <mchappel@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Alan Rominger <arominge@redhat.com>
Co-authored-by: FloMiau <37121807+FloMiau@users.noreply.github.com>
Co-authored-by: mahadelmi <mahadelmi@cmail.carleton.ca>
Co-authored-by: Sayee <57951841+sayee-jadhav@users.noreply.github.com>
Co-authored-by: Karl Goetz <goetzk@users.noreply.github.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Baptiste Mille-Mathias <baptiste.millemathias@gmail.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
* Top-level deprecation of plugin did not get collection_name added when deprecating by version.
* Add changelog fragment.
(cherry picked from commit 689cfd1983)
* [Bugfix] curses.setupterm() error
When run playbook in celery task, curses.setupterm() will be failed
```
File "<frozen importlib._bootstrap>", line 675, in _load
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
File "/Users/guang/.virtualenvs/ansible/lib/python3.6/site-packages/ansible/plugins/action/pause.py", line 45, in <module>
curses.setupterm()
TypeError: argument must be an int, or have a fileno() method.
```
* Add changelog
Co-authored-by: Sam Doran <sdoran@redhat.com>
(cherry picked from commit c3fc2d27d9)
Co-authored-by: 老广 <ibuler@qq.com>
Co-authored-by: 老广 <ibuler@qq.com>
stdout may differ from stdin so it should be used to determine the column
width, especially since it is the target file descriptor.
(cherry picked from commit 45e0f74702)
Co-authored-by: Pavel Březina <pbrezina@redhat.com>
Since only check_type_str() accepts extra param, only pass to our checker and
do not pass kwargs to custom checkers.
* Add unit tests
(cherry picked from commit bc05415109)
Co-authored-by: Sam Doran <sdoran@redhat.com>
A recent updated to psutil, which is a dependency of ansible-runner, fails
to install on older versions of pip.
Commit with the breaking change:
135628639b
(cherry picked from commit 9d27d7c8b1)
Co-authored-by: Sam Doran <sdoran@redhat.com>
Parse errors from libyaml now compensate for the offset of the documentation within a module.
(cherry picked from commit 1a0d8a51cd)
Co-authored-by: Matt Clay <matt@mystile.com>
These tests verify that AnsibleModule can be instantiated when cwd does not exist or is unreadable.
(cherry picked from commit d6fb42d1c5)
Co-authored-by: Matt Clay <matt@mystile.com>
* Migrating MySQL to community.mysql
* Removed aliases to fix yaml linting
Co-authored-by: Ben Mildren <bmildren@digitalocean.com>
(cherry picked from commit b149a89e07)
Co-authored-by: Ben Mildren <ben.mildren@gmail.com>
* doc: avoid mix of single and double quotes (#70115)
Avoid mix of single and double quotes in the `ternary`, this way
we can copy/past the example without any surprise.
(cherry picked from commit b491f776b9)
* document FQCN for M() and :seealso: in DOCUMENTATION blocks (#70245)
* document FQCN for M() in DOCUMENTATION blocks
* add note about c
(cherry picked from commit 83f6e4850b)
* Fix bullet points in intro_getting_started.rst. (#70365)
The layout was jumbled due to issues with whitespace.
(cherry picked from commit dc6f4b6502)
* Add steps for how to create changelog.rst for a collection (#70262)
* Update docs/docsite/rst/dev_guide/developing_collections.rst
* add steps to create changelogs, add sentence about not using the tool
* add note for rerunning the command
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 5a28b2b86c)
* ansible-doc: avoid problems with YAML anchors when formatting man page (#70045)
* Avoid problems with YAML anchors when formatting man page.
* Add changelog.
(cherry picked from commit 5e4f708241)
* Minor grammatical fix (#70405)
'you' -> 'your'
(cherry picked from commit a1ac595d42)
* incorporate minimalism feedback on filters page (#70366)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
(cherry picked from commit c89f3cda9e)
* more correct info about role main.yml (#70326)
fixes#40496
(cherry picked from commit 5d3d097de3)
* Fix a small typo in cache plugin description @ `config/base.yml`
PR #70420
(cherry picked from commit 626df08d9d)
* with_sequence: example using vars (#69369)
Added an example for using vars in with_sequence.
Fixes: #68836
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 5709173c32)
* Update pull.py (#70393)
(cherry picked from commit 46ad3c1162)
* Update playbooks.rst (#70317)
(cherry picked from commit 7c90a2d2a6)
* Add documentation for ipaddr filters (#70343)
(cherry picked from commit 9eb904ea61)
* update platform table with links to collections (#70373)
(cherry picked from commit aa59c23aed)
* Add description of collections and become_exe keywords (#68055)
* Add description of collections keyword
* Update based on feedback.
- Add link to become plugins.
- Add note about how the collections keyword works with roles.
(cherry picked from commit 5833af9e2a)
Co-authored-by: Gonéri Le Bouder <goneri@lebouder.net>
Co-authored-by: Mark Sanders <ziplokk.mark.sanders@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Sir Mobus Gochfulshigan Dorphin Esquire XXIII <celestialtuba@gmail.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Michael Scherer <mscherer@users.noreply.github.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Ethan <smithe2413@gmail.com>
Co-authored-by: jafiala <56597272+jafiala@users.noreply.github.com>
Co-authored-by: Baptiste Mille-Mathias <baptiste.millemathias@gmail.com>
Co-authored-by: Sam Doran <sdoran@redhat.com>
* migrating ProxySQL to community.proxysql
* Removed remaining ProxySQL ref to community.general
Co-authored-by: Ben Mildren <bmildren@digitalocean.com>
(cherry picked from commit 1a542e9824)
Co-authored-by: Ben Mildren <ben.mildren@gmail.com>
Change:
- Remove warnings from command module which point to modules that no
longer ship with ansible-base but have moved to collections.
Test Plan:
- CI
Signed-off-by: Rick Elrod <rick@elrod.me>
* Migrate onyx modules from community.network to mellanox.onyx
Signed-off-by: Samer Deeb <samerd@mellanox.com>
* Redirect all onyx plugins from network.common to mellanox.onyx
Signed-off-by: Samer Deeb <samerd@mellanox.com>
* Update documentation as per sanity tests
* Added example about custom SSH port in example section
Fixes: #29236
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 74bedab8a9)
Lightbulb is deprecated in favor of https://ansible.github.io/workshops/. Update docs links accordingly.
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit e4f48c920c)
* ansible-test - do not validate blacklisted ps modules
* Update changelogs/fragments/validate-modules-ps-doc-blacklist.yaml
Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit 40ce448657)
The `packaging` and `pyparsing` packages are now installed by `ansible-test` during provisioning of RHEL instances to match the downstream vendored versions.
(cherry picked from commit 70c59423fc)
Co-authored-by: Matt Clay <matt@mystile.com>