Compare commits

...

1263 Commits

Author SHA1 Message Date
90c8ab0c8c New release v2.11.3rc1 2021-07-13 00:19:09 -05:00
78c7721052 [stable-2.11] slurp - improve error code and test coverage (#75038) (#75045)
* Improve the error handling code

Rather than multiple return paths, have a single return and set the message based
on the type of failure.

* Add another test for non-specific failures

* Reorganize tests so failure tests are in one tasks file

* Remove os.stat() call and add changelog.
(cherry picked from commit afe6eb574e)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-07-12 10:34:03 -05:00
420527bebf [stable-2.11] module_common - handle cache directory creation collision (#75106) (#75132)
* module_common - handle cache directory creation collision

Occasionally multiple workers can try to create the cache directory if it exists. Catch the exception
and handle it.

* Just re-raise if it doesn't exist rather than trying again

* Use exists_ok rather than handling an exception

* Remove unused import and unused variable

* Go back to try/except but with OSError

Since we do not have split controller remote, this needs to be able to run in Python 2 in order
to be merged currently.
(cherry picked from commit 16a74b798c)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-07-12 10:33:08 -05:00
1f4d1dfa0b [stable-2.11] command - remove unreachable code and achieve full test coverage (#75036) (#75044)
(cherry picked from commit 4ab791d501)
2021-07-12 00:50:15 -05:00
6d2e8f7729 [stable-2.11] file integration test - cleanup testing users and group (#75037)
(cherry picked from commit 0467b1d477)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-07-12 00:44:52 -05:00
b3115e3c16 2.11: Add support for unicode in ansible-inventory CLI (#74912) (#75008)
(cherry picked from commit 5ac1b04929)
2021-07-12 00:44:21 -05:00
36eef4b9f8 Do not show empty version_added_collection values in ansible-doc text output. (#74999) (#75003)
(cherry picked from commit 58450f041a)
2021-07-12 00:41:04 -05:00
35383360d2 Template suboptions in a role's arg spec (#75073) (#75094)
(cherry picked from commit ca6123e0ee)
2021-07-12 00:34:47 -05:00
1b6698aba8 ansible-test: exposes tiny_prefix variable (#75128)
ansible-test aws provider now creates and exposes a new tiny_prefix
variable to provide a shorter prefix for the AWS tests.

(cherry picked from commit 5b8fb4dcd3)
2021-07-12 00:33:48 -05:00
3b5bc9b3fa Unfrack extra vars (#75127) (#75148)
* Ensure we keep the original path as per cli

  fixes #75126

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 60c9f045cc)
2021-07-11 22:50:13 -05:00
a2239d8819 [stable-2.11] task_executor - use correct value for ssh connection retries (#75155) (#75191)
Since the task and connection both have the same 'retries' keyword, the task default
would override the connection value.

Do not pass 'retries' from the task to the connection options.

* Set ssh_connection retries default value back to 0
  It was 0 before the move to config and was changed to 3 by accident.
(cherry picked from commit a8de35e131)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-07-11 22:40:16 -05:00
40ecd27211 Removed Galaxy banner (#75163) (#75217)
(cherry picked from commit 1e00099753)
2021-07-08 14:12:51 -05:00
b1e9da9d75 Bump sphinx_ansible_theme to v0.7.0+ (#75059) (#75174)
This version relies on an external lib implementing lexers and styles.
That lib pulls in proper Pygments version so this patch also drops it
from direct requirements.

(cherry picked from commit d75d9443fc)

Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
2021-07-08 14:12:33 -05:00
ca1da07dda [stable-2.11] Restrict packaging to < 21.0 for Python < 3.6. (#75186)
(cherry picked from commit 67bc49e001)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-07-07 11:34:53 -07:00
1ed901f7ef Update Japanese translation for stable-2.11 (#75180) 2021-07-06 11:50:58 -05:00
49950fa875 Use antsibull sphinx extension (#73170) (#75100)
* Use antsibull sphinx extension.

* Require antsibull 0.34.0.

(cherry picked from commit 2c0f050b4f)
2021-06-29 10:23:50 -05:00
e137398a84 collections_using.rst: add note that manual upgrade is required when installing collections from Galaxy (#75024) (#75025)
(cherry picked from commit 5df82415b5)
2021-06-24 13:33:18 -05:00
348eee92bf [bp-2.11] Clarify Vault password client naming requirements (#75083)
(cherry picked from commit aedc82da98)

Co-authored-by: Andreas Olsson <andreas@arrakis.se>
2021-06-24 13:31:49 -05:00
ff7bbe3f0a [bp-2.11] Syntax fixes for docs (#75088)
(cherry picked from commit 3a8fc2d2be)

Co-authored-by: Chandler Swift <chandler@chandlerswift.com>
2021-06-23 16:09:04 -05:00
f72720c7f8 remove reference to container ML (#75014) (#75028)
(cherry picked from commit 2387ce311f)
2021-06-23 16:06:21 -05:00
37b3593720 [2.11] Use sphinx_ansible_theme Sphinx theme in docs (#75058)
* Use `sphinx_ansible_theme` Sphinx theme in docs (#74318)

(cherry picked from commit 346c7a765d)

* 🔥 Drop unused `core.css` file

This is a forgotten leftover from #74318 that should've been removed
earlier.

(cherry picked from commit ec408a69f1)

* Update docs requirements list (#74956)

* removes upper bound on sphinx version
* updates versions of docs build dependencies, adds known good requirements file
* adds instructions for using known_good_reqs file

(cherry picked from commit 58f26388be)

Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
Co-authored-by: Sviatoslav Sydorenko <wk@sydorenko.org.ua>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2021-06-23 15:57:53 -05:00
a5d1238f42 Update Ansible release version to v2.11.2.post0. 2021-06-22 02:52:05 -05:00
ae9001ee18 New release v2.11.2 2021-06-22 00:04:37 -05:00
7316e1b54a Update Ansible release version to v2.11.2rc1.post0. 2021-06-14 22:22:45 -05:00
c207402507 New release v2.11.2rc1 2021-06-14 17:38:00 -05:00
392e93135d psrp - cleanup command (#74985) (#75001)
(cherry picked from commit 58d8397771)
2021-06-14 17:12:23 -05:00
e009cd9733 delegation fix (#74685) (#74811)
(cherry picked from commit b518aabf81)
2021-06-14 14:58:02 -05:00
f752c7f179 role argspec - tag role argspec validation task with 'always' (#74994) (#74996)
* update tag docs

(cherry picked from commit 97acb0f470)
2021-06-14 14:44:24 -05:00
dce10b89ad Ssh opts fix (#74972)
(cherry picked from commit 675df166c2)
2021-06-14 14:18:48 -05:00
7448c2fa62 [2.11] Fix using module-specific module_defaults in action plugins (#74849)
* Use the module redirect_list when getting defaults for action plugins (#73864)

* Fix module-specific defaults in the gather_facts, package, and service action plugins.

* Handle ansible.legacy actions better in get_action_args_with_defaults

* Add tests for each action plugin

* Changelog

Fixes #72918

(cherry picked from commit 5640093f1c)

* Fix tests for < 3.8
2021-06-14 14:17:44 -05:00
bf6f277edd [stable-2.11] slurp - handle error when path is a directory (#74930). (#74964)
(cherry picked from commit 0a5cc80ce2)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-06-14 13:53:36 -05:00
fad56bd4e6 [stable-2.11] subversion - fix stack trace when getting repository information (#74405) (#74977)
* subversion - set LC_ALL for accurate command output parsing

When LC_ALL is not set, the output language of commands will differ based on locale. There
is a lot of history of trying to fix this. See the following pull requests:

https://github.com/ansible/ansible-modules-core/pull/4358
https://github.com/ansible/ansible-modules-core/pull/4358

This patch attempts to fix this my setting LC_ALL to a UTF-8 locale. Setting LC_ALL to C reintroduces this bug https://github.com/ansible/ansible-modules-core/issues/4178.

I'm sure there are some problems I am not seeing with setting this to en_US.UTF-8, but that is
the only way I could find to fix this bug without reintriducing the bug mentioned above.

* Rather than setting locale, just check for matches before trying to get groups

This is a pragmatic solution to avoid the stack trace since setting the locale correctly
to ensure message parsing is accurate is problematic.

* Improve regexps for finding revision and URL
(cherry picked from commit a8cf0196f7)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-06-14 13:16:18 -05:00
f92f039ea7 [2.11] Fix slurp error handling for unreadable files and directories (#74915)
- Fixes #67340
- Backport PR for #68608

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-06-14 10:47:23 -05:00
13e5c64918 Apply display_failed_stderr on loop item results (#74865) (#74898)
(cherry picked from commit 01ab6c6ec7)
2021-06-14 10:40:49 -05:00
25ac505975 Basic: don't call lstat when check_mode (#64279) (#74883)
While mode is specified in check_mode, don't call lstat.
Since file may not present.

Fixes: #61185
(cherry picked from commit 7099657dd7)

Co-authored-by: Logistic Bot <logistic-bot@protonmail.com>
2021-06-14 10:38:47 -05:00
93de61a8da Due to the takeover of freenode we're moving to a different irc network. (#74775) (#74968)
* Updates our channels to point at the same channel name on libera.chat
* Links that used to point to webchat.freenode.net now point to https://libera.chat
* Removes http://irc.freenode.net from the linkcheck exceptions.
* Updates docs/docsite/rst/dev_guide/developing_modules_in_groups.rst

(cherry picked from commit 80e7e1a17c)

Co-authored-by: John R Barker <john@johnrbarker.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2021-06-14 09:08:16 -05:00
dad721d9dc psrp - Fix reset connection on failed scenarios (#74967) (#74984)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

(cherry picked from commit cf3a304ce1)
2021-06-14 08:54:15 -05:00
a16dd1150e ansible-pull - update help info for --directory option (#74936) (#74993)
* Update -d help info for ansible-pull

* fix pep8

(cherry picked from commit 6539c59857)
2021-06-14 08:53:39 -05:00
03aff644cc fix unsafe preservation across newlines (#74960) (#74973)
CVE-2021-3583
  ensure we always have unsafe

Co-authored-by: Rick Elrod <rick@elrod.me>
(cherry picked from commit 4c8c40fd3d)
2021-06-11 16:43:09 -05:00
578fa17af5 [stable-2.11] version test - improve message when value is empty (#74754) (#74789)
When an empty value is provided, no `version` attribute will exist on the `LooseVersion` or
`StrictVersion` object. We catch and handle this, but it's not immediatebly clear that an
AttributeError means an empty value was provided.

Specifically handle the case where value or version are empty and add more
helpful error messages.

Add integration tests.
(cherry picked from commit 71e33d2578)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-06-11 11:32:30 -05:00
46378f0086 avoid literal quoting in config lists (#74740) (#74773)
* avoid literal quoting in config lists (#74740)
* added tests
(cherry picked from commit d2d1f01f9d)
2021-06-11 11:20:55 -05:00
b2808ed147 Fix name of subkey. (#74939) (#74966)
(cherry picked from commit 81ad125aa6)
2021-06-10 19:45:07 -05:00
8b8996cb36 Localization: Import first set of translated files (#74954)
* Localization: Import first set of translated files

(cherry picked from commit d45c2cec55)

* Ignore smart quotes in the dev guide translation.

The smart quotes are in the warning message to not use smart quotes.

(cherry picked from commit 3f694e9f02)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2021-06-10 18:22:58 -05:00
9627912180 Update inventory script references from c.g to ansible-community/contrib-scripts. (#74905) (#74926)
(cherry picked from commit acf09e56a2)
2021-06-07 13:46:12 -05:00
56ab8508d0 adds banner for GalaxyNG survey (#74889) (#74906)
* adds banner for GalaxyNG survey (#74889)

(cherry picked from commit 62fc4ad8da)

* gives each banner a unique div ID (#74907)

(cherry picked from commit 33924d7e8d)
2021-06-03 16:24:44 -05:00
13a829af2b [bp-2.11] Fix small typo in playbook_filters doc (#74763)
Move versionadded to next line to render correctly.

(cherry picked from commit 888fea69e5)

Co-authored-by: Chander G <mail@chandergovind.org>
2021-06-03 14:25:34 -05:00
8d6a8583c9 Improve and extend changelog logs (#74106) (#74753)
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 4bf420706b)
2021-06-03 14:24:56 -05:00
6f126a8d08 [bp-2.11] Update example and description of git:single_branch (#74832)
(cherry picked from commit b63512774b)

Co-authored-by: Daniel Chabrowski <dantezstudio@gmail.com>
2021-06-03 13:56:31 -05:00
6987150d40 [bp-2.11] filters: Add a note about seed (#74874)
While using ``seed`` parameter of the 'random' filter, behavior changes between Python 2 and Python 3.
Added a note about this in the documentation.
Fixes: #63784

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2021-06-03 13:42:27 -05:00
ee38c4244b remove package porting guides from stable branch, point to devel (#74890)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-06-03 13:20:12 -05:00
4ceaefc240 Update Ansible release version to v2.11.1.post0. 2021-05-24 17:51:07 -05:00
f468ec7087 New release v2.11.1 2021-05-24 14:50:49 -05:00
84707c60a4 updates list of available versions for Ansible 3 (#74265) (#74757)
* updates list of available versions for Ansible 3 (#74265)

(cherry picked from commit 126e9244c2)

* update conf.py (#74751)

(cherry picked from commit cd8e3a2208)

Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2021-05-18 18:08:29 -05:00
bbca98f622 Set the version to 4 (#74755) 2021-05-18 15:38:25 -05:00
15ae85269f Update Ansible release version to v2.11.1rc1.post0. 2021-05-17 18:46:52 -05:00
d24f793ab1 New release v2.11.1rc1 2021-05-17 16:54:21 -05:00
892f0bf644 Add changelog for ansible-galaxy improvements (#74738) (#74739)
Changelog for #74240

(cherry picked from commit 9cfedcd9c9)
2021-05-17 16:04:03 -05:00
b5f13e5f28 Fix world readable setting (#74324) (#74418)
now uses shell option in all cases, the old constant still exists
as 'documentation' but it not settable.
also fix the docsite link in warnings/errors

import cleanup

(cherry picked from commit d8fa2b50d5)
2021-05-17 12:11:21 -05:00
ed456f25f6 restores delegated vars that were not passed (#74371)
* restores delegatd vars that were not passed

   this will restore delegate display on callbacks using the vars
   also moves to use delegate_to directly on the default callback

* clog

(cherry picked from commit cbc83545582d8d7a718140263c465129e0e535d9)
2021-05-17 10:35:57 -05:00
00d5a1610f Fix pb subs collapse (#74301) (#74376)
* fix subdir parsing for plays

  fixes #74283

  Co-authored-by: Nikolaos Kakouros <nkak@kth.se>

(cherry picked from commit 6418f368e3)
2021-05-17 10:28:42 -05:00
22adad0f19 [2.11] Do not remove non-empty cron tabs (#74698)
* Only remove crontabs if they are empty

(cherry picked from commit fefda12827)

* Add integration test to ensure system cron tab doesn't get removed. Increase cron integration tests separation.

(cherry picked from commit 1e37fa86b4)

* Also detect crontab which only contains whitespace as empty.

(cherry picked from commit 4b69c8f501)

* cron integration test: Adjust system crontab path to be distribution specific.

(cherry picked from commit 70be3730db)

* Add changelog fragment for #74497.

(cherry picked from commit c606b50a3d)

Co-authored-by: Fabian Klemp <fabian.klemp@elara-gmbh.de>
2021-05-17 10:11:59 -05:00
3d6c8ee3e0 Map Debian 8 to Python 2 (#74152) (#74359)
* Map Debian 8 to Python 2

If Python 3 is installed on Debian 8 Ansible cannot run, as the version
is too old (3.4)

* Add integration test for python interpreter discovery on Debian 8

* fix test issue on Debian 9, add changelog

* un"fix" not broken test :D

Co-authored-by: Fabian Klemp <fabian.klemp@elara-gmbh.de>
Co-authored-by: Matt Davis <mrd@redhat.com>
(cherry picked from commit 437a08eb6d)

Co-authored-by: elara-leitstellentechnik <elara-leitstellentechnik@users.noreply.github.com>
2021-05-17 09:10:03 -05:00
5ee1fe2665 Detect Homebrew on Mac M1 (Apple Silicon) (#74378) (#74401)
Homebrew's default install location for macOS on ARM is /opt/homebrew.
Source: https://docs.brew.sh/FAQ

On a Mac M1 (Apple Silicon), homebrew will be installed at
/opt/homebrew/bin/brew.
2021-05-17 05:37:11 -05:00
71fc9ec393 [bp-2.11]: apt_key - Binary GnuPG keys downloaded via URL were corrupted (#74522)
* Binary GnuPG keys downloaded via URLs by the 'ansible.builtin.apt_key' module were corrupted so 'gpg' could not import them (https://github.com/ansible/ansible/issues/74424)
(cherry picked from commit 0375070871)
(cherry picked from commit 4cc80ef9c9)
2021-05-17 05:35:02 -05:00
5b0a3ac43d Actually run blocks/finalized_task test (#74291) (#74312)
(cherry picked from commit 7fecb7ccc3)
2021-05-17 05:33:46 -05:00
85b4c70172 defend against bad or missing crypt (#74304)
* defend against bad or missing crypt

  fixes #74279

(cherry picked from commit 4494ef3a9d)
2021-05-17 05:33:25 -05:00
46b67b74c7 removed unused imports (#74299)
(cherry picked from commit e3eeb88f7c)
2021-05-17 05:33:25 -05:00
02d07dcace [become] Add Solaris chmod ACL fallback
Change:
- Newer Solaris drops setfacl. Add a fallback for its chmod ACL syntax.

Test Plan:
- New units

Tickets:
- Fixes #74282

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-05-17 05:30:22 -05:00
341834fe70 [become] Fix solaris permissions regression
Change:
- Regression introduced in #70785
- When macOS chmod ACL syntax is used, Solaris-derived chmods return
  with a status of 5. This is also used for our sshpass handling,
  because sshpass will return 5 on auth failure. This means on Solaris,
  we incorrectly assume auth failure when we reach this branch of logic
  and try to run chmod with macOS syntax.
- We now wrap this specific use of chmod in an exception handler that
  looks for AnsibleAuthenticationFailure and skips over it. This adds
  another authentication attempt (something we normally avoid to prevent
  account lockout), but seems better than the regression of not allowing
  other fallbacks to be used.
- Without this patch, if setfacl fails on Solaris (and sshpass is used),
  we do not try common_remote_group or world-readable tmpdir fallbacks.

Test Plan:
- New unit

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-05-17 05:30:22 -05:00
2c9389b193 Prevent ansible_failed_task from further templating (#74290) (#74308)
Fixes #74036

* Add changelog

(cherry picked from commit 664531d7d6)
2021-05-17 05:22:53 -05:00
a81386fa62 fix config manager list loption with choices (#74267) (#74298)
fixes #74225

  Co-authored-by: Kim Nørring <github@norring.dk>

(cherry picked from commit b91749d671)
2021-05-17 05:19:58 -05:00
3aab644285 The error message about the failure to import a 'gpg' key by the 'ansible.builtin.apt_key' module was incorrect (https://github.com/ansible/ansible/issues/74423) (#74521)
Co-authored-by: Sam Doran <sdoran@redhat.com>
(cherry picked from commit e4d7fc9745)
2021-05-17 05:09:43 -05:00
3d4d43a1ce [incidental_setup_rabbitmq] [2.11] Remove main (#74728)
Change:
- This file got missed in bcd7b61c03 /
  #74715 somehow.

Test Plan:
- If CI passes, it worked.

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-05-17 05:06:06 -05:00
a9b7625151 Makefile: Allow one to specify python version (#74517) (#74528)
Change:
- Allow overriding python version as env var for Makefile
- Including hacking directory in git export, for docs build

Test Plan:
- Tested as part of recent downstream work

Co-authored-by: Yanis Guenane <yguenane@gmail.com>
2021-05-17 04:25:11 -05:00
dd7118c433 [stable-2.11] hostname - add Rocky Linux support (#74545) (#74560)
(cherry picked from commit 2d41e5f99a)

Co-authored-by: Louis Abel <nazunalika@users.noreply.github.com>
2021-05-17 04:24:35 -05:00
ebf7233e35 [stable-2.11] facts - set correct OS family for Rocky Linux (#74530) (#74561)
(cherry picked from commit d101009688)

Co-authored-by: Ruairidh MacLeod <ruairidh@rkm.dev>
2021-05-17 04:24:10 -05:00
45618a6f38 dont specify default for port, allow ssh/config (#74526) (#74562)
also added general note on how defaults work.

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sam Doran <sdoran@redhat.com>
(cherry picked from commit 30912b6a47)
2021-05-17 04:19:52 -05:00
63cb289bf0 [bp-2.11] Update cli_parsing.rst (#74590)
Bad indent in an example

(cherry picked from commit dcb807dea7)

Co-authored-by: Joseph Jacobs <joej164@gmail.com>
2021-05-17 04:10:06 -05:00
d10195631e [stable-2.11] pause - ensure control characters are always set appropriately (#74568) (#74600)
On some systems, curses.tigetstr() returns None, which does not work as a control character.

* Add unit tests

* Sort imports

* Skip on older Python

This is an action plugin and only runs on the controller, so no need to test of Python 2. Making
the import hackery work on Python 2 would required some more work which I am not sure is
worth it since we are moving away from Python 2 support on the controller.

* Make the tests work on Python 2 and 3
(cherry picked from commit 55b401a3e7)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-05-17 04:09:22 -05:00
66a9ea2f23 [bp-2.11] service - compare version without LooseVersion (#74618)
The distutils module is not shipped with SUNWPython on Solaris.
It's in the SUNWPython-devel package. Do not use LooseVersion.

Fixes: #74488

(cherry picked from commit 4d7dc15d4e)

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-17 04:07:11 -05:00
162973d1a7 ansible-galaxy - increase page size and add retry decorator for throttling (#74240) (#74648)
* Get available collection versions with page_size=100 for v2 and limit=100 for v3

* Update unit tests for larger page sizes

* Add a generic retry decorator in module_utils/api.py that accepts an Iterable of delays and a callable to determine if an exception inheriting from Exception should be retried

* Use the new decorator to handle Galaxy API rate limiting

* Add unit tests for new retry decorator

* Preserve the decorated function's metadata with functools.wraps

Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
(cherry picked from commit ee725846f0)
2021-05-17 04:06:53 -05:00
fc84de8faa Role argspec: allow new argument spec file (#74582) (#74656)
* support separate role argspec file in ansible-core
* support both .yml and .yaml extensions on argspec file in ansible-doc
* fix filename building bug and rename some argspec files to test variations
* use yaml extensions from constants
* add superfluous meta/main.yml files to tests
* Update lib/ansible/cli/doc.py
* update docs
* add changelog and allow for main.yml variations
* add collection role testing

Co-authored-by: Sam Doran <sdoran@redhat.com>
(cherry picked from commit 8fb54885bf)
2021-05-17 03:14:16 -05:00
a19d44ca7b modules: get_url: Fix checksum binary validation (#74502) (#74675)
From the sha512sum man page:

... The default mode is to print a line with checksum, a character indicating type ('*' for binary, ' ' for text), and name for each FILE.

(cherry picked from commit 403a5d147d)
2021-05-17 03:10:08 -05:00
cf8df3faa4 [stable-2.11] ini lookup - catch and handle duplicate key and missing section errors (#74629) (#74682)
* Remove unused import
* Add integration tests for errors
* Cleanup formatting on existing tests
* Add changelog.
(cherry picked from commit 0affe4d027)

* Add note about Py2/3 differences regarding key names

* Fix tests

Kwarg parsing wasn't backported.
2021-05-17 03:07:29 -05:00
a624731700 replace - better handling of file exceptions (#74686) (#74691)
(cherry picked from commit 51b5659598)
2021-05-17 03:00:14 -05:00
bcd7b61c03 [stable-2.11] Remove incidental_setup_rabbitmq integration test
All tests using this have been removed..
(cherry picked from commit 8d3dce49bf)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-05-14 13:06:28 -07:00
83c5e57ce5 Backportapalooza5 (#74706)
* Jinja intersphinx should point at 3.0; other updates

(cherry picked from commit 8c34eaa69f)

* Update AWS guides with new SDK and Python requirements (#74585)

The 2.0 collection releases will introduce new Python requirements
and a new SDK support policy

(cherry picked from commit fa15d35cb1)

* Add JC filter plugin example (#74563)

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 91212b2008)

* Fix typo on roles documentation (#74696)

##### SUMMARY
Small fix on the roles directory structure documentation

##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr

(cherry picked from commit 25de07946c)

* intro: Add a note about current user (#74638)

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 39df263f1a)

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
Co-authored-by: Jill R <4121322+jillr@users.noreply.github.com>
Co-authored-by: Kelly Brazil <kellyjonbrazil@gmail.com>
Co-authored-by: m0nt3cr1st0 <gonzalo.rubio.casas@gmail.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-14 11:16:46 -05:00
383559f8af [stable-2.11] CI and compat fixes for Jinja2 >= 3.0 (#74666)
* Add constraint for MarkupSafe

MarkupSafe >= 2.0.0 requires Python >= 3.6.0. Add a constraint for older Python versions
and fix the `groupby_filter` test.

* Fix template_jinja2_latest test.

* patch filter decorators on newer Jinja2

* Jinja2 >= 3.0 renames several filter decorators used by Ansible itself, as well as by filters in collections. This patch ensures that the old names are usable within Ansible and by collections without warnings or errors.

* Ignore docs-build issues.

Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Matt Davis <mrd@redhat.com>.
(cherry picked from commit f99d024851)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-05-11 21:51:53 -07:00
0fbedb3364 [docs][2.11] Backportapalooza4 (#74662)
* Change Shippable refs in docs to Azure Pipelines.

(cherry picked from commit 8bd599d048)

* Update cli_parsing.rst (#74555)

Bad indent in an example

(cherry picked from commit dcb807dea7)

* systemd doc update (#74442)

Document that systemd module manages units (timers, services, ...) and not only service. (#74442)

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
(cherry picked from commit 74647a1314)

* Update the module lifecycle document to also cover plugins and collections (#74413)

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit a6cc508822)

* Docs: communication.rst - add ansible-community to the IRC channel list (#74570)

(cherry picked from commit 5463cbb841)

* adhoc clarify help (#74616)

also added comments to code

(cherry picked from commit 7f7d3067e3)

* update docs copyright (#74643)

(cherry picked from commit 7195367635)

* docs: Add a note about `crypt` (#74640)

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 79e12ba98e)

Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Joseph Jacobs <joej164@gmail.com>
Co-authored-by: Baptiste Mille-Mathias <baptiste.millemathias@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-11 14:44:47 -05:00
3f0b92e0b6 [stable-2.11] callback_default test - Reduce sleep time to correct CI failures
For unknown reasons, these tests started failing recently because the results
from testhost11 are being returned before testhost10, but only when coverage is
enabled.

Setting the initial host sleep time to 0 fixes this failure.

ci_coverage
(cherry picked from commit 728e43bc59)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-05-07 14:26:04 -07:00
4da2e2db79 functional backport of 74448 (#74567)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-05-04 17:56:35 -05:00
167726e291 [docs][2.11][backport] Backportapalooza3 (#74566)
* AWS: update reference to auto-retrying ResourceNotFound (#72314)

AWS Dev Guidelines: update reference to auto-retrying ResourceNotFound

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit c387b318a6)

* docs: Improve documentation for regex_search,replace,findall (#74368)

Improve the documentation for regex_search by adding a few more
realistic examples such as showing how to extract only parts of a
string by using regex groups.

Extend regex_findall and regex_replace by an example that includes
the multiline and ignorecase parameters.

(cherry picked from commit f194108a26)

* Improve a documentation of the first_found lookup plugin (#73080)

Co-authored-by: Wojciech Ściesiński <wojciech.sciesinski@huuugegames.com>
(cherry picked from commit f40ab25909)

* Update the porting guide for a new ansible version (#74490)

(cherry picked from commit 112b175f17)

* setup: Add note and example of delegated facts (#74479)

* Added a note about 'delegated_facts'
* Added an example of 'delegated_facts'

Fixes: #67067

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 7b03ebf939)

* command - add command name to warning (#74475)

(cherry picked from commit 9e61952cdc)

* update backporting instructions to reflect new latest stable branch, some edits (#74512)

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
(cherry picked from commit b765d3799b)

Co-authored-by: Mark Chappell <mchappel@redhat.com>
Co-authored-by: Christian Fetzer <christian.fetzer@bmw.de>
Co-authored-by: Wojciech Sciesinski <it-praktyk@users.noreply.github.com>
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2021-05-04 15:13:14 -05:00
744412d0cd [stable-2.11] incidental_setup_rabbitmq test - Use official repo for rabbitmq-erlang (#74450)
Previously it was hosted on bintray, but that service is shutting down on May 1. Using the new
repository also required using a newer version of RabbitMQ.
(cherry picked from commit 62cba4a6ad)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-05-03 13:31:13 -05:00
2743ea1e69 [stable-2.11] Add porting guide and documentation for changes to argument spec validation (#74268) (#74353)
* Add ArgumentSpecValidator to docs
* Improve docs for ArgumentSpecValidator
* Document removal of private methods

* Update module_utils documentation
    - Add docs for argument spec classes as well as validation and parameters files.
    - preserve the order in the source for errors.py
    - document DEFAULT_TYPE_VALIDATORS so it can be referenced elsewhere
    - fix automodule directive for validation.py

* Update docs in arg_spec and paremeters
    - This improves the generated documentation.

* Document breaking changes in porting guide.
* Update formatting in porting guide and add a Deprecated section
* Fine tune module_utils documentation

* Move instance docstring to the __init__ method
  Remove optional description since it fails the sanity test and I am not 100% it is valid anyway.

* Remove incorrect parameter from docstring
  This was changed a while ago but wasn't removed from the docstring.

* Use attr rather than attribute
  The py:attribute: domain only exists in newer Sphinx >= 3.1.

* Improve documentation on exceptions
* Final pass
    - use args/kwargs instead of param
    - fix formatting errors that didn't display examples correctly
    - format TypeErrors so they are referenced as classes
    - specify complex types
(cherry picked from commit 2cbfd1e350)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-04-30 10:42:24 -05:00
51d1ab036d [stable-2.11] Use our own copy of the Codecov uploader (#74460)
Due to the recent security incident, use our own copy hosted in S3
to mitigate future risk from running an arbitrary script downloaded from a
remote and untrtusted server.
(cherry picked from commit aa12af1d34)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-04-29 14:03:35 -07:00
ccf646d3a6 stubs out release and maintenance info, points to devel (#74496)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-04-29 10:59:24 -05:00
af07c35f98 Backport/2.11/docs2 (#74484)
* Add description for COLLECTIONS_SCAN_SYS_PATH (#74351)

Fixes: #74275

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 567361b124)

* lighten navigation background to make section labels easier to read for core docs (#74356)

* make section labels for /ansible-core/ docs easier to read, with black text and lighter gray background

(cherry picked from commit 6119fb0a9a)

* Correct splitext() description, and example (#74377)

`splitext()` returns a 2-tuple of strings, and the last element of the return value includes the `.`

(cherry picked from commit c295de661c)

* Using "~" instead of "+" for concatination (#74364)

Changed FAQ examples to conform with the Jinja documentation:
If both values on either side of a plus/+ are numbers, they will be added whereas using "~" will convert all operands into strings and then concatenate them. Closes #73799.

(cherry picked from commit e6a5245d60)

* Docs - Split Developing collections page, add info on optional module_utils (#74105)

*

(cherry picked from commit c90922ee36)

* Add weos4 network platform to documentation (#74088)

* Add weos4 network platform to documentation

* Fix small format issues

(cherry picked from commit 7ca5dede97)

* Fix typo in Makefile (#74396)

Fixed minor typo specfic -> specific

(cherry picked from commit 4880fee6ca)

* Update complex_data_manipulation.rst (#72509)

(cherry picked from commit c2985c491b)

* Update VMware library installation docs (#71219)

Depending upon OS/distro, please use pip/pip3.

(cherry picked from commit ddfc648d37)

* Update AWS dev guides to use collections utils and fragments (#72312)

(cherry picked from commit cf08c23b4f)

* Use is_boto3_error_code in 'standard' example (#72313)

Use is_boto3_error_code in 'standard' example rather than e.response['Error']['Code'] (#72313)

Co-authored-by: Sloane Hertel <shertel@redhat.com>
(cherry picked from commit 63afb33d86)

* Update Kubernetes collection name in docs (#74440)

(cherry picked from commit 8d499bbc83)

* Update argcomplete docs links on installation guide (#74410)

Link on installation docs is outdated. Switch to currently docs at: https://kislyuk.github.io/argcomplete/

(cherry picked from commit f97787ca74)

* fix spacing to fix header, reorg contributing page (#74421)

Co-authored-by: John R Barker <john@johnrbarker.com>
(cherry picked from commit 9d9b08bece)

* Update first_found documentation (#70502)

* import_tasks do not work with loop, use use include_tasks instead
* update documentation

(cherry picked from commit bacede7a2b)

* Product-related updates. (#74454)

(cherry picked from commit 34c9ed8a28)

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: Alex Willmer <alex@moreati.org.uk>
Co-authored-by: Hublerho <43293510+Hublerho@users.noreply.github.com>
Co-authored-by: Ernst Oudhof <17832702+ernst-s@users.noreply.github.com>
Co-authored-by: Hu Shuai <hus.fnst@cn.fujitsu.com>
Co-authored-by: dhx-mike-palandra <45608336+dhx-mike-palandra@users.noreply.github.com>
Co-authored-by: jakelevinez <31458570+jakelevinez@users.noreply.github.com>
Co-authored-by: Mark Chappell <mchappel@redhat.com>
Co-authored-by: Lidiane Taquehara <lidi.mayra@gmail.com>
Co-authored-by: Alex Domoradov <alex.hha@gmail.com>
Co-authored-by: Bill Nottingham <notting@redhat.com>
2021-04-28 16:13:45 -05:00
d51ec33d84 [stable-2.11] Fix ansible-test AZP build lookup.
(cherry picked from commit 877e5b3dfe)

Co-authored-by: Matt Clay <matt@mystile.com>
2021-04-28 10:49:38 -07:00
75d9fa648e [stable-2.11] Remove obsolete Shippable specific scripts.
Also remove some other unncessary code from CI scripts.
(cherry picked from commit be7de9844e)

Co-authored-by: Matt Clay <matt@mystile.com>
2021-04-28 10:49:16 -07:00
8d03c2ddc4 Backport/2.11/docs1 (#74457)
* Fix issue with version 3 in docs version list (#74089)

Previously would subsitute the "3" in "s3" instead of the version location in the URL

(cherry picked from commit 325ccf22fe)

* corrected epmhasis line (#74254)

need to be careful when adding lines as you create a different offset

(cherry picked from commit 7b39ee361d)

* correct how to install Docker SDK for Python (#74288)

* docs: correct guide for the latest Docker SDK for Python
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: Daeseok Youn <daeseok.youn@navercorp.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>

(cherry picked from commit 9369bd6ca1)

* Provide results to examples (#73984)

(cherry picked from commit 99a2b5f300)

* remove deprecated ansible.module_utils._text from documentation (#73211)

According to comment in ansible.module_utils._text it is deprecated and
should not be used. This is now reflected in the documentation.

(cherry picked from commit 5e5bfa8116)

* Update playbooks_filters.rst (#74242)

##### SUMMARY
Make the `random` filter description more clear.

(cherry picked from commit 5f391a72ee)

* Docs: Fix k8s_config_resource_name YAML example (#74129)

The `name` key should be beneath `metadata`:

(cherry picked from commit c9c84594d8)

* Update lookup.rst (#73716)

Document that users must pass `allow_unsafe=True` as an option in the lookup to allow templating, with a note about security implications.

Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
(cherry picked from commit c0cc574e65)

* vmware: Add a note about known issue (#73273)

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
(cherry picked from commit 6e56e72d99)

Co-authored-by: Scott Sinclair <252082+pwae@users.noreply.github.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: daeseokyoun <daeseok.youn@gmail.com>
Co-authored-by: Baptiste Mille-Mathias <baptiste.millemathias@gmail.com>
Co-authored-by: schurzi <github@drachen-server.de>
Co-authored-by: yuri <1969yuri1969@gmail.com>
Co-authored-by: ml <6209465+ml-@users.noreply.github.com>
Co-authored-by: sry9681 <sry9681@users.noreply.github.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-04-28 11:10:29 -05:00
4e3f422540 set version to 2.11 (#74455) 2021-04-27 15:16:52 -05:00
b5ad0296a2 update changelog links and release-maint page (#74431) (#74447)
(cherry picked from commit d1e6ee7b21)
2021-04-27 13:12:23 -05:00
74c3c30063 update versions (#74432) (#74441)
(cherry picked from commit a75bae8a62)
2021-04-27 13:11:48 -05:00
a4eff47860 [backport][Docs] Docs backportapalooza1 (#74355)
* Docs: clarify role docs - vars vs params, dependencies (#74104)

(cherry picked from commit 05662fd2ab)

* pin docutils to 0.16 until theme problem is fixed (#74193)

(cherry picked from commit 7443e9d659)

* Docs: Remove duplicate word (#74223)

The word "to" was erroneously used twice consecutively.

Signed-off-by: Matthew Cengia <mattcen@mattcen.com>
(cherry picked from commit c7473828c7)

* Change look and feel of the `ansible-core` docs (#74200)

(cherry picked from commit d7f826c987)

* fix see_also formatting (#74252)

(cherry picked from commit 270f109bb3)

* Update the porting guide for ansible package 4.0.0 alpha4 (#74280)

(cherry picked from commit ee38202fc0)

* Typo fix in help output (#74277)

Should still fit in 80 chars

(cherry picked from commit 8e5dc7306e)

* update intersphinx links for Ansible 3

(cherry picked from commit 481c036632)

Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
Co-authored-by: Matthew Cengia <mattcen+github@mattcen.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
Co-authored-by: Richlv <richlv@nakts.net>
2021-04-27 09:57:15 -05:00
1df28faad6 [stable-2.11] Fix ansible-test docker container IP detection..
(cherry picked from commit 14ff5e213c)

Co-authored-by: Matt Clay <matt@mystile.com>
2021-04-26 23:01:12 -07:00
405da50dc7 [stable-2.11] Fix pypi-test-container port conflict.
(cherry picked from commit cb7f4f1971)

Co-authored-by: Matt Clay <matt@mystile.com>
2021-04-26 23:00:09 -07:00
2d931e101e Update Ansible release version to v2.11.0.post0. 2021-04-26 14:24:58 -05:00
2c16395054 New release v2.11.0 2021-04-26 12:19:06 -05:00
bd107203b2 [stable-2.11] Update alpine repo to community for libuser (#74374) (#74375)
(cherry picked from commit a3e7cf0)

Co-authored-by: Matt Martz <matt@sivel.net>
2021-04-22 10:29:58 -05:00
1808502b51 [stable-2.11] Bump azure-pipelines-test-container to version 1.9.0
(cherry picked from commit 4819e9301b)

Co-authored-by: Alexander Sowitzki <asowitzk@redhat.com>
2021-04-13 10:53:30 -07:00
62b68bf83e [stable-2.11] ansible-test - ensure trailing separator is added for connection unit test target (#74176) (#74180)
For connection units tests, if the `__init__.py` file is modified, the trailing separator was
not added, making the target invalid.
(cherry picked from commit 7b79b69369)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-04-12 21:18:05 -05:00
01a0e728c7 [stable-2.11] Add PyPI proxy container for tests on Python 2.6. (#74204)
(cherry picked from commit becf941673)

Co-authored-by: Matt Clay <matt@mystile.com>
2021-04-12 21:15:28 -05:00
cf18aa3d74 [stable-2.11] Update test containers in ansible-test. (#74166) (#74167)
* Update distro test containers to version 2.0.2.

* Update the default test containers.
(cherry picked from commit 459ea5a4a4)

Co-authored-by: Matt Clay <mclay@redhat.com>
2021-04-12 20:57:29 -05:00
ad2221fbc8 Update Ansible release version to v2.11.0rc2.post0. 2021-04-06 15:28:39 -05:00
228c2782ad New release v2.11.0rc2 2021-04-06 13:43:31 -05:00
f196914e13 Use a file-like obj for stdout/stderr for deadlock workaround (#74156) (#74160)
Fixes #74149

(cherry picked from commit 96f94c0fef)
2021-04-06 12:47:03 -05:00
275d0acfa1 renamed: ansible-base.{dirs,install} -> ansible-core.{dirs,install} (#74162) 2021-04-06 12:43:12 -05:00
ccc44d9dc0 Update Ansible release version to v2.11.0rc1.post0. 2021-04-05 19:35:01 -05:00
8f85594ff9 New release v2.11.0rc1 2021-04-05 17:35:18 -05:00
6711bb0364 [stable-2.11] Add ansible-test constraint for decorator. (#74128)
(cherry picked from commit f436058fad)

Co-authored-by: Matt Clay <matt@mystile.com>
2021-04-05 17:00:23 -05:00
1c1734d32c Fix 2.11 changelog ancestor, missed at 2.10 branching (#74123)
Signed-off-by: Rick Elrod <rick@elrod.me>
2021-04-05 11:37:57 -05:00
33185c29ab Implement workaround for stdout deadlock in multiprocessing shutdown (#74099) 2021-04-05 08:51:12 -05:00
4e2da0f894 Add ansible-test six constraint for Python 2.6. 2021-04-01 14:02:46 -07:00
c0a8ed1e35 Fixed link to win_package module (#74090) 2021-04-01 14:07:25 -05:00
f9f839fa08 Fix debug factsetter (#74067)
* prevent debug from setting namespaced facts as tlv
* also added tests
2021-03-31 09:30:09 -04:00
112a7718c6 Porting guide update for ansible-4.0 alpha3 (#74075) 2021-03-30 18:20:11 -05:00
b75844af45 Fix ansible-test coverage exporting.
ci_complete
ci_coverage
2021-03-30 14:30:15 -07:00
846c2d1ed3 Fix comment in iptables unit test (#74061) 2021-03-30 16:11:12 -04:00
47ffa27416 Update the porting guide for a new ansible version (#74073) 2021-03-30 14:13:42 -05:00
381bd1a575 import openbsd patches (#74056)
* add openbsd service info
* Create openbsd-service.yml
* Update var name
2021-03-30 12:17:40 -04:00
6b33864a2c Clarify tags on tasks are applied with OR and not AND (#74038)
Co-authored-by: flowerysong <junk+github@flowerysong.com>
2021-03-30 11:05:54 -04:00
5e25ba62a6 Update Ansible release version to v2.11.0b4.post0. (#74064) 2021-03-29 21:45:32 -05:00
ae90774f2b New release v2.11.0b4 (#74063) 2021-03-29 19:31:47 -05:00
454c7e37ec nonzero exit code on ansible galaxy collection verify failures (#74051) 2021-03-29 13:06:02 -07:00
1527078a8f pause - do not continue with '\r' when timeout is set (#74030)
Original function of pause was, to only allow user input
(finished with enter) when no timeout was set. This restores
the behaviour.
2021-03-29 15:39:42 -04:00
a84c1a5669 add --offline option to galaxy collection verify (#74040)
* --offline allows in-place verify for installed collections with manifests
* manifest hash, collection name, version, and path are now always displayed
* test updates
2021-03-29 09:47:15 -07:00
af7f3fc266 Revert "Add duplicated set filter and documentation (#72729)" (#74053)
This reverts commit 99a6627c60.

* ci_complete
2021-03-27 20:28:28 -05:00
88d6a72178 Temporarily disable strategy units (#74048) 2021-03-26 19:10:00 -07:00
99a6627c60 Add duplicated set filter and documentation (#72729)
Co-authored-by: Kerry <kerry@flatline-studios.com>
2021-03-27 00:18:55 +01:00
def2870df7 updated link to ansible.builtin.user password (#73789) 2021-03-26 16:19:20 -05:00
22330dd322 Correctly set path and fullpath for template vars (#73924)
* Correctly set path and fullpath for template vars

 don't expect path to always be full path
 also added exception/tb on action fail
2021-03-26 16:33:25 -04:00
4a82e2c486 Fix setup subset (#74022)
* fix error msg on bad subset

* added test
* handle more raised but not handled fact exceptions
2021-03-26 12:43:16 -04:00
c66cff444c documents the use of ansible.legacy (#73942) 2021-03-25 16:36:46 -04:00
5dbcaa4c01 Update version on FreeBSD (#73664)
##### SUMMARY
<!--- Your description here -->
On the main freebsd change, and no the version: py37-ansible

##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2021-03-25 16:30:52 -04:00
59c61bc88a update docs to uninstall ansible-base on upgrade (#74024) 2021-03-25 15:21:37 -05:00
2abb2d3f17 Update playbooks_variables.rst. To say you can define variables within a playbook is somewhat misleading. Variables are defined within plays and are only visible within the play they are defined in *not* the entire playbook. There is no way to define vars to have strictly playbook scope. (#73986)
+label: docsite_pr
2021-03-25 16:05:50 -04:00
0bf9b7fdf8 Added prerequisites to install for CentOS (#73993)
* Added prerequisites to install for CentOS as well so CentOS users don't have to look for alternatives for each Ubuntu package.

Signed-off-by: mm667937 <marketa.muzikova@broadcom.com>


Signed-off-by: mm667937 <marketa.muzikova@broadcom.com>
2021-03-25 16:03:32 -04:00
584432be26 Use FQCN for module set_stats (#74028) 2021-03-25 15:26:48 -04:00
73c08df2db Docs: Add filter "urlencode" with example (#74034)
* Add example for URLENCODE filter
2021-03-25 15:20:41 -04:00
eb631c1881 use present tense for porting guide entries (#74021)
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
2021-03-25 15:04:10 -04:00
46b02e125f dev_guide/testing_integration: update image list (#74017) 2021-03-25 11:24:01 -07:00
4881ca1dcb Introduce the concept of playbooks early on (#74018)
* Introduce the concept of playbooks early on
Co-authored-by: Sandra McCann <samccann@redhat.com>
2021-03-25 11:55:01 -04:00
940b7af7d8 argspec validation - fix apply_defaults (#74029)
* Add test
2021-03-24 19:17:07 -04:00
3bccfb1615 Updating Community docs with DO information (#74019) 2021-03-24 16:24:46 -04:00
fa1b52ce55 dnf test - update libmodulemd when updating python3-dnf (#74025)
The dependency version is set too low in the latest version of the package.

https://bugzilla.redhat.com/show_bug.cgi?id=1942236
2021-03-24 15:49:57 -04:00
77ec2b3b3a Documentation: update committer_guidelines.rst (#73782)
Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2021-03-24 15:30:55 -04:00
c8a7899869 Update the porting guide for a new ansible version (#74016) 2021-03-24 12:12:09 -05:00
0543916a86 Docsite: clarify a changelog entry format (#73902)
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Sandra McCann <samccann@redhat.com>
2021-03-24 11:21:34 -04:00
c4e211a429 apt_key - update key ID and URL used in test
The GPG key in getfedore.org/static/fedora.gpg changed and caused the test to fail. Update
to using the new key ID and save the GPG file in our S3 to prevent spontaneous changes/breakage.
2021-03-23 13:55:40 -07:00
a1ece49006 Add integration tests for add_collection_to_versions_and_dates(), and extend ansible-doc tests (#73601)
* Add add_collection_to_versions_and_dates integration tests.

* Add doc fragment tests with fragments from other collections.

* Remove trailing whitespace (Python 2's json.dump inserts some).

* Use ' ' instead of '\s'.
2021-03-24 05:30:57 +10:00
a520da0584 setup virtualization: fix RHEV product_name (#73919) 2021-03-23 21:18:01 +05:30
4780e10a2b Adding jborean93/WindowsServer2019 in docs (#73950) 2021-03-23 21:16:54 +05:30
c1eed681aa fix wait_for looping when missing net module (#73963)
fixes #43486
2021-03-23 16:12:49 +01:00
6856e751ff Fix trailing whitespace in Conditional debug() (#73956)
Signed-off-by: Alex Willmer <alex@moreati.org.uk>
2021-03-23 16:08:44 +01:00
232eeee206 less blocking on fact reading (#73951)
* less blocking on fact reading


Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2021-03-23 10:27:53 -04:00
2bff120db6 Fix wrong backup directory var name in apt module (#73840)
* Fix wrong backup directory var name in apt module
2021-03-22 10:06:45 -04:00
2c40dccd85 Update Ansible release version to v2.11.0b3.post0. (#73980) 2021-03-19 23:48:17 -05:00
88a1a85ff8 New release v2.11.0b3 (#73977) 2021-03-19 22:08:27 -05:00
c6cf7986ab add porting guide info for optional module_utils (#73979) 2021-03-19 20:21:22 -05:00
abacf6a108 Use ArgumentSpecValidator in AnsibleModule (#73703)
* 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.
2021-03-19 12:09:18 -07:00
089d0a0508 find - set proper default based on use_regex (#73961)
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>
2021-03-19 13:18:31 -04:00
48c0fbd1cb Fix a bug adding unrelated candidates to the plugin loader redirect_list (#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
2021-03-18 17:53:57 -04:00
3e63eb8418 fix typo 2021-03-18 12:50:06 -07:00
3811fddede Amazon: Fix distribution facts for older release
Ansible can gather distribution facts for older Amazon Linux
with /etc/os-release data.

Fixes: #73946

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-03-18 12:42:04 -07:00
ad5ee1542a Remove ini and env fields for config option CONNECTION_FACTS_MODULES 2021-03-18 12:40:15 -07:00
7a55e98d29 clarifies docs for file module, addresses issue 72372 (#73938) 2021-03-18 12:34:04 -07:00
ccd9a992cf complex data example using value and default from list of dicts (#73937) 2021-03-18 12:31:33 -07:00
efe97aeb31 Update developing_inventory.rst (#73931)
* 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>
2021-03-18 12:14:21 -07:00
78f34786dd Send callbacks directly from the TaskExecutor instead of TaskResults masquerading as callbacks (#73927) 2021-03-18 12:12:29 -07:00
561cdf3ace Updated COLLECTIONS_4.rst to include ansible-inclusion repo link for new 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>
2021-03-18 11:59:01 -04:00
95dc8f2361 Add some dev documentation for constructed features (#73497) 2021-03-18 09:45:13 -04:00
30c465c1a9 Promote publication (#72400)
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>
2021-03-17 16:14:32 -04:00
b57444af14 Rebased pr73824 (#73934)
Co-authored-by: Eugene <k.evgen61@gmail.com>
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-03-17 16:07:38 -04:00
4add723107 ansible-pull: Run All Playbooks When Multiple Are Supplied (#73172)
* ansible-pull: run all playbooks when multiple are supplied

* add test for ansible-pull with multiple playbooks supplied from cli

* add changelog fragment
2021-03-17 13:52:51 -04:00
0279d02980 Add porting guide for ansible 4 2021-03-17 08:41:02 -07:00
e10da3c368 Porting guide changes when adding a new ansible release
* Add the ansible-4 porting guide to the index
* Need to exclude the porting guide for ansible-4 from the core docs build
2021-03-17 08:41:02 -07:00
832631b888 Ensure task from the worker is finalized/squashed (#73881)
* Ensure task from the worker is finalized/squashed. Fixes #57399. Fixes #49942
2021-03-16 15:09:43 -04:00
a29fcfa995 Update Ansible release version to v2.11.0b2.post0. (#73917) 2021-03-15 20:30:15 -05:00
aff69b6b4c New release v2.11.0b2 (#73915) 2021-03-15 17:54:49 -05:00
1e5ccb326f Allow for searching handler subdir for included tasks (#73809)
* Allow for searching handler subdir for included tasks
2021-03-15 15:39:59 -04:00
3098022146 Fix typo in porting_guide_3.rst (#73871)
paramater -> parameter
2021-03-15 15:58:41 +05:30
7099a5f448 setup - virtualization facts add Red Hat vendor (#72876)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-03-15 15:20:44 +05:30
9ec4e08534 Don't match passive_interface for validate-modules (#73880)
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>
2021-03-13 08:28:57 -06:00
7c0af58449 validate-modules no_log test: extend search range, add more known false-positives (#73882)
* validate-modules no_log test: extend search range, add more known false-positives.

* Mark false-positives.
2021-03-13 08:28:33 -06:00
ed18fcac3b Ensure unit test paths for connection and inventory plugins are based on the context (#73877) 2021-03-12 12:46:40 -08:00
3a8c9242e1 Use virtual host style S3 bucket names in tests. 2021-03-12 11:34:25 -08:00
197e8f5640 Mention that minor releases end once the next ansible release is made. (#73836) 2021-03-11 16:12:55 -06:00
780f79ecbc Update the porting guide for a new ansible version (#73856) 2021-03-11 14:49:03 -06:00
b486feaaf4 document slurp returns (#73865)
* no path on return
2021-03-11 14:28:47 -06:00
bd020dd14a describe what ansible-core is (#73829) 2021-03-11 14:27:36 -06:00
37cb550185 fix su localization optoin
fixes #73837
2021-03-11 11:53:28 -08:00
8ef54759ec moved vs deprecated world readable tmp setting (#73825) 2021-03-11 11:43:27 -08:00
27eaab310b Add direct link to using multiple inventory sources (#73680)
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>
2021-03-11 14:36:00 -05:00
474f46ea56 Docs: Updates the release and maintenance page to reflect new cadences (#73781)
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>
2021-03-11 14:25:18 -05:00
1ac2858b5a Update developing_modules_general.rst (#73805)
##### SUMMARY
<!--- Fixing a typo. There was a double "you" in the text. -->


##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2021-03-11 14:11:04 -05:00
31932f5fa3 Docs: Update installation page for package split (#73790) 2021-03-11 11:05:44 -08:00
b2015c98e2 validate-modules: make sure that options that potentially contain secret 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>
2021-03-11 12:57:11 -05:00
3e1f6484d7 add optional module_utils import support (#73832)
* 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
2021-03-10 11:08:13 -08:00
15064c7a42 Update resource_prefix syntax for ansible-test. 2021-03-10 09:00:12 -08:00
1d5110db6f Unify additional info + WYSIWYG as optional input in the documentation report issue form (#73796) 2021-03-09 20:55:14 +01:00
9db557e431 Nonfatal facts (#73804)
continue with local facts vs at script error
 actually capture execution errors
 better error messages in general
 add more local facts tests

 fixes #52427
2021-03-08 16:20:37 -05:00
212837defc Documentation: Lay the ground for i18n work. (#73746)
* 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>
2021-03-05 09:31:56 -08:00
fb66b4ffbc distribution: Add Amazon Linux distribution facts (#73767)
* Update Amazon Linux Distribution facts gathering logic
* Update tests

Fixes: #73742

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-03-05 09:16:10 -05:00
78d3810fdf Auto cleanup of async cache file (#73760)
* Auto cleanup of async cache file

* Add changelog
2021-03-04 11:06:27 -08:00
a165c72073 feature_request: Component Name (#73787)
Typo in name results in Bot shouting
2021-03-04 17:06:00 +00:00
2d85c9de93 Some changelog fixes for 2.11 (#73778)
Signed-off-by: Rick Elrod <rick@elrod.me>
2021-03-03 16:26:59 -05:00
42c3c51665 Set fact fixes (#73684)
* fixes to set_fact

  correctly give error messages that were previously ignored
  corrected and expanded docs
2021-03-03 16:23:56 -05:00
ce1de28061 Fix notify on import_tasks (#73572)
* Fix notify on import_tasks

  also able to apply to blocks now.
2021-03-03 16:11:09 -05:00
935528e22e finish migrating ssh plugin to config system (#73708)
* finish migrating ssh plugin to config system

  fixes #72739
  fixes #57220

* fix connection detection in reset
* correct options for connection meta reset

Co-authored-by: David Shrewsbury <Shrews@users.noreply.github.com>
2021-03-03 15:25:16 -05:00
43300e2279 module output is only json objects (#73765)
* module output is only json objects

 remove json lists as they are not valid from modules
 fixes #73744
2021-03-03 15:11:18 -05:00
527bff6b79 Don't fail for mixed typed keys (#73726)
* Don't fail for mixed typed keys

  but warn that content cound not be sorted because of this

* added tests
2021-03-03 14:24:50 -05:00
6514027957 add base 2.10 to docs version switcher (#73770) 2021-03-03 13:06:11 -06:00
2e0835b312 minor detection improvement on j2plugin loader (#73714)
* minor  improvement on j2plugin loader, comments and var names clarified
2021-03-03 11:31:29 -05:00
fca85db56a Convert markdown issue templates into issue forms (#73751)
* Convert markdown issue templates into issue forms

* Limit allowed issues to the form based ones

* Title-case the form field labels

Co-authored-by: John R Barker <john@johnrbarker.com>

* Remove CoC checkboxes from the forms

Co-authored-by: John R Barker <john@johnrbarker.com>
2021-03-03 11:53:33 +00:00
734c053562 Update Ansible release version to v2.11.0b1.post0. (#73764) 2021-03-02 17:33:56 -06:00
24d41180ea New release v2.11.0b1 (#73761) 2021-03-02 15:16:50 -06:00
f40dde44f4 Remove old ansible-test windows completion entries. 2021-03-02 10:48:03 -08:00
b6add939ff Remove outdated --docker and --remote entries. 2021-03-02 10:05:39 -08:00
c888705493 Add note on infoblox inventory script. (#73676) 2021-03-02 11:01:50 -06:00
1f2f292290 Fix invalid yaml in collections_using.rst (#73727)
Fix invalid quoting.
2021-03-02 10:10:08 -05:00
158d28a254 .github/BOTMETA.yml: cleanup (#73652)
Remove anything that is not in ansible/ansible as issues/PRs
with those components will be auto-closed anyway.
2021-03-02 13:37:44 +01:00
3cc693b92c Import test: improve docs, add more tests (#73600) 2021-03-01 16:10:46 -08:00
ba3f84883f Reduce complexity of Templar._lookup slightly (#73277)
* A little more complexity reduction
* restore logic
* Readability
* Add ran check back
* Add clog
2021-03-01 16:11:54 -05:00
949b2cc74c Update CI URL in setup.py (#73750)
* Update CI URL in setup.py

* AZP
2021-03-01 14:20:10 -06:00
6cb324bb0e selinux: return selinux_getpolicytype facts (#73609)
* selinux: return selinux_getpolicytype facts

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* add basic selinux facts tests

* fix selinux facts test when selinux missing

Co-authored-by: Matt Davis <mrd@redhat.com>
2021-03-01 11:11:09 -08:00
e7e3c12ad2 Fixes for ansible-console usability (#73665)
- Fix Ctrl+C/D behavior (#68529)
 - correct few typos and missing infos
 - Fixes doc (#72195)
2021-03-01 14:04:59 -05:00
d0e991e892 Clarify CLI version number as core version (#72287)
* clarify CLI version number as core version

* reduce confusion with `ansible` PyPI package >= 2.10 drifting from core version

* fix units
2021-03-01 11:14:56 -06:00
920b68f5f2 Fixed/improved regular expresssion for collection names (#73577)
* added changelog fragment
* added a couple of tests to coll name validation
2021-03-01 10:40:38 -05:00
e804fccf1c Let file module not change link to absolute when src not given (#65448)
The file module changes existing sym links from relative to absolute
if the src is not stated in the tasks since it uses `os.path.realpath`
to fetch the link source and not `os.readlink`. Changed that.
2021-03-01 15:14:03 +01:00
176beddb3f Fix typo in incidental.py (#73737)
successfull -> successful
2021-03-01 17:37:58 +05:30
17fabd8b45 [changelog config] Ansible Base -> ansible-core (#73739)
Signed-off-by: Rick Elrod <rick@elrod.me>
2021-02-27 21:51:11 -06:00
2377a0a776 Improve ArgumentSpecValidator unit tests (#73642)
* Add more scenarios to basic valid testing
* Update invalid tests
* Fix test for Python 2
* Condense data
* Add tests for missing required and invalid-elements
* Update aliases tests
* Add invalid scenarios for aliases
* Add tests for _add_error() method
* Fix sanity test failure
2021-02-26 09:30:16 -05:00
91b42d62fa another useful example (#73728) 2021-02-25 16:11:16 -06:00
9690512069 Pipe it to connections (#73688)
* pipelining tweaks
  added 'defaults'  entry for ini pipelining from ssh plugin
2021-02-25 15:08:11 -05:00
8628c12f30 find module - stop traversing directories with os.walk when depth is already exceeded (#73718) 2021-02-26 05:32:49 +10:00
950ab74758 Normalize ConfigParser between Python2 and Python3 (#73715)
* Normalize config parser between py2 and py3

* Add tests and changelog

* Use different config entry, since we supply certain env vars
2021-02-25 11:03:03 -06:00
eb72c36a71 galaxy: Handle ignored directory names in role skeleton (#72035)
* galaxy: restore left hand slicing in assignment

Fix 'ansible-galaxy role init --role-skeleton=role-skeleton' when the role skeleton
contains an ignored directory.

The issue was because the 'dirs' variable was changed to reference a different list,
but needs to be mutated instead to stop os.walk from traversing ignored directories.

Fixes: #71977

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-02-24 18:52:24 -05:00
dabfee4d5c commented function (#73625) 2021-02-24 01:20:47 -05:00
29d3951464 Docs: Adds banner for core/package split (#73552)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-02-23 15:54:17 -05:00
f4eab92aa0 fix core version switcher (#73704) 2021-02-23 14:12:54 -06:00
11f1177e6c Operate pexpect with bytes to limit encoding issues (#73255)
* Operate pexpect with bytes to limit encoding issues

* Update tests to ensure no pepxect encoding issues

* Add changelog fragment

* Add multiline note

* Use rst formatting directly
2021-02-23 18:57:25 +01:00
4b347415fa inventory: misc typo fixes (#73695)
* Misc typo fixes

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-02-23 10:42:20 -05:00
3ab52f2965 Disable junit callback on roles_arg_spec_tests (#73663)
This prevents the role arg spec validation tasks from showing up as failure
in the CI output.
2021-02-23 10:21:28 -05:00
c22bc46cb9 Mention ansible-core @ "Release and maintenance" (#73612) 2021-02-22 19:07:25 -06:00
b28abdfbdb Fixed typo in vault documentation (#73666)
Example variable was named `my_encrytped_var`. Renamed it to `my_encrypted_var`.
2021-02-22 19:03:23 -06:00
fa046d302c [InventoryManager] Fix two unhandled exceptions (#73667)
Change:
- Fix regression: unhandled exception when given inventory directory
  is empty or contains empty subdirectories.
- Fix unhandled exception when limit file is actually a directory
  instead of a file.
- Fix inventory tests which previously could never fail due to missing
  `set -e`. Fixed up tests that failed after `set -e` was added. Added
  several tests.

Test Plan:
- New tests
- Fixed existing tests which previously could never fail

Tickets:
- Fixes #73658

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-02-22 16:18:23 -05:00
5078a0baa2 Minor Doc Update to password.py (#73468)
Adds in the caveat that Python's string modules have different constants depending on the major version (2.x vs 3.x), but preserves the fact that a fair amount of them are common. Other minor docs touchups also included.
2021-02-18 17:22:16 -06:00
c8ee186e11 Remove warning about role validation with deps (#73653)
* Remove warning about role validation with deps

* add changelog

* update cl
2021-02-18 17:16:03 -06:00
1a14996025 Replace reference to playbook_environment (#73633)
Use the new anchor syntax
2021-02-18 17:07:23 -06:00
fa05af8321 Fixing ad-hoc commands #73636 (#73646) 2021-02-18 16:48:22 -06:00
b6566d26df pylint sanity test: stop ignoring 'used-before-assignment' (#73639)
* Remove pylint ignore 'used-before-assignment'.

* Adjust changelog fragment.
2021-02-18 12:36:28 -08:00
89ed2353e0 Update the porting guide for a new ansible version (#73650)
* Update the porting guide for a new ansible version

* Add a link to the changelog to the ansible-3 porting guide
2021-02-18 12:38:56 -05:00
010afe0b2d azure-pipelines: remove ubuntu1604 2021-02-18 08:58:02 -08:00
ac0dedda72 hostname - add Almalinux support (#73619) 2021-02-18 10:24:36 -05:00
ccbfdec334 Split Ansible docs from core docs (#73616)
* excludes scenario guides from core docs, splits porting guides and roadmaps, symlinks indices to create index.html pages, and adds .gitignore entries for conf.py and the toplevel index.rst files generated by the docs build

This solution builds three types of docs:
* ansible-2.10 and earlier: all the docs.  Handle this via `make webdocs
  ANSIBLE_VERSION=2.10`
* ansible-3 and later: a subset of the docs for the ansible package.
  Handle this via `make webdocs ANSIBLE_VERSION=3` (change the
  ANSIBLE_VERSION to match the version being built for.
* ansible-core: a subset of the docs for the ansible-core package.
  Handle this via `make coredocs`.

* `make webdocs` now always builds all the collection docs
*  Use `make coredocs` to limit it to core plugins only
*  The user specifies the desired version. If no ANSIBLE_VERSION is specified, build plugins for the latest release of ansible
 
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2021-02-17 09:57:05 -06:00
27baa8cd86 OpenStack guidelines: Replace with link (#73617)
Replace the guidelines page with a link to the current guidelines on opendev.org.
2021-02-17 09:09:08 -05:00
d40da3ee0b Update 2.10 porting guide to include module index (#73615)
This will help users find out where modules and plugins might have been moved.
2021-02-16 11:24:52 -06:00
00bd0b893d ansible-galaxy - set the cache file after getting all collection versions (#73557)
* Manage the in-memory cache in _call_galaxy but let the caller set the file cache after getting paginated results

* Add a test for caching successful and not caching unsuccessful paginated results

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2021-02-15 09:45:01 -05:00
29aef842d7 ansible-test: make sure tests are also run for the new plugin types (#73599)
* Make sure tests are also run for the new plugin types.
* New plugin types are not documentable.
2021-02-13 14:05:16 -08:00
d092356fc5 Fix ansible-test handling of egg-info.
Resolves https://github.com/ansible/ansible/issues/67990
2021-02-13 01:05:00 -08:00
133a29acb4 Add test to verify pkg_resources imports work. 2021-02-12 23:51:37 -08:00
18f7282ccf ansible-doc - account for empty meta/main.yml (#73590)
* ansible-doc - account for empty meta/main.yml

 from_yaml() will return None when encrounting an empty file.
2021-02-12 17:37:00 -05:00
d1d9406066 Add rolespec_validate to import/include_role (#73589)
* Add rolespec_validate to import/include_role

* Add changelog

* fix sanity, not private
2021-02-12 16:26:33 -06:00
1f3a90270b Import sanity test for plugins (#72497) 2021-02-12 14:09:50 -08:00
4059b37ab1 Conscious language added to user guide, development guide, and Ansible community guide, (#73574)
* Added conscious language note to index pages of guides
2021-02-12 15:32:44 -06:00
ff0edca8cc Catch more potential errors when setting up curses. 2021-02-12 13:09:02 -08:00
f0ec10dbc3 Role arg spec validation implementation (#73152)
* Initial import of modified version of alikins' code
* Add unit testing for new Role methods
* Fix validate_arg_spec module for sanity test. Add test_include_role_fails.yml integration test from orig PR.
* Add testing of suboptions
* Use new ArgumentSpecValidator class instead of AnsibleModule
* fix for roles with no tasks, use FQ name of new plugin
* Add role dep warning
2021-02-12 16:00:17 -05:00
6d15e1aa6e corrected description info (#73586)
* corrected description info
2021-02-12 13:17:44 -05:00
ea2f37d253 allow constructed to use vars plugin (#73418)
Allow constructed to optionally use vars plugin data

* mostly for those looking to leverage group_vars/ and host_vars/
* limited to already processed sources
2021-02-12 11:14:50 -05:00
30a4ef4414 Update ansible-test default test containers. 2021-02-11 19:43:02 -08:00
0a8d5c0983 ansible-test: yamllint, check the assigment
Ensure `yamllint`'s `check_assignment()` correctly ignore the
attribute assignment. Those don't have any `.id` attribute and will
trigger an `AttributeError` exception.

See: https://github.com/ansible/ansible/pull/73322
2021-02-11 19:42:27 -08:00
f327e65d11 Use iskeyword and str.isidentifier for "is FQCN" (#73279)
* Use valid FQCN in test_verbosity_arguments

* Use iskeyword and str.isidentifier for "is FQCN"
2021-02-11 18:23:57 -08:00
f533d46572 Fix ansible-test constraints issues. (#73578)
* Silence Python 3.5 EOL notice in pip.
* Skip import test on compat/selinux.py utils.
* Improve Python version skip warning.
* Use Python 3.6 as minimum Python for sanity tests.
* Improve min Python handling for code-smell tests.
* Overhaul test-constraints sanity test.
* Merge sanity test constraints with requirements.
* Remove legacy content specific constraints.
* Add changelog fragment.
2021-02-11 16:45:53 -08:00
b6811dfb61 Add argument spec validator (#73335)
Add argument spec validator class
2021-02-11 19:17:14 -05:00
2b227203a2 Ansible 4 roadmap (#73465)
Co-authored-by: Deric Crago <deric.crago@gmail.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: John R Barker <john@johnrbarker.com>
Co-authored-by: Deric Crago <deric.crago@gmail.com>
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-02-11 15:47:04 -05:00
d0fda3e901 Let vault lookup output unicode string. (#73571)
Until now, the lookup plugin returned a byte string.
Changed this to output a unicode string instead.
2021-02-11 14:27:47 -05:00
bcefb6b5f1 fix typo in ansible vault decrypt if vault error (#73542) 2021-02-11 14:14:50 -05:00
1cb753225c added perf note to inc/imp diffs (#73371) 2021-02-11 13:10:02 -05:00
4334957e2c add that we now validate choices to porting guide (#73509)
for those that had choices that didn't match actual values used
2021-02-11 13:09:23 -05:00
ec8a556538 only add data when there is data to add (#54559)
Only add data when there is data to add

  also avoid clobbering existing data with empty file
  fixes #45843

* remove redundant code, update comments
* fix mock dataloader, original does not return None
* added test
2021-02-11 10:07:20 -05:00
4c5ce5a1a9 module compat for py3.8+ controller (#73423)
* module compat for py3.8+ controller

* replaced internal usages of selinux bindings with internal ctypes binding (allows basic selinux operations from any Python interpreter), plus tests

* added new respawn_module API to allow modules to import Python packages that are only available under a well-known interpreter, plus tests

* added respawn logic to modules that need Python libs from a specific system interpreter (apt, apt_repository, dnf, yum)

minimize internal HAVE_SELINUX usage

spurious junk

pep8

* pylint fixes

* add RHEL8 Python 3.8 testing

* more pylint

* import sanity

* unit tests

* changelog update

* fix a bunch of stuff

* tweak changelog

* fix setup_rpm_repo on EL8

* misc sanity/test fixes

* misc feedback tweaks

* fix import fallback in test module

* fix selinux MU test

* fix dnf tests to avoid python-dependent test packages

* add trailing LFs to aliases

* fix yum tests to avoid test package with Python deps

* hack create_repo for EL6 to create noarch package
2021-02-10 21:32:59 -08:00
8a175f59c9 Upgrade pylint used by ansible-test. (#70155)
* Upgrade pylint and deps in ansible-test.
* Enable pylint on Python 3.9.
* Update pylint config.
* Add ignore for vendored six.
* Add ignores for support plugins.
* Fix issue reported by pylint.
2021-02-10 15:52:41 -08:00
7cd577cc16 Fill in some 2.11 roadmap dates (#73560)
Signed-off-by: Rick Elrod <rick@elrod.me>
2021-02-10 13:03:44 -06:00
6fd0a74601 unarchive: add support for .tar.zst (zstd compression) (#73265) 2021-02-09 23:14:41 -06:00
ae241b407a Update guide_azure.rst (#73030)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2021-02-10 09:36:25 +05:30
4344607d7d user - add password expiration parameters (#69531)
* Add integration test

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-02-09 16:41:15 -05:00
bf10bb370b Update the porting guide for a new ansible release (#73547) 2021-02-09 15:06:10 -06:00
c3e2bdd3a8 Bump azure-pipelines-test-container to version 1.8.0 2021-02-09 21:07:38 +01:00
2f5c83dfb1 Add AlmaLinux to the family of Red Hat-like operating systems (#73541)
* Add changelog and fixtures for AlmaLinux support

Co-authored-by: Christoph Schug <com+github@schug.net>
2021-02-09 13:04:39 -05:00
7d18ea5e93 default callback - add "show_task_path_on_failure" option (#73260)
When running in verbosity <2, display the file and line number for tasks that fail. This provides
useful information without having to run at increased verbosity.

* Move _print_task_path to CallbackBase class
* Add integration tests
* Add color parameter to _print_task_path()

* Keep color output consistent for now
  Currently the path is display with COLOR_DEBUG formatting with verbosity >= 2.
  Instead of the color of the path changing based on verbosity level, just keep it at the
  currently behavior of COLOR_DEBUG. Having the color of the same information change
  based on verbosity level seems incorrect and makes visual parsing of the information
  more difficult.

Co-authored-by: tahar.jegham <jeghamseifeddine@gmail.com>
2021-02-09 12:43:59 -05:00
ca448f7c35 Update collection routing (#73046)
* Docker content from community.general migrated to community.docker.

* Hetzner Robot content from community.general migrated to community.hrobot.

* RouterOS content from community.network migrated to community.routeros.

* PostgreSQL content from community.general migrated to community.postgresql.

* OC content from community.general migrated to community.okd.

* Cisco NSO content from community.network migrated to cisco.nso.

* Add changelog fragment.

* Google content from community.general migrated to community.google.

* Hashi Vault content from community.general migrated to community.hashi_vault.

* KubeVirt content from community.general migrated to community.kubevirt.

* FortiOS content from community.network migrated to community.fortios.

* Update changelog fragment.

* DellEMC content from community.general migrated to dellemc.openmanage.
2021-02-09 09:31:35 -08:00
65fc8c9e35 INTERPRETER_PYTHON_DISTRO_MAP: Treat oracle same as rhel/centos (#73498)
* treat oracle same as rhel/centos

* fix misunderstood use of yaml anchors

* add changelog fragment

* Update changelogs/fragments/73498-INTERPRETER_PYTHON_DISTRO_MAP-Treat-oracle-same-as-rhel-centos.yml
2021-02-09 10:40:39 -05:00
d3441bc313 Add new split filter (#73532)
* Add version added
2021-02-09 10:37:15 -05:00
1a2da990a4 Temporary fix for cryptography issues. (#73530) 2021-02-08 14:35:00 -08:00
aca5b0e43b [setup_rpm_repo test] Ensure rpm-build is present (#73516)
Change:
- Other targets might remove rpm-build as they clean up after
  themselves. Ensure that it's present in setup_rpm_repo because
  rpmfluff needs it.

Test Plan:
- Local experimentation with yum_repository and mysql_db (the latter of
  which depends on a handler which was removing rpm-build) on
  stable-2.9.

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-02-05 15:58:02 -05:00
125c220343 Make non-lockstep callback tests more deterministic (#73511) 2021-02-05 14:11:40 -06:00
67f5bb39c7 galaxy - add format options for collection list (#73474)
* Include all collections in single json object / yaml document
* Add tests
* For galaxy list yaml/json output, use dictionary of dictionaries instead of list
* Add tests for listing single collection in yaml / output format
* --output -> --format
* Add explicit test for listing collection in human format
* Fix bug where empty json object was emitted + add test
2021-02-05 13:24:59 -05:00
d3f3784b86 Don't treat host_pinned as lockstep (#73484)
* Don't treat host_pinned as lockstep. Fixes #73364

* Add intg tests
2021-02-05 09:06:19 -06:00
8d6136eab9 uri - add ca_path parameter (#71979)
* add changelog fragment for #71979 (ca_path for uri)
* add integration tests for ca_path in the uri module
* return path of ca cert instead of its content
* connect to port 444 on self_signed_host
  and use quay.io/ansible/http-test-container:1.3.0
* state that the certificate in ca_path is used for validation
2021-02-05 09:40:52 -05:00
82cdd7e735 Bump antsibull-changelog version for changelog sanity test. 2021-02-04 16:42:26 -08:00
f271d02a9f bugfix: use to_text(stdout) in psrp.Connection.put_file method (#73491)
Co-authored-by: jakegatsby <jakegatsby@example.com>
2021-02-05 10:01:07 +10:00
0cdc410dce no_log mask suboption fallback values and defaults CVE-2021-20228 (#73487)
* no_log mask suboption fallback values and defaults

* Added changelog

* Remove lambda expression
2021-02-05 09:11:55 +10:00
4315e18807 Fix regression introduced in b77abd0491 causing bug in inventory modu… (#73429)
* Fix regression introduced in b77abd0491 causing bug in inventory modules which break functionality in user setting  use_contrib_script_compatible_sanitization  parameter.

* Add changelog

Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
2021-02-04 17:25:08 -05:00
7cef930aa4 Update kubernetes collection routing (#73485)
The community.kubernetes collection will be migrated / renamed to
kubernetes.core in the collection's 2.0 dev cycle. This should coincide
with the ansible-core 2.11 cycle.  The collection is being released to
galaxy under both the community.k8s and k8s.core names today.
2021-02-05 07:58:42 +10:00
7fb7d138fb Update working group links for cloud collections (#73471) 2021-02-05 05:15:32 +10:00
8f887b7adb add self-signed https endpoint for ansible-test (#73463)
* introduce self-signed.ansible.http.tests

* forwarding of port 444

* forward port 8444 to port 444 on http test container

* Fix port forwarding for Windows under docker

* add changelog fragment

Co-authored-by: Jordan Borean <jborean93@gmail.com>
2021-02-05 05:12:22 +10:00
bd18be6c0c Fix ansible-galaxy collection subdir searching and update documentation (#73406)
* Ensure there is a single source of collection metadata
* Allow collection subdirs to be detected by a galaxy.yml or MANIFEST.json
* Add documentation about installing and downloading collection directories
* Add an example for downloading a git repository
* Update documented valid metadata sources for installing git repositories

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2021-02-04 13:42:45 -05:00
997b2d2a19 Make yum_repository test more reliable (#73467)
* Improve setup_rpm_repo

- add handlers to remove repos
- add variable to control whethere or not repos are created

* Use local repo for all distros
* Change repo creation script to module
2021-02-03 17:34:12 -08:00
9759e0ca49 add option to upgrade collections (#73336)
* Add a flag to ansible-galaxy to update collections


Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2021-02-04 07:08:02 +10:00
fce22529c4 fix typo (#73434) 2021-02-03 09:17:02 -06:00
564a0fce4a Add the porting guide for Ansible-3.x (#73455) 2021-02-02 17:03:40 -05:00
7cf80f50d1 validate_modules: fails with .id attribute not found (#73322)
* validate_modules: fails with .id attribute not found

This patch addresses a problem in the `found_try_except_import` test.

This module tries to identify lines like:

`HAS_FOO = True`

In this case, the target (`HAS_FOO`) is of type `ast.Name` and has a
`id` attribute which provide the name.

In my case, I've a line that set a module attribute`. In this case, the
target (`module.var`) has the type `ast.Attribute` and no `id`
attribute. The code trigger an `AttributeError` exception.

This patch ensures we compare a `ast.Name`.

* Update test/lib/ansible_test/_data/sanity/validate-modules/validate_modules/main.py
2021-02-02 13:29:36 -08:00
a78a416e85 hostname: fix references in docs (#73454) 2021-02-02 16:11:50 -05:00
69631da889 lineinfile - add search_string parameter for non-regexp searching (#70647)
* Add tests for search_string
* Improve examples
* Add changelog
2021-02-02 15:37:06 -05:00
9a9272305a Correct pkg_mgr for Fedora-derived OSTree distros (#73445)
Change:
- Remove check that states that only Fedora can be an OSTree
  distribution.
- This allows us to correctly return "atomic_container" as the pkg_mgr
  fact for RHEL for Edge, Fedora/RHEL/CentOS Atomic Host, etc.

Test Plan:
- Created local RHEL for Edge image and tested against it.
- Tested against regular RHEL 8 and still got `dnf` as expected.
- Tested against RHEL 7 Atomic Host and got `atomic_container` now.
- New unit tests.

Tickets:
- Fixes #73084

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-02-02 15:09:30 -05:00
1c83672532 Allow $ & ~ inside paths in galaxy roles (#72966)
ansible-galaxy currently behaves bad then a role to be installed
contains ~ or $ at any place in the path of a file in that role.
It extracts the parent directory of the offending path level as an
empty file. This explodes if that directory contains anything else.

Change this behaviour. `~` is now allowed allowed when it is
not a full level (Yes: `some~thing/`, no: `~/`). The code should
get refactoring in an other PR.
2021-02-02 18:10:05 +01:00
a9b5bebab3 Overhaul ansible-test SSH key management. (#73451)
* Pass remote.sh to shell over stdin.
* Pass docker.sh to shell over stdin.
* Standardize SSH key management.
* Update docker containers.
2021-02-02 08:43:54 -08:00
218f5c3648 user - Prevent user fact lookup failure if LOGNAME is set (#17029) (#73439)
The `UserFactCollector` queries the user login name via
`getpass.getuser()` and looks up the corresponding entry
in the password database.
The login name may differ from the actual user name,
eg. if the `LOGNAME` env variable is set. The lookup
fails in this case. Added a fallback in this case that
tries to get the entry via the user ID.
2021-02-02 10:36:02 -05:00
bce01655cc [ansible-test] Bump CentOS 6 image (yum repos) (#73446)
Change:
- Bump centos6 image version to one which includes multiple fallbacks
  for vault.centos.org content.

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-02-01 16:24:21 -06:00
840bdc1e10 Fix warning for nonexistent inventory cache (#72840)
* Fix inventory cache warning by checking if the key exists before loading it
* changelog
2021-02-01 14:29:36 -05:00
81cd8e46f2 Update ansible-test distro containers to 1.29.0. 2021-02-01 09:24:28 -08:00
728dafb6eb Make ansible-galaxy collection verify error out on no MANIFEST.json
PR #73403

Co-Authored-By: Sviatoslav Sydorenko <webknjaz@redhat.com>
2021-02-01 09:55:21 +01:00
6f4b4c345b Match user-requested transitive pre-releases in collection dependency resolver (#73416)
* Add direct+transitive pre-release regression test

* Match user-requested transitive pre-releases

This change makes sure that in scenario when a user requests
collectionA-pre and collectionB that depends on collectionA,
collectionA-pre would actually match that collectionA requirement
while `--pre` is unset.

Co-authored-by: Jordan Borean <jborean93@gmail.com>
2021-02-01 14:26:49 +10:00
c7cb944315 Always use python exec wrapper in ansible-test. 2021-01-28 15:59:55 -08:00
c986cbb996 Add Python 3.8 and Python 3.9 to the fallback list (#73405) 2021-01-28 11:14:45 -08:00
902c402b6f Update ansible-test default containers. 2021-01-28 09:58:54 -08:00
ded2d0b90e Use sh for ansible-test raw remote shell. 2021-01-28 09:00:55 -08:00
b1344a1847 Avoid sphinx usage in changelog sanity test. 2021-01-27 23:52:13 -08:00
418b9b781d No longer warn about missing pip/python pair.
This warning was intended to help improve test environment configuration.
However, it has ended up producing mostly non-actionable warning noise instead.

In most situations a missing pip or python should result in test failures.
Reporting a missing pip also implies that it should be used by tests, which is not the case.
Tests should be invoking pip as a python module with the appropriate python interpreter instead.
2021-01-27 23:51:48 -08:00
672941fb0d Add test support for Python 3.8 on RHEL and FreeBSD. (#73393)
* Support Python 3.8 on RHEL 8.2+ in ansible-test.

* Support Python 3.8 on FreeBSD in ansible-test.

* Use libyaml with PyYAML on FreeBSD.
2021-01-27 21:35:29 -08:00
1b157ef42f Limit rstcheck sanity test to ansible-core. (#73391) 2021-01-27 21:06:00 -08:00
607af05d36 Fix syntax errors detected by rstcheck.
The errors occur when using sphinx >= 2.0.0.
2021-01-27 16:32:11 -08:00
5aa4295d74 change detection and check mode fixes for apt_key (#73334)
Change detection and check mode fixes for apt_key

* allow apt-key to use proxies
* add note about deprecation of apt-key itself
* expanded error msgs
* show all keys
* fix short_format parsing
* added more return info and documented it
2021-01-27 18:40:58 -05:00
595413d113 Replace the inhouse collection dependency resolver with resolvelib
PR #72591

This change:

  * Adds an artifacts manager that abstracts away extracting the
    metadata from artifacts, downloading and caching them in a
    temporary location.

  * Adds `resolvelib` to direct ansible-core dependencies[0].

  * Implements a `resolvelib`-based dependency resolver for
    `collection` subcommands that replaces the legacy
    in-house code.

    This is a dependency resolution library that pip 20.3+ uses
    by default. It's now integrated for use for the collection
    dependency resolution in ansible-galaxy CLI.

  * Refactors of the `ansible-galaxy collection` CLI.
    In particular, it:

      - reimplements most of the `download`, `install`, `list` and
        `verify` subcommands from scratch;

      - reuses helper bits previously moved out into external modules;

      - replaces the old in-house resolver with a more clear
        implementation based on the resolvelib library[0][1][2].

  * Adds a multi Galaxy API proxy layer that abstracts accessing the
    version and dependencies via API or local artifacts manager.

  * Makes `GalaxyAPI` instances sortable.

  * Adds string representation methods to `GalaxyAPI`.

  * Adds dev representation to `GalaxyAPI`.

  * Removes unnecessary integration and unit tests.

  * Aligns the tests with the new expectations.

  * Adds more tests, integration ones in particular.

[0]: https://pypi.org/p/resolvelib
[1]: https://github.com/sarugaku/resolvelib
[2]: https://pradyunsg.me/blog/2020/03/27/pip-resolver-testing

Co-Authored-By: Jordan Borean <jborean93@gmail.com>
Co-Authored-By: Matt Clay <matt@mystile.com>
Co-Authored-By: Sam Doran <sdoran@redhat.com>
Co-Authored-By: Sloane Hertel <shertel@redhat.com>
Co-Authored-By: Sviatoslav Sydorenko <webknjaz@redhat.com>

Signed-Off-By: Sviatoslav Sydorenko <webknjaz@redhat.com>
2021-01-27 22:23:22 +01:00
82b74f7fd7 iptables: Fixed get_chain_policy API (#69152)
While getting policy name in get_chain_policy API,
module does not require any additional parameters except chain
Enabling flag in get_chain_policy API call fixes this.

Fixes: #68612

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-01-27 15:24:53 -05:00
11398aac09 update faq link (#73353)
Fix faq link.
2021-01-27 14:58:23 -05:00
c7d4acc12f allow env to override unspecified unsafe_writes (#73282)
* allow env var for fallback value for unspecified unsafe_writes
2021-01-27 14:16:10 -05:00
2b0cd2c13f use correct executable and options in all cases (#73323)
Use correct ssh executable and options in all cases on connection plugin

  * Also nicer naming/comments

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2021-01-26 20:21:24 -05:00
1265c6def3 Update porting guide for 2.10.6 2021-01-26 16:29:40 -08:00
13d08d232c Rename ansible-test functions to match constants. 2021-01-26 14:24:16 -08:00
73fadc5e97 Clean up code in ansible-test. (#73379)
* Relocate code to fix type dependencies.

* Fix missing and unused imports.

* Fix type hints.

* Suppress PyCharm false positives.

* Avoid shadowing `file` built-in.

* Use json.JSONEncoder directly instead of super().

This matches the recommended usage and avoids a PyCharm warning.

* Remove redundant regex escape.

* Remove redundant find_python call.

* Use tarfile.open directly.

* Add changelog fragment.
2021-01-26 14:02:08 -08:00
76604397cb Mention that C(...) should be used for inline code. (#73312) 2021-01-26 10:48:47 -06:00
a2af8432f3 Local vars should have highest precedence in AnsibleJ2Vars (#72830)
Ability to add local variables into AnsibleJ2Vars was added in
18a9eff11f to fix #6653. Local variables
are added using ``AnsibleJ2Vars.add_locals()`` method when creating a
new context - typically when including/importing a template with
context. For that use case local template variables created using
``set`` should override variables from higher contexts - either from the
play or any parent template, or both; Jinja behaves the same way.

Also removes AnsibleJ2Vars.extras instance variable which is not used.

Also adds missing test for #6653.

Fixes #72262
Fixes #72615

ci_complete
2021-01-26 11:37:56 +01:00
fc590aeb21 Use a versioned pip bootstrapper in ansible-test. 2021-01-25 12:31:11 -08:00
ab667200cc Mention renaming ansible-base to -core @ roadmap (#73354)
* Mention renaming ansible-base to -core @ roadmap

* Replace ansible-base with ansible-core @ roadmap
2021-01-25 12:34:40 -05:00
f3ce7cfe53 tiny grammatical edit (#73339) 2021-01-25 10:28:55 -05:00
6abeabaff1 Fix versionadded syntax @ galaxy user guide 2021-01-25 12:08:52 +01:00
484e4af4d0 Handle get-pip.py breaking change on Python 2.7. 2021-01-23 11:45:53 -08:00
7f6fcc3407 json_query: Update documentation (#73302) 2021-01-22 15:41:24 -05:00
e0c9f285ff undeprecated hash_merge setting (#73328)
added updates from sloan's PR
 feedback from others

Co-authored-by: Sloane Hertel <shertel@redhat.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Sandra McCann <samccann@redhat.com>

Co-authored-by: Sloane Hertel <shertel@redhat.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Sandra McCann <samccann@redhat.com>
2021-01-22 15:00:19 -05:00
dec443e3a5 why no mfa? (#73324)
Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: Rick Elrod <rick@elrod.me>
2021-01-22 14:58:35 -05:00
e6da544310 Let command always return stdout & stderr (#73004)
The `command` module does not return stdout & sterr when calling
a non existing executable or an unknown exception arises. This fix
lets the module return empty byte strings in those cases.
2021-01-22 08:40:53 +01:00
1934ca9a55 Add Ubuntu 20.04 to CI and ansible-test (#69161)
Change:
- Add Ubuntu 20.04 to CI now that venv is default instead of virtualenv in ansible-test.

Test Plan:
- CI

Tickets:
- Fixes #69203

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-01-21 22:58:31 -06:00
4357a78130 [ansible-test] First attempt at freebsd/11.4 (#72655)
Change:
- Try CI against freebsd 11.4

Test Plan:
- ci_complete

Tickets:
- Fixes #48782

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-01-21 17:12:18 -06:00
fe792fdcd2 Vanquish rare container bootstrap failure (#73288)
The init script for the test container writes additional lines to
the .bashrc of the user. This was done via a `cat` multiline
instruction, which is implemented internally by writing a
temporary file to TMPDIR (/tmp in this case) first. Docker fails
to provide /tmp just after creation, which results in a race
condition that rarely makes the init fail. Changed the `cat`
statement to multiple `echo`s.

Co-authored-by: Matt Clay <matt@mystile.com>
2021-01-21 12:22:58 -05:00
45240c1871 Update NX-OS platform guide with MDS information (#73315)
Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
2021-01-21 12:03:50 -05:00
7f9ac0f364 Consolidate filters/tests handling into JinjaPluginIntercept (#71463)
* Consolidate filters/tests handling into JinjaPluginIntercept

ci_complete

* Postpone loading all ansible plugins

* Do we need to create an overlay?

ci_complete

* Typo

ci_complete

* Add FIXME

* conditional.py: use public Environment.parse() method

* Remove remaining occurrences of shared_loader_obj being passed to Templar

* __UNROLLED__ not needed with this change anymore

* Incorrect rebase at some point?
2021-01-21 11:22:33 +01:00
823c72bcb5 Shadow input for encrypt_string by default unless asked (fixes #71618) (#73263)
* Shadow input for encrypt_string by default unless asked (fixes #71618)
2021-01-20 15:50:24 -05:00
bc60d8ccda Galaxy - make versions list consistent across versions (#72932)
* Galaxy - make versions list consistent across versions

* Fix up unit tests
2021-01-20 21:19:29 +01:00
51e00c5e86 Fix documentation for slaac filter (#73294)
##### SUMMARY

One of the parameters to the slaac filter was unquoted causing a crash:

```
template error while templating string: expected token 'end of print statement', got ':'. String: {{ fdcf:1894:23b5:d38c:0000:0000:0000:0000 | slaac('c2:31:b3:83:bf:2b') }}
```

This adds the missing quotes.

##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2021-01-20 13:10:24 -05:00
13ea312cc8 added pb fqcn docs (#72602)
* added pb fqcn docs
2021-01-20 11:34:33 -05:00
ec55a221f6 Do not pretend expression is filename in compile() Python built-in call (#73113)
When calling compile(), the filename argument should be either a real file
name or a string. According to Python docs, suggested one is '<string>'.
 Keep the current behaviour (encapsulate the actual expression), 
but enclose it into angle brackets.

Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
2021-01-19 12:20:26 -05:00
e8d4b62b41 Fix YAML error message when error is at the end of the file (#73241)
* Fix YAML error message when error is at the end of the file

If a YAML file fails to load due to a syntax error in a file, or there is an error in the last line of a
file, PyYAML reports the last line number of the file as the index where the error occurred.

When reading the file lines, we use that index to the get the relevant line.  If the index value is out
of range, the relevant line is lost for error reporting.

Subtract one from the index value to avoid the IndexError in this specific scenario. It is possible
to still get an IndexError, which will be handled as it is currently.

* Update existing tests and add new tests
2021-01-19 10:07:36 -05:00
30d93995dd Use a pty for local connections (#73023)
* Use a pty for local connections

Fixes #38696

Co-authored-by: James Cammarata <jimi@sngx.net>
2021-01-18 16:02:04 -05:00
d500e6ec45 doc: fix ansible_play_hosts description about failure (#73190)
The variable ansible_play_hosts actually does _not_ includes failed or unreachable hosts.

+label: docsite_pr
2021-01-18 15:24:29 -05:00
Jan
aae82ff560 Update documentation for "contains" parameter (#73107)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-01-18 15:21:45 -05:00
73aa571305 Make sure to mention collection version for version_added as well. (#73270) 2021-01-18 14:53:10 -05:00
1e27d4052a fix inventory source parse error handling (#73160)
fixes #51025

added test cases
2021-01-18 09:33:51 -05:00
9d71bbd13e add changelog fragment for 73176 (#73259) 2021-01-15 16:26:53 -06:00
aa21804165 Added TLS security protocol for Powershell downloads (#73226)
##### SUMMARY
Added `[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12` to the Powershell scripts that use a file download. If not specified the script won't be allowed to download data from the mentioned URL's.


##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2021-01-14 14:23:19 -08:00
1202dd000f Allow restricting config values to enumerated list (#73162)
* Allow restricting config values to enumerated list
* dont document internal entries
* also ignore private defs for ansible-config
* remove invalid value from tests
* added porting entry
2021-01-14 15:11:30 -05:00
88763c7347 update rstcheck and sphinx versions in contraints (#73176)
* update rstceck and sphinx versions in contraints
* fix test error
2021-01-14 13:50:44 -06:00
e9a1ff296e Fix block example line emphasis (#73238)
Signed-off-by: Adam Miller <admiller@redhat.com>
2021-01-14 14:40:31 -05:00
403a3b90b5 Fix list to dict example (#73213)
##### SUMMARY
<!--- Your description here -->
single_list must be transformed to a list of pairs before feeding it into dict()

##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2021-01-14 14:15:55 -05:00
e2308ed6e3 ansible-galaxy - correct collections-path command line arg (#73193)
It should be plural to match other options and environment variables.
2021-01-14 14:13:01 -05:00
0c4de6839b Add integration tests to ansible-galaxy-collection for 'ansible-galaxy collection verify' (#73229) 2021-01-14 11:49:53 -05:00
df9cf368c0 Always mention the name of the deprecated plugin in routing deprecation messages (#73059) 2021-01-14 17:45:02 +01:00
df451636e7 facts - properly report virtualization facts for Linux guests on bhyve (#73204) 2021-01-14 10:53:03 -05:00
0e6c334115 pause - adjust warning when run in background (#73182)
When the pause module is run in the background and seconds parameter is provided,
do not warn.

* Add tests
* Fix existing tests
  The test wasn't failing when it should have.
2021-01-14 09:35:39 -05:00
7f0eb7ad79 [facts] Differentiate CentOS vs CentOS Stream (#73034)
Change:
- On CentOS Stream, make distribution_release be "Stream"
- On CentOS Core, it continues to be "Core"
- Implement custom distribution file parser for CentOS, so we can look
  for "CentOS Linux" and "CentOS Stream"
- Two new fixtures introduced (CentOS Linux 8.1 and CentOS Stream 8)
- Removed two dicts from `Distribution` class that were seemingly not
  used anywhere.

Test Plan:
- ci_complete
- New test fixtures

Tickets:
- Fixes #73027

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-01-13 17:54:04 -05:00
4164cb26f0 Remove obsolete tower plugin from ansible-test. 2021-01-13 12:37:21 -08:00
3e8c8cd536 Make test_adhoc succeed from within a git checkout
The test currently only expects the literal `ansible` followed
by a semver in the first output line of `ansible --version`.
When running from within a git checkout, additional information
like the currently checkout branch are attached, which lets
the test fail. This commit allows arbitrary information to
follow the semver.
2021-01-13 21:22:21 +01:00
6459fbb7bc Make test_prepare_multipart succeed on non Debian distros
`test_prepare_multipart` fails in non Debian environments since
Debian installations map the file ending `.key` to the MIME type
`application/pgp-keys`, which is not IANA conformant. This commit
explicitly sets the corresponding file type to
`application/octet-stream` and adjusts the expected serialized
result.
2021-01-13 21:21:33 +01:00
270385f949 Remove 'type: complex' from the example, and mention that it should be avoided. (#73171) 2021-01-13 14:01:32 -05:00
21f1811ddf Cleanup provisioning code in ansible-test. (#73207)
* Remove unused code in ansible-test.

* Remove obsolete endpoint logic from ansible-test.

* Remove obsolete region selection in ansible-test.

* Remove obsolete port logic in ansible-test.

* Clean up ansible-test remote providers.
2021-01-12 16:18:28 -08:00
d6670da1d7 Added clog missing for issue 70722 (#73175) 2021-01-12 12:09:59 -05:00
9de2da8a7e Add tests for merging and replacing vars from inventory sources (#73181) 2021-01-11 17:37:34 -05:00
be59caa59b iptables: Added set module/match_set support (#72984) 2021-01-11 16:32:53 -05:00
98726ad86c hostname module: advise 'use:systemd' for RHEL/EL/CentOS 7+ (#72444)
Closes: https://github.com/ansible/ansible/issues/72429

Co-authored-by: Brad Solomon <brsolomon@deloitte.com>
2021-01-11 21:10:26 +01:00
a7e834071c Add macOS 11 to CI (#72622)
* Fix connection_paramiko_ssh test for macOS 11
* Update Azure Pipelines config
* Add changelog
2021-01-11 12:20:47 -05:00
264e08f21a user - properly handle password and password lock when used together (#73016)
Do the right thing on Linux when password lock and a password hash are provided by writing
out the password hash prepended by the appropriate lock string rather than using -U and -L.
This is the correct way to set and lock the account in one command.

On BSD, run separate commands as appropriate since locking and setting the password cannot 
be done in a single action.

FreeBSD requires running several commands to get the account in the desired state. As a result,
the rc, output, and error from all commands need to be combined and evaluated so an accurate
and complete summary can be given at the end of module execution.

* Improve integration tests to cover this scenario.
* Break up user integration tests into smaller files
* Properly lock account when creating a new account and password is supplied

* Simplify rc collection in FreeBSD class
  Since the _handle_lock() method was added, the rc would be set to None, which could make
  task change reporting incorrect. My first attempt to solve this used a set and was a bit too
  complicated. Simplify it my comparing the rc from _handle_lock() and the current value of rc.

* Improve the Linux password hash and locking behavior
  If password lock and hash are provided, set the hash and lock the account by using a password
  hash since -L cannot be used with -p.

* Ensure -U and -L are not combined with -p since they are mutually exclusive to usermod.

* Clarify password_lock behavior.
2021-01-11 11:42:35 -05:00
cec5267cee Documentation: fix formatting (#73060)
Co-authored-by: Andrew Klychkov <andrew.klychkov@gmail.com>
2021-01-11 10:01:17 -05:00
8a202cae3e Update developing_collections.rst (#73142)
Fix typo - FQCN not FCQN.
2021-01-08 12:57:26 -06:00
ae74d871a7 Document install_python_apt option of apt_repository (#72959)
* Update lib/ansible/modules/apt_repository.py
* Remove unnecessary ignored sanity tests
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
Co-authored-by: Amin Vakil <info@aminvakil.com>
2021-01-08 11:30:23 -06:00
61f0d6b919 add note regarding datetime docs (#72976)
Adds a note pointing to the datetime documentation as to_datetime does not use the time library but instead uses datetime.
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2021-01-08 09:47:23 -06:00
d83200c530 Documentation change to the apt module to reference lock files (#73079)
This change references the suggested workaround in #25414.
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2021-01-08 09:44:42 -06:00
456e9b7a33 Update pip integration test to use venv on py3. 2021-01-07 20:12:39 -08:00
05ba49cbba ansible-test - No virtualenv install on Python 3
Tests should use the Python built-in ``venv`` module on Python 3 instead of the standalone ``virtualenv`` module.

On Python 2 the ``virtualenv`` module continues to be the only option.
The version installed is either the OS packaged version or the last release to support Python 2, which is version 16.7.10.
2021-01-07 20:12:39 -08:00
7e769d6dd3 Fix example with the backwards counting in the sequence lookup plugin. (#73081)
The old example failed with:
fatal: [localhost]: FAILED! => {"msg": "to count backwards make stride negative"}
I fixed this and placed a start parameter to consolidate with the rest of the examples provided.

Co-authored-by: Jorge Rua <jorua@redhat.com>
2021-01-07 16:34:05 -06:00
1b88234a3a Fix a typo in the documentation of ansible.builtin.apt (#73061) 2021-01-07 22:27:09 +01:00
b1ee1a285a Added NO_COLOR as config option (#73105) 2021-01-07 15:00:31 -05:00
995e76c6e3 Update windows_winrm.rst (#73101)
The standard Port for ansible winrm is set to 5986/HTTPS. 
To be able to use Kerberos, you need to set ansible_port: 5985/HTTP otherwiese you get error message or timeout.
HTTPS is not needed for environments with Kerberos, since kerberos has server identification built in to the protocoll.
FYI: HTTP traffic will by default also be encrypted when using kerberos
2021-01-07 14:55:32 -05:00
0936623901 update the docs requirements versions (#73108) 2021-01-07 13:40:01 -06:00
44ee04bd1f [dnf] Make "remove" filtering closer to dnf CLI (#73033)
Change:
- Internally, use dnf.subject.Subject#get_best_query for state: absent
- Add a bunch of tests for removing packages, given a bunch of different
  pkg specs (nv, nvr, nvra, wildcard, etc.)

Test Plan:
- New tests
- Local experiments with DNF API via PDB.

Tickets:
- Fixes #72809

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-01-07 11:32:06 -06:00
77942acefc Refactor ansible-test cryptography install code. 2021-01-07 09:04:33 -08:00
c8666f07d7 Add support for argument_specs attribute to RoleMetadata class (#73120) 2021-01-07 11:41:46 -05:00
0eb1e22cd9 Update azure pipelines container 2021-01-06 15:41:09 -08:00
c9f28c1735 Rewrite Docker scenario guide (#73069) 2021-01-06 13:57:14 -05:00
1d8760779c left a stray </div> by mistake (#73132)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-01-06 12:13:24 -05:00
24e8ba7c9e Update the porting guide for a new ansible version (#73124) 2021-01-06 10:13:35 -06:00
25792d2388 galaxy: handle plus sign in user token appearing in role url (#73057)
Fixes: #45475

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-01-06 10:50:44 -05:00
5b4f0b3370 Declare support for Python 3.9 in the metadata
Co-authored-by: Rick Elrod <rick@elrod.me>
2021-01-05 20:48:08 -08:00
b96732fa6b [ansible-test] Add Fedora 33 support and drop F31
Change:
- Changes to make F33 work with current tests
- Add F33 to docker.txt
- Add F33 to AZP config

Test Plan:
- ci_complete

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-01-05 20:48:08 -08:00
0a3c5d9dcc remove doc survey banner (#73119) 2021-01-05 15:40:20 -06:00
de3844cba9 discourage hexdigits in password lookup (#73106)
* actually add new docs

* Update lib/ansible/plugins/lookup/password.py

Co-authored-by: Sandra McCann <samccann@redhat.com>
2021-01-05 15:03:27 -05:00
e0c75a6756 Replace the use of the function string.replace with the method str.replace (#68793)
* Replace the use of the function string.replace() with the method str.replace()
because that's what works for both Python 2 and 3.

* Cleanup the unused string import.

Added a changelog fragment.

* The documentation for os.write() seems a bit iffy, but in Python 3 we
definitely cannot pass it a string and we need to encode it into
bytes.

The Python documentation at
https://docs.python.org/3/howto/pyporting.html#text-versus-binary-data
says that this code will work in Python 2 as well.

Co-authored-by: Lloyd Parkes <lloyd@must-have-coffee.gen.nz>
2021-01-05 11:20:44 -05:00
a469a4455a Add ansible-galaxy-collection-scm tests for requirements.yml (#73029)
* Add ansible-galaxy-collection-scm tests for requirements.yml format

* Add a test for --no-deps

Fix assertion
2021-01-05 10:32:23 -05:00
20509b6507 [facts] fix version facts on FreeBSD RC/PRERELEASE (#73020)
Change:
- The FreeBSD release can contain -RC or -PRERELEASE in addition to
  -RELEASE, -STABLE, or -CURRENT.

Test Plan:
- Added new fixed from an RC version of TrueNAS which uses a -PRERELEASE
  version of FreeBSD.

Tickets:
- Fixes #72331

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-01-05 10:16:59 -05:00
003a9e890d Constrain pexpect and ptyprocess (#73109)
The recent update of ptyprocess to 0.7.0 is incompatible with Python 2.6 and
is causing test failures.

* Add setup_pexpect role to expect test
2021-01-04 15:53:56 -05:00
3074ede8a3 ExecutionPolicy default value is RemoteSigned (#72993)
* ExecutionPolicy default value is RemoteSigned

##### SUMMARY
In Windows setup steps, settings `ExecutionPolicy` is restored to value `Restricted`. But actually default value for Windows server is not `Restricted` but `RemoteSigned` ([source](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.1#default)).

I have got issue with `win_dsc` because `ExecutionPolicy` was `Restricted`.

##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr

* Add changelog fragment

* Apply suggestions from code review

Co-authored-by: Sandra McCann <samccann@redhat.com>
2021-01-04 15:41:54 -05:00
418bad7ad4 type: sub-module -> submodule (#73087)
Updates the docs for the git module. Elsewhere in this file submodule is all one word, and it's all one word in git docs.
2021-01-04 12:03:21 -06:00
776274143f galaxy: Update example for git+file (#73053)
Use correct syntax for installation of role from
local git repository.

Fixes: #72217

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-01-04 12:01:54 -05:00
pva
42bc03f0f5 [get_url] skip checksum during --check (#66700)
Fix get_url failure in check mode (--check) when using the checksum
format <algorithm>:<url>.

Regression introduced in (#20532)

Fixes: #61369
2020-12-22 21:34:42 +05:30
aa56a2ff6a galaxy: Handle token as dict while loading using yaml (#70911)
Malformed galaxy_token file creates stacktrace.

Fixes: #70887

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-12-21 14:53:00 -05:00
932ba36160 ensure unsafe writes fallback (#70722)
* Ensure we actually fallback to unsafe_writes when set to true

 add integration test
 add fix for get_url not passing the parameter from args
2020-12-21 11:20:52 -05:00
202689b1c0 Update lookup.rst (#72831)
##### SUMMARY
Set correct indentation.


##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2020-12-18 14:55:53 -05:00
938199e34a gather_facts - Add link to docs on how to configure facts modules (#72271)
* Add link to docs on how to configure facts modules

* Remove unrendered markup from examples

* Update link to relative reference
2020-12-18 12:25:18 -05:00
79ab1247b8 Fixed vault id in variable encryption example (#72626) 2020-12-18 12:16:38 -05:00
103decccac Add complex example of fileglob with loop (#72396)
* Add complex example of fileglob with loop

* Explain Python unpacking notation

* Add missing paren
2020-12-18 12:08:47 -05:00
97765f4ebd Role duplicates docs updates (#72666)
* Change example to use role params to represent the documented outcome. Fixes #68922

* Add notes about how vars vs role params affect variable scoping, and how lazy evaluation and role-deduplicating is affected. Fixes #72650

* link to term
2020-12-18 11:55:54 -05:00
b514200126 Add link to all module and plugin indexes (#72743)
* Add link to all module and plugin indexes.

* Use glob setting for toctree.

* Explicitly include new file.

* Move all_plugins one level up.

* Revert "Move all_plugins one level up."

This reverts commit bd47e82ead.

* Revert "Explicitly include new file."

This reverts commit 74ae50a734.

* Adjust .gitignore

* Revert "Revert "Explicitly include new file.""

This reverts commit f30d99c861.

* Fix docs make clean

Now that there's a static file in rst/collections, we have to be more
explicit about how we clean the generated files out of that directory.

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2020-12-18 11:55:31 -05:00
8fdb5ace01 Update WSL docs to mention sleep workaround (#72839)
Co-authored-by: Joseph Chambers <joe.chambers@lexisnexis.com>
2020-12-18 11:49:56 -05:00
c1dadfdadc Documentation: fix modules doc formatting (#72898) 2020-12-18 11:45:07 -05:00
389c7b7806 Documentation fix, /etc/apt/source.list from non-code block to code block (#72933)
/etc/apt/source.list
was sentence, not code-block. Therefore made it code-block
2020-12-18 11:41:38 -05:00
5ecfb19cad arg_spec - move validator lookup method to a function (#72667)
* arg_spec - move type checking lookup method to a function

* Change get_wanted_type name and behavior

Change the name to get_validator to bette describe what it is doing.

Change the interface to always return a value. This lines up with the behavior of get_*
functions always returning something or None and check_* functions raising an
Exception if something went wrong during the check.

* Add param to check_type_str()

Not meant to be a long term fix, but gets tests passing. More work is needed to figure
out how to solve this cleanly.

* Remove private attribute mapping types to validator

Since the function that needs it has moved to parameters.py, there is no need to have it as
a attribute of AnsibleModule.

Update tests that were referencing the private attribute.

* Use private method for 'str' type

To avoid having to put the string conversion warning behavior in the check_type_str() method,
use the private _check_type_str() method for 'str' type.

Import CHECK_ARGUMENT_TYPES_DISPATCHER for backwards compalitibility and store it as
a private attribute.

Revert changes to support plugins that are referencing serf._CHECK_ARGUMENT_TYPES_DISPATCHER.

* Add changelog

* Change function name to better reflect its... function

* Change dict name to better reflect its contents

CHECK_ARGUMENT_TYPES_DISPATCHER --> DEFAULT_TYPE_VALIDATORS

* Fix changelog
2020-12-17 17:15:00 -05:00
48803604cd systemd - do not overwrite unit name when searching (#72985)
* systemd - do not overwrite unit name when searching

PR #72702 introduced a bug that changed the unit name when splitting it up for the purpose
of searching for the unit. This only happens on unit file templates on systems that have a 5.8
or newer kernel and a version of systemd that does not contain a bugfix that causes systmed
to fail to parse dbus.

* Use facts rather than a manual probe to determine if systmed is present

* Remov unnecessary block

* Use vars files instead of set_fact

* Add tests for using a templated unit file

* Update changelog fragment

* Use template to get correct path to sleep binary
2020-12-17 15:29:22 -05:00
13bf04e95a Clarify include_role documentation to indicate play vs playbook (#73011)
* Clarify include_role documentation to indicate play vs playbook. Fixes #73006

* Additional clarifications
2020-12-17 14:28:16 -05:00
8e022ef00a import_playbook - change additional params to deprecation (#72987)
* import_playbook - change additional params to deprecation

I incorrectly recommended this be set as a warning when it should have been a deprecation.

* Fix deprecation sanity test to not required a collection name when not inside a collection
2020-12-17 14:14:58 -05:00
dbc2c996ab Allow key None to prevent errors with import test. 2020-12-17 09:04:06 -08:00
850a77f639 ansible-test - prefer venv over virtualenv on Python 3 (#73000)
Also pin virtualenv to 16.7.10 for older Mac OS X systems. This was the version being installed
anway with the previous constraint (<20).

On systems with Python 3, now prefer venv over virtualenv. Test to see if venv is functional since
some systems have a non-functional venv installation (such as Debian).
2020-12-17 10:51:42 -05:00
5e03e322de Pass the top level dictionaries to combine_vars (#72979)
* Pass the top level dictionaries to combine_vars

combine_vars uses dict.update() to replace keys
2020-12-16 11:23:23 -05:00
6487a239c0 developing_inventory sample code: fix undefined var "results" if get_option(cache)=False (#72977)
if user_cache_setting == False, then the previous code didn't parse the inventory source
2020-12-16 10:51:58 -05:00
3274e02fd8 Update Azure Pipelines scripts and config. (#72986)
* Increase fetch depth to reduce the frequency of full test runs for out-of-date PRs.
* Update scripts to match those which will be used in collections.
2020-12-15 15:28:44 -08:00
37d09f2488 Update ansible-test pylint Python support. (#72972)
* Update ansible-test pylint Python support.

* Python 3.8 is now officially supported.
* Python 3.9 is now skipped with a warning.
2020-12-15 10:27:32 -08:00
7eee2454f6 Remove note on combining roles and collections (#72957) 2020-12-15 09:18:14 -06:00
8450858651 Remove inaccurate Vault documentation (#72938)
This is not functionality that exists.
2020-12-15 09:06:10 -06:00
0ba96d2be8 Compare removal and deprecation dates and versions in runtime metadata against current version and today (#72625)
* Check deprecation and removal versions w.r.t. current version.

* Check removal dates from tombstones w.r.t. today.

* Add changelog.
2020-12-15 09:05:38 -05:00
b0c78208fd Add test for ansible-galaxy collection install
Test installing a collection to a directory containing other collections without any metadata (#72971)
2020-12-15 08:59:28 -05:00
d22804c4fb saner path dir management (#72648)
* saner path dir management

   fixes #72628

   ensure we always store paths w/o a_c

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2020-12-14 19:30:13 -05:00
5157a92139 Remove exit code from traps in tests
Having the trap exit with a specific code will override
the exit code that caused the trap to run, which could
mask errors
2020-12-14 09:16:34 -08:00
3a18ef7159 Change role argspec file used by ansible-doc (#72927)
* Change role argspec file used by ansible-doc

This changes the file used for role argument specs from meta/argument_specs.yml
to meta/main.yml. The argument specs are expected to be in that file under the
top-level entry of `argument_spec`.

* Switch to argument_specs
2020-12-14 12:05:40 -05:00
83fb24b923 iptables: Adding multiport module support (#72928) 2020-12-14 10:23:54 -05:00
0044091a05 Update yum/dnf module docs to include version comp (#72763)
* Update yum/dnf module docs to include version comp

Fixes #61234

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix up docs syntax to sanity tests are happy

Signed-off-by: Adam Miller <admiller@redhat.com>
2020-12-11 10:31:19 -05:00
e7dee73774 Collection list site packages (#70173)
* ansible-galaxy collection list and verify now utilize collections in site-packages.

This is a short term fix for #70147.  The long term fix needs to handle
install (but that discussion is also bound up in how upgrade is going to
work and where things can get installed so it's deferred for 2.11.)

* Add test for ansible-galaxy collection list with site-packages

* Fix sanity issue

Co-authored-by: David Moreau Simard <moi@dmsimard.com>
Co-authored-by: Jordan Borean <jborean93@gmail.com>
2020-12-11 09:59:33 +10:00
0a60e5e341 Add a couple more tests to ansible-galaxy-collection (#72931)
* Test installing a dependency compatible with multiple collection requirements

Test downloading a collection without dependencies

* Move cleanup to the end of the test suite
2020-12-10 11:26:50 -05:00
a3b6485073 Fix reset_connection paramiko, winrm, psrp (#72688)
* Ensure we only reset the connection when one has been previously established. Fixes #65812

* Ensure psrp doesn't trace

* winrm too

* Indentation fix
2020-12-09 12:57:56 -06:00
36ab3d1189 Fix cryptography constraints in ansible-test. (#72914) 2020-12-09 10:46:05 -08:00
83764ad506 Fix async interpreter parsing (#72636)
* Fix async interpreter parsing. Fixes #70690

* Target localhost instead of remote host

* Don't forget inventory

* Address shellcheck issue
2020-12-09 11:41:45 -06:00
1b70260d5a Add implicit role_complete block instead of role._eor (#72208)
Co-authored-by: Matt Martz <matt@sivel.net>

Fixes #69848
2020-12-09 09:53:01 +01:00
252685092c Use _wrap_native_text only for builtin STRING_TYPE_FILTERS (#71801) 2020-12-09 09:48:32 +01:00
08cc6edc64 vault: Read stdin data as binary on python3 (#52229)
On python3 sys.stdin is an encoded file object that does not support
reading raw binary data. Use the supplied buffer object to do so.

Signed-off-by: Sven Wegener <sven.wegener@inovex.de>

Co-authored-by: Sven Wegener <sven.wegener@inovex.de>
2020-12-09 09:46:32 +01:00
e5ccd18be4 Wording changes to docs (#70082) 2020-12-08 16:46:34 -05:00
6098793315 add docs survey banner (#72907)
* add docs survey banner, with date
2020-12-08 15:09:35 -06:00
6bc1e9f5dd Address additional ansible_core rename issues (#72906)
* Update __requires__ to reference the correct ansible_core package name

* ansible-test updates to handle the correct egg_info for ansible_core
2020-12-08 12:22:55 -06:00
57c2cc7c77 correct the reST rendering of the R() note (#72896) 2020-12-08 16:46:09 +01:00
8f77e95765 Add alinux hostname module support (#72894) 2020-12-08 16:42:42 +01:00
bc35fbf5de Change apt-add-repository to add-apt-repository (#72893) 2020-12-08 16:40:51 +01:00
4e74270322 Replace "hash of the path" by "hash of the file" (#72880) 2020-12-08 16:32:48 +01:00
fe17cb6eba Fix fileglob parameter order bug (#72879) 2020-12-08 16:31:34 +01:00
e97f333532 Add missing endfor to vlan_parser example (#72872) 2020-12-08 16:25:56 +01:00
bc37976df2 Clarify mode behavior for modules that can set file permissions (#72837) 2020-12-08 16:11:36 +01:00
711064a073 Remove shippable.yml 2020-12-07 10:13:09 -08:00
be2c376ab8 Extract embedded function to RoleMixin method and add tests (#72754)
* Add changelog
* Simplify return
2020-12-07 13:07:23 -05:00
034e9b0252 unarchive - add include option (#40522)
This should allow users to extract specific files from an archive as
desired.

Fixes #16130, #27081.

* Rebase and make a few minor changes
* Add changelog
* Improve tests

- move to separate tasks file
- change assertions to check for exactly one file
- use remote_tmp_dir for output dir

* Make exclude and include mutually exclusive
* Don't remove files needed by other tasks
* Fix sanity tests
* Improve feature documentation
* Skip tests that use map() on CentOS 6
* Use fnmatch on include for zip archives
  This matches the behavior of exclude

Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-12-07 12:49:41 -05:00
6608f3aab3 Update ansible roadmap (#72838)
* Update to the ansible package roadmap for 3.0.0

* Rename files for the ansible roadmap from 2.11 to 3.0

Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2020-12-04 19:50:01 -08:00
f569d80fde Improve deprecations (#72697)
* Remove space before comma in '... bla , use ...'

* 'why' is inserted in the middle of a sentence, between two commas.

* Make deprecations from base.yml show source ansible-core.

* Add changelog fragment.

* Improve some more 'why's.

* Add PR URL to fragment.
2020-12-04 14:50:32 -05:00
b464d18fd1 AnsibleModule.set_mode_if_different: handle symlink is in a sticky directory (#45198)
* file: add symlink is in a sticky directory tests
* file: handle symlink in a sticky directory

Co-Authored-By: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>

* Add changelog and fix unit test
The builtins import was removed since it was unused, but it is now needed.
2020-12-04 14:21:51 -05:00
5226ac5778 The implicit default for type=bool options is not 'false', but 'none' (#72699)
* The implicit default for type=bool options is not 'false', but 'none'.

* Fix modules, resp. add ignore.txt entries.
2020-12-04 12:13:14 -05:00
f94ba68d8f ansible-test sanity: fix UnicodeDecodeError for --python 2.7 --docker (#72623)
* Store target paths as unicode.

* Add changelog fragment.
2020-12-04 12:12:14 -05:00
221c50b57c Use AZP config for integration-aliases test.
No changelog entry since this test is limited to the ansible/ansible repo.
2020-12-03 15:35:58 -08:00
38f21557ba json_query: Add examples for starts_with and contains (#72821)
* Add a note about - data structure returned from register variables
needs to be parsed using ``to_json | from_json`` in order to
get correct result.
* Add examples for starts_with and contains

Fixes: https://github.com/ansible-collections/community.general/issues/320

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-12-03 14:52:00 -05:00
0a7fcd135c Docsite: update "Migrating Ansible content to a different collection" info (#72710)
* add a reminder about ignore-*.txt entries, fix formatting, add symlink removal note
* Update docs/docsite/rst/dev_guide/developing_collections.rst

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: David Moreau Simard <moi@dmsimard.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2020-12-03 13:29:01 -06:00
10e59ef749 Documentation: fix modules doc formatting (#72788)
* Update lib/ansible/modules/apt_key.py

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2020-12-03 13:23:43 -06:00
08842cd6bb Fix Azure Pipelines change detection. (#72824) 2020-12-03 09:19:03 -08:00
2b24fae429 Replace exit with sys.exit in Galaxy CLI. 2020-12-03 08:32:01 -08:00
2701bb940a Remove myself from suse-team in BOTMETA (#72827) 2020-12-03 10:34:22 +01:00
9e7616b208 Fix yum_repository for more centos6 EOL fallout
Change:
- Use a version specific vars file to specify archive url for EPEL.

Test Plan:
- ci_complete

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-12-03 01:15:08 -08:00
f7adbec626 [devel] Fix CI schedule. 2020-12-02 20:49:10 -08:00
a788ea0132 systemd - account for templated unit files when searching for service (#72702)
Related to issue #71528 and PR #72337

Co-authored-by: Martin Polden <mpolden@mpolden.no>
2020-12-02 21:51:45 -05:00
d05b26115b update PyPI badge to ansible-core (#72813) 2020-12-02 18:26:54 -08:00
d567a553a9 update devel build badge for AZP (#72807) 2020-12-02 16:53:59 -08:00
3b88058b72 Bump centos6 image for pinned junit-xml dep
Signed-off-by: Rick Elrod <rick@elrod.me>
2020-12-02 14:02:32 -08:00
3a633b278d [devel] Azure Pipelines configuration. 2020-12-02 13:40:01 -08:00
a59825128d [centos6] update container for EOL
Change:
- Reference:
  https://lists.centos.org/pipermail/centos-devel/2020-December/056208.html
- Bump centos6 container to 1.25.0

Test Plan:
- ci_complete

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-12-02 12:17:05 -08:00
2aa3531b1b Docsite: update complex_data_manipulation and playbooks_advanced_syntax rst files to use FQCNs (#72539) 2020-12-02 10:29:49 -06:00
ebd8c101fd modules: fix documentation formatting (#72737) 2020-12-02 10:03:36 -06:00
478b2687ec Update the porting guide to include 2.10.4 (#72782) 2020-12-01 18:30:48 -06:00
a95213d2f5 Switch to hashlib.sha256() for ansible-test (#72411)
When FIPs mode is enable on centos-8, we are not able to load md5
functions.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2020-12-01 13:14:20 -05:00
79fb065d16 document that handler can not run include_role and import_role (#72744)
Warn the users until issue #20493 is fixed.
2020-12-01 10:15:46 -06:00
276ad4f8f5 added more specific info about user scope (#72680)
in ref of #72674
2020-12-01 16:25:15 +01:00
a223ea5185 distribution - handle NetBSD OS Family (#70799)
Fixes: #43739

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-12-01 10:01:25 -05:00
8a4afbf9f2 Autodecryption does not work with remote_src=yes (#56565)
This is in reference to the issue: https://github.com/ansible/ansible/issues/41130 (Cannot decrypt with copy module when remote_src: yes)

Autodecryption of the vaulted files does not work when we want to copy files with remote_src=yes.

Co-authored-by: ziaurrehman72 <ziaurrheman72@yahoo.com>
2020-12-01 14:27:08 +05:30
1db9588279 ansible-test - add cryptography constraint for cffi (#72761)
The recently released version of cffi fails to install on systems with an older version of gcc. In
our case, this in the CentOS 6 test image. There is a fix but it has not yet been released.

https://foss.heptapod.net/pypy/cffi/-/issues/480
2020-11-30 16:49:33 -05:00
fa481e3316 Fix missing dashes in playbooks intro doc (#72746) 2020-11-30 16:19:40 -05:00
2eb9795543 Test pip fix 2020-11-30 12:02:26 -08:00
454ac6420e Update playbooks_filters_ipaddr.rst (#72705)
Fix the order of the arguments for ansible.netcommon.reduce_on_network. Pass the network as the argument and the list of IP addresses as the filter input.
2020-11-30 11:58:11 -06:00
74196577a3 added sample output for echo example (#72718) 2020-11-30 09:59:27 -05:00
0fa1cd88ce ansible-doc: replace DataLoader with from_yaml (#72686)
* Replace DataLoader with pure yaml
2020-11-23 13:32:03 -05:00
a57539f764 Update VMware module development (#72603)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-11-23 09:35:27 -05:00
ae08c6a639 Ensure Ansible's unique filter preserves order (#67856)
Fixes #63417
2020-11-23 08:55:18 +01:00
35022e13a8 Update intro_getting_started.rst (#72689)
Move the command output to immediately follow the example.
2020-11-20 14:35:19 -06:00
3add96909d Fix parsing of values when using an empty string as key (#57132) (#72545)
Signed-off-by: Yadnesh Kulkarni <ykulkarn@redhat.com>
2020-11-20 19:22:55 +01:00
18e5628b19 Slight tweak to galaxy source selection (#72685) 2020-11-20 07:54:43 +10:00
c36acc9eaa Add a versioning helper module 2020-11-19 20:53:23 +01:00
46198cf80a Add orig_exc context to error messages (#72677)
* Add orig_exc context to error messages. Fixes #68605

* Fix string formatting
2020-11-20 05:40:22 +10:00
fb092a82a1 ansible-galaxy - source deps from all servers and not just parent (#72576)
* ansible-galaxy - source deps from all servers and not just parent

* Added integration tests for this scenario
2020-11-20 04:54:40 +10:00
37f298f10e Move progress messages into _display_progress CM 2020-11-19 01:23:52 +01:00
f8ef34672b Provide better decryption errors for single vault values (#72362)
Fixes #72276
Fixes #72281
2020-11-18 14:25:32 -06:00
e889b1063f arg_spec - rework _check_arguments() (#72447)
* Move _syslog_facitily to __init__
  No good reason it should not be set for each object

* Move internal property setting to private method
* Create check_arguments() function
* Remove unused import
* Rename function to better match its behavior
  Change the behavior to return a set, either empty or populated, with unsupported keys.
  Accept legal_inputs as optional which will not required calling handle_aliases before calling
  get_unsupported_parameters().

* Add changelog
* Rework function behavior and documentation
  I realized I missed the original intent of this method when moving it to a function. It
  is meant to compared the parameter keys to legal inputs always, not compare
  parameter keys to argument spec keys, even though the argument spec keys should
  be a subset of legal inputs.

* Add tests
* Fix typo.
* Set internal properties when handling suboptions
2020-11-18 14:15:33 -05:00
1fbac24739 Update ansible-runner tests version and deps (#72197)
We could not find reason for the docutils install so trying out removing it.
Also bumping to latest version of ansible-runner

Skip all python2 versions because next ansible-runner drops it

Co-authored-by: Elijah DeLee <kdelee@redhat.com>
2020-11-18 11:00:04 -05:00
cf39d9de25 update team_azure membership (#72653)
* remove/ignore haroldwongms at his request
2020-11-17 15:20:45 -08:00
1937dd5e9c Update developing_plugins.rst (#72305)
##### SUMMARY
ansible_date_time returns utc time. datetime.utcnow() rather than datetime.now()

##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2020-11-17 21:45:03 +01:00
570aed0913 ansible-doc role arg spec support (#72120)
* Support listing roles in text and JSON

* Change tests for unfrack'd playbook_dir var

These tests were using '/tmp' for testing the setting of the playbook_dir
var. Now that we unfrack that var, MacOS will change this to '/private/tmp'
causing the tests to fail. We can choose a path that does not exist (since
unfrack does not validate existence) so that we can guarantee unfracking
will not change the value.
2020-11-17 12:58:19 -05:00
07248e5ec1 avoid key errors on environment access (#72620) 2020-11-17 12:09:46 -05:00
ad4ddd8211 document what the name of a play is (#72633)
##### SUMMARY

Make clear that `ansible_play_name` is the name attribute from the play and not the file name of the playbook.

improves #57361

##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2020-11-17 11:56:49 -05:00
d8baf4d38d Document and warn when max_fail and free are used (#72616)
Fixes #16666
2020-11-17 10:11:15 -05:00
13bc35e13c actual min changes needed for rhel8 (#72477)
* actual min changes needed for rhel8

 - specifiy releaserver as dnf/vars is ignored
2020-11-16 15:43:05 -05:00
6894ae7d1d Rename to ansible-core (#72594)
Change:
- Initial set of changes for renaming to ansible-core
- Includes changelog fragment changes from base -> core
- Does NOT include docs changes
- Modifies detection stuff in setup.py to support ansible<2.9 and ansible-base

Test Plan:
- ci_complete
2020-11-13 15:42:10 -06:00
452bc3af04 example of exponential backup (#72617) 2020-11-13 16:00:21 -05:00
85570e2dc0 Fix documented type of mode field in copy module (#72593)
* Fix type of mode field in copy module

* Remove module type checking from ignore.txt sanity checks

* Remove mode type

Co-authored-by: Matt Martz <matt@sivel.net>
2020-11-12 16:28:01 -05:00
bbef250c2b Fix super annoying Python 2.6 multiprocessing.Queue stack trace in CI (#72604)
* Fix super annoying Python 2.6 multiprocessing.Queue stack trace in CI

A bug exists in Python 2.6 that sometimes raises an exception during interpreter shutdown. We
encounter this frequently in our CI since we run tests on CentOS 6 as the control node, which
has Python 2.6.6 with this bug.

This PR adds a very minor sleep only on Python 2.6 which gets around this issue. I did lot of testing
using a standalon script I found that easily duplicated the issue to find the minimum sleep value
needed to avoid this issue.

CPython issue: https://bugs.python.org/issue4106
Fix in CPython: https://hg.python.org/cpython/rev/d316315a8781

* Use correct attribute
2020-11-12 14:39:08 -05:00
4b8cb6582b pause - do not hang if run in the background (#72065)
* Consolidate logic for determining whether or not session is interactive
  into a single function, is_interactive()
* Increase test coverage

I wasn't able to find a good way of simulating running a backgrounded test with CI since the
whole test is essentially run not in a TTY, which is similar enough to cause the new is_interactive()
function to always return false.
2020-11-12 12:22:57 -05:00
aee7a3ed68 Fix FreeBSD HTTP Kerberos setup (#72595) 2020-11-12 13:40:59 +10:00
8c67432fc8 Update intro_installation.rst (#72586) 2020-11-11 10:44:50 -05:00
03a395cba4 Rollback pulp container to stabilise CI (#72580) 2020-11-11 17:09:16 +10:00
a521ea0a13 Tweak galaxy CI tests to bring stability (#72578) 2020-11-11 13:46:57 +10:00
44a38c9f33 add return documentation for unarchive. (#72546)
* add return documentation for unarchive, add fragment for changelog, apply suggestions from code review

Co-authored-by: Amin Vakil <info@aminvakil.com>
2020-11-10 16:27:39 -06:00
a5eb788578 Minor Edit: Fix typo in platform_index.rst (#72564)
Fix Dell OS 10 dellemc.os10.0s10 to dellemc.os10.os10 in platform_index.rst
2020-11-10 16:22:07 -06:00
ddad9930aa Clarify collection paths in docs (#72510)
* Clarify collection paths in docs, fix rst syntax, rephrase docs about using collection from folder/local git

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-11-10 16:19:43 -06:00
bdd0c48837 Added changelog for RHEL 7.9 (#72572) 2020-11-11 05:30:11 +10:00
4f0e2fff95 avoid fatal exception on invalid collection name (#72296)
* avoid fatal exception on invalid collection name used in ansible-doc filter
2020-11-10 11:46:15 -05:00
48c08f410c allow any type of unsafe data (#72547)
* allow any type of unsafe data

  dont limit to strings
2020-11-10 10:48:20 -05:00
e879f12fb9 Fix AIX networks facts when nestat is either missing or has incorrect permissions (#72516)
* Added check for none on netstat_path variable

* Added changelog
2020-11-10 10:07:28 -05:00
d451433e5d Add RHEL 7.9 - ci_complete (#72558) 2020-11-10 16:53:22 +10:00
fa2be89cd4 Add coverage exporting to ansible-test
A new `--export` option for `ansible-test coverage combine` allows multi-step aggregation of code coverage for CI pipelines.
2020-11-09 22:34:05 -08:00
f022dedd0a Fix container discovery for the acme test plugin. 2020-11-09 14:11:12 -08:00
aa4d53ccdf ensure local exposes correct user (#72543)
* ensure local exposes correct user

  avoid corner case in which delegation relied on
  playcontext fallback which was removed

  fixes #72541
2020-11-09 16:21:17 -05:00
de5858f48d Added caching mechanism for Galaxy API requests (#71904)
* Added caching mechanism for Galaxy API requests

* Add cache options and split up code

* Added unit tests

* Fix sanity test

* Use modified date and fix up caching for explicit servers

* Make sure credentials are not in cached server name

* Added test for getting updated cache version

* Changes from review
2020-11-10 06:50:32 +10:00
a1730af91f Ensure blockinfile correctly returns backupfile (#72544)
* Ensure blockinfile correctly returns backupfile

  Fixes #27626
  based on #27859

Co-authored-by: Giovanni Sciortino (@giovannisciortino)
2020-11-09 14:45:09 -05:00
e7bf0696ef [ansible-test] use newer container images (#72126)
Change:
- Bump default, ansible-base, distro containers
- We do NOT add fedora33 yet, because it doesn't work right on Shippable
  due to an old kernel. This will be added post-AZP.

Test Plan:
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-11-09 13:04:44 -06:00
c1da427a5e iptables: Reorder comment postition (#71496)
* Reorder comment postition

* Add comment unit test

* Fix unit test

* Fix unit test

* Add changelog

* Add paramaters which would be problematic without this fix

* Fix typo

* Fix unit test

* Fix unit test
2020-11-09 19:40:55 +01:00
11b7091c84 fix paramiko deps for freebsd/12.2
Signed-off-by: Rick Elrod <rick@elrod.me>
2020-11-09 12:09:53 -06:00
7a08efc546 update shippable for fbsd 12.2
Signed-off-by: Rick Elrod <rick@elrod.me>
2020-11-09 12:09:53 -06:00
3b379f372e [ansible-test] first attempt at freebsd 12.2
Change:
- Add freebsd/12.2 remote target

Test Plan:
- ci_complete

Tickets:
- Fixes #72366

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-11-09 12:09:53 -06:00
8eab113cb1 show keyword documentation in ansible-doc (#72476)
* show keyword documentation in ansible-doc

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-11-09 09:55:17 -05:00
96ad5b799e Emit warning when running on the controller with a Python older than 3.8 (#72467)
* Emit warning when running on the controller with a Python older than 3.8

* Add spaces

Co-authored-by: Matt Clay <matt@mystile.com>

* and more spaces

Co-authored-by: Matt Clay <matt@mystile.com>

* s/Py/Python/

Co-authored-by: Matt Clay <matt@mystile.com>

* Add note to Control node requirements about Py3.8 requirement

* Add collection_name to deprecated call

* more spaces

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

* Clarify that we are only packaging for py3.8+

Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2020-11-09 08:53:52 -06:00
09ad4baf5b Remove incidental_setup_ec2 test target (#72523) 2020-11-06 14:13:47 -05:00
0ed7bfc694 Fix task get_name to always prepend the role name (#72511)
* Fix 'role_name : tast_name' notation if task contains role name

* Add tests for notifying handler names which contain the role name

Co-authored-by: Thomas Wouters <thomaswouters@gmail.com>
2020-11-06 11:46:58 -05:00
c8590c7482 Various intentional tests (#72485)
* Add tests for argspec choices type=list

* Add explicit interpreter discovery tests to validate modules returning ansible_facts still set interp

* Add explicit tests for missing_required_lib

* Add explicit tests for recursive_diff

* ci_complete ci_coverage

* Update data to cover more code/tests

* ci_complete ci_coverage

* Add argspec tests for aliases, and no_log

* Forgotten file

* ci_complete ci_coverage

* Add argspec tests for type int

* ci_complete ci_coverage

* Remove incidental_k8s

* ci_complete ci_coverage

* fix missing newline

* Remove incidental_sts_assume_role

* ci_complete ci_coverage
2020-11-06 08:41:41 -06:00
599805e316 Introduce Ansible plugin in Jetbrains section of doc (#72465) 2020-11-05 16:08:43 -05:00
da1c1e8bb8 Add info on how to contribute to **community**-maintained collections as well. (#72494) 2020-11-05 16:07:45 -05:00
a5a0b8f0e7 Style guide edit to the tools page (#72506) 2020-11-05 15:28:34 -05:00
72302dd611 Replace some more FQCNs. 2020-11-05 12:19:08 -08:00
a2593b5e27 CLI - Specify jinja version in --version output 2020-11-05 11:37:55 -08:00
488b9d6c35 remove redundant remote_user for local setting
local action plugin already does and this also should fix
  fork/thread issue by removing use of pwd library

  fixes #59642
2020-11-05 11:17:46 -08:00
5fb6280672 Add verbose log for network action handler information 2020-11-05 11:11:22 -08:00
b33d7e2e29 Add changelog (#72502) 2020-11-05 12:50:44 -05:00
c7a4b39633 Adjust action groups to moved modules (#72428)
* Support docker and k8s action groups for moved modules in community.docker and community.kubevirt.

* Also support k8s action group for community.okd.

* Also add kubernetes.core.

* Adjust PR #.

* Fix changelog fragment.

* Remove community.okd.

* Revert "Remove community.okd."

This reverts commit 812b5aa6e2.
2020-11-05 10:13:51 +00:00
d8c637da37 [dnf] Some fixes around filtering (#72483)
Change:
- Docs: Add note that security/bugfix apply to dependencies too, like
  the dnf command.

- dnf: security/bugfix only makes sense for updates, so limit the
  package query sack to available updates.

- tests: Limit tests to our known-good test packages, so that RHEL
  packages marked security/bugfix without similarly marked dependencies
  don't fail our tests.

Test Plan:
- Tested with `dnf upgrade-minimal --bugfix` and reproduced the same
  error currently seen in CI, showing that we are consistent with what
  dnf does.

Tickets:
- Likely fixes #72316

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-11-04 15:13:55 -05:00
5654de6fce Return error if cwd directory does not exist (#72390)
* Return warning or error if cwd directory does not exist, in AnsibleModule.run_command()
2020-11-04 14:33:39 -05:00
01d207a3e3 Improve argument spec documentation (#72335)
* Link to argument spec documentation from 'Creating a module'.

* Use items instead of sub-headings.

* Update deprecation information.

* Document conditional requirements.

* Document supports_check_mode and add_file_common_args.

* Add deprecation examples.

* Re-add word.

* Improve title.

* Fix RST formatting, add conditional dependency section starter.
2020-11-04 18:17:46 +01:00
569d937df8 Improve config.rst formatting (#72354)
* Indent Jinja2 directives.

* Show version_added and deprecations for ini settings and environment variables.

* Make default conditional, add choices. Copied from #55474.

* Add Ansible variables. Copied from #55474.

* Turn ini keys and environment variables into lists. Copied from #55474.

* Improve formatting. Copied from #55474.
2020-11-04 10:48:10 -06:00
7f86e0715c hint in doc of git module to abort on missing http password (#72164)
* hint in doc of git module to abort on missing http password

improves #69489

* fix syntax in doc of git module

Co-authored-by: Matt Martz <matt@sivel.net>

Co-authored-by: Matt Martz <matt@sivel.net>
2020-11-04 17:19:06 +01:00
dbe43e071e Docsite: update user_guide/playbooks_module_defaults (#72051)
* Docsite: update user_guide/playbooks_module_defaults, add name: lines and use FQCN consistently
2020-11-04 09:58:47 -06:00
880087748c Remove incidental tower integration tests (#72461)
* Add explicit test for dict repr in argspec

* Add explicit test for undefined repr

* ci_complete ci_coverage

* Skip old jinja2

* ci_complete ci_coverage

* Remove incidental_tower_receive

* ci_complete ci_coverage

* Remove incidental_tower_credential_type

* ci_complete ci_coverage

* Remove ignore entries

* ci_complete ci_coverage
2020-11-04 09:46:08 -06:00
8ada1bb447 docs: Transpose two words to correct a sentence. (#72329) 2020-11-04 09:40:39 -06:00
1a5d2938c6 Update playbooks_filters_ipaddr.rst (#72464)
Fix small code formatting issue - remove extra `:` before code-block.
2020-11-04 09:14:17 -06:00
1eae2bb890 Update Galaxy NG version used in CI (#72469) 2020-11-04 10:07:38 +10:00
d53c47940a Update the ansible-2.10 porting guide 2020-11-03 15:47:34 -08:00
d76f85208d clarify upstream release status of 2.10 (#72269)
* clarify upstream release status of 2.10

* wordsmith
2020-11-03 11:39:27 -05:00
da60525610 Fix missing ansible.builtin FQCNs in hardcoded action names (#71824)
* Make sure hard-coded action names also check for FQCN.
* Use _add_internal_fqcn() to avoid hardcoded lists and typoes.
2020-11-03 08:51:31 -05:00
79021df2e4 Restore ansible-test coverage config.
Reverts a portion of the changes made in https://github.com/ansible/ansible/pull/70028
2020-11-02 16:13:33 -08:00
6b30efa454 Fix fallout from #70028. 2020-11-02 15:04:41 -08:00
ccc63abc8e Remove incidental vmware tests (#72420)
* Add explicit tests for ansible.module_utils.common.network.is_mac

* Test missing ANSIBLE_CONFIG

* Add explicit inventory script tests

* Add explicit tests for _consume_options

* Adjust perms, remove extra file

* ci_complete ci_coverage

* remove incidental_inventory_vmware_vm_inventory

* ci_complete ci_coverage

* Remove incidental_script_inventory_vmware_inventory

* ci_complete ci_coverage

* Remove incidental_vmware_guest

* ci_complete ci_coverage

* Remove incidental_vmware_host_hyperthreading and incidental_vmware_prepare_tests

* ci_complete ci_coverage

* newline and comment about what the test is doing

* ci_complete ci_coverage
2020-11-02 17:00:17 -06:00
64a809d2b6 Improve ansible-test classifications for collections (#72353) 2020-11-02 10:44:51 -08:00
6543c7bc5d Remove incidental_cs_role_permission (#72380)
* Add explicit argspec tests for choices

* ci_complete ci_coverage

* Remove incidental_cs_role_permission

* ci_complete ci_coverage

* ci_complete ci_coverage
2020-11-02 10:35:13 -06:00
2ee5af514b Update pip tests to omit install dev extras to avoid dep issues (#72436) 2020-11-02 10:06:09 -06:00
2e4038f4d2 Fixed a typo in user_guide/playbooks_conditinals (#72427)
+label: docsite_pr
2020-11-02 10:04:57 -05:00
809d5fc398 ansible-test - skip installing PowerShell sanity test reqs if they are already installed (#72423) 2020-10-30 21:52:27 -04:00
4b673484f0 rethink wording (#70028)
* rethink wording
* removed unrequired requirement
* fix tests
* fixed versions
Co-authored-by: Sloane Hertel <shertel@redhat.com>
2020-10-30 17:13:12 -04:00
4fb336cef1 ansible-doc: export has_action when --json is used (#72359)
* ansible-doc: export has_action when --json is used.
* Remove docuri and now_data, which were not used resp. ignored in format_plugin_doc and the functions it calls anyway.
* Add function _combine_plugin_doc.
2020-10-30 10:51:54 -04:00
111589d999 Minor typo/style fixes (#72374) 2020-10-30 10:34:02 -04:00
cb94c0cc55 added timeout options to adhoc and console (#71230)
* added timeout options to adhoc and console

* added test

* fix typosesz

* fix conflict

* task_timeout

* fix timeout option, added extra vars to console

* actually use right cli switch .. DUH!

* added timeout to include 'valid' but ignored keys

* fix default

* fixes per review
2020-10-30 10:09:30 -04:00
96c1972439 find will give more specific reasons on skip (#68823)
* find will give more specific reasons on skip

 - added more error handling
 - use random path for test
2020-10-30 10:08:19 -04:00
fb09fd2a23 wait_for - ignore psutil related errors (#72401)
When enumerating connections with psutil, catch and ignore errors to avoid returning a stack trace.

Co-authored-by:  Matt Martz <matt@sivel.net>
2020-10-29 21:40:31 -04:00
e73a0b2460 Explicitly get the include task, and not assume it is the parent (#72378)
* Explicitly get the include task, and not assume it is the parent. Fixes #6571
2020-10-29 15:15:18 -04:00
a51a6f4a25 reboot - add reboot_command parameter (#69847)
Fixes #51359
* Update default search paths
* Fix returns for args and command, don't allow conversion
* Reorganize tests
* Fix test for Azure Pipelines
2020-10-28 12:10:59 -04:00
e05c62547b run playbook from collections (#67435)
* fixes for collection playbooks

 - add fqcn invocation, also handles extensions
 - bring import_playbook into new normal
 - avoid adding collection playbooks to adjacency
 - deal with extensions or lack of em
 - added tests
 - fix bugs with multiple playbooks supplied
 - unicode/bytes/native fixes
 - fix modulenotfound for < py3.7
 - tests
2020-10-28 11:46:39 -04:00
8f9cf456b0 url lookup - set default user agent (#72324)
* Add unit tests
* Add note about when default changed
2020-10-28 09:34:06 -04:00
4856ab0e68 Galaxy server update (#72286)
* Update galaxy server image used in CI

* Fix port and migration issue

* Add delete step, still need to deal with pagination

* Make cleanup more efficient

* Remove testing code
2020-10-28 09:17:40 +10:00
d6115887fa systemd - use list-unit-files rather than list-units (#72363)
list-unit-files will return all files on the system. list-units omits those
that are disabled.

Co-authored-by: Ken Dreyer <ktdreyer@ktdreyer.com>
2020-10-27 17:43:36 -04:00
7352457e7b hostname - add macOS (#54439)
* Add DarwinStrategy class and integration tests

macOS has three seprate hostname params that need to be set. One of those params, LocalHostName, has more stringent requirements than the other two, which accept special characters and spaces. Create a method to scrub the hostname to ensure it works well with the system requirements.

* Update documentation

* Account for virtualization type returned on Azure Pipelines

* Do not be dependent on order of self.name_types

Use the scrubbed name when the name type is LocalHostName
2020-10-27 17:30:54 -04:00
dd19c9f737 Update playbooks_tags.rst (#72351)
##### SUMMARY
Corrected the "Adding tags to blocks" example syntax. 


##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2020-10-27 15:50:49 -04:00
c51438312a blockinfile - properly insert block when no trailing new line exists (#72350) 2020-10-27 10:34:09 -05:00
233e7beb5b Fix processing of add_file_common_args=True when argument_spec is not specified as kwarg. (#72334) 2020-10-27 10:25:18 -05:00
dee8a4a8f1 Use type 'path' for fact_caching_connection in jsonfile cache plugin (#72317) 2020-10-27 10:10:13 -05:00
b848fa0fc7 Update hostname test to skip containerd. 2020-10-26 14:05:38 -07:00
db84e2c989 systemd - fix issue with capbpf and newer kernel (#72337)
A bug existed in systemd 245 that did not properly handle unknown kernel
capabilities gracefully. This resulted in incomplete output when querying
for the service status. It is possible to get service status by other means.
This PR works around this issue by getting service status using other commands
in the event of a failure due to this bug.
2020-10-26 13:53:31 -04:00
2293b327c0 [ansible-test] Limit cryptography to <3.2 (#72342)
Change:
- Cryptography 3.2 drops support for OpenSSL 1.0.2. Some of our CI
  infrastructure still uses this version (FreeBSD, namely). For now,
  just add a constraint to use old cryptography.

Test Plan:
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-10-26 11:39:37 -05:00
8b07d46166 Add a toggle for the leading separator for keyed_groups (#60882)
* Add a toggle for the leading separator for keyed_groups if no prefix is given

* changelog

* Add tests for backward compatibility and the new toggle
2020-10-23 15:57:44 -04:00
0b2b82c0b6 Add changelog fragment for #71736. (#72323) 2020-10-23 14:34:31 -05:00
83909bfa22 Remove ansible-galaxy login (#72288)
* GitHub is removing the underlying API used to implement the `login` command. Since the general consensus seems to be that relatively nobody currently uses this command (in favor of explicit token passing), support was simply removed for interactive login. If a future need arises, this command should be reimplemented via OAuth Device Auth Grants.
* login or role login commands now produce a fatal error with a descriptive message
* updated 2.10 and 2.11 porting guide entries

* remove dead code/config, update messages and porting guides
2020-10-23 09:11:45 -07:00
b6360dc5e0 VMware: scenario guide for vmware_tools connection plugin (#72080)
* VMware: scenario guide for vmware_tools connection plugin

Scenario doc to guide user about the usage of vmware_tools
using connection plugin.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* review comments

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-10-23 10:44:12 -04:00
3c2e8b99be Fix ansible-test handling of user-defined docker networks. (#72256)
* Fix ansible-test docker container detection.

* Attach test containers to the correct network.

* Do not assume `localhost` for accesing Docker.

* Look for containers on current network.

* Always map /var/run/docker.sock into containers.

This fixes issues when using a remote Docker host.

* Support container IP lookup from networks list.

* Fix container network attachment.

* Remove redundant container detection messages.

* Limit DOCKER_HOST parsing to TCP.

* Restore docker socket existence check.

The check is skipped if the docker hostname is not localhost.

* Correct changelog entry.
2020-10-22 18:45:03 -07:00
1489bf9190 Adds argspec tests for required, required_one_of and required_by (#72245)
* Improve variable names.

* Add test for required.

* Add test for required_one_of.

* Add test for required_by.
2020-10-22 14:05:59 -05:00
fe65144a4a vmware: Using env variable for custom SSL path (#72273)
When validate_certs is True and user has custom SSL
certificate path, user can use ``REQUESTS_CA_PATH``
in ``environment`` parameter of task to specify this path.

Fixes: https://github.com/ansible-collections/community.vmware/issues/49

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-10-22 14:48:26 -04:00
e64ba97e8a Fix the reversed order of return values (#72088)
* Fix the reversed order of return values

AnsibleModule.run_command returns a tuple of return code, stdout and stderr.
The module main function of the user module expects user.create_user to
return a tuple of return code, stdout and stderr.
Fix the locations where stdout and stderr got reversed.

* Fix another missed occurance

* Add changelog

* Fix further reversed order of return values occurrences

Followup to 72c3ba62c8:
Fix further reversed order of return values occurrences.
2020-10-22 20:02:53 +02:00
c20329a0f6 Update migrating_roles.rst (#72260)
Fix a typo in the sample spec file Source0 line
2020-10-20 13:19:45 -05:00
3ece57c01a remove ansibleFest banner (#72253) 2020-10-20 13:18:16 -05:00
69e510e767 [virt facts] recognize containerd as a container (#72210)
Change:
- containerd is now recognized as container tech

Test Plan:
- Tested with Docker inside Github Actions in a private repo:

        "ansible_virtualization_role": "guest",
        "ansible_virtualization_tech_guest": [
            "containerd",
            "container",
            "VirtualPC"
        ],
        "ansible_virtualization_tech_host": [],
        "ansible_virtualization_type": "containerd",

Tickets:
- Fixes #66304 because this is what docker containers show up as
  in Github Actions.

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-10-20 10:39:13 -05:00
afba5c2852 Miscellaneous fixes in user_guide/intro_inventory.rst docs (#72202)
* Fixing missing hosts entry under the group dict.

* Added missing 'vars:' key

* Reordering arguments for consistency with the format displayed by "ansible-playbook --help"

* Fixing contradictory text
2020-10-20 10:35:15 -05:00
02658d7bf8 k8s: Scenario guides (#72095)
* Start Kubernetes Scenario guides for users
* K8S inventory scenario guide

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-10-20 10:11:33 -04:00
d18901dd4a Update HTTP -> HTTPS (#72244)
Co-authored-by: Ronald Eddy Jr <ron@Ronalds-MacBook-Pro.local>
2020-10-19 15:57:20 -04:00
c9fa1d0e7e Fix race condition when creating async dir (#72069)
* Fix race condition when creating async dir

* Simplify exception wrapper

* Remove var used for testing
2020-10-19 15:05:19 -04:00
618d1a3871 Document security concern for users setting the system_tmpdirs shell plugin config (#72213) 2020-10-19 14:58:09 -04:00
be5fc4e642 Ensure we call action_loader.get with collection_list (#72206)
* Ensure we call action_loader.get with collection_list. Fixes #72170

* Add tests and changelog

* Remove grep, do assertion in playbook. ci_complete

* Skip old jinja2 versions

* ci_complete

* dedupe
2020-10-19 09:54:24 -05:00
9ddb1d76af [tests/dnf] work around dnf packaging issue (#72249)
Change:
- In this test we end up upgrading dnf (and python3-dnf) so that we can
  test its new logging behavior. However, the latest Fedora 32 dnf had a
  packaging issue which caused it to not pull in the latest
  python3-libdnf. This is fixed, but not synced out to mirrors yet.
  Fixing it in this test will get CI passing again in the meanwhile.

Test Plan:
- CI

Tickets:
- https://bugzilla.redhat.com/show_bug.cgi?id=1887502

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-10-19 09:52:33 -05:00
39d6c5ef7a fix simple typos (#72219) 2020-10-15 16:47:55 -05:00
5ec53f9db8 make collection callbacks follow normal flow (#59932)
make collections whitelist follow normal flow

* fixes missing set_options call and adhoc and stdout processing rules
* avoid dupes
* fixed to handle redirects
* also updated tests with new and more accurate skip message
* fix callback tests for envs with cowsay installed
* lots MOAR comments on why the code is as it is, some todos to refactor in future

Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
2020-10-15 15:31:18 -04:00
a33cc191bd Update 2.11 Roadmap to include dates and planned work (#72222)
* Update 2.11 Roadmap to include dates and planned work

* remove comma
2020-10-15 13:52:51 -05:00
2ef4b7e07e Fix ansible-test Azure Pipelines container auth. 2020-10-14 12:35:11 -07:00
8465f285cc Update playbooks_strategies.rst (#72176)
beside the fact that naming the variable to specify the number of machines executed in *parallel* is named *serial* - the number of hosts chosen in this example is not optimal, either: 2x2 = 4; so - 3 hosts in 2 batches should clear things up a little
2020-10-14 12:26:16 -05:00
b18e462bbb Consistent Taxonomy (#72215)
Historically "these" have been called directives, attributes, and keywords. We've now settled on `keyword` (https://docs.ansible.com/ansible/latest/reference_appendices/playbooks_keywords.html). Update all documentation to reflect this term.
2020-10-14 12:16:30 -05:00
3b40c6f3b7 [config] coerce more to string when 'type: str' (#72172)
Change:
- When a plugin defines `type: str` on a parameter, treat more kinds of
  input as a string instead of whatever it is parsed as.

Test Plan:
- New unit tests
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-10-14 12:53:08 -04:00
6e7a40dd94 Update the porting guide for a new ansible version (#72211) 2020-10-13 12:36:23 -05:00
cdf62edc65 service_facts: return service state information on AIX (#72073)
* service_facts: return service state information on AIX

AIX uses the System Resource Controller (SRC) to manage services.
See https://www.ibm.com/support/knowledgecenter/ssw_aix_72/osmanagement/sysrescon.htm
Use lssrc command on AIX to return service state information.


Co-authored-by: dberg1 <dberg1@github.com>
2020-10-13 11:28:59 -04:00
caba47dd3f Add support for GSSAPI/Kerberos to urls.py (#72113)
* Add support for GSSAPI/Kerberos to urls.py

* Test out changes with the latest test container

* Get remote hosts working

* Fix up httptester_krb5_password reader

* Fix tests for opensuse and macOS

* Hopefully last lot of testing changes

* Dont do CBT on macOS

* Fixes from review
2020-10-13 14:16:07 +10:00
c4acd41d6e Ensure delegate vars calculation has correct loop context. Fixes #37132 (#71477) 2020-10-12 14:21:15 -05:00
5d811fc551 Remove incidental_win_psexec (#71953)
* Explicit coverage to remove incidental_win_psexec

* rc=1 failed

* ci_complete ci_coverage

* Test rc!=0 without failed and until

* ci_complete ci_coverage

* Remove incidental_win_psexec

* Reduce delay

* ci_complete ci_coverage
2020-10-12 14:16:13 -05:00
7c1dd1c7fb add link to jinja docs from templating section (#72205) 2020-10-12 13:52:24 -05:00
c084bc160c add details on how to get API token for Galaxy (#72203) 2020-10-12 13:47:41 -05:00
e673b8e4ec fix typo (foward -> forward) (#72182) 2020-10-11 11:05:08 +05:30
9382738f52 Update contributing_maintained_collections.rst (#72178)
##### SUMMARY
Adding Kubernetes.Core collection, editing vmware.vmware_rest a bit


##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2020-10-09 16:12:45 -04:00
30a651bca3 Docsite: update user_guide/playbooks_async (#72115) 2020-10-09 10:50:58 -05:00
e119c2d2bf Add The Bullhorn to the community communication page (#72125)
Update documentation on communication channels for Ansible.
2020-10-09 10:49:53 -05:00
835752cc53 Update playbooks_vars_facts.rst (#72150)
Remove misleading typo, add a note on the mode of local facts

Co-authored-by: JensHeinrich <github.com/JensHeinrich>
2020-10-09 10:44:27 -05:00
af7fd0f79d doc: use FQCN for vmware_rest examples
Use the collection name + the module name for clarity.
2020-10-08 15:24:13 -04:00
bb2c96aacc Fix subversion_pacakges name (#72138) 2020-10-08 15:22:04 -04:00
5f76bd2af7 Support collection constraints in ansible-test.
This allows collections to specify requirements and constraints for packages that ansible-test has requirements or constraints for.
2020-10-08 12:20:19 -07:00
2f8dbf673e Remove incidental_zabbix_host (#72142)
* Add explicit apt tests for fnmatch and update_cache

* Add explicit apt_key tests for fetching key directly from url

* ci_complete ci_coverage

* Remove repo only by repo

* ci_complete ci_coverage

* Add apt cache update after apt_repository to show that the cache doesn't update

* ci_complete ci_coverage

* Add systemd tests for enabling and disabling a service

* ci_complete ci_coverage

* Remove incidental_zabbix_host

* ci_complete ci_coverage
2020-10-08 13:32:59 -05:00
cf0cd4b50b Remove incidental_aws_codebuild (#72140)
* Remove incidental_aws_codebuild

* ci_complete ci_coverage
2020-10-07 14:02:32 -05:00
102e429285 Add test to replace exclusive incidental_cloudformation coverage (#72137)
* Add intentional coverage for incidental_cloudformation

* Remove the incidental_cloudformation test target and the now unused supporting modules
2020-10-07 12:54:21 -04:00
c72e2ee675 import of the vmware_rest documentation (#72090)
Co-authored-by: Jill R <4121322+jillr@users.noreply.github.com>
2020-10-07 11:33:55 -04:00
1ae3683d0c Fix example to use correct shebang (#72129)
* Fix example to use correct shebang

* Fix other example modules as well

* Ignore shebang test
2020-10-07 10:07:27 -05:00
cfa41898c4 Add explicit coverage of argspec choices with strings that shadow YAML bools (#72122)
* Add explicit coverage of argspec choices with strings that shadow YAML bools

* ci_complete ci_coverage

* Remove incidental_ufw

* ci_complete ci_coverage
2020-10-06 16:00:28 -05:00
865113aa29 Update user module documentation (#72109)
Co-authored-by: ankitsagar <ankitsagar15@gmail.com>
2020-10-06 15:31:37 -04:00
50c8c87fe2 Add explicit coverage of suboptions=list without elements (#72108)
* Add explicit coverage of suboptions=list without elements

* ci_complete ci_coverage

* Remove incidental_vmware_guest_custom_attributes

* ci_complete ci_coverage
2020-10-06 13:15:02 -05:00
aff78f4cbc Fix various sanity errors in plugins (#71736)
* Fix various sanity errors in plugins.

* Revert callback_type -> type transform.

* Undo paramiko_ssh 'connection' change, since this discrepancy is hardcoded in the plugin loader.

* Standardize on name and type (for callbacks).

* Fix existing author entries.

* Add 'Unknown (!UNKNOWN)' as author when author is missing.

* These are actually parsed as integers in the code.

* Revert "Add 'Unknown (!UNKNOWN)' as author when author is missing."

This reverts commit 29d1438aca.
2020-10-06 12:37:16 -04:00
960e4c0809 Add intentional coverage for incidental_ec2_instance (#72028)
* Add a test suite for module_utils.common.dict_transformations

* ci_complete

ci_coverage

Add a wait_for test using delegate_to

* Remove incidental_ec2_instance

* Remove unused test support modules

* Requested changes

ci_complete

ci_coverage

* Oops, put everything back to test coverage again

ci_complete

ci_coverage

* Remove incidental_ec2_instance tests and supporting modules
2020-10-06 11:10:03 -05:00
9ffa84cc1c basic: Handle exception in default selector (#72101)
In Python 2.7, default selector raises IOError
instead of OSError. Fix handles this exception.

Fixes: #71704

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-10-06 11:25:51 -04:00
ebc91a9b93 [unarchive] work on older RHEL with group: <gid> (#72098)
Change:
- No longer fail due to old Fedora/RHEL and our failure to try to cast
  gids to integers before trying to pass them to getgrgid() before
  trying to use them.
- Add tests for user/mode for various unarchive formats.

Test Plan:
- New integration tests, ran against centos6 container

Tickets:
- Fixes #71903
2020-10-06 11:25:03 -04:00
a90e37d017 [virt facts] identify KubeVirt properly (#72092)
Change:
- Make KubeVirt be identified as such, and with a guest role.
- This is a breaking change, since playbooks could be relying on the
  incorrect behavior previously.

Test Plan:
- Issue author

Tickets:
- Fixes #72001

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-10-06 11:22:22 -04:00
0332046699 [ansible-test] attempt to work around podman (#72096)
Change:
- podman > 2 && < 2.2 does not support "images --format {{json .}}"
- podman also now outputs images JSON differently than docker
- Work around both of the above.

Test Plan:
- Tested with podman 2.0.6 in Fedora 31.

Signed-off-by: Rick Elrod <rick@elrod.me>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2020-10-05 20:13:52 -05:00
460ba041c8 Add explicit coverage of required_together (#72107)
* Add explicit coverage of required_together

* ci_complete ci_coverage

* Remove incidental_hcloud_server

* Remove hcloud from shippable matrix

* ci_complete ci_coverage
2020-10-05 16:02:11 -05:00
7f1c32f5ce Rewrite _is_role and remove incidental_flatpak_remote (#72105)
* Build explicit list instead of complicated nested loop

* ci_complete ci_coverage

* Remove incidental_flatpak_remote

* ci_complete ci_coverage
2020-10-05 13:52:39 -05:00
3db08adbb1 Add optional attribute arg for min and max filters (#50909)
* Pass **kwargs to min and max filters

* Use the jinja2 filters if available

* Add unit tests

* Add examples to docs passing attribute
2020-10-05 10:40:37 -04:00
709484969c sysctl/openbsd fact fixes (#72070)
Change:
- Use `sysctl -n` for openbsd uptime information
- Allow `get_sysctl()` to account for multi-line sysctl settings
- Add unit tests for `get_sysctl()`

Test Plan:
- New unit tests

Tickets:
- Fixes #71968
- Refs #72025
- Refs #72067

Signed-off-by: Rick Elrod <rick@elrod.me>
Co-authored-by: Brian Coca <brian.coca+git@gmail.com>
Co-authored-by: Brian Coca <bcoca@ansible.com>
2020-10-02 18:36:31 -05:00
35809806d3 Remove incidental_timezone (#72063)
* Add explicit coverage for templated undefined with_items element

* ci_complete ci_coverage

* Remove incidental_timezone

* ci_complete ci_coverage
2020-10-02 16:56:31 -05:00
ab2b339dd6 More explicit argspec tests (#72064)
* Add more explicit coverage of argspec functionality

* fail_on_missing_params

* ci_complete ci_coverage

* Remove incidental_aws_step_functions_state_machine

* ci_complete ci_coverage

* Remove incidental_cs_service_offering

* ci_complete ci_coverage
2020-10-02 14:53:09 -05:00
a7170da851 user - allow local users with an expiry date to be created (#72022)
The luseradd / lusermod commands do not support the -e option. Set
the expiry time in this case via lchage after the user was
created / modified.

Fixes: #71942

In Python3 math.floor returns an integer whereas Python2 returns a float.
Hence always convert the result of math.floor to an int to ensure that
lexpires is an integer.

Move local expires tests in a separate file and import the tasks to the
main.yml to keep main.yml smaller.
2020-10-02 15:38:27 -04:00
bc98ebf29f installation docs - add tip pointing to pip docs (#71741) 2020-10-02 15:34:44 -04:00
cceba07114 VariableManager - add the 'vars' key before getting delegated variables (#71214)
* VariableManager - add the 'vars' key before getting delegated variables
2020-10-02 15:13:56 -04:00
fb03ac7019 Add libyaml info to version output, and restore git info (#71948)
* Add libyaml info to version, restore git functionality

* Add clog fragment

* Update tests to reflect new version output
2020-10-02 14:04:49 -05:00
d051e66b13 git - clarify behavior of dest parameter (#71950) 2020-10-02 14:41:33 -04:00
0e480d38dd uri status_code elements are type int (#72062) 2020-10-02 13:36:14 -05:00
2b79cd2c0f Fix typos (#72072) 2020-10-02 10:32:03 -04:00
1107aace1b Add deprecation collection name to plugin options (#71735)
* Add changelog fragment.

* Use correct field that's expected by lib/ansible/cli/__init__.py..

* Add basic unit tests.
2020-10-02 09:43:23 -04:00
3efc8b6de8 Docsite: update user_guide/playbooks_prompts (#72049) 2020-10-01 16:34:23 -04:00
c12fce3aa9 Docsite: update user_guide/playbooks_checkmode (#72052) 2020-10-01 16:33:24 -04:00
77840f886e Docsite: update user_guide/playbooks_debugger (#72053) 2020-10-01 16:32:03 -04:00
e68a638e7c WIP: OpenBSD: add uptime to gather_facts (#72025)
* OpenBSD: add uptime to gather_facts
2020-10-01 15:34:40 -04:00
eee13962e5 Minor typo in test_strategies.rst (#72060) 2020-10-01 14:34:23 -04:00
88a676246e Update porting_guide_2.8.rst (#72041)
##### SUMMARY
Removed translatable words from codeblocks as per https://github.com/ansible/ansible/issues/59449

##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2020-10-01 11:53:02 +01:00
4187846fe7 Update my github username (#72050) 2020-10-01 11:48:59 +01:00
672df07a33 Bump httptester version (#72036) 2020-10-01 08:18:21 +10:00
09c2475368 Update the tests to work with new httptester container (#72013) 2020-10-01 06:38:44 +10:00
9081b22868 Remove incidental_vyos_static_route (#72024)
* Add explicit tests for required_together suboptions

* ci_complete ci_coverage

* Remove incidental_vyos_static_route

* ci_complete ci_coverage

* Add explicit coverage of suboptions required_if

* ci_complete ci_coverage

* Remove incidental_vyos_logging

* ci_complete ci_coverage
2020-09-30 15:38:12 -05:00
64d9ccb965 Reword strangely patronising introduction to loops (#72019) 2020-09-30 16:05:46 -04:00
f1c4a954d5 Close file descriptor of temporary file after building certificate chain (#71825)
* Close file descriptor of temporary file after building certificate chain.

* Add changelog fragment for PR71825
2020-09-30 20:43:24 +02:00
3af7425367 Clarify how package module works (#70345)
Module package is actually a proxy to a native package manager
modules (internally it delegates to the module that matches the
results of ansible_pkg_mgr).

Fixes #69371
2020-09-30 12:57:39 -04:00
ea119d3089 fix distribution fact for SLES4SAP (#71559)
b6b238a fixed the SLES4SAP detection, which was at this time ok.
Sadly Suse changed with SLES 15 the /etc/os-release file, so the above
change will no longer work.

This commit updates the SLES4SAP detection regarding
https://www.suse.com/support/kb/doc/?id=000019341.

The symlink realpath is matched with endswith, because in SLES 12+ the
link target is SLES_SAP.prod, but in SLES 11 the link target is
SUSE_SLES_SAP.prod.
2020-09-30 10:52:41 -04:00
6f4aed5377 Remove incidental_nios_txt_record (#72009)
* Add explicit coverage of argspec type=dict

* Non string mapping failure

* ci_complete ci_coverage

* Remove incidental_nios_txt_record and associated files

* Don't forget the ignore.txt changes

* ci_complete ci_coverage
2020-09-30 08:56:27 -05:00
4197666179 Only apply the unroll wrapper once (#72003)
Co-authored-by: Matt Martz <matt@sivel.net>

Fixes #71920
2020-09-30 09:15:28 +02:00
8893a244b9 Validate plugin option type 'dict' / 'dictionary' (#71928)
* Validate option type 'dict' / 'dictionary'.

* Add changelog fragment.

* Change type of 'environment' to list.
2020-09-29 17:16:14 -04:00
a077bca5d5 ansible-test: improve version number validation, validate some semantic versioning properties (#71679)
* Validate removal versions.
* Validate that removal collection versions and version_added collection versions conform to semver spec.
* Validate removal version numbers in meta/runtime.yml.
* Stricter validation for isodates (f.ex. YYYY-M-D is not allowed).
* Improve error reporting.
* Validate removal collection versions.

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2020-09-29 13:33:45 -07:00
3c33618cf6 powershell - remove env var (#72010) 2020-09-30 06:24:31 +10:00
8f02819db0 Replace deprectated include with {import,include}_tasks in apt{,_repository,_key} integration tests (#71964)
* Replace deprectated include with import_tasks

* Fix
2020-09-29 11:35:59 -04:00
91a153434a Fix sorting of ignore.txt (#71930)
Mostly out of order from directory flattening
2020-09-29 11:10:23 -04:00
f2512f7931 Remove incidental_xml integration tests (#71917)
* Add explicit integration tests to cover incidental_xml coverage

* normalize diff

* More normalization

* diff without changed

* ci_complete ci_coverage

* nuke incidental_xml

* ci_complete ci_coverage
2020-09-29 08:39:44 -05:00
cbd3df369f Adding check to ensure 'container' get's added to guest_tech when appropriate (#71385) 2020-09-28 14:21:44 -05:00
94522b7c10 Fix typos (#71970) 2020-09-28 14:33:24 -04:00
74be7de361 Docsite: improve user_guide/playbooks_vars_facts (#71973)
* Docsite: improve user_guide/playbooks_vars_facts
2020-09-28 14:32:01 -04:00
8ae3998ecf Docsite: update user_guide/vault (#71975) 2020-09-28 14:29:34 -04:00
0645436acd Docsite: update user_guide/playbooks_filters (#71980) 2020-09-28 14:26:57 -04:00
0c3a9c7ae6 ansible-doc: show correct plugin name (#71966) 2020-09-28 10:40:33 -05:00
c5a161b2b0 Update faq.rst (#71982)
Added link to https://access.redhat.com/solutions/5295121 in third sentence
2020-09-28 11:07:03 -04:00
6a7e637c5f [tests] Make setup_docker clean up better (#71949)
Change:
- pip packages should get removed after, not try to add them again
- Try removing containerd.io package too

Test Plan:
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-09-25 18:07:38 -05:00
35b0fef536 Changes required for macOS 10.15 (#71841)
* Use default group of staff on macos to prevent sudo issues
* Install gnu-tar for macos in git and unarchive tests
* Enable timezone module to support py3 on macos
* If the virtualenv command is missing, try python -m virtualenv
* Install passlib for filter_core on macos
* Install paramiko via pip on macos for paramiko tests
* Normalize discovered python interpreter on macos
* Get pip tests passing, by ensuring we have wheel installed
* Create /etc/ansible for ca certs on mac, list lookup_url as destructive
* Fixups for CA certs
* Include macos
* Dynamically get cafile instead of hardcoding the path
2020-09-25 15:30:47 -04:00
ebff2154aa add badge for CII (#71944) 2020-09-25 13:28:53 -05:00
91b0dfb659 adds changelog for already-merged PR (#71947)
* adds changelog for already-merged PR

* Update changelogs/71921-raise-bytes-for-binary-test

Co-authored-by: Matt Clay <matt@mystile.com>

* adds yaml extension, corrects placement

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2020-09-25 14:14:17 -04:00
eed606e0e9 adds name lines to handler re-use examples (#71946)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2020-09-25 12:46:45 -04:00
c1005147e0 doc: add vmware_rest_guidelines
Add the development guidelines for the vmware_rest collection.
2020-09-25 12:24:48 -04:00
27826827e9 updates intersphinx references for docs links (#71921)
* DOCS: updates intersphinx references for docs links
* TESTS: Raise the number of bytes scanned to determine if a file is binary. The newest ansible-2.10.inv file has its first null byte at position 2261. 4096 is still a cheap chunksize to read so it still makes sense to raise this.

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2020-09-25 10:33:29 -05:00
4cb20dba97 Update index.rst (#71887)
* Update docs/docsite/rst/community/index.rst to include another link to the mailing lists list
2020-09-25 10:28:51 -05:00
c19af92be6 Docsite: improve user_guide/playbooks_variables (#71938)
* Docsite: improve user_guide/playbooks_variables
2020-09-25 09:48:33 -05:00
2fed63a930 Docsite: improve inventory-related pages (#71907)
* Update docs/docsite/rst/plugins/inventory.rst
2020-09-25 09:46:24 -05:00
ece0be30ab Move ansible.galaxy.collection module into package
This change preserves how all the external imports refer to this code
while allowing us to start cutting the spaghetti into more easily
maintainable pieces.

This is a start of the upcoming refactoring effort destined to
eliminate tight coupling, implicit data manipulation, god objects,
abstraction leaks and other code smells.

Essentially, `ansible.galaxy.collection` is going to be a package that
holds parts of the collection management code spread across loosely
coupled modules.

PR: #71931
2020-09-25 16:15:10 +02:00
92b66e3e31 CI provider fixes for ansible-test. (#71929)
* Make Azure Pipelines resource_prefix lowercase.

* Make classification of CI files consistent.

* Update package-data sanity test for AZP.
2020-09-24 17:34:07 -07:00
4f990e7615 dev_guide: Add Pygments Lexer examples (#71458)
* dev_guide: Add Pygments Lexer examples

Fixes: #51307

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* adds ansible-output lexer, remmoves unsupported lexers

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2020-09-24 15:00:17 -05:00
90134b0ac3 Ensure native jinja is off for non-native tests (#71914)
Even if native jinja is off by default now it is better to be
explicit and it will be prepared in case we changed that default.
2020-09-24 15:52:06 -04:00
9a39452a31 update the definition of changed (#71865)
* add nuance to the definition of changed, add notes to modules that return "changed" without changing state
2020-09-24 14:33:22 -05:00
5348e7bf61 test: cloudstack: Use test-container 1.4.0 (#71905) 2020-09-24 11:58:37 -07:00
a47eafa581 Update playbooks_reuse_roles.rst (#71880)
Change "vars_files" to "vars, files" under the Roles heading
2020-09-24 13:40:02 -05:00
25bfda8417 Docsite: improve user_guide/intro_inventory (#71859) 2020-09-24 13:34:41 -05:00
c3841b8440 Docsite: improve user_guide/playbooks_tags (#71858) 2020-09-24 13:33:03 -05:00
7a0a2f188b Docsite: improve user_guide/playbooks_reuse_roles (#71857)
* Docsite: improve user_guide/playbooks_reuse_roles

* fix
2020-09-24 13:29:28 -05:00
2655fc0c23 Docsite: update Migrating Ansible content to a different collection (#71854)
Co-authored-by: Felix Fontein <felix@fontein.de>
2020-09-24 14:19:04 -04:00
401be27053 Add example values and results for theory filters (#71908)
Add example values and results for theory filters
2020-09-24 12:18:17 -05:00
ed6fb2e3f6 Docsite: improve user_guide/intro_adhoc (#71909) 2020-09-24 12:16:15 -05:00
70e25dc158 clarify releases download for older releases only (#71892) 2020-09-24 09:57:16 -05:00
e358946b98 update install instructions for pip (#71891) 2020-09-24 09:56:27 -05:00
4aedd1b987 add new glossary terms for 2.10 (#71813)
* add new terms for 2.10
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2020-09-24 09:45:54 -05:00
d6063b7457 clarify FQCN use for playbooks (#71816)
* clarify FQCN use

* Apply suggestions from code review

Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>

Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2020-09-24 09:45:11 -05:00
31ddca4c0d [incidental_setup_docker] changes to upstream repo (#71897)
Change:
- The docker-ce.repo file for centos does not work on RHEL since it uses
  $releasever and on RHEL that is, e.g., "7Server".
- Instead, set up the repo manually.
- Additionally, the docker centos8 repo no longer has old versions, so
  we use the (only) version in the repo instead.

Test Plan:
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-09-23 18:31:18 -05:00
98d10cd6ee Fix conditional for the dnf nobest test (#71805) 2020-09-23 09:10:12 +02:00
5cd489af06 Let get_file_attributes() work without lsattr -v (#71845)
* Let get_file_attributes() work without `lsattr -v`

Change:
- module_utils's get_file_attributes() expects `lsattr -v` to work, but
  in some cases, it may not.
- The function now takes an optional include_version bool parameter,
  which removes this expectation.
- Places where we call get_file_attributes() without using the 'version'
  it returns, we now call it with include_version=False.

Test Plan:
- New unit tests

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-09-22 16:15:47 -05:00
5b27b307b9 Update intro_getting_started.rst (#71851)
Fixed the formatting on the remote user name override list.
2020-09-22 15:29:31 -05:00
3e9943bc5e Reduce ignored module sanity tests (#70319)
* Reorder test/sanity/ignore.txt to better see changes
* Remove extra empty line causing pass fail
* Apply suggestions made by Akasurde
* Minor fix in package_facts and remove two unnecessary ignores
* Fix subversion based on a suggestion made by felixfontein
* Apply suggestions made by felixfontein and Andersson007
* Fix subversion.py as suggested by felixfontein
* Minor reformatting in yum_repository description
* Reformat changelog
* Add key to apt_key, add deprecated changelog
* Add PR url to changelog
* Ignore paramater-type-not-in-doc in favour of adding key back to apt_key
* Fix apt_key
* Remove undocumented-paramater from apt_key ignore
* Ignore doc-choices-do-not-match-spec in package_facts
* Fix package_facts
* Fix filter option in setup module
2020-09-22 16:07:29 -04:00
606924a4b4 Update the porting guide for a new ansible version (#71863) 2020-09-22 13:52:08 -04:00
bf4e102d97 update version switcher for 2.10 release 2020-09-22 10:46:58 -07:00
0e5911d650 add cli parser documentation (#71497)
* with native network example, linux example
2020-09-22 11:54:24 -05:00
abfb7919dc [default callback] Show include_tasks task banner (#71821)
Change:
- In some cases (always with free strategy, sometimes with linear), the
  default callback would not show the task banner for include_tasks.
- This only affects the include_tasks task itself, not the tasks in the
  included file.

Test Plan:
- Updated default callback tests

Tickets:
- Fixes #71277

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-09-22 11:40:12 -04:00
a99212464c Remove incidental_consul tests (#71811)
* Add explicit intg tests for argspec functionality

* ci_complete ci_coverage

* Remove incidental_consul and incidental_setup_openssl

* ci_complete ci_coverage
2020-09-22 11:33:59 -04:00
00b22ab55e Provide more information in AnsibleUndefinedVariable (#71666)
* Provide more information in AnsibleUndefinedVariable

Fixes #55152
2020-09-22 09:38:53 -04:00
6984081111 Test changes to allow using "macos" test image (#71849)
* Add link to remote.sh from macos.sh
* Add skip/macos to tests that have skip/osx
2020-09-22 09:10:36 -04:00
782effbb89 Fix hostname test on docker.
The test is not supported when running in a container. It now recognizes both 'docker' and 'container' as virtualization types that should cause the test to be skipped.
2020-09-21 17:26:07 -07:00
17765cd4e8 Fix attribute testing in file integration test. (#71843)
The file test will no longer attempt to test attributes if `lsattr -vd` does not work on the system under test.
2020-09-21 13:49:07 -07:00
bcfead8e0f change duplicated label 2020-09-21 12:32:11 -07:00
7f62b4733d Update EXAMPLES in package_facts.py documentation (#71838)
this module is not limited to rpm , so remove rpm in tasks name
2020-09-21 12:14:00 -04:00
3db4be2c3b Docsite: improve user_guide/playbooks_reuse (#71834) 2020-09-21 10:31:07 -04:00
e6e9840717 Remove incidentals without coverage (#71788)
* Remove incidental_lookup_hashi_vault
* Remove incidental_connection_chroot
* Remove incidental_selinux
* Remove incidental_win_hosts
2020-09-17 16:57:28 -05:00
2d2c5d5ed7 setup - update docs for win setup fact_path (#71791) 2020-09-17 16:01:19 -04:00
d63d880383 Remove incidental_synchronize tests (#71776)
* Remove incidental_synchronize tests

* Update sanity ignore
2020-09-17 09:31:47 -05:00
05a45f63ff Docsite: misc fixes of playbooks_delegation (#71753) 2020-09-17 10:22:03 -04:00
aa1f0bd062 Docsite: fix playbooks_conditionals (#71754) 2020-09-17 10:21:28 -04:00
79dc6fa948 Docsite: fix user_guide/playbooks_blocks (#71769) 2020-09-17 10:20:22 -04:00
1cf42897d2 Docsite: fix user_guide/playbooks_handlers (#71770) 2020-09-17 10:19:24 -04:00
2c6661d4c1 Docsite: fix user_guide/playbooks_error_handling (#71771) 2020-09-17 10:18:21 -04:00
a204f5f955 Docsite: fix user_guide/playbooks_environment (#71772) 2020-09-17 10:17:05 -04:00
195c8b496e Add integration coverage to replace hash_vault and consul_session (#71775)
* Add integration coverage to replace hash_vault and consul_session

ci_complete
ci_coverage

* Remove errant list element
2020-09-16 16:40:26 -05:00
65cdb86c8a incidental_setup_openssl - Pin version of Python packages
A recent update to cffi that was yanked is still being installed on our
Mac OS X 10.11 test image since the version of pip there is very old and
does not ignore yanked packages.

Pin the version of pyOpenSSL and its dependencies to fix this and avoid
future spontaneous failures.
2020-09-16 08:49:16 -07:00
7a38c470ba [docs] add porting guide for DNF GPG validation (#71640)
* [docs] add porting guide for DNF GPG validation

Change:
- This was a breaking change (security fix), but I neglected to add a
  porting guide entry for it previously.

Tickets:
- Refs #71537
- Refs #71539
- Refs #71540
- Refs #71541

Signed-off-by: Rick Elrod <rick@elrod.me>

* changes from sivel

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-09-15 16:07:34 -04:00
760334303b vmware: Add docs for filters (#71670)
Add a scenario guide for filters in VMware documentation

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-09-15 16:06:37 -04:00
c36e939414 Fixed invalid urls inside guide_packet.rst and collections_using.rst (#71705)
* Fixed invalid urls inside guide_packet.rst and collections_using.rst

* Reverted fix for collections_using.rst
2020-09-15 16:05:27 -04:00
00ed5b1f2e Fix broken bullet list (#71728) 2020-09-15 16:04:07 -04:00
4bf61f0714 Fix typo in delveloping_plugins_network (#71737) 2020-09-15 16:03:08 -04:00
a80131a283 Docsite: misc fixes (#71697) 2020-09-15 16:01:49 -04:00
13ab9f5932 Docsite: improve playbooks_loops.rst (#71718) 2020-09-15 16:00:09 -04:00
fdf80690e4 [dnf] accumulate update filters (#71726)
Change:
- Previously when `security: true` and `bugfix: true` were both given,
  only security updates would get applied. Filters now accumulate so
  that both get applied in this case.

Test Plan:
- New integration tests for both check_mode and not. These tests make
  use of a contrived yum repository which is stored in S3.

Tickets:
- Fixes #70854

Signed-off-by: Rick Elrod <rick@elrod.me>
Co-authored-by: Matt Martz <matt@sivel.net>

Co-authored-by: Matt Martz <matt@sivel.net>
2020-09-15 11:36:18 -04:00
7048542199 Fix passing the connection timeout to connection plugins (#71722)
* Fix passing the connection timeout to connection plugins
2020-09-15 11:34:11 -04:00
5511c898cc Docsite: fix a typo in user_guide/index.rst (#71717) 2020-09-15 11:31:38 -04:00
173091e2e3 distro: Add support for Pardus distribution (#71663)
Fixes: #71636

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-09-15 09:47:24 -04:00
fc08c1f3c5 runas - create new SYSTEM token on become (#71714) 2020-09-15 05:39:23 +10:00
e813b0151c fix coverage output from synthetic packages (#71727)
* fix coverage output from synthetic packages

* synthetic packages (eg, implicit collection packages without `__init__.py`) were always created at runtime with empty string source, which was compiled to a code object and exec'd during the package load. When run with code coverage, it created a bogus coverage entry (since the `__synthetic__`-suffixed `__file__` entry didn't exist on disk).
* modified collection loader `get_code` to preserve the distinction between `None` (eg synthetic package) and empty string (eg empty `__init__.py`) values from `get_source`, and to return `None` when the source is `None`. This allows the package loader to skip `exec`ing things that truly have no source file on disk, thus not creating bogus coverage entries, while preserving behavior and coverage reporting for empty package inits that actually exist.

* add unit test
2020-09-14 09:14:23 -07:00
74a103d655 Remove em dash from the pytest configuration file
On some systems (tested with official Debian Buster-based Python 3.6
docker image), setting the LC_ALL environment variable to en_US.UTF-8
will trigger Python into switching its preferred encoding to ASCII.
If any python process tries to read a non-ASCII file in this scenario,
it will terminate with an error.

And this is exactly what happens to pytest when it tries to load its
configuration that ansible-test supplies because the configuration
contains an em dash.

In order to bypass this issue, we replaced the em dash with a regular
dash and things started working again.

An alternative solution would be to replace the en_US.UTF-8 locale with
something safer, but unfortunately, the en_US.UTF-8 is probably as safe
as it gets.
2020-09-14 09:02:48 -07:00
a10af345a9 don't set warn = True, it will be overwritten in the next line (#71682) 2020-09-12 02:58:09 -05:00
59a240cd31 Fix with_dict/with_list being passed incorrect type tests (#71699)
These tests were failing due to a variable passed being undefined
instead of being of an incorrect type which is the actual
intent of the tests.
2020-09-11 07:53:10 +02:00
7a0e545700 Add how to run unit test link in testing_units_modules doc (#71523)
* Add how to run unit test link in testing_units_modules
* Fix sanity test
2020-09-10 15:21:01 -05:00
1a06587f3b Fix typo in the documentation (#71701)
Fix typo in the documentation: casting instead of casing
2020-09-10 10:49:59 -05:00
11ba30183e Docs(lineinfile): Update link to python regex docs (#71688)
There was a link still pointing at the python2 documentation.
2020-09-10 10:19:26 -04:00
73bed95ead Docsite: add reference to Style guide (#71694) 2020-09-10 10:17:13 -04:00
daca3ade99 Allow list of filters for the setup module (#68551)
The setup module can now filter out multiple pattern by providing a list
to the filter parameter instead of just a string. Single string sill
works. Previous behaviour remains.

(cherry picked from commit b5c36dac483fdd74d6c570d77cc8f3e396720366)
2020-09-09 20:40:48 +02:00
b430f9b9aa Adds FAQ and other pointers for collections (#71606) 2020-09-09 13:16:26 -04:00
a34043c6be Changed all_modules references to list_of_collections in the documentation (#71656) 2020-09-09 11:43:40 -05:00
1ad0f666d5 Fix typo in documentation (#71652)
Fix typo on the page about unit testing modules,
2020-09-09 11:41:43 -05:00
9fcf1db871 Update the porting guide for 2.10.0b2 (#71677) 2020-09-09 08:37:56 -05:00
61f6aa55b6 Add semver support to the jinja2 version test (#71600) 2020-09-08 08:52:27 -05:00
b615789fcc psrp - fix hang when copying an empty file (#71649) 2020-09-05 14:57:15 +10:00
4d4e75ee05 Update to the ansible-2.10.0 pre-release schedule (#71647) 2020-09-04 20:26:43 -05:00
bbd4ec13f1 clarify that collection names use same requirements as namespaces (#71639) 2020-09-04 14:37:44 -05:00
2f240f5dd7 Add note on where inventory scripts moved to' (#71638) 2020-09-04 14:35:08 -05:00
48f12c14e9 AnsibleVaultEncryptedUnicode should be considered a string (#71609)
* AnsibleVaultEncryptedUnicode should be considered a string

* linting fix

* clog frag
2020-09-03 14:54:00 -05:00
7bfeed3e24 Docsite: replace Latin phrases to English (#71588)
Replace Latin phrases like "e.g." and "i.e." and "etc." with English phrases. 

* Update docs/docsite/rst/community/committer_guidelines.rst
* Update docs/docsite/rst/dev_guide/developing_modules_documenting.rst
* Update docs/docsite/rst/dev_guide/developing_program_flow_modules.rst
* Update docs/docsite/rst/dev_guide/module_lifecycle.rst
* Update docs/docsite/rst/user_guide/intro_inventory.rst
* Update docs/docsite/rst/user_guide/playbooks_loops.rst
* Update docs/docsite/rst/user_guide/playbooks_reuse.rst
* Update docs/docsite/rst/dev_guide/platforms/aws_guidelines.rst
* Update docs/docsite/rst/dev_guide/testing.rst
* Update docs/docsite/rst/dev_guide/testing_integration.rst
* Update docs/docsite/rst/porting_guides/porting_guide_2.5.rst
* Update docs/docsite/rst/reference_appendices/faq.rst
2020-09-03 14:47:57 -05:00
0cf4aabc55 Ensure we clean up if an exception kills strategy.run. Fixes #23958 (#71513) 2020-09-03 15:09:08 -04:00
d398a4b4f0 file: module should warn in check_mode when path and owner/group don't exist (#69640)
* file: module must fail in check_mode when path and owner/group don't exist
2020-09-03 09:11:50 -04:00
a3b954e5c9 Force template module to use non-native Jinja2 (#68560)
Fixes #46169
2020-09-03 09:01:34 +02:00
3d769f3a76 Add pause to avoid same mtime in test. 2020-09-02 15:35:08 -07:00
db98433e7a Use InventoryManager for inventory_hostnames lookup (#71573)
* Use InventoryManager for inventory_hostnames lookup. Fixes #17268

* Add test for using patterns

* s/it's/its/

* Allow bypassing parse_sources in InventoryManager

* Remove unneeded method call
2020-09-02 15:42:09 -05:00
05788c05d3 Remove incidental_postgresql_user tests 2020-09-02 13:14:04 -07:00
b518a5db14 add skeleton ansible 2.11 roadmap (#71566)
* add skeleton ansible roadmap to docs/docsite/rst/roadmap/COLLECTIONS_2_11.rst
2020-09-02 13:48:53 -05:00
96aee766f4 More docs updates to reflect collections ecosystem (#71597) 2020-09-02 13:50:12 -04:00
7f9258b024 update backport instructions for 2.11 (#71567)
* update backport instructions in docs/docsite/rst/community/development_process.rst

Co-authored-by: Matt Martz <matt@sivel.net>
2020-09-02 11:53:48 -05:00
64e2b9da3b [yum tests] add missing "always" block (#71564)
Change:
- So that if yum tests get re-run, we don't error out the second time.

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-09-02 11:35:20 -05:00
db519bc17c [tests] Bump container versions (#71518)
Change:
- This pulls in python 3.9.0rc1

Test Plan:
- CI, hopefully

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-09-02 11:20:55 -05:00
bfba0ffc45 Docsite: improve developing_modules_documenting.rst (#71590)
* Docsite: improve developing_modules_documenting.rst

* add necessary dots to returns descriptions
2020-09-02 09:26:42 -04:00
cda5854099 Docsite: improve spelling_word_choice.rst (#71592) 2020-09-02 09:24:53 -04:00
1882c60b04 Update the porting guide for ansible-2.10.0b1 (#71583) 2020-09-01 18:47:51 -04:00
0c50ee1abe [docs] Fix up porting guides for CVE revert (#71580)
Change:
- Fix up wording and do proper backports for porting guide entries.

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-09-01 17:25:58 -05:00
98febab975 Use new endpoint for Parallels based instances. 2020-09-01 13:20:20 -07:00
b694dbadfe User guide overhaul, Table of Contents (#71553) 2020-09-01 12:29:21 -04:00
29b20bd1b1 DOCS: Mentions ansible-base, adds collections pointers to Community and Dev Guides (#71480) 2020-09-01 12:25:37 -04:00
56423b1648 testing_sanity.rst: add argument for running in docker (#71223) 2020-09-01 12:00:13 -04:00
b9e2c4e37d Add tests for ignore functionality of collection build (#69345)
In order to test this piece of functionality, we create a dedicated
collection that contains files that should be ignored when building
the collection tarball.

After the collection is built, we make sure the produced tarball does
not contain any files that should be ignored.
2020-09-01 11:51:35 -04:00
159544610e get_url: Handle same SHA sum for downloaded files (#71435)
Fixes: #71420

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-09-01 09:55:08 -04:00
0f3b5bb4a6 [tests] fix fallout from dnf gpg fix (#71548)
Change:
- Missed needed gpg ignores

Test Plan:
- CI
- ci_complete

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-08-31 18:41:07 -05:00
785012321f Fix setup_paramiko test (#71547) 2020-08-31 15:39:41 -05:00
f75223d2c6 update install for 2.10 (#71543)
* update install for 2.10
2020-08-31 15:34:20 -05:00
215eb730e1 ansible-vault: Fix typo in help message (#71485) 2020-08-31 14:58:45 -05:00
ec3920cef1 Update intro_patterns.rst (#71542)
Call out the trailing comma when specifying a single host. Small snag that took me a while to notice.
2020-08-31 14:49:18 -05:00
bc6461432e Add --allow-disabled to sanity docs (#71524) 2020-08-31 10:46:03 -05:00
9bea33ffa3 [dnf] ensure packages are gpg-verified (#71537)
Change:
- By default the dnf API does not gpg-verify packages. This is a feature
  that is executed in its CLI code. It never made it into Ansible's
  usage of the API, so packages were previously not verified.
- This fixes CVE-2020-14365.

Test Plan:
- New integration tests

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-08-31 10:47:38 -04:00
d083307e36 Set global skipped result flag for looped tasks (#67847)
This allows for the skipped filter to be used on a registered looped
task results.

Fixes #16949
2020-08-28 08:01:26 +02:00
2bbcbe99fd Support macOS 10.15 for ansible-test --remote.
Use of this new version is experimental, so it is not enabled in CI yet.
2020-08-27 15:48:11 -07:00
d6fe849b2e add skeleton 2.11 base roadmap (#71478) 2020-08-27 16:45:20 -05:00
c586d436fa Feature freeze date has been merged with Ansible-2.10.0beta1 (#71494) 2020-08-27 15:55:55 -04:00
fbdfb85c20 Remove duplicate unit test (#71488)
test_dict_undefined_values is a duplicate of test_dict_undefined_values_is_defined.
It seems originally test_dict_undefined_values was supposed
to do what test_dict_undefined_values_bare does so it is safe to remove.
2020-08-27 15:55:30 -04:00
50f221c63e Fix incorrect msg in the results dict in loops (#71482) 2020-08-27 15:49:53 -04:00
a1a624b150 Normalize how None is handled in quote filter. Fixes #32174 (#71473) 2020-08-27 15:42:56 -04:00
addee0699e quick update to changelog instructins (#71492) 2020-08-27 11:05:35 -05:00
7127d37466 Remove "mode: preserve" option from documentation (#71486)
Remove "mode: preserve" option from documentation in doc fragments "FILE_COMMON_ARGUMENTS", as it was incorrectly included in the documentation for the `lineinfile`, `unarchive` and other file-related modules. 
The `copy` and `templates` modules documentation remains untouched and still contain "mode: preserve", as intended.
2020-08-27 10:37:04 -05:00
fdf5dd02b3 Updates for password hashing (#71120)
* Validate salt when using crypt. Respect salt_size in password lookup. Repair salt for bcrypt. Fixes #71107. Fixes #53750. Fixes #36129.

* Handle algorithms we don't know about, and make sure to return the salt

* Account for old passlib

* Add tests for salt constraints

* Add changelog fragment

* Add test for #36129
2020-08-26 14:54:38 -05:00
b6f10b9b52 update Network Advanced Topics for FQCN (#71325)
* update Network Advanced Topics for FQCN
2020-08-26 12:33:59 -05:00
f82a1e06d7 updates network plugin docs pages for 2.10 (#71467)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2020-08-26 12:05:20 -04:00
1257b0a184 service: Add a note about ignored parameters (#71455)
Some parameters for systemd are ignored, add a note about such parameters in documentation.
Fixes: #23144

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-26 10:11:41 -05:00
9792d631b1 _check_failed_state: always use the current/nested state (#71347)
Fixes #71306
2020-08-26 07:07:34 +02:00
f5b6df14ab Fix ansible-test coverage traceback. (#71446)
* Add integration test for ansible-test coverage.

* Fix ansible-test coverage traceback.

* Fix coverage reporting on Python 2.6.
2020-08-25 21:23:44 -07:00
72a7cb4a2c powershell - fix quoting values (#71411)
* powershell - fix quoting values

* Add ignore for smart quote skip
2020-08-26 07:06:51 +10:00
8897d7e2ff powershell - fix nested CLIXML parser (#71412) 2020-08-26 07:06:19 +10:00
3c8744f0c1 Add link to Matt's blog (#71436)
nitzmahone's blog nicely explained why Windows is not supported
as Ansible controller. Link that in documentation so users can
read about it.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-25 10:09:07 -04:00
0b16c0a8c7 user_guide: Fix reuse role examples (#71440)
Fixes: #53919

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-25 10:08:17 -04:00
5c1594916a user_guide: Add an example for loop (#71441)
Explain how to use complex data in loop while converting
from with_together

Fixes: #47906

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-25 10:07:21 -04:00
985ba187b2 psrp - use native copy mechanism (#71409)
* psrp - use native copy mechanism

* Fix sanity issues

* Split the bugfix and deprecation into separate changelog fragments
2020-08-25 12:23:40 +10:00
d099591964 Update ansible-test remote endpoint handling. (#71413)
* Request ansible-core-ci resources by provider.
* Remove obsolete us-east-2 CI endpoint.
* Add new --remote-endpoint option.
* Add warning for --remote-aws-region option.
* Update service endpoints.
* Allow non-standard remote stages.
* Add changelog fragment.
2020-08-24 15:17:03 -07:00
a6537b59ab Modify wording to specify two ctl-d to end stdin input in ansible-vault (#69436)
* 51860 - Modify wording to specify two ctl-d to end stdin input in ansible-vault
* removes space to make line 160 chars
2020-08-24 15:08:16 -05:00
2b7461eb52 fix broken links due to master -> main branch rename (#71426) 2020-08-24 15:39:21 -04:00
6fedcaa3a6 added configurable dir for tree callback (#71348)
* added configurable dir for tree callback

 - allows usage in playbooks
 - also made errors more specific if bad dir is supplied
 - ensure we expand paths

* docfix
2020-08-24 13:00:15 -04:00
4317c2c80c Update uri.py (#67688)
Adds an example of creating workspaces in Log analytics Azure
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2020-08-22 11:10:44 -05:00
66e38bf499 docs: Remove examples using the ec2.py script (#69107)
This script is mostly unmaintained and relies on the deprecated and
unmaintained `boto` library. Featuring it prominently in the docs
leads to many new users using it instead of the supported `aws_ec2`
inventory plugin.
2020-08-21 14:50:09 -05:00
6c48c62f93 document securing editor for vault (#71404) 2020-08-21 13:42:53 -05:00
156b1c5245 Keep caution tape for older versions (#71400) 2020-08-21 12:30:43 -04:00
fb035da3b2 clarify inventory plugin user documentation (#71387) 2020-08-21 12:26:02 -04:00
3f3bcbf05e galaxy: Add examples for galaxy section in ansible.cfg (#70931)
Add example section for galaxy section in ansible.cfg

Fixes: #68402

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-21 12:17:18 -04:00
13ab73cd89 Docs: ansible_host can contain FQDN (#71186) 2020-08-21 12:14:18 -04:00
3e4377300b Explain duplicate checks includes tags and when (#68183)
##### SUMMARY
Per #67913, when comparing dependencies, Ansible takes into account parameters, tags and the when clause in determining whether a role is a duplicate or not.

##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2020-08-21 11:49:43 -04:00
1425e3597b Allow meta tasks to use tags (#67508)
* Support tags for explicit meta tasks

Add --list-tasks tests for meta tags

Add breaking_changes changelog fragment and porting guide
2020-08-21 11:08:49 -04:00
59b80b9146 docs: Update Kubernetes Guide (#71372)
Fixes: #61681

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-21 10:37:03 -04:00
5498b0bb71 Documentation: improve dev_guide/testing_integration.rst (#71370) 2020-08-20 15:24:22 -04:00
e5bb7b1a16 Add skip_reason to meta task skips (#71355)
Change:
- Make them more consistent with other tasks.

Test Plan:
- CI, new test

Tickets:
- Refs #71009

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-08-20 13:48:10 -05:00
a479b003e8 Fix module links. (#71030) 2020-08-20 14:08:41 -04:00
80b8fde946 update fest link (#71376) 2020-08-20 09:40:51 -05:00
b82889eef5 Add note about integration tests for new modules to the dev guide (#71345) 2020-08-20 10:15:08 -04:00
705c666521 skydive.skydive was renamed to community.skydive (#71357) 2020-08-19 21:46:20 +01:00
74f88c56a5 quick fix to change main back to devel (#71342)
* quick fix to change main back to devel
* Update docs/docsite/rst/dev_guide/developing_collections.rst

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-08-19 15:26:12 -05:00
41d7d53573 base.yml: Fix typos (#71346) 2020-08-19 15:22:39 -05:00
9be8d723da Add Fest banner (#71360)
Adds Fest banner, with fixes; updates existing banners, adds links.
2020-08-19 15:19:53 -05:00
2675768e3d Make noop tasks implicit (#71344)
Signed-off-by: Rick Elrod <rick@elrod.me>
Co-authored-by: Rick Elrod <rick@elrod.me>
2020-08-19 13:10:54 -05:00
f8aa307659 add extra vars to inventory plugins (#70970)
* add extra vars to inventory plugins
* disable by default for backwards compat
* also allow extra vars for options
2020-08-19 12:56:28 -04:00
f7ade8e61c allow per conditonal item debugging (#70966)
* allow per conditonal item debugging
* offloaded a bit from _check_c
2020-08-19 12:55:17 -04:00
b87944926d Improve proposed fix for bare variables (#70687)
* Make proposed fix for bare variables clearer

* Add changelog fragment
2020-08-19 00:55:30 +02:00
ea58d7c233 Make it so callback plugins can act on implicit/explicit meta tasks (#71009)
Change:
- Now sends meta tasks to the task start callback
- Lets callback plugins opt-in to receiving implicit tasks

Test Plan:
- New integration tests

Tickets:
- Indirectly fixes #71007 by allowing custom callbacks with this data

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-08-18 16:56:48 -05:00
a1257d75aa network: Correct documentation (#71246)
ini-style inventory does not support Ansible Vault password.
This fixes network_best_practices_2.5 doc.
Fixes: #69039

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-18 15:34:25 -05:00
7f97a62d87 fix make webdocs warnings (#71340) 2020-08-18 15:05:50 -05:00
92cd35fdb1 Grammatically updated the README file (#71300) 2020-08-18 15:59:06 -04:00
4f993922c8 Add documentation about info/facts module development (#71250)
Fixes: #40151

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-18 15:56:43 -04:00
f79a7c5585 Update Network Getting Started for FQCN/collection world (#71188)
* pull out network roles, cleanup, update first playbook examples, update gather facts section, some inventory conversion to .yml, update inventory and roles, simplify the navigation titles, fix tocs, feedback comments
2020-08-18 14:14:32 -05:00
5073cfc8bc incorporate minimalism feedback on debugging page (#71272)
Co-authored-by: bobjohnsrh <50667510+bobjohnsrh@users.noreply.github.com>
2020-08-18 14:16:36 -04:00
4792d83e13 cron module defaults to current user, not root (#71337) 2020-08-18 14:02:11 -04:00
02ea80f6d7 tidies up vars page (#71339) 2020-08-18 14:01:03 -04:00
4d68efbe24 Writing style updates to Using Variables topic (#71194)
* updated topic title, underline length for headings, and incorporated peer feedback
2020-08-18 11:25:33 -05:00
180507c62b dev_guide: improve developing_collections.rst (#71332) 2020-08-18 12:07:27 -04:00
6d17736ef4 subelements: Clarify parameter docs (#71177)
skip_missing parameter in subelements lookup plugin is accepted from
inside the dictionary.

Fixes: #38182

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-18 12:03:28 -04:00
88bfc7977d Fix meta tasks used with --flush-cache (#71311)
* Remove incorrect code
2020-08-18 11:41:58 -04:00
4afc228108 hacking: replace use of "which" with "command -v" (#71278)
"command -v" is the POSIX compliant way to get the path to a command.
It returns the path to the command if it exists and exits with a
non-zero status when it does not, without any output. "which" is not
POSIX and it can have various different effects. With Zsh, it says
"python not found" on stdout.

See:
 - https://pubs.opengroup.org/onlinepubs/009695399/utilities/command.html

Signed-off-by: Vincent Bernat <vincent@bernat.ch>
2020-08-18 11:31:28 -04:00
f2f6c34632 Fix play stats when rescue block is a child block (#70922)
* check run state of current block only

* Add changelog and test

* Add test for issue 29047

* Fix for both tests

* blerg

* Change test messages

* fix tests

* Add multi-level block in rescue test case

* Add recursive rescue check and multi-level test

* Should probably run the new test

* ci_complete

* Merge new tests

* ci_complete
2020-08-18 11:20:55 +02:00
824cd4cbeb Update ansible european IRC channel (#71326)
Signed-off-by: Rémi VERCHERE <remi@verchere.fr>
2020-08-17 17:06:48 -05:00
1d1de2c6fd Update password.py (#71295)
List md5_crypt, bcrypt, sha256_crypt, sha512_crypt as hash schemes in the password plugin.
2020-08-17 16:00:47 -05:00
606604bb97 Add warning about copyright year change (#71251)
To simplify project administration and avoid any legal issues,
add a warning in the docs. This reflects - https://github.com/ansible/ansible/issues/45989#issuecomment-423635622 and fixes: #45989

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-17 15:44:06 -05:00
ecd3b52ad7 Writing style updates to Developing dynamic inventory topic (#71245)
* modified the writing style

* incorporated peer feedback
2020-08-17 14:16:19 -05:00
6289570234 epoch can be a float with strftime filter. Fixes #71257 (#71314) 2020-08-17 13:46:49 -05:00
9da880182b Allow the TOML inventory to dump unsafe. Fixes #71307 (#71309) 2020-08-17 13:46:13 -05:00
959af7d90b Don't do conflict check on sdist and egg_info (#71310)
* Don't do conflict check on sdist and egg_info. Fixes #71279

* Add changelog

* adjust changelog PR link

Co-authored-by: Rick Elrod <rick@elrod.me>

* add warning about bdist_wheel

Co-authored-by: Rick Elrod <rick@elrod.me>
2020-08-17 13:45:41 -05:00
ecea018506 Fix 404 links (#71256)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-17 13:52:45 -04:00
ee48e0b0ad Fix roadmap formatting. (#71275) 2020-08-17 13:50:22 -04:00
61b7f234bd Update auto-generated 2.10 porting guide in devel. (#71276) 2020-08-17 13:49:38 -04:00
a496b89d6f overview_architecture.rst: fix playbook example (#71303) 2020-08-17 13:44:05 -04:00
9296ee9329 developing_modules_in_groups.rst: add note about releasing (#71305) 2020-08-17 13:43:15 -04:00
eb8b3a8479 get_url - Allow checksum file to be local file:// url (#71205)
This would be a partial solution for #69364 in that the SHASUMS file can be downloaded and gpg verified but then used from the downloaded location to verify the get_url's file.
* Make checksum url parsing more explicit

Use urlsplit to test if the checksum string has a (currently tested and) supported url scheme.

* Fix whitespace
* Changelog fragment
* Added tests
* Fix typo in test setup
2020-08-17 12:21:15 -04:00
a1a50bb3cd systemd - supports new systemctl output message for chroot (#71197)
The message generated by systemctl has been updated in 9321e23c40, which requires a corresponding change in the systemd module.

In addition, this fixes the module when the SYSTEMD_OFFLINE environment variable is set.
2020-08-17 12:09:07 -04:00
5821128995 Allow callbacks from forks (#70501)
* POC for supporting callback events that come from the worker

* linting fixes. ci_complete

* fix up units. ci_complete

* Try moving the sentinel put higher. ci_complete

* safeguards. ci_complete

* Move queue killing to terminate

* LINTING. ci_complete

* Subclass Queue, to add helper send_callback method

* Just use _final_q instead of adding another queue and thread

* Revert a few changes

* Add helper for inserting a TaskResult into the _final_q

* Add changelog fragment

* Address rebase issue

* ci_complete

* Add test to assert async poll callback from fork

* Don't use full path

* ci_complete

* Use _results_lock as a context manager

* Add new generic lock decorator, and use it with send_callback
2020-08-17 10:51:01 -05:00
92d59a58c0 Fix code markups and add link to CVE (#71082) 2020-08-17 10:55:30 -04:00
d816a5966e Force an upgrade to a newer version of antsibull 2020-08-14 13:01:29 -07:00
99cac0b135 Fix expr regex for MacOSX compat
MacOSX seems to want bare `+` whereas GNU expr wants escaped `+` (`\+`)
to mean match one or more.  Use `\{1,\}` instead which will match one or
more on both MaxOSX and GNU-using systems.

Fixes #71053
2020-08-14 13:01:29 -07:00
22d2c97b81 Updates to docs build for new antsibull CLI
* --ansible-base-cache renamed to --ansible-base-source
* _acd_version in the .deps file has been renamed to _ansible_version
2020-08-14 13:01:29 -07:00
e507c127e5 Move 2.10.0rc1 release date a few days forward. (#71270)
At yesterday's meeting it was decided to have ansible-2.10.0 depend on
ansible-base-2.10.1 so that we can get several fixes for ansible-base's
routing (including adding the gluster.gluster collection).
ansible-base-2.10.1 will release on September 8th.  So we will plan on
releasing ansible-2.10.0rc1 on the 10th.

https://meetbot.fedoraproject.org/ansible-community/2020-08-12/ansible_community_meeting.2020-08-12-18.00.html
2020-08-13 17:21:36 -05:00
4f0bd5de38 a few writing style updates (#71212) 2020-08-13 10:53:29 -05:00
9f72ff80e3 Redirect gluster modules to gluster.gluster. (#71240) 2020-08-12 23:23:27 -07:00
553ccedcd3 Update release page for ansible and ansible-base (#71229)
* [docs] 2.7 is EOL, add 2.10 which is almost out
- Remove 2.7 support from the maintenance schedule
- Add 2.10 which is in RC and will be out soon enough.
Signed-off-by: Rick Elrod <rick@elrod.me>

* Update docs/docsite/rst/reference_appendices/release_and_maintenance.rst, fix table and separate ansible-base from ansible, fix rstcheck errors, clean up sections, explain the two packages
Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: Rick Elrod <rick@elrod.me>
2020-08-12 15:51:38 -05:00
ae3b8eec12 Adds fest link (#71241)
* adds two possible links to AnsibleFest - pick one

* selected preferred text

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2020-08-12 16:44:56 -04:00
336c176ebc Fix cron file regression (#71207) 2020-08-12 14:04:29 -05:00
888be697cb Revert "Change default file permissions so they are not world readable (#70221)" (#71231)
* Revert "Change default file permissions so they are not world readable (#70221)"

This reverts commit 5260527c4a.

* Revert "Fix warning for new default permissions when mode is not specified (#70976)"

This reverts commit dc79528cc6.
2020-08-12 12:29:04 -05:00
19589db10c Fix references to Ansible Collections Overview (#71227) 2020-08-12 12:06:22 -04:00
c59472715a Add support for non-yaml EXAMPLES (#71184)
* Add support for non-yaml EXAMPLES

* Make pattern raw string

* fmt tag should be the first non-whitespace line

* Add changelog fragment
2020-08-12 09:17:45 -05:00
847152c798 Enable auto-closing needs_collection_redirect issues/PRs (#71179) 2020-08-12 08:57:03 +02:00
7635d23cee Fix netconf validate capability check (#71195)
*  Use ``:validate`` string to check if the netconf
   server supports validate capability as per netconf RFC
2020-08-12 09:17:54 +05:30
dd048a5197 add FQCN to M() references (#70530)
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2020-08-11 10:57:11 -04:00
b66d66027e Skip literal_eval for string filters results in native jinja. (#70988)
Fixes #70831
2020-08-11 10:19:49 +02:00
7195788ffe updates per writing style (#70978)
* updated to follow IBM and Ansible style guides
* modified heading underlines
* incorporated peer review feedback
2020-08-10 17:39:34 -05:00
0a7ab396c7 filters: minor doc fix (#71178)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-10 16:32:15 -04:00
edac065bd2 toml: Clarify about inventory examples (#71180)
Add a note in toml inventory plugin about three different
inventory examples.

Fixes: #67003

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-10 16:31:26 -04:00
172230d7b8 update Ansible-maintained platform guides with FQCN (#70369)
* update platform guides with FQCN
* implemented feedback
* fix remainin fqcn
* Update docs/docsite/rst/network/user_guide/platform_netconf_enabled.rst
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2020-08-10 15:09:35 -05:00
ae1291004e Make sure that apache2-webdav related packages get upgraded (#71187) 2020-08-10 13:10:20 -04:00
f4388de14d add another resource module example (#71162)
* Update docs/docsite/rst/network/user_guide/network_resource_modules.rst
Co-authored-by: Nilashish Chakraborty <nilashishchakraborty8@gmail.com>
2020-08-10 11:18:43 -05:00
e72e12aa27 docs: 'ansible_play_hosts' lists active hosts, not limited by serial (#71116)
ansible_play_batch lists the currently targeted host(s) in the serial/batch, while
ansible_play_hosts lists all the hosts which will be targeted by the play.
2020-08-10 09:42:45 -05:00
80ad1a17df Remove incidental_lvg target (#71174)
Change:
- This no longer has any incidental coverage.

Test Plan:
- Coverage report

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-08-10 00:34:34 -05:00
f46b124d65 start of 'data manipulation' examples (#46979)
Co-authored-by: Klaus Frank <agowa338@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-10 10:18:41 +05:30
4f54fb8d43 Remove incidental azure tests (#71164)
Change:
- All incidental coverage from these tests has moved to intentional
  coverage.

Test Plan:
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-08-08 00:56:53 -05:00
501f30df45 password: Add example to generate random string (#71144)
Password lookup can be used to generate random string
with desired length. This is useful in various scenarios.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-08 08:42:14 +05:30
3f22f79e73 Ensure -k is set to delegated hosts without a pass (#71136)
* Ensure -k is set to delegated hosts without a pass

* Fix up some broken tests

* Update task_executor.py

one possible fix, the other is updating winrm to normalize on 'password' like the other connection plugins

* Add alias for winrm and fix incorrect assumption

* Make sure aliases are used for keyword options

* Conditionally run test if sshpass is present, fix sanity

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2020-08-08 09:06:32 +10:00
5f8b45a70e Updating Getting Started with Resources section #68962 (#71102)
* Updating Getting Started with Resources section #68962
* Add links, including Workshops URL #68962
2020-08-07 16:09:19 -05:00
7c60dadb9a Updates to Integration tests to pass against Alpine (#70946)
* Start of alpine testing

* More updates

* Add forgotten file

* remove debug

* Add alpine3

* equal

* group 4

* group 4

* group 5

* Try to decrease test length

* libuser only available in testing

* Remove debug

* Make loops target work on hosts without gnu date

* Enable alpine testing

* ci_complete

* Don't specify uid for creating test user

* ci_complete

* Re-sort docker completion

* use newer container image

* ci_complete

* fix indentation

Co-authored-by: Matt Clay <matt@mystile.com>

Co-authored-by: Matt Clay <matt@mystile.com>
2020-08-07 14:28:10 -05:00
56748a8060 remove network for 2.10 base porting guide (#71158) 2020-08-07 14:27:01 -05:00
abe4a1d533 remove network section from base porting guide (#71157) 2020-08-07 14:26:49 -05:00
410b6a7109 Update integration tests to support rpmfluff-0.6 (#71155) 2020-08-07 14:09:09 -05:00
050841324c ansible-test: bump acme test container version to 2.0.0 (#71097) 2020-08-07 09:34:52 -07:00
0a9638ce4b Update the porting guide for ansible-2.10.0a8 (#71141) 2020-08-07 12:22:02 -04:00
2f77606aa1 Add CVE reference to changelog for PR 70762 (#71151) 2020-08-07 10:55:09 -05:00
37a7485ac8 Fix version comparison for determining what ansible to build against
* The version comparison for determining what ansible package to build
  docs against was comparing the version number for ansible-base but it
  needed to check the version number for ansible instead

* add a comment about some bad logic than needs to be fixed after 2.10.0
2020-08-07 07:59:59 -07:00
6ac4439a6a Drop "rhui-" prefix from RHEL repositories in AMI (#71130)
The repository names seem to have changed and no longer have the "rhui-" prefix
2020-08-06 16:07:35 -05:00
6bf1dd428b Update 70762 changelog to use security_fixes (#71124) 2020-08-06 14:58:56 -05:00
fb9c9570d5 Fixes due to branch being renamed (#71115)
The ansible collection repository correctly renamed their default branch from `master` to `main`, which has caused a number for broken urls. This PR fixes those urls.
2020-08-06 14:14:27 -05:00
cb9336ab6d Docs: Fix typo (#71119)
Fix typo
2020-08-06 14:12:33 -05:00
fbfc0f99eb Make changelog tool be more strict about suffixes (#70909)
* Bump antsibull-changelog version.

* Flag all dotfiles, except .keep and .gitkeep.

* Enable ignoring other fragment extensions.
2020-08-06 10:49:39 -05:00
4e55b93613 virt facts: allow guest/host to have >1 virt tech (#70832)
Change:
- Allow systems to declare multiple virt techs. For example if a system
  is both a docker container, but virtualized on KVM, show both. If a
  system is set up to run virtualbox and KVM VMs, show both.

- This is done by introducing new facts keys:
  - virtualization_tech_guest
  - virtualization_tech_host

- Backwards compatibility is preserved by keeping track of the previous
  return-points and refusing to update those keys after we would have
  returned, but now returning them at the end, so that the new keys can
  accumulate their data.

Test Plan:
- Local
- CI

Tickets:
- Refs #66304
- Refs #17151
- Refs #17058
- Probably others

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-08-06 09:45:37 -05:00
fc83055425 Fix changelog fragment type. (#70902) 2020-08-05 15:32:31 -04:00
fb144c4414 Update ansible doc formats (#71070)
* Fix tty_ify bugs and refactor

* Move tty_ify() and supporting attributes to the DocCLI class as that's
  the only thing using it.
* Add unittest for the code.
* Fix a bug where the substitution macros can be detected when they are
  a part of another word.
* Add support for L(), R(), and HORIZONTALLINE which were added to the
  website docs many years ago.

* Update test/units/cli/test_doc.py

Co-authored-by: Matt Clay <matt@mystile.com>

Co-authored-by: Matt Clay <matt@mystile.com>
2020-08-05 10:53:25 -07:00
662d34b9a7 add jinja2 global to reserved names (#71088)
* add jinja2 global to reserved names

  also allow expansion by additional context provided from caller

  fixes #41955

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-05 10:43:31 -04:00
504ef607f3 Misc typo fixes (#71089) 2020-08-05 10:16:44 +05:30
aab9beccf7 Remove ANSIBLE_COLLECTIONS_PATHS dep warning (#71094) 2020-08-05 07:38:35 +10:00
f9af27c631 dont clobber facts in loop (#71032)
* dont clobber facts in loop

	fixes #71031
2020-08-04 15:41:42 -04:00
72d3d44163 add note to uninstall older versions of ansible for pip (#71023)
* add note to uninstall older versions of ansible for pip

* combine with the other PR
2020-08-04 13:39:24 -05:00
0d7c144ce4 Allow macOS ACLs to work for unpriv -> unpriv (#70785)
Change:
- Use `chmod +a` in the fallback chain to allow MacOS to use ACLs to
  allow an unprivileged user to become an unprivileged user.

Test Plan:
- CI, new tests

Tickets:
- Fixes #70648

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-08-04 14:32:48 -04:00
79f7104556 Update platform_index.rst (#70927) 2020-08-04 14:31:37 -04:00
0055673c70 VMware: Inventory scenario guide for hostnames (#71055)
Added a scenario guide for ``hostnames`` parameter
for vmware_vm_inventory.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-04 14:30:33 -04:00
4e27569347 Add more include and yaml parsing tests (#70506)
These additional tests should provide coverage for features currently tested by the postgres incidental tests.
2020-08-04 11:24:52 -07:00
cdcf0aa42a Intentional coverage, incidental_azure_rm_resource (#71052)
Change:
- Adds some intentional coverage around PluginLoader for cases that
  incidental_azure_rm_resource covered.
- Specifically, modules starting with an underscore, and starting with
  an underscore but a symlink.

Test Plan:
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-08-04 12:53:31 -05:00
8af3079640 Add intentional coverage for incidental_lvg (#71043)
Change:
- Add hardware_facts test target which manually sets up some LVM devices
  and tests facts against them.

Test Plan:
- New integration tests

Tickets:
- Refs #71041 and #71042 both of which I discovered during this

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-08-04 12:52:38 -05:00
810a9a5593 find: Allow reading whole file for contains regex (#71083)
Change:
- Add a parameter `read_whole_file` which allows for reading the whole
  file when doing a `contains` regex search.
- This allows for (for example) matching a pattern at the very end of
  a file.

Test Plan:
- New integration tests

Tickets:
- Fixes #63378

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-08-04 12:49:45 -05:00
5ca3aec3c4 native types: properly handle Undefined in nested data (#68432) 2020-08-04 19:06:07 +02:00
3bec27dc34 Allow cache_timeout=0 to reach inv. cache plugins (#70977)
Change:
- Previously, `cache_timeout=0` was seen as falsey and not passed along
  to cache plugins as an option. Now only "nulley" values are not sent.

Test Plan:
- New integration tests

Tickets:
- Fixes #70702

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-08-04 11:54:28 -05:00
a9eb8b0488 Add some documentation for the format of meta/runtime.yml (#71035)
* Document the format of meta/runtime.yml

* Document multiple Ansible versions

Clarify difference between deprecation and tombstone fields

* add note
2020-08-04 11:25:08 -04:00
f6b3b4b430 ansible-galaxy - fix download for subdirs in SCM (#71005) 2020-08-04 11:10:00 -04:00
4bd7580dd7 Fix fortimanager httpapi redirect (#71073)
* The fortimanager httpapi plugin is in fortinet.fortimanager, not in fortinet.fortios.

* Add changelog fragment.
2020-08-04 05:42:46 +01:00
86b6c4bbb6 fix collection package root location under pytest >=6.0.0 (#70963) 2020-08-03 17:31:32 -07:00
b53e7f8720 Fix ansible-test self-test change classification.
Changes to sanity and unit tests now trigger the ansible-test self-test integration tests.

No changelog entry since this only affects tests for ansible itself and not collections.
2020-08-03 15:24:54 -07:00
7f62a9d7b5 Make cache adjudicator's flush call plugin flush (#70987)
Change:
- Previously CachePluginAdjudicator#flush only removed entries from the
  cache backend that it knew about by using them earlier. Now it calls
  the underlying plugin's flush() method.

Test Plan:
- New unit tests

Tickets:
- Fixes #68770

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-08-03 17:16:15 -05:00
8313cc8fb1 Warning banner should only show on /devel/ docs, not on pages with 'devel' in their titles (#70849)
* banner should not be placed on pages with 'devel' in their titles

* Update docs/docsite/_themes/sphinx_rtd_theme/ansible_banner.html

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

* Only match paths at the beginning

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
2020-08-03 16:56:55 -04:00
11a31e99e6 added note about fakeroot (#71018)
see #70895
2020-08-03 16:36:26 -04:00
a0523e5b8a Update documentation of httpapi's handle_httperror method for clarity (#70991) 2020-08-03 16:35:00 -04:00
4f4436c124 updates changelog types; some updates for easier translation (#71027)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2020-08-03 13:46:41 -04:00
e10902d744 Add the ansible_2_10 intersphinx reference. (#71028)
There are links from the scenario guides to collections but collections
docs aren't built in testing or locally when we're on the devel branch.
Due to that we need to make sure those references resolve to the
production docsite.  We can use intersphinx to make sure that happens.

* The test for binary files wasn't reading enough of the file.

Checking for null bytes in the first 1024 bytes failed to diagnose the
ansible_2_10.inv file as binary
2020-08-03 12:31:36 -05:00
a6725d6e2a docs: Add a note about package requirements for fact gathering (#70796)
Fixes: #26148

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-03 12:09:40 -05:00
864573a38d Document common return values with examples (#71046)
* adding return value examples
* shift to console code blocks
* cleaning up whitespace and shortening invocation example
* reordering diff section
2020-08-03 11:51:58 -05:00
991714b9d1 copy - redact 'content' from invocation in check mode (#71033)
* sanitize copy module invocation secrets in check mode
2020-08-03 11:41:45 -04:00
9850915bd6 Update intro_getting_started.rst (#71039)
Added two additional learning resources in the See also: section- forgot closing backticks
2020-08-03 10:35:36 -05:00
74c14c6743 Strip spaces in module names in explicit actions (#71040)
* Strip spaces in module names in explicit actions

Change:
- When an action is called like "action: copy foo=bar", strip spaces
  around the action name.
- This allows "action: copy        foo=bar" to work as expected.

Test Plan:
- New integration tests

Tickets:
- Fixes #62136

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-08-03 11:30:45 -04:00
701c638757 Document string tests a bit more (#71049)
- Explain how `regex` differs from `match` and `search`.
- Document `multiline` and `ignorecase`.

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-08-03 10:19:20 -05:00
0c855dc70b Guide users to use ansible-runner (#71063)
Update the docs to guide users to use `ansible-runner` instead of using Python API directly. In many use cases, executing Ansible playbooks are sufficient. In those use cases, `ansible-runner` is easier and much stable to use comparing with Python API, but there is no mention of it.
2020-08-03 10:15:37 -05:00
6160e82bf2 Update network integration auth timeout (#71057)
*  Incase of network integration test for connection local
   test the paramiko_ssh auth_timeout is the value of timeout
   under defaults section which is 10 seconds.
*  For slower connection 10sec timout value result in authentication
   timeout error hence increase the timeout value to 90 seconds
2020-08-03 19:28:30 +05:30
96aa81e8ff Remove incidental_azure_rm_mariadbserver tests (#71037)
Change:
- Remove incidental test which has no remaining incidental coverage.

Test Plan:
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-08-01 15:34:35 -05:00
54bee7152b Update network platform guides with FQCN (#70699)
* fqcn all the docs things!
2020-07-31 15:57:57 -05:00
61b36c6f30 Porting guides for ansible-base 2.10 and ansible 2.10 (#70891)
* Fix changelog link title.

* Rename Ansible 2.10 and 2.11 porting guides to Ansible-base porting guides.

* Add stub for automatically generated 2.10 porting guide.

* Move things that should not be in the ansible-base porting guide to the ansible porting guide.

* Apply changes to base porting guides.

* Add remark that ansible-base is mainly for developers.

* Ansible Base -> Ansible-base

* Fix link in base porting guide.

* Add generated porting guide.

* Use same header signs as antsibull-changelog's RST builder.

* Update generated porting guide.
2020-07-31 15:28:18 -05:00
698efb8981 'Foreport' changes to 2.10 porting guide from stable-2.10 to devel. (#71024)
Without this, this change would get lost when backporting #70891, or would make backporting a lot harder.
2020-07-31 12:53:23 -05:00
5019335660 Document how to upgrade to ansible with pip (#70768)
Fixes #70348
2020-07-31 13:13:54 -04:00
75e8da0950 hacking: fix announce script version parsing (#71008)
Change:
- Fix a bug where rc/beta versions throw off the "is this an
  ansible-base release"? check.

Test Plan:
- Used it for 2.10.0rc4

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-30 21:28:43 -05:00
f99f96ceb6 Fix unstable unarchive test (#71004)
* Add mode to copy tasks
* Fix unreliable test by ignoring errors
2020-07-30 19:25:45 -04:00
58145dff9c document how to migrate between collections (#70243)
* document how to migrate between collections
* Apply suggestions from code review

Co-authored-by: John R Barker <john@johnrbarker.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2020-07-30 15:51:53 -05:00
9879da8e23 DOCS: add 2.10 collections roadmap (#70975)
* draft of 2.10 collections roadmap

* incorporates feedback from felixfontein

* gundalow and samccann feedback, fix link

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2020-07-30 16:26:03 -04:00
bf7276a4e8 Emit proper error for x in y when y is undefined (#70990)
Fixes #70984
2020-07-30 15:57:01 -04:00
d62dffafb3 Add latest rc from ansible-base (#70974)
* Add latest rc from ansible-base
2020-07-30 14:56:56 -05:00
8c48366f1c Document to_json will convert to ASCII strings by default (#70954)
... as reported in issue #68702
2020-07-30 14:45:40 -05:00
e28b20d729 remove github link from plugins (#70951) 2020-07-30 14:43:07 -05:00
ac5f3f8bef unarchive - Check 'fut_gid' against 'run_gid' in addition to supplemental groups (#65666)
Add integration tests for unarchiving as unprivileged user
Break tasks into separate files for easier reading and maintenance

Create a user by specifying a default group of 'staff' for macOS.

The user module does not actually remove the user directory on macOS,
so explicitly remove it.

Put the removal tasks in an always block to ensure they always run

Co-authored-by: Philip Douglass <philip.douglass@amadeus.com>
Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-07-30 15:28:05 -04:00
e139739ab3 iptables: Add a note about ipv6-icmp (#70915)
ipv6-icmp ping is valid protocol and adding note about
it in protocol parameter.

Fixes: #70905

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-30 14:16:43 -05:00
54e2ae79e7 fix downloading collections in git repos and tar.gz artifacts (#70524)
* Fix downloading tar files

* Fix downloading SCM collections

* changelog
2020-07-30 13:55:29 -04:00
e6bf202738 linux facts - return proper broadcast address (#64528)
* linux facts - return proper broadcast address

Check that the value being returned is actually a broadcast address

* Add tests

* Cleanup tests
2020-07-30 19:40:14 +02:00
c4f442ed5a facts - fix incorrect time for some date_time_facts (#70665)
The iso8601_micro and iso8601 facts incorrectly called now.utcnow(), resulting
in a new timestamp at the time it was called, not a conversion of the previously
stored timestamp.

Correct this by capturing the UTC timestamp once then calculating the local
time using the UTC offset of the current system.

* Use time.time() for getting the current time
* Convert from that stored epoch timestamp to local and UTC times
* Used existing timestamp for epoch time
* Add unit tests that validate the formate of the return value rather than an exact value since mocking time and timezone is non-trivial
2020-07-30 11:39:58 -04:00
2e0097ada3 Fix ansible-test relative import analysis. 2020-07-30 08:05:28 -07:00
fcea87926f Support manjaro arm in hostname module (#69861) 2020-07-30 13:52:19 +05:30
dc79528cc6 Fix warning for new default permissions when mode is not specified (#70976)
Follow up to #70221
Related to #67794
CVE-2020-1736

When set_mode_if_different() is called with mode of 'None', ensure we issue
a warning about the change in default permissions.

Add integration tests to ensure the warning works properly.

* Fix tests
- actually use custom module 🤦‍♂️
- verify file permission on created files
- use remote_tmp_dir so we're ready for split controller
- improve test module so we can skip the call to set_fs_attributes_if_different()
- fix tests for CentOS 6
2020-07-30 00:05:29 -04:00
14dc4de424 Update docs for --tags default, and add some tests (#70939)
Change:
- Clarify that not passing `--tags` will cause `ansible_run_tags` to
  default to `["all"]`.
- Add some extra coverage around `ansible_run_tags`

Test Plan:
- New integration and unit tests

Tickets:
- Fixes #69619

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-29 17:16:57 -05:00
b1cb2553af ansible-galaxy - fix fallback for AH searches (#70957) 2020-07-30 07:28:43 +10:00
7f0c84ea15 Update module debugging docs (#70847)
- Combine remote and local debugging instructions.
- Update the example code to match current AnsiballZ structure and behavior
- Change reference name and update references
- Clarify how PYTHON path is modified
- Also add note about other remote debugging tools.

Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2020-07-29 12:14:49 -04:00
a24f51d9e5 package - use existing list of package manages from facts (#70920) 2020-07-29 12:08:11 -04:00
73a9ad9aea ansiballz - remove deprecated excommunicate command (#70921) 2020-07-29 12:05:12 -04:00
20a7476064 git: verify, only use --raw when we need it (#70900)
Change:
- Allow older git to verify tags again
- Enable verification tests everywhere, even if most of them only work
  on newer git. Some of them work on older git and they test the --raw
  parameter.

Test Plan:
- Re-enabled subset of git tests

Tickets:
- Fixes #64469

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-29 10:45:51 -05:00
f9c3c6cba6 Allow changed/failed mgmt on strategy actions (#70919)
* Allow changed/failed mgmt on strategy actions
2020-07-29 10:44:46 -04:00
37e9d2278a Fix a typo in "restart mysql" example (#70950)
Fix a typo in "restart mysql" example task. It's missing a space between "state:" and "restarted".
2020-07-29 11:46:16 +05:30
69e5c6c14a Update network_best_practices_2.5.rst (#70962)
Fix a small typo in the playbook tasks sample section
2020-07-29 11:41:18 +05:30
748ba96610 How to use rst :ref: for modules in collections (#70567) 2020-07-28 17:40:16 -05:00
3a8ac62596 Cap pytest version to avoid relative import issue. 2020-07-28 14:51:39 -07:00
787e6108e0 Document galaxy install from local clones (#70941) 2020-07-28 14:05:28 -04:00
5c8520fbd9 Fix verbosity for var_templating test (#70943)
* Fix verbosity for var_templating test

Display the subtests

* fix specificity and set ANSIBLE_BECOME_ALLOW_SAME_USER

Co-authored-by: Matt Martz <matt@sivel.net>

Co-authored-by: Matt Martz <matt@sivel.net>
2020-07-28 12:02:43 -05:00
c19a10e13a RHEV virt facts: Detect vdsmd in addition to vdsm (#70901)
Change:
- Look for the `vdsmd` process in addition to `vdsm` as before.

Tickets:
- Fixes #66147

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-28 11:35:34 -04:00
7d32129efb [dnf] show installations/removals in check_mode (#70892)
Change:
- Previously, we only showed that something would have changed, not what
  would have changed. This allows us to show what will chang as well.

Test Plan:
- Local RHEL8 VM
- New integration tests

Tickets:
- Fixes #66132

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-28 11:23:55 -04:00
ae42d5ebdc remove jose-delarosa - new job (#70884) 2020-07-28 11:12:03 -04:00
8fb8f1b2a0 fix changelog link (#70883) 2020-07-28 11:11:15 -04:00
7e2cc7db12 validate-modules: fix version_added validation for top-level, fix error codes (#70869)
* Also validate top-level version_added.

* Fix error code.

* Produce same version_added validation error in schema than in code (and stop returning it twice).

* Return correct error codes for invalid version_added for options and return values.

* Add changelog.

* Fix forgotten closing braket.

* Accept 'historical' for some top-level version_added.
2020-07-28 10:10:35 -05:00
45c2eb6c0a lineinfile - fix broken exception handling (#70846)
* prevent (ExceptionType) is not subscriptable errors
* tweak error message and use text conversion
* add to_text import
2020-07-28 10:30:32 -04:00
be4be926c4 subversion Give subversion module a validate_certs option (#70890)
* Give subversion module a validate_certs option

Change:
- Add `validate_certs` option to subversion module. Defaults to off for
  backwards compatibility.

Tickets:
- Fixes #22599

Signed-off-by: Rick Elrod <rick@elrod.me>

* Update changelogs/fragments/22599_svn_validate_certs.yml

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

* test verify_certs codepaths

Signed-off-by: Rick Elrod <rick@elrod.me>

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-27 14:18:54 -04:00
4cc4cebc97 reboot - fix Void Linux (#70704)
Add entry for appropriate commands for Void Linux
2020-07-27 09:39:36 -04:00
9d2982549d dnf: Add nobest option (#70318)
* dnf: Add nobest option

* dnf: Fix indent, add nobest specifically to dnf not yum

* Add changelog for dnf: add nobest option

* dnf: Add nobest to yumdnf module argument_spec

* dnf: remove nobest from module paramaters in yumdnf.py

* dnf: Add test for nobest option

* dnf: Cleanup packages in nobest test at last

* dnf: Cleanup manually added repos in nobest test at last

* dnf: Remove dnf-plugins-core as well in nobest test

* dnf: Change nobest release version to 2.11

* Change changelog number according to change in PR number

* Change changelog number according to change in PR number
2020-07-27 12:02:07 +02:00
205eda335f [ansible_builtin_runtime.yml] fix text[fs]m typo (#70893)
Change:
- textsfm -> textfsm

Test Plan:
- Out-of-band ansible_builtin_runtime.yml checker script

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-25 17:44:43 -05:00
1223ce656a reset logging to INFO (#70878)
- due to CVE-2019-14846
 - also added comments and test to avoid 'oportunistic' reversion
2020-07-24 15:53:17 -04:00
9c12f20f27 Update the number of contributors in README: 5000+ (#70880) 2020-07-24 21:48:23 +02:00
953aa26286 Get serial number of NVMe device without sg_inq (#70284)
* Get serial number of NVMe device without sg_inq

* Add changlelog for #70284

* Use get_file_content() to get serial number from a file
2020-07-24 00:35:10 -05:00
8b96caf712 Update ansible-base test container to 1.5.0. (#70856) 2020-07-23 20:49:57 -05:00
21ac550828 virtualization facts: check /dev/kvm as a fallback (#70829)
Change:
- On Linux, there are situations where a host might be a KVM host but
  not have the kernel module enabled (it might be compiled in instead).
  In these cases, /dev/kvm will still exist, and rather than reporting
  NA, we should report that the host is a KVM host.

Test Plan:
- Local

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-23 19:50:04 -05:00
5e1a968983 Do not add connection vars to the output results (#70853)
* Do not add connection vars to the output results

* Also revert the delgated scenario JIC

* Added regression test
2020-07-24 09:53:08 +10:00
7a42d27462 Proper example for splitext filter in docs (#70494)
* Update playbooks_filters.rst with a clear example of how to extract its 2 tokens. 

Co-authored-by: Sloane Hertel <shertel@redhat.com>
2020-07-23 15:07:55 -05:00
20bb915092 Refactor Python API examples and docs
PR #70446: it's a follow-up for #70445.

It includes a merge of `examples/scripts/uptime.py` and a similar
code snippet from `docs/docsite/rst/dev_guide/developing_api.rst`.

This patch also changes the docs RST file to include contents of
the example file instead of holding a copy of a similar code.
2020-07-23 18:24:02 +02:00
4c0af6c808 fix internal cases of actions calling unqualified module names (#70818)
* fix internal cases of actions calling unqualified module names

* add porting_guide entry
* misc other fixes around action/module resolution broken by redirection

ci_complete

* Update docs/docsite/rst/porting_guides/porting_guide_2.10.rst

Co-authored-by: Rick Elrod <rick@elrod.me>

* Update docs/docsite/rst/porting_guides/porting_guide_2.10.rst

Co-authored-by: Rick Elrod <rick@elrod.me>

* address review feedback

* pep8

* unit test fixes

* win fixes

* gather_facts fix module args ignores

* docs sanity

* pep8

* fix timeout test

* fix win name rewrites

Co-authored-by: Rick Elrod <rick@elrod.me>
2020-07-23 09:02:57 -07:00
b28d59124b WIP: add collections as an intersphinx link (#70826)
* adds collections as a ref for intersphinx

* no need for intersphinx

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2020-07-23 08:44:05 -07:00
e439194c8c basic: Add name of aliases in error message (#69427)
With this patch, user will be notified with available aliases
of arg parameter.

Fixes: #58752

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-23 16:02:18 +05:30
5260527c4a Change default file permissions so they are not world readable (#70221)
* Change default file permissions so they are not world readable

CVE-2020-1736

Set the default permissions for files we create with atomic_move() to 0o0660. Track
which files we create that did not exist and warn if the module supports 'mode'
and it was not specified and the module did not call set_mode_if_different(). This allows the user to take action and specify a mode rather than using the defaults.

A code audit is needed to find all instances of modules that call atomic_move()
but do not call set_mode_if_different(). The findings need to be documented in
a changelog since we are not warning. Warning in those instances would be frustrating
to the user since they have no way to change the module code.

- use a set for storing list of created files
- just check the argument spac and params rather than using another property
- improve the warning message to include the default permissions
2020-07-22 17:05:38 -04:00
bf98f031f3 Sanitize URI module keys with no_log values (#70762)
* Add sanitize_keys() to module_utils.

* More robust tests

* Revert 69653 change

* Allow list or dict

* fix pep8

* Sanitize lists within dict values

* words

* First pass at uri module

* Fix insane sanity tests

* fix integration tests

* Add changelog

* Remove unit test introduced in 69653

* Add ignore_keys param

* Sanitize all-the-things

* Ignore '_ansible*' keys

* cleanup

* Use module.no_log_values

* Avoid deep recursion issues by using deferred removal structure.

* Nit cleanups

* Add doc blurb

* spelling

* ci_complete
2020-07-22 14:49:37 -05:00
1733253297 Modification of 'Adding modules and plugins locally' topic (#70659)
* Remediated the topic to comply with IBM style guide and minimalism practices
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2020-07-22 11:59:18 -05:00
34f18a97f4 Add ansible-releases@redhat.com to announce template (#70812)
Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-22 11:08:32 -05:00
84adaba6f5 Allow hostvars delegation (#70331)
* ensure hostvars are available on delegation
* also inventory_hostname must point to current host and not delegated one
* fix get_connection since it was still mixing original host vars and delegated ones
* also return connection vars for delegation and non delegation alike
* add test to ensure we have expected usage when directly assigning for non delegated host
2020-07-22 11:13:57 -04:00
06a4fc2833 Document existing ansi_re sequences and add ESC[m (#70683)
* Document existing ansi_re sequences and add `ESC[m`

* Add changelog
2020-07-22 08:56:21 -04:00
b7ee07215d Update Molecule support contact (#70797)
As Molecule started to use https://github.com/ansible-community/molecule/discussions we need to update documentation before retiring
the molecule-users mailing list.
2020-07-22 11:53:52 +01:00
481cd30129 runtime: aws_netapp_cvs_filesystems (#70781) 2020-07-22 11:15:48 +01:00
8cccede0d4 basic: use PollSelector implementation (#70352)
Some platform such as ESXi does not implement EpollSelector,
which is selected by DefaultSelector. Use SelectSelector which is
based upon 'select' implementation. This works perfectly with
a platform like VMware ESXi.

Fixes: #70238

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-22 09:18:21 +05:30
96b74d3e0b Ensure single vaulted values aren't counted as sequences. Fixes #70784 (#70786) 2020-07-21 16:48:35 -05:00
2a7df5e07b add note for write permission on rst files (#70766)
* add note for write permission on rst files
* Update docs/docsite/rst/community/documentation_contributions.rst

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2020-07-21 16:00:47 -05:00
24e5d3a51c fix rstcheck problem and gitignore collections dir (#70764) 2020-07-21 15:59:56 -05:00
97cd1a4b82 Modernize GitHub pull-request template (#70787)
Change:
- Remove "New Module Pull Request" since we're not taking new modules in
  ansible/ansible
- Add "Tests Pull Request" to use for things like adding coverage that
  aren't bugfixes.

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-21 15:06:27 -05:00
0ead4306a8 user - Create home and parent directories only when requested (#70600)
The home user and the parents directories should only be created when
create_home == True
2020-07-21 15:50:44 -04:00
5ce47646ad cron - Allow non-ascii (UTF-8) chars in cron file paths and jobs (#70426)
* Encode/Decode files in UTF-8
* Use helper function in ansible
* Add an integration test
* Use emoji in test data.
* add changelog
* Also support non-ascii chars in filepath and add tests about this.
* Also use non-ascii chars in replaced text and ensure not to break cron syntax.
* rename self.existing to self.n_existing
* rename crontab.existing to crontab.n_existing
2020-07-21 15:00:21 -04:00
4f96f9826c distribution: Add support for DragonFly (#70748)
partially fixes #43739

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-21 13:47:11 -04:00
1e0d83524c runtime os_image_facts is now called os_image_info (#70776) 2020-07-21 11:45:26 -04:00
8188bce0ff Redirect restored modules to community.general. (#70769) 2020-07-21 07:46:03 +01:00
69472a5f8d Refactor _fixup_perms2 to remove way-nested logic (#70701)
Change:
- Refactoring to make it harder to get wrong and easier to read.
- Generalize become_unprivileged tests and fix some that never worked
  but also never failed.

Test Plan:
- CI, new units/integration tests

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-20 18:46:47 -05:00
707e8b6e0c ansible_builtin_runtime.yml fixes (#70767)
* Correct name is modules, not mso: https://github.com/CiscoDevNet/ansible-mso/blob/master/plugins/doc_fragments/modules.py

* The port_ went missing.

https://github.com/CiscoDevNet/ansible-aci/blob/master/plugins/modules/aci_interface_policy_port_channel.py
https://github.com/ansible/ansible/blob/stable-2.9/lib/ansible/modules/network/aci/aci_interface_policy_port_channel.py

https://github.com/CiscoDevNet/ansible-aci/blob/master/plugins/modules/aci_interface_policy_port_security.py
https://github.com/ansible/ansible/blob/stable-2.9/lib/ansible/modules/network/aci/aci_interface_policy_port_security.py

* Fix typo.
2020-07-20 15:38:50 -07:00
eb06488e1d Remove preview status from TOML inventory (#70770) 2020-07-20 17:47:29 -04:00
1e3989c9f7 Need to return any error code from running antsibull-docs (#70763)
This way we fail early if there's a problem
2020-07-20 14:05:01 -07:00
59513ae673 Fix incorrect statement to set a variable for a playbook (#70712)
Fixes #70638
2020-07-20 13:45:40 -05:00
92e16c2838 Few fixes for reference_appendices/faq.html (#70719)
* Format using `` instead of `, add line breaks for long lines, rephrase or remove useless text.
Move some text.

* Add clearer version of OpenSSh is affected by SCP bug

* Review some pages using ansible doc writing guide.
2020-07-20 13:43:39 -05:00
fb3db170cc Make Sources, Plugins sections easier to read (#70652)
Re-wrote the Inventory Sources section and also the next section to have shorter, clearer sentences with a more active voice.
2020-07-20 13:30:06 -05:00
f9bb5c9c5a dellemc related module name changes (#70749)
* dellemc related module name changes

* Addressing review comments
2020-07-20 18:53:24 +01:00
54b002e1ac Guard against allowing ansible to ansible-base upgrades (#70529)
* Guard against allowing ansible to ansible-base upgrades

* newline

* use alias

* Add an explicit line detailing this is a 1 time thing

* period

* Read __version__ and __author__ rather than import, update working, and add ability to skip conflict checks

* Remove commented code

* Re introduce removed changes from rebase

* Just use open

* Nuke unused import
2020-07-20 11:57:43 -05:00
77d0effcc5 Fix missing quoting for remote_tmp in second mkdir of shell module. Issue #69577 (#69578)
* Fix missing quoting for remote_tmp in second mkdir of shell module. Issue #69577

* adding changelog

* fixing typo in changelog entry

* adding test case

Adding test case written by bmillemayhias.

* using $HOME instead of ~

* fixing commit measage

* Update 69578-shell-remote_tmp-quoting.yaml

Co-authored-by: Brian Kohles <me@briankohles.com>
2020-07-20 11:25:29 -05:00
84b4387702 debconf: add a note about no_log usage (#70738)
debconf module exposes sensitive information to logs, console.
Add a note to user about using no_log=True to hide such
information from console.

Fixes: #32386

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-20 21:08:13 +05:30
633c2d0522 Fix misleading documentation for naming blocks (#68458)
From what I have observed it is the block itself that doesn't support the name attribute rather than the tasks inside the block.

* Update docs/docsite/rst/user_guide/playbooks_blocks.rst

Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2020-07-20 09:48:53 -05:00
2811d9486f Update default from True to False for CONDITIONAL_BARE_VARS (#70709)
ci_complete
2020-07-20 09:29:31 -05:00
c1402ddee0 validate_modules: added missing single quote (#70744)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-20 09:26:17 -05:00
cf217178c7 Followup to #70610: fix ansible_builtin_runtime.yml redirects to wrong collections (#70725)
* Followup to #70610: fix redirects to wrong collections

* gcp module_utils is in community.general.

* dellos10_* modules are in dellemc_networking.os10, not dellemc.os10.

* intersight_facts was renamed to intersight_info in cisco.intersight in version 1.0.7.

* Fix more dellos10 redirects.
2020-07-19 20:16:52 -05:00
8915f262b4 misc typo fixes (#70736)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-19 18:51:29 -05:00
f90aa5599f Don't treat empty excludes as a match. Fixes #70640 (#70710) 2020-07-17 17:34:24 -04:00
566c5e6ce1 Handle Slackware OS version strings containing a plus (“+”) (#68142)
A couple of years ago Slackware -current began using a plus (“+”) at the end of the distribution version string to indicate a future version work-in-progress.

Rearrange distribution_files unit tests to easily support more tests
  - add conftest with common fixtures 
  - use parametrize for testing multiple scenarios

* Add changelog
* Add unit tests for Slackware distribution parsing
* Use correct fixtures for Slackware
Data comes from /etc/slackware-version

Co-authored-by: Sam Doran <sdoran@redhat.com>
Co-authored-by: <Eduard Rozenberg <eduardr@pobox.com>>
2020-07-17 16:39:26 -04:00
154efd97f2 win async - use full path for powershell (#70703) 2020-07-18 06:08:29 +10:00
9dda393d70 Collections docs generation (#59761)
* Build documentation for Ansible-2.10 (formerly known as ACD).

Builds plugin docs from collections whose source is on galaxy

The new command downloads collections from galaxy, then finds the
plugins inside of them to get the documentation for those plugins.

* Update the python syntax checks
  * docs builds can now require python 3.6+.

* Move plugin formatter code out to an external tool, antsibull-docs.
  Collection owners want to be able to extract docs for their own
  websites as well.
* The jinja2 filters, tests, and other support code have moved to antsibull
* Remove document_plugins as that has now been integrated into antsibull-docs

* Cleanup and bugfix to other build script code:
  * The Commands class needed to have its metaclass set for abstractmethod
    to work correctly
  * Fix lint issues in some command plugins

* Add the docs/docsite/rst/collections to .gitignore as
  everything in that directory will be generated so we don't want any of
  it saved in the git repository
* gitignore the build dir and remove edit docs link on module pages

* Add docs/rst/collections as a directory to remove on make clean
* Split the collections docs from the main docs

* remove version and edit on github
* remove version banner for just collections
* clarify examples need collection keyword defined

* Remove references to plugin documentation locations that no longer exist.
  * Perhaps the pages in plugins/*.rst should be deprecated
    altogether and their content moved?
  * If not, perhaps we want to rephrase and link into the collection
    documentation?
  * Or perhaps we want to link to the plugins which are present in
    collections/ansible/builtin?

* Remove PYTHONPATH from the build-ansible calls
  One of the design goals of the build-ansible.py script was for it to
  automatically set its library path to include the checkout of ansible
  and the library of code to implement itself.  Because it automatically
  includes the checkout of ansible, we don't need to set PYTHONPATH in
  the Makefile any longer.

* Create a command to only build ansible-base plugin docs
  * When building docs for devel, only build the ansible-base docs for
    now.  This is because antsibull needs support for building a "devel
    tree" of docs.  This can be changed once that is implemented
  * When building docs for the sanity tests, only build the ansible-base
    plugin docs for now.  Those are the docs which are in this repo so
    that seems appropriate for now.
2020-07-17 13:07:35 -07:00
ca5197f784 package_facts - correct package parsing for apk (#70668)
* remove atoms, use rsplit instead of regex
2020-07-17 11:03:49 -04:00
c616e54a6e refactor Python module_utils locator (#70610)
* refactor Python module_utils locator

* no longer recursive
* embed special-case module code internally
* share common code between collections/not cases
* fixes #70134
* properly support subpackage redirection
* adds support for FQCN redirect targets used by migration (expands to FQ Python name)
* add tests

* add changelog
2020-07-16 17:57:47 -07:00
b479adddce move firewalld to ansible.posix (#70692)
Signed-off-by: Adam Miller <admiller@redhat.com>
2020-07-16 15:16:09 -05:00
58d24584c0 Pipe lookup plugin usage example documentation fix (#70679) 2020-07-16 13:52:14 -04:00
8c213c9334 template connection variables accessed directly before using (#70657)
* template variables accessed directly when using them instead of FieldAttributes
2020-07-16 11:21:39 -04:00
055871cbb8 api: time.clock compatible code (#70650)
time.clock is removed in Python 3.8. Add time.clock
compatible code.

Fixes: #70649

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-16 12:24:22 +05:30
4a735adc21 fix typo in changelog (#70673)
Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-15 18:45:44 -05:00
08b20c9c08 Fix spelling errors. (#70664) 2020-07-16 01:43:22 +02:00
9d27d7c8b1 ansible_runner test - Add constraints (#70667)
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
2020-07-15 18:22:44 -04:00
8455bc6838 Some more coverage for csvfile (#70661)
* Some more coverage for csvfile

Change:
- Add a few tests

Test Plan:
- CI, new tests

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-15 14:44:52 -05:00
02c63ec285 update roadmap rc1 date (#70662) 2020-07-15 11:47:36 -07:00
112aa574f5 dont recommend copy content in template (#70658)
* remove content ref in template

  fixes #63484
2020-07-15 13:16:56 -05:00
57b548598c add alpine apk package manager to package_facts [wip] (#70587)
* add alpine apk package manager to package_facts
2020-07-15 12:40:25 -04:00
e1a33a6a84 inventory_hostnames lookup plugin -> 100% coverage (#70628)
Change:
- Add tests to get inventory_hostnames up to 100% coverage.

Test Plan:
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-15 11:31:48 -05:00
01e30993fd Get subelements lookup plugin coverage to 100% (#70634)
Change:
- Add a bunch of tests to bump coverage to 100%

Test Plan:
- CI, new tests

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-15 11:00:57 -05:00
db354c0300 Docs: User guide overhaul, part 5 (#70307) 2020-07-14 17:00:44 -04:00
f1f782fc37 partial update of community docs to reflect collections transition (#70488) 2020-07-14 15:47:18 -04:00
692e5de05e bot: remove from team (#70637) 2020-07-14 12:06:54 -05:00
fe86a93482 Add a new date_time fact to provide DST timezone
PR #70449
2020-07-14 18:22:51 +02:00
e22e103cdf winrm - Added kinit_args to control the args for kinit calls (#70624) 2020-07-14 12:05:11 -04:00
a77dbf0866 Allow single vault encrypted values to be used directly as module parameters. Fixes #68275 (#70607) 2020-07-14 11:56:26 -04:00
375c6b4ae4 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>
2020-07-14 11:43:25 -04:00
0690b68bd3 Support datetime.date object in module result (#70595)
* Support datetime.date object in module result

Fixes #70583

* change blank lines for pep8 sanity test
2020-07-14 11:42:40 -04:00
40591d5fbb Document tags are not supported with task meta. (#70590)
fixes #70338
2020-07-14 11:38:15 -04:00
8d160b1881 Remove remaining examples of 1.1.1.1 (#70552)
* Remove remaining examples of 1.1.1.1

* Update ec2_group.py
2020-07-14 11:19:59 -04:00
1e02a201a6 Fix ansible-test virtualenv management. 2020-07-14 01:26:06 -07:00
09f02980a4 Update ansible-test change detection for plugins. 2020-07-13 18:28:59 -07:00
d372ce2c5d Get m_u.facts.utils coverage up to 100% (#70614)
* 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>
2020-07-13 16:52:56 -07:00
918388b85f Fix building Ansible dist w/ setuptools>=48,<49.1 (#70525)
* Fix building Ansible dist w/ setuptools>=48,<49.1

This change addresses the deprecation of the use of stdlib
`distutils`. It's a short-term hotfix for the problem and we'll
need to consider dropping the use of `distutils` from our `setup.py`.

Refs:
* https://github.com/ansible/ansible/issues/70456
* https://github.com/pypa/setuptools/issues/2230
* https://github.com/pypa/setuptools/commit/bd110264

Co-Authored-By: Jason R. Coombs <jaraco@jaraco.com>

* Add a change note for PR #70525

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-07-13 17:16:26 -04:00
20209c508f 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>
2020-07-13 14:41:59 -05:00
38ccfb4a3e updated requirements file for docs build (#70609) 2020-07-13 15:35:08 -04:00
c410311f55 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.
2020-07-13 14:15:44 -05:00
f4ea43c4a0 Update windows_winrm.rst (#70306)
gcc also needed to be installed alongside python-devel, krb5-devel, krb5-libs, and krb5-workstation.
2020-07-13 13:43:39 -05:00
d16018fe72 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>
2020-07-13 11:58:14 -05:00
e5649ca3e8 pipe: update docs for Popen with shell=True usage (#70596)
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>
2020-07-13 21:40:52 +05:30
adcdee9bb0 remove 'alternatives' from COMMAND_WARNINGS config (#70577)
Change:
- This line causes the deprecation to make no grammatical sense. Nuking
  it.

Test Plan:
- My eyes

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-10 21:46:54 -05:00
d5480572c8 varnames: add tests, fix exception grammar (#70573)
Change:
- Add integration tests for various cases
- Fix wrong use of "its" in an exception thrown in varnames when it
  throws an AnsibleError, given a term of the wrong type.

Test Plan:
- new tests, CI

Tickets:
- Fixes #70546

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-10 21:04:02 -05:00
df45dcdae0 Add integration tests for test plugins. (#70576) 2020-07-10 18:48:51 -07:00
cf89ca8a03 Make filter type errors 'loop friendly' (#70417)
- 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>
2020-07-10 18:49:57 -04:00
24dcaf8974 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.
2020-07-11 00:24:08 +02:00
1b4fd23ba6 csvfile: use parse_kv() for args, add tests (#70550)
Change:
- Use parse_kv() for parsing in the csvfile lookup plugin. This allows
  us to handle multi-word search keys and filenames. Previously, the
  plugin split on space and so none of these things worked as expected.
- Add integration tests for csvfile, testing a plethora of weird cases.

Test Plan:
- New integration tests, CI

Tickets:
- Fixes #70545

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-10 16:21:03 -05:00
f4c89eab23 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.
2020-07-10 22:52:47 +02:00
edcd1a1a70 Doc: fix examples of changelog entries. (#70551) 2020-07-10 16:17:03 -04:00
8789d7968d try to capture better winrm/put_file error (#70508)
* try to capture better winrm/put_file error

fixes #70361

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

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
2020-07-10 15:37:52 -04:00
b285f4c675 Updated infini* redirects to transition to infinidat collection (#70565) 2020-07-10 20:04:21 +01:00
1ec32dd2ec Revert "Disable Hetzner Cloud tests (#70558)" (#70563)
This reverts commit bd100a8649.
2020-07-10 14:53:37 -04:00
bd100a8649 Disable Hetzner Cloud tests (#70558)
They are failing and Hetzner is working on a fix
2020-07-10 13:30:31 -04:00
9c40b1b2ff Replace filename with file in apt_key (#70492)
* Replace filename with file from apt_key check

  one is internal variable, the other is actual parameter used and required for parameter check.
2020-07-10 12:42:49 -04:00
9fbd65958d hostname: hostnamectl check -> SystemdStrategy (#70532)
Change:
- Move hostnamectl check out of GenericStrategy because it was incorrect
  for everything except the SystemdStrategy which is where it belongs.
- Add some initial tests for the hostname module, though we are limited
  by the fact that we can't do much testing with it in containers.

Test Plan:
- new hostname integration tests

Signed-off-by: Rick Elrod <rick@elrod.me>

Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-07-09 20:04:23 -05:00
b149a89e07 Migrating MySQL to community.mysql (#70523)
* Migrating MySQL to community.mysql

* Removed aliases to fix yaml linting

Co-authored-by: Ben Mildren <bmildren@digitalocean.com>
2020-07-09 15:48:43 -04:00
bbd8f15a58 Correct name of fileglob lookup integration test. 2020-07-09 12:28:06 -07:00
71c378e139 Fix decrypt argument in assemble module (#70465)
* Do not pass decrypt parameter to assemble module

* Add integration tests where decrypt=True

* Add changelog #70465
2020-07-09 15:24:12 -04:00
28fda23284 command warnings: don't send the param from action (#70531)
Change:
- Followup to #70504. We need to not pass the 'warn' parameter from the
  action plugin either, unless it's True. Otherwise, even though it
  defaults to false, we always show the deprecation.

Test Plan:
- Local

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-09 14:13:10 -04:00
f7db428375 update documentation link to python 3 (#70509)
update the docs link for strftime on the filters page to point to the python3 docs
2020-07-09 11:58:39 -05:00
64c2cb273f Document that subversion module requires subversion (#70537) 2020-07-09 11:56:44 -05:00
c4fd5bee00 Speedup modify module (#70475)
* speed up modify_module

* Remove debugging

* ci_complete

* Simplify generic_visit, alias to visit, eliminate some attr lookups

* ci_complete

* Add changelog fragment
2020-07-09 10:22:26 -05:00
b0d9deeae3 Fix ansible-test error in community.aws (#70507)
* Fix ansible-test error in community.aws

* Add changelog entry for fix

* Change check from None to string_types

* Update changelogs/fragments/70507-validate-null-author.yaml

clarify wording "or a list of strings"

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update test/lib/ansible_test/_data/sanity/validate-modules/validate_modules/schema.py

clarify wording - single string or not specified valid

Co-authored-by: Felix Fontein <felix@fontein.de>

* Do not fail but return None when given outside list

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-07-08 15:17:12 -05:00
8aca464b8b Make sure ansible_become treated as a boolean (#70484)
* Make sure ansible_become treated as a boolean
2020-07-08 14:53:38 -04:00
7525503512 fix netbox inventory plugin name to redirect (#70458)
Co-authored-by: akira <akira6592@example.com>
2020-07-08 11:15:46 +05:30
e1ba7dc52a Update AWS Integration test docmentation (#70454) 2020-07-08 08:01:37 +05:30
f3ef4ed076 Remove some constants.py deprecated items (#70466)
Change:
- Remove mk_boolean
- Remove BECOME_METHODS
- Remove get_config

Test Plan:
- CI, removed mk_boolean unit tests

Tickets:
- Fixes #69678

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-07 18:41:19 -05:00
41414ed475 Deprecate command warnings feature (#70504)
Change:
- The command warnings feature which suggests that users use modules
  instead of certain commands is now deprecated. Its `warn` paramater
  and `COMMAND_WARNINGS` configuration options are also deprecated.
  Their use will become an error in version 2.13.

Test Plan:
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-07-07 18:40:38 -05:00
707458cc8c Make netbsd virtualization facts more specific (#70467)
Change:
Our handling of NetBSD virtualization facts led to facts that were just
plain incorrect. One example is reporting Xen even when the system is
running on something completely different (like KVM).

As stated by the reporter of #69352, NetBSD has a better sysctl setting
to use for this information, machdep.hypervisor.

This PR does the following:

- Try to use machdep.hypervisor sysctl value if the other sysctl values
  we check don't end up with enough information to be useful
- Only look for /dev/xencons and assume Xen if nothing else works
  (Really this should probably return 'unknown' since the file exists on
  non-Xen systems and is not very useful).
- Add a few more patterns (Xen matches and also Hyper-V) to
  VirtualSysctlDetectionMixin#detect_virt_product.

This change is slightly breaking:
- If the first two attempts at using sysctl worked before,
  (machdep.dmi.system-product and machdep.dmi.system-vendor), they will
  continue to work.
- For cases when those values didn't work, previously the existence of
  /dev/xencons was checked, and if found, we reported 'xen' (even on
  non-Xen systems when the file existed). After this PR, we try the
  machdep.hypervisor sysctl key before still falling back to
  /dev/xencons. This means that in some cases, we might go from
  (wrongly) saying "xen" to giving a more accurate value such as "kvm"
  or "Hyper-V".

Test Plan:
- Tested with local NetBSD VM and got 'kvm' instead of 'xen' back.

Tickets:
- Fixes #69352

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-07 17:28:13 -05:00
fb7740ae3b Update hacking/shippable docs.
The `--all` option downloads more than is needed for analyzing code coverage.
2020-07-07 10:22:45 -07:00
688cd8657b Fix string/bytestring comparsion in m_u.basic (#70439)
Change:
- module_utils.basic.is_special_selinux_path() used a string ==
  bytestring comparison which returned False and made Ansible think that
  certain filesystems aren't, in fact, special-cased, when they should
  be. Ensure both sides of the == are bytestrings.

Test Plan:
- Added `copy` integration tests for this case.

Tickets:
- Fixes #70244

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-07 11:48:05 -04:00
f5037314e3 sanity: remove ansible-bad-function (#70431)
* Updated docs and ignore.txt
* Replaced with correct function calls

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-07 11:46:28 -04:00
535fde3c0f DigitalOcean content has been moved to community.digitalocean. (#70483) 2020-07-07 13:42:09 +01:00
5b03267a1f Add ansible-doc tests for documentation containing YAML anchors (#70436)
Co-authored-by: Tadej Borovšak <tadej.borovsak@xlab.si>
2020-07-07 08:33:55 -04:00
1a542e9824 migrating ProxySQL to community.proxysql (#70490)
* migrating ProxySQL to community.proxysql

* Removed remaining ProxySQL ref to community.general

Co-authored-by: Ben Mildren <bmildren@digitalocean.com>
2020-07-07 12:32:12 +01:00
bd1378405b Small documentation fixes (#70480)
* Add type for options in the sample module shown in Developing Modules, as this is required to have the tests being
green
* Remove duplicated strings: the same sentence is in "Python tips" and "Module security", keeping the
latter.
2020-07-06 12:53:10 -05:00
9164b96774 ansible-doc man formatter: fail with better error message when description isn't there (#70046)
* 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.
2020-07-06 13:29:03 -04:00
7d7f15fc9b apt - make errors more transparent (#70099)
Include error from apt Python library in module error output

Co-authored-by: Andreas Schleifer <aschleifer@bigpoint.net>
2020-07-06 12:20:09 -04:00
73139df36c botmeta: exoscale migrated to ngine_io.exoscale (#70095)
* botmeta: exoscale migrated to ngine_io.exoscale

* botmeta: exoscale: add missing migrations

* Update lib/ansible/config/ansible_builtin_runtime.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-07-03 10:15:41 +01:00
1787a3dbf5 botmeta: vultr migrated to ngine_io.vultr (#68916) 2020-07-03 09:49:35 +01:00
8cb1272ca4 botmeta: cloudstack migrated to ngine_io.cloudstack (#68917)
* botmeta: cloudstack migrated to ngine_io.cloudstack

* also update file references

* cloudstack: botmeta: added missing migrated_to
2020-07-03 09:47:22 +01:00
8d97c8c222 Fix the internal Python API usage examples
Previous version initialized the `TaskQueueManager` after calling
`Play.load()` while advertising a way to inject a custom library
location path. This caused the tasks loader not to find any custom
modules because it was triggered before the path was actually added
to the module loader.

This patch changes the order of the operations to ensure that the
customized `context.CLIARGS` actually influences things.

Resolves https://github.com/ansible/ansible/issues/69758.
2020-07-03 10:44:54 +02:00
0198ceebe4 botmeta: cloudscale: add missing migrations (#70447) 2020-07-03 10:15:33 +05:30
82e5d03bdb 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>
2020-07-02 17:23:37 -05:00
4f0ec5a9a0 Suppress warning for user directory in ansible-inventory (#65344)
When user uses home directory in --playbook-dir option
of ansible-inventory command, it warns user about this.
This PR suppress the warning message for user's home directory usage
in ansible-inventory command.

Fixes: #65262

Signed-off-by: Satyajit Bulage <sbulage@redhat.com>
2020-07-02 16:22:21 -04:00
b4184aa50e ssh connection - use get_option() rather than _play_context (#70438)
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.
2020-07-02 15:04:58 -04:00
47c809aca1 label PRs to ansible_builtin_runtime.yml (#70442) 2020-07-02 19:42:33 +01:00
4e41e37aa7 Fix flatten null perserve versionadded (#70435) 2020-07-02 13:28:39 -05:00
1be78dbfc5 Updated bundled libraries (#70418)
Change:
- Update bundled six to 1.13 (last with py2.6 support)
- Make it pass lint
- Fix check to allow skipping over compat __init__.py files we authored
- Fix check to allow files that can't be updated for some reason

Test Plan:
- ansible-test sanity --docker
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-02 12:39:00 -05:00
c600f8df58 All cloudscale.ch modules are moved to a collection (#70358) 2020-07-02 17:44:28 +01:00
aa59c23aed update platform table with links to collections (#70373) 2020-07-02 10:20:11 -05:00
9eb904ea61 Add documentation for ipaddr filters (#70343) 2020-07-02 11:17:46 -04:00
7c90a2d2a6 Update playbooks.rst (#70317) 2020-07-02 11:11:09 -04:00
46ad3c1162 Update pull.py (#70393) 2020-07-02 10:59:01 -04:00
36d7ba1408 Fixed TypeError instancemethod expecting at least 2 arguments (#69463)
* Fixed TypeError instancemethod expecting at least 2 arguments

* added changlelog for 69463
2020-07-02 00:01:31 -04:00
7a15a3a109 fix flatten handling of nulls/nones (#70141)
* fix flatten loop control issue (break -> continue)

fix issue #69012

(cherry picked from commit 2127be5ec5)

* fixed null break bug and added option to include

 fixes #69012
 fixes #69013

Co-authored-by: pseudocoder <borisovano@users.noreply.github.com>
Co-authored-by: David Shrewsbury <Shrews@users.noreply.github.com>
2020-07-01 18:52:03 -04:00
626df08d9d Fix a small typo in cache plugin description @ config/base.yml
PR #70420
2020-07-01 23:24:59 +02:00
ce570691e7 Test against galaxy_ng (#70303)
* Test against galaxy_ng

* Switch container image

* Remove redundant |default

* Re-enable

* Update image

* Update wording

* Don't use pulp as the container name
2020-07-01 16:20:03 -04:00
5d3d097de3 more correct info about role main.yml (#70326)
fixes #40496
2020-07-01 16:16:21 -04:00
c89f3cda9e incorporate minimalism feedback on filters page (#70366)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2020-07-01 16:15:32 -04:00
5709173c32 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>
2020-07-01 16:12:48 -04:00
1f1d6e5aec Use the first galaxy server supporting v1 for roles (#70375)
* Use the first galaxy server supporting v1 for roles. Fixes #65440

* Add changelog fragment

* This is best effort, fall back to original behavior if something bad happens
2020-07-01 14:58:35 -05:00
91aea92c62 Add ability to fallback to chgrp remote_tmp and its files. (#68627)
* Add ability to fallback to chgrp remote_tmp and its files.

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-01 15:16:56 -04:00
b9e38e8b55 misc collection metadata fixes (#70403)
* 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
2020-07-01 14:09:21 -04:00
f7078c1f8f Throw a prettier error in m_u.basic syslog (#70312)
Change:
- In certain situations, such as when the input string contains null
  bytes (\0), syslog.syslog will throw a TypeError. Handle that and
  fail_json instead.

Test Plan:
- New test
- ansible-test --docker centos[68] (for py2 and py3 respectively)

Tickets:
- Refs #70269

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-01 09:28:48 -05:00
a1ac595d42 Minor grammatical fix (#70405)
'you' -> 'your'
2020-07-01 10:47:08 +05:30
40ce448657 ansible-test - do not validate blacklisted ps modules (#70376)
* 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>
2020-07-01 07:59:53 +10:00
a8ae8f4d72 setup: Handle CIFS share with backward slash (#70006)
CIFS can be mounted using backward slash as well in /etc/fstab like

\\Windows\share /data/ cifs credentials=/root/.creds 0 0

Handle this condition while gather mount information in Linux.

Fixes: #48813

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-30 16:09:35 -04:00
8324db7cb5 Add new option for YUM4/DNF repositories (#70042)
Documentation reference:
  https://dnf.readthedocs.io/en/stable/conf_ref.html

Co-authored-by: Estelle Poulin <dev@inspiredby.es>
2020-06-30 15:48:36 -04:00
eeb153287b Fix some missing migrates from network.common to mellanox.onyx (#70394)
Signed-off-by: Samer Deeb <samerd@mellanox.com>
2020-06-30 20:47:31 +01:00
5e4f708241 ansible-doc: avoid problems with YAML anchors when formatting man page (#70045)
* Avoid problems with YAML anchors when formatting man page.

* Add changelog.
2020-06-30 15:33:44 -04:00
74bedab8a9 known_hosts: update documentation (#70342)
* 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>
2020-06-30 12:03:31 -04:00
3c64ac2264 Clean up symlink cache during 'make clean' (#70350)
Make building across versions, renamed modules can result in no such
file errors by the install.
2020-06-30 11:44:10 -04:00
24915b2ccf Fix ansible_builtin_runtime.yml w.r.t. c.g and c.n (#70322)
* Fix module_utils for community.general.
* Fix module_utils for community.network.
* Add forgotten entry for community.general.
2020-06-30 11:22:23 -04:00
4997063b4a apt - add fail_on_autoremove option to avoid unintended package removals (#70056)
* Ensure not to remove existing packages while installing apt packages.
* Make all lines shorter than 160 characters
* Allow removing packages only when upgrading.
* Add integration tests
2020-06-30 09:53:14 -04:00
b05e00e99a Fix delegate_facts with interpreter not being set (#70293)
Fixes #70168

ci_complete

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2020-06-30 15:49:09 +02:00
30e70f4b63 Handle post_validate templating errors and fix tests (#70240)
* Handle unexpected templating errors

* Fixes #70050

Fix up tests that weren't running and add tests for graceful templating error handling
2020-06-30 09:31:58 -04:00
cc2cee6980 Fix -vvvvv unicode error in executor.module_common (#70368)
Change:
- Fix a UnicodeDecodeError in executor.module_common that could get
  triggered with -vvvvv.

Test Plan:
- `ansible-test integration --docker centos7 module_utils -vvvvv`
  This would show the error previously, and no loner does after this
  patch.

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-06-29 18:02:03 -05:00
70bb2b33ca Improve error message when ssh client is not found on the host (#70122)
* Add changlelog
2020-06-29 17:26:19 -04:00
e396715d7b git - add single_branch option (#28465)
In some usecases, we want to be able to clone a single branch
of a repository, without using --depth (which implies --single-branch).

* Use branch name when available
  -  update description of parameter
  - consolidate branch or tag checking for easy reuse

* Add changelog
* Use static task imports rather than dynamic includes
* Add integration tests for single_branch
* Account for older versions of git
* Minor tweak to warnings

Co-authored-by: Laurent Coustet <laurent.coustet@clarisys.fr>
Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-06-29 15:40:54 -04:00
5a28b2b86c 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>
2020-06-29 14:22:31 -05:00
2d59e548f6 Improve ansible-galaxy STDOUT messages for collections (#70040)
- Fix issue #70010
- Add installation successful message
- This feature targets "collection" sub-command and does not affect "role" sub-command

Signed-off-by: Hideki Saito <saito@fgrep.org>
2020-06-29 15:18:30 -04:00
e4f48c920c Docs: mention about Ansible workshops (#70353)
Lightbulb is deprecated in favor of https://ansible.github.io/workshops/
Update links accordingly.
Fixes: #70296

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-29 14:06:04 -05:00
dc6f4b6502 Fix bullet points in intro_getting_started.rst. (#70365)
The layout was jumbled due to issues with whitespace.
2020-06-29 14:05:05 -05:00
689cfd1983 Top-level deprecation of plugin did not get collection_name added when deprecating by version (#70344)
* Top-level deprecation of plugin did not get collection_name added when deprecating by version.

* Add changelog fragment.
2020-06-29 11:58:54 -07:00
83f6e4850b document FQCN for M() and :seealso: in DOCUMENTATION blocks (#70245)
* document FQCN for M() in DOCUMENTATION blocks

* add note about c
2020-06-29 11:16:59 -05:00
e39a9bf583 Add support for Parrot Linux, a Debian derivate (#69158)
Co-authored-by: black <invalid>
2020-06-29 20:22:44 +05:30
c3fc2d27d9 pause - fix curses.setupterm() error (#47851)
* [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>
2020-06-29 10:37:40 -04:00
b491f776b9 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.
2020-06-29 09:16:20 -05:00
ca90c138f4 Reap still running threads after timeout
This is an improvement to #49921 which reaps threads after the timeout
expires instead of letting them continue to take up resources.
2020-06-27 08:30:48 -07:00
d6fb42d1c5 Add integration tests for basic.py _set_cwd.
These tests verify that AnsibleModule can be instantiated when cwd does not exist or is unreadable.
2020-06-26 16:40:52 -07:00
3479803520 Changed from dellemc_networking to dellemc (#70299) 2020-06-26 08:48:08 +01:00
7fdd8fcfcb pip tests, use py2 compat sampleproject fork (#70313)
Change:
- sampleproject has gone py3 only. Use a py2 compatible fork.

Test Plan:
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-06-25 22:38:17 -05:00
5833af9e2a 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.
2020-06-25 18:49:57 -05:00
0cd07eb3fd hash filter - fail when unsupported type is passed as an argument (#70292)
Fixes #70258
2020-06-25 14:55:21 -05:00
b019029bf3 Add intentional unit tests for basic._set_cwd and common.dict_merge (#70283)
* Add unit tests for basic._set_cwd

* incidental coverage for dict_merge

* add test for async stderr inclusion
2020-06-25 14:45:13 -05:00
29169ae847 stat: Handle colon in filename (#70259)
Handle colon appearing in filename while parsing the mimetype and charset
using file command.

Fixes: #70256

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-25 14:21:50 -05:00
3c9be97e16 fix runtime.yml splunk.enterprise_security -> splunk.es (#70305)
Signed-off-by: Adam Miller <admiller@redhat.com>
2020-06-25 18:34:11 +01:00
45e0f74702 display: use stdout for column width (#70199)
stdout may differ from stdin so it should be used to determine the column
width, especially since it is the target file descriptor.
2020-06-25 12:57:24 +05:30
3fe48ecba2 Add collection path in CLI version info (#68633)
This will provide user default path of collection

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-25 01:58:56 -04:00
74494a1908 Code cleanup for ansible-test coverage support. 2020-06-24 17:39:35 -07:00
8d92df4537 Test netconf plugins in ansible-doc sanity test. 2020-06-24 15:53:32 -07:00
a3c1ea886f Revert commits related to delegated facts changes (#70272)
* Revert "Fix storing delegate_to facts (#70231)"

This reverts commit 88bb76f248.

* Revert "Fix storing local task_vars facts for the retry (#70171)"

This reverts commit eaf6086eea.
2020-06-24 15:36:51 -04:00
2531d54880 Throw AnsibleError instead of OSError, py3.9 crypt (#70246)
Change:
- On Python 3.9, `crypt.crypt` will throw instead of returning `None`
  when the algorithm isn't supported. So we catch that and handle it
  the same way we handled the algorithm not being supported on 3.8: by
  throwing AnsibleError.

Test Plan:
- CI for <=3.8.
- Local for 3.9b3:
  ansible -m debug -a "msg=\"{{ 'changeme' | password_hash('bcrypt') }}\"" localhost

  Before:
  localhost | FAILED! => {
      "msg": "Unexpected failure during module execution.",
      "stdout": ""
  }

  After:
  localhost | FAILED! => {
      "msg": "crypt.crypt does not support 'bcrypt' algorithm"
  }

Tickets:
- Fixes #69930

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-06-24 13:50:28 -05:00
ebd20ddca6 Include changelogs/changelog.yaml in distribution. (#70260) 2020-06-24 11:38:20 -05:00
262f93e22c Code cleanup in the import sanity test. 2020-06-23 23:09:00 -07:00
dd07bdf22d Fix galaxy role info bug to support multiple roles (#70148)
* Add changelog fragment
* Update changelog
2020-06-23 16:57:25 -04:00
4885ebad27 default_callback: Move 'check_mode_markers' in doc_fragments (#70228)
Callback plugin dense, yaml, and debug implement 'check_mode_markers'
so moving documentation to default callback doc_fragments.

Fixes: https://github.com/ansible-collections/community.general/issues/565

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-23 16:26:09 -04:00
70c59423fc Pin ansible-test requirements for RHEL.
The `packaging` and `pyparsing` packages are now installed by `ansible-test` during provisioning of RHEL instances to match the downstream vendored versions.
2020-06-23 11:52:25 -07:00
0073ab5fa6 Nuke strategy.SharedPluginLoaderObj, depr. 2.11 (#70235)
* Nuke strategy.SharedPluginLoaderObj, depr. 2.11

Change:
- Nuke SharedPluginLoaderObj class
- Update tests (which seemingly didn't use it anyway)
- Changelog

Test Plan:
CI, grep

Signed-off-by: Rick Elrod <rick@elrod.me>

* Nuke from ignore.txt

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-06-23 13:09:26 -04:00
7ef6b174e8 Migrate onyx modules from community.network to mellanox.onyx (#70213)
Signed-off-by: Samer Deeb <samerd@mellanox.com>
2020-06-23 17:21:56 +01:00
7584e145a9 Nuke _get_item() from callback, deprecated 2.11 (#70233)
Change:
- Remove _get_item() alias as it has been deprecated
- Update tests
- Remove relevant sanity curtailment
- Add changelog

Test Plan:
CI, grep

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-06-23 12:03:27 -04:00
88bb76f248 Fix storing delegate_to facts (#70231)
* Fix storing delegate_to facts
2020-06-23 12:02:16 -04:00
c9edb35652 Nuke systemd module user option, 2.11 deprecation (#70211)
Change:
Remove all references to the 'user' param in systemd module.

Test Plan:
CI and grep.

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-06-23 11:55:01 -04:00
9cfc76a221 Nuke with_ squashing, deprecated for 2.11 (#70209)
Change:
Removes with_* loop squashing and tests for 2.11

Test Plan:
CI, and grepped for with_items in package manager integration targets.
There might be some test cases in collections which need to stop testing
this behavior.

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-06-23 11:53:25 -04:00
40a42de081 async_status: Update documentation (#70196)
Fixes: #38164

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-23 11:45:54 -04:00
4b358c6641 Update config.yml (#70154)
typos & branding
* Update .github/ISSUE_TEMPLATE/config.yml

Co-authored-by: Rick Elrod <rick@elrod.me>
2020-06-23 11:17:33 -04:00
fa48678a08 Rename pylint plugin and add tests. (#70225)
* Renamed custom pylint plugin for unwanted names.
* Add integration tests for sanity test failures.
2020-06-22 20:25:35 -07:00
4816bb4f43 More boilerplate fixes. (#70224)
* Fix boilerplate in hacking dir.
* Fix boilerplate in docs dir.
* Fix boilerplate in integration tests.
* Fix boilerplate in examples.
2020-06-22 19:05:30 -07:00
234994fc07 Fix boilerplate in setup.py and lib/ansible/ dir. 2020-06-22 16:29:16 -07:00
1fedb95e4b Use libc wcwidth to calculate print width in display (#66214)
* Use libc wcwidth to calculate print width in display. Fixes #63105

* Remove errantly added blank lines

* Fixes

* Move setlocale, adjust tests to work around py2 oddity with characters following null

* Don't change cli stub

* emojis

* Remove to_text call

* Special accounting for deletions

* Add initialization function, expand tests, ensure fallback to len

* get_text_width requires text, ensure banner deals with it

* Handle setlocale errors

* Move variable decrement

* Remove unused import
2020-06-22 16:57:01 -05:00
26e8c07f32 Remove incidental_lookup_rabbitmq test.
It is no longer contributing unique code coverage.
2020-06-22 14:33:03 -07:00
98a0995fd0 Clean up unit test boilerplate. 2020-06-22 14:20:33 -07:00
4a0f42923b adds japanese translation as a version-switcher option (#70214)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2020-06-22 16:25:44 -04:00
eaf6086eea Fix storing local task_vars facts for the retry (#70171)
* Fix storing local task_vars facts for the retry

Fixes #70168
2020-06-22 10:07:47 -04:00
b2d6db7916 Rebalance CI groups to avoid macOS timeouts (#70126) 2020-06-19 16:40:51 -04:00
5885ed4455 remove gendered example (#70117)
Changed example to not assume things about names and genders
2020-06-19 14:35:03 -05:00
da868d9d60 docs: Add note about ansible-doc (#70162)
ansible-doc can only parse Python modules, added a note about
this is developer guide; Fixes: #69109
2020-06-19 14:28:02 -05:00
0ef75f65d9 Fix broken link in AWS Guide (#70153)
Point to collection rather than ansible/ansible for example.
2020-06-19 14:18:55 -05:00
647c6cd289 updates to ansible-maintained collections guidelines (#70178) 2020-06-19 14:04:19 -05:00
86606d3ca7 Disable ansible-galaxy-collection test (#70177)
It it currently failing
2020-06-19 14:20:06 -04:00
8ad46870a4 Update note about AWS collection test requirements in docs (#70176) 2020-06-19 13:40:19 -04:00
598c40beb3 Fix up the redirection of the win setup module (#70158) 2020-06-19 09:27:02 -07:00
8b24a4c5ed Fix up the redirection of the win setup module (#70158) 2020-06-19 09:24:35 -07:00
fd882e0e18 Get test data file directly in rebalance script (#70107)
Rather than looking through tests.json to find the data file, look for it explicitly
within a given target to avoid problems processing data in tests.json.
2020-06-19 09:57:50 -04:00
bc05415109 Only pass kwargs to our string checker not callable checkers (#70151)
Since only check_type_str() accepts extra param, only pass to our checker and
do not pass kwargs to custom checkers.

* Add unit tests
2020-06-19 09:52:05 -04:00
87406890cf find: Specify elements type in paths (#70139)
Fixes: #35990

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-19 06:56:02 +05:30
bccf6b85f2 Change comprehension to list() in plugin loader. 2020-06-18 12:29:52 -07:00
89afb60999 Fix transport defs in test connection plugins. 2020-06-18 11:50:51 -07:00
c67efe0bd1 Avoid unnecessary comprehensions. 2020-06-18 11:50:31 -07:00
9bbde9d085 Avoid file module false positive in newer pylint. 2020-06-18 11:36:44 -07:00
1a0d8a51cd Fix yamllint sanity test line numbers.
Parse errors from libyaml now compensate for the offset of the documentation within a module.
2020-06-18 10:03:21 -07:00
0ed5b77377 Detect failure in always block after rescue (#70094)
* Detect failure in always block after rescue

Fixes #70000

ci_complete

* Add more tests
2020-06-18 11:03:36 -05:00
33e25504ac redirecting the conjur lookup plugin to correct collection (#70106) 2020-06-18 07:38:15 +01:00
feb163e0de Improve consistency of ansible-test pylint results. (#70132)
* Disable too-many-ancestors pylint check.

This check was only enabled for ansible-test code.

In some cases this check counts 1 more ancestor in python 3.7+ than under python 3.6, making the check inconsistent and unsuitable for use in ansible-test.

* Disable additional pylint checks:

- import-error
- no-name-in-module

These checks were only enabled for ansible-test code.

These checks provide inconsistent results since they are dependent on available imports, which vary between environments.

It may be practical to enable these checks in the future if changes are made to ensure a consistent test environment for pylint.
2020-06-17 17:03:41 -07:00
e3f3b4002e Clean up ansible-test pylint configs. (#70129)
* Sort disabled pylint codes in config.
* Fix comments in pylint config.
* Add comments to pylint config.
* Prepare to sort pylint config.
* Fix pylint config indentation.
* Sort pylint good/bad names in config.
* Add changelog fragment.
2020-06-17 15:06:04 -07:00
fa1fb2d13b Test ansible-galaxy against pulp/pulp_ansible (#69605)
* Test galaxy cli against pulp

* linting fix

* Renames and small fixes

* Better handling for resetting pulp

* Clean up some things, add a comment

* I can't spell

* Bump fallaxy, use alternate pulp image

* Only reset pulp when we're are executing against pulp

* Update for updated pulp container

* Update some comments with correct URLs and typos

* Linting fix

* Pin pulp-fedora31 to a digest

* Address review comments for documentation
2020-06-17 16:06:07 -05:00
cc071cdea6 Bump devel to 2.11.0 (#70121)
Signed-off-by: Rick Elrod <rick@elrod.me>
2020-06-17 14:22:38 -05:00
3392 changed files with 137846 additions and 121854 deletions

View File

@ -0,0 +1,254 @@
trigger:
batch: true
branches:
include:
- devel
- stable-*
pr:
autoCancel: true
branches:
include:
- devel
- stable-*
schedules:
- cron: 0 7 * * *
displayName: Nightly
always: true
branches:
include:
- devel
- stable-*
variables:
- name: checkoutPath
value: ansible
- name: coverageBranches
value: devel
- name: pipelinesCoverage
value: coverage
- name: entryPoint
value: test/utils/shippable/shippable.sh
- name: fetchDepth
value: 500
resources:
containers:
- container: default
image: quay.io/ansible/azure-pipelines-test-container:1.9.0
pool: Standard
stages:
- stage: Sanity
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Test {0}
testFormat: sanity/{0}
targets:
- test: 1
- test: 2
- test: 3
- test: 4
- test: 5
- stage: Units
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Python {0}
testFormat: units/{0}
targets:
- test: 2.6
- test: 2.7
- test: 3.5
- test: 3.6
- test: 3.7
- test: 3.8
- test: 3.9
- stage: Windows
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Server {0}
testFormat: windows/{0}/1
targets:
- test: 2012
- test: 2012-R2
- test: 2016
- test: 2019
- stage: Remote
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
targets:
- name: macOS 11.1
test: macos/11.1
- name: RHEL 7.9
test: rhel/7.9
- name: RHEL 8.3 py36
test: rhel/8.3@3.6
- name: RHEL 8.3 py38
test: rhel/8.3@3.8
- name: FreeBSD 11.4
test: freebsd/11.4
- name: FreeBSD 12.2
test: freebsd/12.2
groups:
- 1
- 2
- 3
- 4
- 5
- stage: Docker
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: linux/{0}
targets:
- name: Alpine 3
test: alpine3
- name: CentOS 6
test: centos6
- name: CentOS 7
test: centos7
- name: CentOS 8
test: centos8
- name: Fedora 32
test: fedora32
- name: Fedora 33
test: fedora33
- name: openSUSE 15 py2
test: opensuse15py2
- name: openSUSE 15 py3
test: opensuse15
- name: Ubuntu 18.04
test: ubuntu1804
- name: Ubuntu 20.04
test: ubuntu2004
groups:
- 1
- 2
- 3
- 4
- 5
- stage: Galaxy
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Python {0}
testFormat: galaxy/{0}/1
targets:
- test: 2.7
- test: 3.6
- stage: Generic
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Python {0}
testFormat: generic/{0}/1
targets:
- test: 2.7
- test: 3.6
- stage: Incidental_Remote
displayName: Incidental Remote
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: i/{0}
targets:
- name: OS X 10.11
test: osx/10.11
- name: RHEL 7.9
test: rhel/7.9
- name: RHEL 8.3 py36
test: rhel/8.3@3.6
- name: RHEL 8.3 py38
test: rhel/8.3@3.8
- name: FreeBSD 11.4
test: freebsd/11.4
- name: FreeBSD 12.2
test: freebsd/12.2
- stage: Incidental_Docker
displayName: Incidental Docker
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: i/linux/{0}
targets:
- name: CentOS 6
test: centos6
- name: CentOS 7
test: centos7
- name: CentOS 8
test: centos8
- name: Fedora 32
test: fedora32
- name: Fedora 33
test: fedora33
- name: openSUSE 15 py2
test: opensuse15py2
- name: openSUSE 15 py3
test: opensuse15
- name: Ubuntu 18.04
test: ubuntu1804
- name: Ubuntu 20.04
test: ubuntu2004
- stage: Incidental_Windows
displayName: Incidental Windows
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Server {0}
testFormat: i/windows/{0}
targets:
- test: 2012
- test: 2012-R2
- test: 2016
- test: 2019
- stage: Incidental
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: i/{0}/1
targets:
- name: IOS Python
test: ios/csr1000v/
- name: VyOS Python 2.7
test: vyos/1.1.8/2.7
- name: VyOS Python 3.6
test: vyos/1.1.8/3.6
- name: AWS Python 2.7
test: aws/2.7
- name: AWS Python 3.6
test: aws/3.6
- name: Cloud Python
test: cloud/
- stage: Summary
condition: succeededOrFailed()
dependsOn:
- Sanity
- Units
- Windows
- Remote
- Docker
- Galaxy
- Generic
- Incidental_Remote
- Incidental_Docker
- Incidental_Windows
- Incidental
jobs:
- template: templates/coverage.yml

View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Aggregate code coverage results for later processing.
set -o pipefail -eu
agent_temp_directory="$1"
PATH="${PWD}/bin:${PATH}"
mkdir "${agent_temp_directory}/coverage/"
options=(--venv --venv-system-site-packages --color -v)
ansible-test coverage combine --export "${agent_temp_directory}/coverage/" "${options[@]}"
if ansible-test coverage analyze targets generate --help >/dev/null 2>&1; then
# Only analyze coverage if the installed version of ansible-test supports it.
# Doing so allows this script to work unmodified for multiple Ansible versions.
ansible-test coverage analyze targets generate "${agent_temp_directory}/coverage/coverage-analyze-targets.json" "${options[@]}"
fi

View File

@ -0,0 +1,60 @@
#!/usr/bin/env python
"""
Combine coverage data from multiple jobs, keeping the data only from the most recent attempt from each job.
Coverage artifacts must be named using the format: "Coverage $(System.JobAttempt) {StableUniqueNameForEachJob}"
The recommended coverage artifact name format is: Coverage $(System.JobAttempt) $(System.StageDisplayName) $(System.JobDisplayName)
Keep in mind that Azure Pipelines does not enforce unique job display names (only names).
It is up to pipeline authors to avoid name collisions when deviating from the recommended format.
"""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import re
import shutil
import sys
def main():
"""Main program entry point."""
source_directory = sys.argv[1]
if '/ansible_collections/' in os.getcwd():
output_path = "tests/output"
else:
output_path = "test/results"
destination_directory = os.path.join(output_path, 'coverage')
if not os.path.exists(destination_directory):
os.makedirs(destination_directory)
jobs = {}
count = 0
for name in os.listdir(source_directory):
match = re.search('^Coverage (?P<attempt>[0-9]+) (?P<label>.+)$', name)
label = match.group('label')
attempt = int(match.group('attempt'))
jobs[label] = max(attempt, jobs.get(label, 0))
for label, attempt in jobs.items():
name = 'Coverage {attempt} {label}'.format(label=label, attempt=attempt)
source = os.path.join(source_directory, name)
source_files = os.listdir(source)
for source_file in source_files:
source_path = os.path.join(source, source_file)
destination_path = os.path.join(destination_directory, source_file + '.' + label)
print('"%s" -> "%s"' % (source_path, destination_path))
shutil.copyfile(source_path, destination_path)
count += 1
print('Coverage file count: %d' % count)
print('##vso[task.setVariable variable=coverageFileCount]%d' % count)
print('##vso[task.setVariable variable=outputPath]%s' % output_path)
if __name__ == '__main__':
main()

View File

@ -0,0 +1,24 @@
#!/usr/bin/env bash
# Check the test results and set variables for use in later steps.
set -o pipefail -eu
if [[ "$PWD" =~ /ansible_collections/ ]]; then
output_path="tests/output"
else
output_path="test/results"
fi
echo "##vso[task.setVariable variable=outputPath]${output_path}"
if compgen -G "${output_path}"'/junit/*.xml' > /dev/null; then
echo "##vso[task.setVariable variable=haveTestResults]true"
fi
if compgen -G "${output_path}"'/bot/ansible-test-*' > /dev/null; then
echo "##vso[task.setVariable variable=haveBotResults]true"
fi
if compgen -G "${output_path}"'/coverage/*' > /dev/null; then
echo "##vso[task.setVariable variable=haveCoverageData]true"
fi

View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Upload code coverage reports to codecov.io.
# Multiple coverage files from multiple languages are accepted and aggregated after upload.
# Python coverage, as well as PowerShell and Python stubs can all be uploaded.
set -o pipefail -eu
output_path="$1"
curl --silent --show-error https://ansible-ci-files.s3.us-east-1.amazonaws.com/codecov/codecov.sh > codecov.sh
for file in "${output_path}"/reports/coverage*.xml; do
name="${file}"
name="${name##*/}" # remove path
name="${name##coverage=}" # remove 'coverage=' prefix if present
name="${name%.xml}" # remove '.xml' suffix
bash codecov.sh \
-f "${file}" \
-n "${name}" \
-X coveragepy \
-X gcov \
-X fix \
-X search \
-X xcode \
|| echo "Failed to upload code coverage report to codecov.io: ${file}"
done

View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
# Generate code coverage reports for uploading to Azure Pipelines and codecov.io.
set -o pipefail -eu
PATH="${PWD}/bin:${PATH}"
if ! ansible-test --help >/dev/null 2>&1; then
# Install the devel version of ansible-test for generating code coverage reports.
# This is only used by Ansible Collections, which are typically tested against multiple Ansible versions (in separate jobs).
# Since a version of ansible-test is required that can work the output from multiple older releases, the devel version is used.
pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check
fi
ansible-test coverage xml --stub --venv --venv-system-site-packages --color -v

View File

@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Configure the test environment and run the tests.
set -o pipefail -eu
entry_point="$1"
test="$2"
read -r -a coverage_branches <<< "$3" # space separated list of branches to run code coverage on for scheduled builds
export COMMIT_MESSAGE
export COMPLETE
export COVERAGE
export IS_PULL_REQUEST
if [ "${SYSTEM_PULLREQUEST_TARGETBRANCH:-}" ]; then
IS_PULL_REQUEST=true
COMMIT_MESSAGE=$(git log --format=%B -n 1 HEAD^2)
else
IS_PULL_REQUEST=
COMMIT_MESSAGE=$(git log --format=%B -n 1 HEAD)
fi
COMPLETE=
COVERAGE=
if [ "${BUILD_REASON}" = "Schedule" ]; then
COMPLETE=yes
if printf '%s\n' "${coverage_branches[@]}" | grep -q "^${BUILD_SOURCEBRANCHNAME}$"; then
COVERAGE=yes
fi
fi
"${entry_point}" "${test}" 2>&1 | "$(dirname "$0")/time-command.py"

View File

@ -0,0 +1,25 @@
#!/usr/bin/env python
"""Prepends a relative timestamp to each input line from stdin and writes it to stdout."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import sys
import time
def main():
"""Main program entry point."""
start = time.time()
sys.stdin.reconfigure(errors='surrogateescape')
sys.stdout.reconfigure(errors='surrogateescape')
for line in sys.stdin:
seconds = time.time() - start
sys.stdout.write('%02d:%02d %s' % (seconds // 60, seconds % 60, line))
sys.stdout.flush()
if __name__ == '__main__':
main()

View File

@ -0,0 +1,39 @@
# This template adds a job for processing code coverage data.
# It will upload results to Azure Pipelines and codecov.io.
# Use it from a job stage that completes after all other jobs have completed.
# This can be done by placing it in a separate summary stage that runs after the test stage(s) have completed.
jobs:
- job: Coverage
displayName: Code Coverage
container: default
workspace:
clean: all
steps:
- checkout: self
fetchDepth: $(fetchDepth)
path: $(checkoutPath)
- task: DownloadPipelineArtifact@2
displayName: Download Coverage Data
inputs:
path: coverage/
patterns: "Coverage */*=coverage.combined"
- bash: .azure-pipelines/scripts/combine-coverage.py coverage/
displayName: Combine Coverage Data
- bash: .azure-pipelines/scripts/report-coverage.sh
displayName: Generate Coverage Report
condition: gt(variables.coverageFileCount, 0)
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
# Azure Pipelines only accepts a single coverage data file.
# That means only Python or PowerShell coverage can be uploaded, but not both.
# Set the "pipelinesCoverage" variable to determine which type is uploaded.
# Use "coverage" for Python and "coverage-powershell" for PowerShell.
summaryFileLocation: "$(outputPath)/reports/$(pipelinesCoverage).xml"
displayName: Publish to Azure Pipelines
condition: gt(variables.coverageFileCount, 0)
- bash: .azure-pipelines/scripts/publish-codecov.sh "$(outputPath)"
displayName: Publish to codecov.io
condition: gt(variables.coverageFileCount, 0)
continueOnError: true

View File

@ -0,0 +1,55 @@
# This template uses the provided targets and optional groups to generate a matrix which is then passed to the test template.
# If this matrix template does not provide the required functionality, consider using the test template directly instead.
parameters:
# A required list of dictionaries, one per test target.
# Each item in the list must contain a "test" or "name" key.
# Both may be provided. If one is omitted, the other will be used.
- name: targets
type: object
# An optional list of values which will be used to multiply the targets list into a matrix.
# Values can be strings or numbers.
- name: groups
type: object
default: []
# An optional format string used to generate the job name.
# - {0} is the name of an item in the targets list.
- name: nameFormat
type: string
default: "{0}"
# An optional format string used to generate the test name.
# - {0} is the name of an item in the targets list.
- name: testFormat
type: string
default: "{0}"
# An optional format string used to add the group to the job name.
# {0} is the formatted name of an item in the targets list.
# {{1}} is the group -- be sure to include the double "{{" and "}}".
- name: nameGroupFormat
type: string
default: "{0} - {{1}}"
# An optional format string used to add the group to the test name.
# {0} is the formatted test of an item in the targets list.
# {{1}} is the group -- be sure to include the double "{{" and "}}".
- name: testGroupFormat
type: string
default: "{0}/{{1}}"
jobs:
- template: test.yml
parameters:
jobs:
- ${{ if eq(length(parameters.groups), 0) }}:
- ${{ each target in parameters.targets }}:
- name: ${{ format(parameters.nameFormat, coalesce(target.name, target.test)) }}
test: ${{ format(parameters.testFormat, coalesce(target.test, target.name)) }}
- ${{ if not(eq(length(parameters.groups), 0)) }}:
- ${{ each group in parameters.groups }}:
- ${{ each target in parameters.targets }}:
- name: ${{ format(format(parameters.nameGroupFormat, parameters.nameFormat), coalesce(target.name, target.test), group) }}
test: ${{ format(format(parameters.testGroupFormat, parameters.testFormat), coalesce(target.test, target.name), group) }}

View File

@ -0,0 +1,45 @@
# This template uses the provided list of jobs to create test one or more test jobs.
# It can be used directly if needed, or through the matrix template.
parameters:
# A required list of dictionaries, one per test job.
# Each item in the list must contain a "job" and "name" key.
- name: jobs
type: object
jobs:
- ${{ each job in parameters.jobs }}:
- job: test_${{ replace(replace(replace(replace(job.test, '/', '_'), '.', '_'), '-', '_'), '@', '_') }}
displayName: ${{ job.name }}
container: default
workspace:
clean: all
steps:
- checkout: self
fetchDepth: $(fetchDepth)
path: $(checkoutPath)
- bash: .azure-pipelines/scripts/run-tests.sh "$(entryPoint)" "${{ job.test }}" "$(coverageBranches)"
displayName: Run Tests
- bash: .azure-pipelines/scripts/process-results.sh
condition: succeededOrFailed()
displayName: Process Results
- bash: .azure-pipelines/scripts/aggregate-coverage.sh "$(Agent.TempDirectory)"
condition: eq(variables.haveCoverageData, 'true')
displayName: Aggregate Coverage Data
- task: PublishTestResults@2
condition: eq(variables.haveTestResults, 'true')
inputs:
testResultsFiles: "$(outputPath)/junit/*.xml"
displayName: Publish Test Results
- task: PublishPipelineArtifact@1
condition: eq(variables.haveBotResults, 'true')
displayName: Publish Bot Results
inputs:
targetPath: "$(outputPath)/bot/"
artifactName: "Bot $(System.JobAttempt) $(System.StageDisplayName) $(System.JobDisplayName)"
- task: PublishPipelineArtifact@1
condition: eq(variables.haveCoverageData, 'true')
displayName: Publish Coverage Data
inputs:
targetPath: "$(Agent.TempDirectory)/coverage/"
artifactName: "Coverage $(System.JobAttempt) $(System.StageDisplayName) $(System.JobDisplayName)"

1
.gitattributes vendored
View File

@ -1,2 +1 @@
.github/ export-ignore
hacking/ export-ignore

30231
.github/BOTMETA.yml vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,54 +0,0 @@
---
name: 🐛 Bug report
about: Create a report to help us improve
---
<!--- Verify first that your issue is not already reported on GitHub -->
<!--- Also test if the latest release and devel branch are affected too -->
<!--- Complete *all* sections as described, this form is processed automatically -->
##### SUMMARY
<!--- Explain the problem briefly below -->
##### ISSUE TYPE
- Bug Report
##### COMPONENT NAME
<!--- Write the short name of the module, plugin, task or feature below, use your best guess if unsure -->
##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```paste below
```
##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```paste below
```
##### OS / ENVIRONMENT
<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->
##### STEPS TO REPRODUCE
<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->
<!--- Paste example playbooks or commands between quotes below -->
```yaml
```
<!--- HINT: You can paste gist.github.com links for larger files -->
##### EXPECTED RESULTS
<!--- Describe what you expected to happen when running the steps above -->
##### ACTUAL RESULTS
<!--- Describe what actually happened. If possible run with extra verbosity (-vvvv) -->
<!--- Paste verbatim command output between quotes -->
```paste below
```

125
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@ -0,0 +1,125 @@
---
name: 🐛 Bug report
description: Create a report to help us improve
issue_body: false # default: true, adds a classic WSYWIG textarea, if on
body:
- type: markdown
attributes:
value: |
⚠
Verify first that your issue is not [already reported on GitHub][issue search].
Also test if the latest release and devel branch are affected too.
*Complete **all** sections as described, this form is processed automatically.*
[issue search]: https://github.com/ansible/ansible/search?q=is%3Aissue&type=issues
- type: textarea
attributes:
label: Summary
description: Explain the problem briefly below.
placeholder: >-
When I try to do X with ansible-core from the devel branch on GitHub, Y
breaks in a way Z under the env E. Here are all the details I know
about this problem...
validations:
required: true
- type: dropdown
attributes:
label: Issue Type
# FIXME: Once GitHub allows defining the default choice, update this
options:
- Bug Report
validations:
required: true
- type: input
attributes:
label: Component Name
description: >-
Write the short name of the module, plugin, task or feature below,
*use your best guess if unsure*.
placeholder: dnf, apt, yum, pip, user etc.
validations:
required: true
- type: textarea
attributes:
label: Ansible Version
description: >-
Paste verbatim output from `ansible --version` between
tripple backticks.
value: |
```console (paste below)
$ ansible --version
```
validations:
required: true
- type: textarea
attributes:
label: Configuration
description: >-
Paste verbatim output from `ansible-config dump --only-changed` between quotes.
value: |
```console (paste below)
$ ansible-config dump --only-changed
```
validations:
required: true
- type: textarea
attributes:
label: OS / Environment
description: >-
Provide all relevant information below, e.g. target OS versions,
network device firmware, etc.
placeholder: RHEL 8, CentOS Stream etc.
validations:
required: true
- type: textarea
attributes:
label: Steps to Reproduce
description: |
Describe exactly how to reproduce the problem, using a minimal test-case. It would *really* help us understand your problem if you could also pased any playbooks, configs and commands you used.
**HINT:** You can paste https://gist.github.com links for larger files.
value: |
<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
```
validations:
required: true
- type: textarea
attributes:
label: Expected Results
description: >-
Describe what you expected to happen when running the steps above.
placeholder: >-
I expected X to happen because I assumed Y and was shocked
that it did not.
validations:
required: true
- type: textarea
attributes:
label: Actual Results
description: |
Describe what actually happened. If possible run with extra verbosity (`-vvvv`).
Paste verbatim command output between quotes.
value: |
```console (paste below)
```
validations:
required: true
...

View File

@ -1,5 +1,5 @@
# Ref: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
blank_issues_enabled: true # default
blank_issues_enabled: false # default: true
contact_links:
- name: 🔐 Security bug report 🔥
url: https://docs.ansible.com/ansible/latest/community/reporting_bugs_and_features.html?utm_medium=github&utm_source=issue_template_chooser
@ -20,7 +20,7 @@ contact_links:
about: Please ask and answer usage questions here
- name: ⚡ Working groups
url: https://github.com/ansible/community/wiki
about: Interedted in improving a specific area? Become a part of a working group!
about: Interested in improving a specific area? Become a part of a working group!
- name: 💼 For Enterprise
url: https://www.ansible.com/products/engine?utm_medium=github&utm_source=issue_template_chooser
about: Red Hat offers supported builds of Ansible Engine
about: Red Hat offers support for the Ansible Automation Platform

View File

@ -1,38 +0,0 @@
---
name: 📝 Documentation Report
about: Ask us about docs
---
<!--- Verify first that your improvement is not already reported on GitHub -->
<!--- Also test if the latest release and devel branch are affected too -->
<!--- Complete *all* sections as described, this form is processed automatically -->
##### SUMMARY
<!--- Explain the problem briefly below, add suggestions to wording or structure -->
<!--- HINT: Did you know the documentation has an "Edit on GitHub" link on every page ? -->
##### ISSUE TYPE
- Documentation Report
##### COMPONENT NAME
<!--- Write the short name of the rst file, module, plugin, task or feature below, use your best guess if unsure -->
##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```paste below
```
##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```paste below
```
##### OS / ENVIRONMENT
<!--- Provide all relevant information below, e.g. OS version, browser, etc. -->
##### ADDITIONAL INFORMATION
<!--- Describe how this improves the documentation, e.g. before/after situation or screenshots -->
<!--- HINT: You can paste gist.github.com links for larger files -->

View File

@ -0,0 +1,97 @@
---
name: 📝 Documentation Report
description: Ask us about docs
# NOTE: issue body is enabled to allow screenshots
issue_body: true # default: true, adds a classic WSYWIG textarea, if on
body:
- type: markdown
attributes:
value: |
⚠
Verify first that your issue is not [already reported on GitHub][issue search].
Also test if the latest release and devel branch are affected too.
*Complete **all** sections as described, this form is processed automatically.*
[issue search]: https://github.com/ansible/ansible/search?q=is%3Aissue&type=issues
- type: textarea
attributes:
label: Summary
description: |
Explain the problem briefly below, add suggestions to wording or structure.
**HINT:** Did you know the documentation has an `Edit on GitHub` link on every page?
placeholder: >-
I was reading the ansible-core documentation of version X and I'm having
problems understanding Y. It would be very helpful if that got
rephrased as Z.
validations:
required: true
- type: dropdown
attributes:
label: Issue Type
# FIXME: Once GitHub allows defining the default choice, update this
options:
- Documentation Report
validations:
required: true
- type: input
attributes:
label: Component Name
description: >-
Write the short name of the rst file, module, plugin, task or
feature below, *use your best guess if unsure*.
placeholder: docs/docsite/rst/dev_guide/debugging.rst
validations:
required: true
- type: textarea
attributes:
label: Ansible Version
description: >-
Paste verbatim output from `ansible --version` between
tripple backticks.
value: |
```console (paste below)
$ ansible --version
```
validations:
required: true
- type: textarea
attributes:
label: Configuration
description: >-
Paste verbatim output from `ansible-config dump --only-changed` between quotes.
value: |
```console (paste below)
$ ansible-config dump --only-changed
```
validations:
required: true
- type: textarea
attributes:
label: OS / Environment
description: >-
Provide all relevant information below, e.g. OS version,
browser, etc.
placeholder: Fedora 33, Firefox etc.
validations:
required: true
- type: markdown
attributes:
value: |
**Additional Information**
Describe how this improves the documentation, e.g. before/after situation or screenshots.
**HINT:** You can paste https://gist.github.com links for larger files.
...

View File

@ -1,25 +0,0 @@
---
name: ✨ Feature request
about: Suggest an idea for this project
---
<!--- Verify first that your feature was not already discussed on GitHub -->
<!--- Complete *all* sections as described, this form is processed automatically -->
##### SUMMARY
<!--- Describe the new feature/improvement briefly below -->
##### ISSUE TYPE
- Feature Idea
##### COMPONENT NAME
<!--- Write the short name of the module, plugin, task or feature below, use your best guess if unsure -->
##### ADDITIONAL INFORMATION
<!--- Describe how the feature would be used, why it is needed and what it would solve -->
<!--- Paste example playbooks or commands between quotes below -->
```yaml
```
<!--- HINT: You can also paste gist.github.com links for larger files -->

View File

@ -0,0 +1,62 @@
---
name: ✨ Feature request
description: Suggest an idea for this project
issue_body: false # default: true, adds a classic WSYWIG textarea, if on
body:
- type: markdown
attributes:
value: |
⚠
Verify first that your issue is not [already reported on GitHub][issue search].
Also test if the latest release and devel branch are affected too.
*Complete **all** sections as described, this form is processed automatically.*
[issue search]: https://github.com/ansible/ansible/search?q=is%3Aissue&type=issues
- type: textarea
attributes:
label: Summary
description: Describe the new feature/improvement briefly below.
placeholder: >-
I am trying to do X with ansible-core from the devel branch on GitHub and
I think that implementing a feature Y would be very helpful for me and
every other user of ansible-core because of Z.
validations:
required: true
- type: dropdown
attributes:
label: Issue Type
# FIXME: Once GitHub allows defining the default choice, update this
options:
- Feature Idea
validations:
required: true
- type: input
attributes:
label: Component Name
description: >-
Write the short name of the module, plugin, task or feature below,
*use your best guess if unsure*.
placeholder: dnf, apt, yum, pip, user etc.
validations:
required: true
- type: textarea
attributes:
label: Additional Information
description: |
Describe how the feature would be used, why it is needed and what it would solve.
**HINT:** You can paste https://gist.github.com links for larger files.
value: |
<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
```
validations:
required: true
...

View File

@ -8,7 +8,7 @@
- Bugfix Pull Request
- Docs Pull Request
- Feature Pull Request
- New Module Pull Request
- Test Pull Request
##### COMPONENT NAME
<!--- Write the short name of the module, plugin, task or feature below -->

View File

@ -1,4 +1,5 @@
---
- 2.11.0 Hey Hey, What Can I Do
- 2.10.0 When the Levee Breaks
- 2.9.0 Immigrant Song
- 2.8.0 How Many More Times

7
.gitignore vendored
View File

@ -32,11 +32,16 @@ docs/man/man3/*
docs/docsite/_build
docs/docsite/*.html
docs/docsite/htmlout
docs/docsite/rst/conf.py
docs/docsite/rst/index.rst
docs/docsite/rst/cli/ansible-*.rst
docs/docsite/rst/cli/ansible.rst
docs/docsite/rst/dev_guide/collections_galaxy_meta.rst
docs/docsite/rst/dev_guide/testing/sanity/index.rst.new
docs/docsite/rst/modules/*.rst
docs/docsite/rst/collections/*.rst
!docs/docsite/rst/collections/all_plugins.rst
docs/docsite/rst/collections/*/*.rst
docs/docsite/rst/playbooks_directives.rst
docs/docsite/rst/plugins_by_category.rst
docs/docsite/rst/plugins/*/*.rst
@ -77,6 +82,8 @@ Vagrantfile
/lib/ansible.egg-info/
# First used in the `devel` branch during Ansible 2.10 development.
/lib/ansible_base.egg-info/
# First used in the `devel` branch during Ansible 2.11 development.
/lib/ansible_core.egg-info/
/shippable/
/test/integration/cloud-config-*.*
!/test/integration/cloud-config-*.*.template

View File

@ -2,15 +2,18 @@ include README.rst
include COPYING
include SYMLINK_CACHE.json
include requirements.txt
include shippable.yml
recursive-include docs *
include docs/docsite/rst/collections/all_plugins.rst
exclude docs/docsite/rst_warnings
exclude docs/docsite/rst/conf.py
exclude docs/docsite/rst/index.rst
recursive-exclude docs/docsite/_build *
recursive-exclude docs/docsite/_extensions *.pyc *.pyo
include examples/hosts
include examples/ansible.cfg
include examples/scripts/ConfigureRemotingForAnsible.ps1
include examples/scripts/upgrade_to_ps3.ps1
include lib/ansible/keyword_desc.yml
recursive-include lib/ansible/executor/powershell *.ps1
recursive-include lib/ansible/module_utils/csharp *.cs
recursive-include lib/ansible/module_utils/powershell *.psm1
@ -32,5 +35,6 @@ recursive-include test/units *
include Makefile
include MANIFEST.in
include changelogs/CHANGELOG*.rst
include changelogs/changelog.yaml
recursive-include hacking/build_library *.py
include hacking/build-ansible.py

View File

@ -5,16 +5,20 @@
# useful targets:
# make clean ---------------- clean up
# make webdocs -------------- produce ansible doc at docs/docsite/_build/html
# make coredocs ------------- produce core doc at docs/docsite/_build/html
# make sdist ---------------- produce a tarball
# make deb-src -------------- produce a DEB source
# make deb ------------------ produce a DEB
# make docs ----------------- rebuild the manpages (results are checked in)
# make gettext -------------- produce POT files for docs
# make generate-po ---------- generate language specific po file
# make needs-translation ---- generate list of file with unstranlated or fuzzy string for a specific language
# make tests ---------------- run the tests (see https://docs.ansible.com/ansible/devel/dev_guide/testing_units.html for requirements)
########################################################
# variable section
NAME = ansible-base
NAME = ansible-core
OS = $(shell uname -s)
PREFIX ?= '/usr/local'
SDIST_DIR ?= 'dist'
@ -30,7 +34,7 @@ else
ASCII2MAN = @echo "ERROR: rst2man from docutils command is not installed but is required to build $(MANPAGES)" && exit 1
endif
PYTHON=python
PYTHON ?= python
GENERATE_CLI = hacking/build-ansible.py generate-man
# fetch version from project release.py as single source-of-truth
@ -57,6 +61,9 @@ DATE := $(shell date --utc --date="$(GIT_DATE)" +%Y%m%d%H%M)
CPUS ?= $(shell nproc)
endif
# Intenationalisation and Localisation
LANGUAGES ?=
# DEB build parameters
DEBUILD_BIN ?= debuild
DEBUILD_OPTS = --source-option="-I"
@ -153,6 +160,8 @@ clean:
rm -f test/units/.coverage*
rm -rf test/results/*/*
find test/ -type f -name '*.retry' -delete
@echo "Cleaning up symlink cache"
rm -f SYMLINK_CACHE.json
@echo "Cleaning up Debian building stuff"
rm -rf debian
rm -rf deb-build
@ -268,6 +277,22 @@ epub:
webdocs:
(cd docs/docsite/; CPUS=$(CPUS) $(MAKE) docs)
.PHONY: coredocs
coredocs:
(cd docs/docsite/; CPUS=$(CPUS) $(MAKE) coredocs)
.PHONY: gettext
gettext:
(cd docs/docsite/; CPUS=$(CPUS) $(MAKE) gettext)
.PHONY: generate-po
generate-po:
(cd docs/docsite/; CPUS=$(CPUS) LANGUAGES=$(LANGUAGES) $(MAKE) generate-po)
.PHONY: needs-translation
needs-translation:
(cd docs/docsite/; CPUS=$(CPUS) LANGUAGES=$(LANGUAGES) $(MAKE) needs-translation)
.PHONY: linkcheckdocs
linkcheckdocs:
(cd docs/docsite/; CPUS=$(CPUS) $(MAKE) linkcheckdocs)
@ -275,7 +300,7 @@ linkcheckdocs:
.PHONY: generate_rst
generate_rst: lib/ansible/cli/*.py
mkdir -p ./docs/man/man1/ ; \
PYTHONPATH=./lib $(GENERATE_CLI) --template-file=docs/templates/man.j2 --output-dir=docs/man/man1/ --output-format man lib/ansible/cli/*.py
$(GENERATE_CLI) --template-file=docs/templates/man.j2 --output-dir=docs/man/man1/ --output-format man lib/ansible/cli/*.py
docs: generate_rst

View File

@ -1,4 +1,4 @@
|PyPI version| |Docs badge| |Chat badge| |Build Status| |Code Of Conduct| |Mailing Lists| |License|
|PyPI version| |Docs badge| |Chat badge| |Build Status| |Code Of Conduct| |Mailing Lists| |License| |CII Best Practices|
*******
Ansible
@ -12,7 +12,7 @@ changes like zero-downtime rolling updates with load balancers easy. More inform
Design Principles
=================
* Have a dead simple setup process and a minimal learning curve.
* Have a dead-simple setup process with a minimal learning curve.
* Manage machines very quickly and in parallel.
* Avoid custom-agents and additional open ports, be agentless by
leveraging the existing SSH daemon.
@ -28,8 +28,7 @@ Design Principles
Use Ansible
===========
You can install a released version of Ansible via ``pip``, a package manager, or
our `release repository <https://releases.ansible.com/ansible/>`_. See our
You can install a released version of Ansible with ``pip`` or a package manager. See our
`installation guide <https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html>`_ for details on installing Ansible
on a variety of platforms.
@ -53,7 +52,7 @@ Get Involved
* Submit a proposed code update through a pull request to the ``devel`` branch.
* Talk to us before making larger changes
to avoid duplicate efforts. This not only helps everyone
know what is going on, it also helps save time and effort if we decide
know what is going on, but it also helps save time and effort if we decide
some changes are needed.
* For a list of email lists, IRC channels and Working Groups, see the
`Communication page <https://docs.ansible.com/ansible/latest/community/communication.html>`_
@ -64,7 +63,7 @@ Coding Guidelines
We document our Coding Guidelines in the `Developer Guide <https://docs.ansible.com/ansible/devel/dev_guide/>`_. We particularly suggest you review:
* `Contributing your module to Ansible <https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_checklist.html>`_
* `Conventions, tips and pitfalls <https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_best_practices.html>`_
* `Conventions, tips, and pitfalls <https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_best_practices.html>`_
Branch Info
===========
@ -72,7 +71,7 @@ Branch Info
* The ``devel`` branch corresponds to the release actively under development.
* The ``stable-2.X`` branches correspond to stable releases.
* Create a branch based on ``devel`` and set up a `dev environment <https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html#common-environment-setup>`_ if you want to open a PR.
* See the `Ansible release and maintenance <https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html>`_ page for information about active branches.
* See the `Ansible release and maintenance <https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html>`_ page for information about active branches.
Roadmap
=======
@ -84,7 +83,7 @@ Authors
=======
Ansible was created by `Michael DeHaan <https://github.com/mpdehaan>`_
and has contributions from over 4700 users (and growing). Thanks everyone!
and has contributions from over 5000 users (and growing). Thanks everyone!
`Ansible <https://www.ansible.com>`_ is sponsored by `Red Hat, Inc.
<https://www.redhat.com>`_
@ -96,12 +95,12 @@ GNU General Public License v3.0 or later
See `COPYING <COPYING>`_ to see the full text.
.. |PyPI version| image:: https://img.shields.io/pypi/v/ansible.svg
:target: https://pypi.org/project/ansible
.. |PyPI version| image:: https://img.shields.io/pypi/v/ansible-core.svg
:target: https://pypi.org/project/ansible-core
.. |Docs badge| image:: https://img.shields.io/badge/docs-latest-brightgreen.svg
:target: https://docs.ansible.com/ansible/latest/
.. |Build Status| image:: https://api.shippable.com/projects/573f79d02a8192902e20e34b/badge?branch=devel
:target: https://app.shippable.com/projects/573f79d02a8192902e20e34b
.. |Build Status| image:: https://dev.azure.com/ansible/ansible/_apis/build/status/CI?branchName=devel
:target: https://dev.azure.com/ansible/ansible/_build/latest?definitionId=20&branchName=devel
.. |Chat badge| image:: https://img.shields.io/badge/chat-IRC-brightgreen.svg
:target: https://docs.ansible.com/ansible/latest/community/communication.html
.. |Code Of Conduct| image:: https://img.shields.io/badge/code%20of%20conduct-Ansible-silver.svg
@ -113,3 +112,6 @@ See `COPYING <COPYING>`_ to see the full text.
.. |License| image:: https://img.shields.io/badge/license-GPL%20v3.0-brightgreen.svg
:target: COPYING
:alt: Repository License
.. |CII Best Practices| image:: https://bestpractices.coreinfrastructure.org/projects/2372/badge
:target: https://bestpractices.coreinfrastructure.org/projects/2372
:alt: Ansible CII Best Practices certification

View File

@ -0,0 +1,735 @@
========================================================
ansible-core 2.11 "Hey Hey, What Can I Do" Release Notes
========================================================
.. contents:: Topics
v2.11.3rc1
==========
Release Summary
---------------
| Release Date: 2021-07-13
| `Porting Guide <https://docs.ansible.com/ansible/devel/porting_guides.html>`__
Minor Changes
-------------
- ansible-test - aws creates and exposes a new tiny_prefix variable to provide a shorter prefix for the AWS tests.
Bugfixes
--------
- Add unicode support to ``ansible-inventory`` CLI (https://github.com/ansible/ansible/issues/57378)
- Ensure we get full path for extra vars into cliargs to avoid realpath issues after initial load.
- ansible-doc - in text output, do not show empty ``version_added_collection`` values (https://github.com/ansible/ansible/pull/74999).
- ansible-test - restrict ``packaging`` to ``< 21.0`` for Python ``< 3.6`` (https://github.com/ansible/ansible/pull/75186).
- command - remove unreachable code path when trying to convert the value for ``chdir`` to bytes (https://github.com/ansible/ansible/pull/75036)
- module_common - handle exception when multiple workers try to create the cache directory
- roles - make sure argspec validation task templates suboptions (https://github.com/ansible/ansible/issues/75070).
- slurp - improve the logic in the error handling and remove ``os.stat()`` call (https://github.com/ansible/ansible/pull/75038)
- ssh_connection - rename ``retries`` to ``reconnection_retries`` to avoid conflicts with task vars (https://github.com/ansible/ansible/issues/75142).
- ssh_connection - set the default for ``reconnection_retries`` back to ``0`` (https://github.com/ansible/ansible/issues/75142).
- task_executor/ssh_connection - use the ``retries`` value from ``ssh_connection`` settings, not the default from the ``Task`` field attributes (https://github.com/ansible/ansible/issues/75142).
v2.11.2
=======
Release Summary
---------------
| Release Date: 2021-06-22
| `Porting Guide <https://docs.ansible.com/ansible/devel/porting_guides.html>`__
Security Fixes
--------------
- templating engine fix for not preserving usnafe status when trying to preserve newlines. CVE-2021-3583
Bugfixes
--------
- AnsibleModule.set_mode_if_different - don't check file existence when check_mode is activated (https://github.com/ansible/ansible/issues/61185).
- Apply ``display_failed_stderr`` callback option on loop item results. (https://github.com/ansible/ansible/issues/74864)
- Avoid task executor from ending early as vars can come from delegated to host.
- ansible-pull - update documentation for ``--directory`` option to clarify path must be absolute.
- config, ensure 'quoted' lists from ini or env do not take the quotes literally as part of the list item.
- gather_facts, package, service - fix using module_defaults for the modules in addition to the action plugins. (https://github.com/ansible/ansible/issues/72918)
- psrp - Always cleanup the last run pipeline if a second pipeline is invoked to avoid violating any resource limits.
- psrp - Fix error when resetting a connection that was initialised but not connected - (https://github.com/ansible/ansible/issues/74092).
- psrp - Try to clean up any server-side resources when resetting a connection.
- roles - make sure argspec validation task is tagged with ``always`` (https://github.com/ansible/ansible/pull/74994).
- slurp - Fix error messages for unreadable files and directories (https://github.com/ansible/ansible/issues/67340).
- slurp - handle error when ``path`` is a directory and not a file (https://github.com/ansible/ansible/pull/74930).
- ssh connection - fix interaction between transfer settings options.
- subversion - fix stack trace when getting information about the repository (https://github.com/ansible/ansible/issues/36498)
- version test - improve error message when an empty version is provided
v2.11.1
=======
Release Summary
---------------
| Release Date: 2021-05-24
| `Porting Guide <https://docs.ansible.com/ansible/devel/porting_guides.html>`__
Minor Changes
-------------
- ansible adhoc, clarified the help to some options, also added some comments to code.
- command - update the user warning message to point out command name (https://github.com/ansible/ansible/pull/74475).
Bugfixes
--------
- Add RockyLinux to fact gathering (https://github.com/ansible/ansible/pull/74530).
- Improve resilience of ``ansible-galaxy collection`` by increasing the page size to make fewer requests overall and retrying queries with a jittered exponential backoff when rate limiting HTTP codes (520 and 429) occur. (https://github.com/ansible/ansible/issues/74191)
- Prevent ``ansible_failed_task`` from further templating (https://github.com/ansible/ansible/issues/74036)
- Remove 'default' from ssh plugin as we want to rely on default from ssh itself or ssh/config.
- The error message about the failure to import a ``gpg`` key by the ``apt_key`` module was incorrect (https://github.com/ansible/ansible/issues/74423).
- ansible-test - Avoid publishing the port used by the ``pypi-test-container`` since it is only accessed by other containers. This avoids issues when trying to run tests in parallel on a single host.
- ansible-test - Fix docker container IP address detection. The ``bridge`` network is no longer assumed to be the default.
- ansible-test - Use documented API to retrieve build information from Azure Pipelines.
- ansible.builtin.cron - Keep non-empty crontabs, when removing cron jobs (https://github.com/ansible/ansible/pull/74497).
- ansible.utils.encrypt now handles missing or unusable 'crypt' library.
- ansible_test - add constraint for ``MarkupSafe`` (https://github.com/ansible/ansible/pull/74666)
- apt_key - Binary GnuPG keys downloaded via URLs were corrupted so GnuPG could not import them (https://github.com/ansible/ansible/issues/74424).
- become - fix a regression on Solaris where chmod can return 5 which we interpret as auth failure and stop trying become tmpdir permission fallbacks
- become - work around setfacl not existing on modern Solaris (and possibly failing on some filesystems even when it does exist)
- callback default, now uses task delegate_to instead of delegate vars to display delegate to host
- callbacks, restores missing delegate_vars
- correct doc links for become on warnings over world readable settings.
- correctly use world readable setting since old constant is not 'settable' anymore.
- facts - detect homebrew installed at /opt/homebrew/bin/brew
- filter plugins - patch new versions of Jinja2 to prevent warnings/errors on renamed filter decorators (https://github.com/ansible/ansible/issues/74667)
- get_url - Fixed checksum validation for binary files (leading asterisk) in checksum files (https://github.com/ansible/ansible/pull/74502).
- hostname - Add Rocky Linux support
- ini lookup - handle errors for duplicate keys and missing sections (https://github.com/ansible/ansible/issues/74601)
- interpreter discovery - Debian 8 and lower will avoid unsupported Python3 version in interpreter discovery
- pause - ensure control characters are always set to an appropriate value (https://github.com/ansible/ansible/issues/73264)
- playbook loaded from collection subdir now does not ignore subdirs.
- plugin config now allows list type options to have multiple valid choices (#74225).
- replace - better handling of file operation exceptions (https://github.com/ansible/ansible/pull/74686).
- roles - allow for role arg specs in new meta file (https://github.com/ansible/ansible/issues/74525).
- service - compare version without LooseVersion API (https://github.com/ansible/ansible/issues/74488).
v2.11.0
=======
Release Summary
---------------
| Release Date: 2021-04-26
| `Porting Guide <https://docs.ansible.com/ansible/devel/porting_guides.html>`__
Major Changes
-------------
- A collection can be reinstalled with new version requirements without using the ``--force`` flag. The collection's dependencies will also be updated if necessary with the new requirements. Use ``--upgrade`` to force transitive dependency updates.
- AnsibleModule - use ``ArgumentSpecValidator`` class for validating argument spec and remove private methods related to argument spec validation. Any modules using private methods should now use the ``ArgumentSpecValidator`` class or the appropriate validation function.
- Declared ``resolvelib >= 0.5.3, < 0.6.0`` a direct dependency of
ansible-core. Refs:
- https://github.com/sarugaku/resolvelib
- https://pypi.org/p/resolvelib
- https://pradyunsg.me/blog/2020/03/27/pip-resolver-testing
- It became possible to install Ansible Collections from local folders and namespaces folder similar to SCM structure with multiple collections.
- It became possible to upgrade Ansible collections from Galaxy servers using the ``--upgrade`` option with ``ansible-galaxy collection install``.
- Support for role argument specification validation at role execution time. When a role contains an argument spec, an implicit validation task is inserted at the start of role execution.
- add ``ArgumentSpecValidator`` class for validating parameters against an argument spec outside of ``AnsibleModule`` (https://github.com/ansible/ansible/pull/73335)
- ansible-test - Tests run with the ``centos6`` and ``default`` test containers now use a PyPI proxy container to access PyPI when Python 2.6 is used. This allows tests running under Python 2.6 to continue functioning even though PyPI is discontinuing support for non-SNI capable clients.
Minor Changes
-------------
- Add ``--format`` CLI option to ``ansible-galaxy collection list`` which allows for ``human`` (default), ``yaml``, or ``json``. (https://github.com/ansible/ansible/pull/73474)
- Add an example for using var in with_sequence (https://github.com/ansible/ansible/issues/68836).
- Add new rolespec_validate option to the import/include_role modules do allow disabling of the implicit role arg validation task on a per-role basis.
- Add option to pass extra vars to ansible-inventory
- Add path of collection location in Ansible CLI version info.
- Add standard Python 2/3 compatibility boilerplate to setup script, module_utils and docs_fragments which were missing them.
- Add support for `argument_specs` data in role metadata.
- Add support for datetime.date object type in module result (https://github.com/ansible/ansible/issues/70583).
- Add which conditional is being evaluated at each step when debugging.
- Add yum/dnf version comparison documentation for package install
- Added NO_COLOR environment var to ansible color configuration, allowing it to integrate with existing convention.
- Added name of aliases in user error (https://github.com/ansible/ansible/issues/58752).
- Added support for GSSAPI/Kerberos authentication with ``urls.py`` that is used by ``uri`` and ``get_url``.
- Added support for specify custom credentials for GSSAPI authentication.
- Allow an attribute to be passed to the min and max filters with Jinja 2.10+
- Allow for the skipped filter to be used on a registered looped task results. (https://github.com/ansible/ansible/issues/16949)
- Allow inventory plugins access to extra vars by default
- Allow unsafe_writes to be set on target via env var, for those targets that need a blanket setting.
- Also added extra vars cli option to console CLI.
- AnsiballZ - Improve performance of ``ModuleDepFinder`` by using faster lookups and reducing the object types that are walked while looking for ``import`` statements. (https://github.com/ansible/ansible/pull/70475)
- CLI - Specify jinja version in ``--version`` output
- CLI - Specify whether PyYAML includes libyaml support in version output
- CLI version displays clarified as core version
- Callbacks - Migrate more places in the ``TaskExecutor`` to sending callbacks directly over the queue, instead of sending them as ``TaskResult`` and short circuiting in the Strategy to send the callback. This enables closer to real time callbacks of retries and loop results (https://github.com/ansible/ansible/issues/73899)
- Collection routing: Cisco NSO content from community.network migrated to cisco.nso (https://github.com/ansible/ansible/pull/73046).
- Collection routing: DellEMC content from community.general migrated to dellemc.openmanage (https://github.com/ansible/ansible/pull/73046).
- Collection routing: FortiOS content from community.network migrated to community.fortios (https://github.com/ansible/ansible/pull/73046).
- Collection routing: Google content from community.general migrated to community.google (https://github.com/ansible/ansible/pull/73046).
- Collection routing: Hashi Vault content from community.general migrated to community.hashi_vault (https://github.com/ansible/ansible/pull/73046).
- Collection routing: Hetzner Robot content from community.general migrated to community.hrobot (https://github.com/ansible/ansible/pull/73046).
- Collection routing: KubeVirt content from community.general migrated to community.kubevirt (https://github.com/ansible/ansible/pull/73046).
- Collection routing: OC content from community.general migrated to community.okd (https://github.com/ansible/ansible/pull/73046).
- Collection routing: PostgreSQL content from community.general migrated to community.postgresql (https://github.com/ansible/ansible/pull/73046).
- Collection routing: RouterOS content from community.network migrated to community.routeros (https://github.com/ansible/ansible/pull/73046).
- Collection routing: docker content from community.general migrated to community.docker (https://github.com/ansible/ansible/pull/73046).
- Controller - Add warning for Ansible 2.11 when running a Python version older than Python 3.8 to inform users that 2.12 will only support Python 3.8 and newer on the controller. Starting with Ansible 2.11, the project will only be packaged for Python 3.8 and newer.
- Discourage the use of 'hexdigits' in password lookup, as it distorts expected entropy.
- Enable extra vars for inventory plugin options
- Errors - Ensure that errors passed with ``orig_exc`` include the context of that exception (https://github.com/ansible/ansible/issues/68605)
- Filters - Add new ``split`` filter for splitting strings
- Fixed ansible-doc to not substitute for words followed by parenthesis. For instance, ``IBM(International Business Machines)`` will no longer be substituted with a link to a non-existent module. https://github.com/ansible/ansible/pull/71070
- Force the template module to use non-native Jinja2 (https://github.com/ansible/ansible/issues/46169)
- Internal config entries will not be documented, to mark an entry as internal it must start with `_`.
- Interpreter Discovery - Add Python 3.8 and Python 3.9 to the fallback list
- Minor code cleanup in plugin loader.
- Module API - libselinux-python is no longer required for basic module API selinux operations (affects core modules assemble, blockinfile, copy, cron, file, get_url, lineinfile, setup, replace, unarchive, uri, user, yum_repository)
- Module API - new module_respawn API allows modules that need to run under a specific Python interpreter to respawn in place under that interpreter
- Module iptables multiport destination support added (https://github.com/ansible/ansible/pull/72928)
- Module iptables set/ipset support added (https://github.com/ansible/ansible/pull/72984)
- New 'timeout' feature added to adhoc and console CLIs, corresponding to the recent 'timeout' task keyword.
- New virtualization facts, ``virtualization_tech_guest`` and ``virtualization_tech_host`` now allow for conveying when a system is a host or guest of multiple virtualization technologies.
- Now 'choices' keyword in config definitions also restricts valid values for the entry.
- Refactored ``ansible-galaxy collection [download|install|list|verify]`` CLI subcommands with the public interface kept intact.
- Restructured _fixup_perms2() in ansible.plugins.action to make it more linear
- Shadow prompt input to ansible-vault encrypt-string unless the ``--show-input`` flag is set
- Switch to hashlib.sha256() for ansible-test to allow for FIPs mode.
- TOML inventory plugin is no longer in preview status
- Templar - reduce the complexity of ``Templar._lookup`` (https://github.com/ansible/ansible/pull/73277)
- The ``csvfile`` lookup plugin now uses ``parse_kv()`` internally. As a result, multi-word search keys can now be passed.
- The ``csvfile`` lookup plugin's documentation has been fixed; it erroneously said that the delimiter could be ``t`` which was never true. We now accept ``\t``, however, and the error in the documentation has been fixed to note that.
- The constructed inventory plugin has new option to force using vars plugins on previouslly processed inventory sources.
- The find module is now more specific about the reasons it skips candidate files.
- The logging functionality in module_utils.basic now returns a nicer error when it falls back to syslog but ends up getting a TypeError thrown back.
- The new dependency resolver prefers ``MANIFEST.json`` over ``galaxy.yml`` if it exists in the target directory.
- The plugin loader now keeps track of the collection where a plugin was resolved to, in particular whether the plugin was loaded from ansible-core's internal paths (``ansible.builtin``) or from user-supplied paths (no collection name).
- Toggle allowing usage of extra_vars in compose
- When connecting as an unprivileged user, and becoming an unprivileged user, we now fall back to also trying ``chmod +a`` which works on macOS and makes use of ACLs.
- allow tree callback plugin to be configurable, for use with playbooks.
- ansible-doc - In Windows setup steps, ``ExecutionPolicy`` should be restored to default value ``RemoteSigned`` (https://github.com/ansible/ansible/pull/72993).
- ansible-doc - provide ``has_action`` field in JSON output for modules. That information is currently only available in the text view (https://github.com/ansible/ansible/pull/72359).
- ansible-doc has new option to show keyword documentation.
- ansible-doc will now format, ``L()``, ``R()``, and ``HORIZONTALLINE`` in plugin docs just as the website docs do. https://github.com/ansible/ansible/pull/71070
- ansible-galaxy - Add installation successful message
- ansible-galaxy - Added caching mechanisms when retrieving collection info to speed up installs and downloads
- ansible-galaxy - Change the output verbosity level of the download message from 3 to 0 (https://github.com/ansible/ansible/issues/70010)
- ansible-galaxy - Ensure ``get_collection_versions`` returns an empty list when a collection does not exist for consistency across API versions.
- ansible-galaxy - find any collection dependencies in the globally configured Galaxy servers and not just the server the parent collection is from.
- ansible-galaxy CLI - ``collection verify`` command now exits with a non-zero exit code on verification failure
- ansible-galaxy CLI - ``collection verify`` command now supports a ``--offline`` option for local-only verification
- ansible-test - A warning is no longer emitted when a ``pip*`` or ``python*`` binary is found without a matching couterpart.
- ansible-test - Add ``macos/10.15`` as a supported value for the ``--remote`` option.
- ansible-test - Add a ``--docker-network`` option to choose the network for running containers when using the ``--docker`` option.
- ansible-test - Add constraint for ``decorator`` for Python versions prior to 3.5.
- ansible-test - Add support for running tests on Fedora 33 (https://github.com/ansible/ansible/pull/72861).
- ansible-test - Added Ubuntu 20.04 LTS image to the default completion list
- ansible-test - Added a ``--export`` option to the ``ansible-test coverage combine`` command to facilitate multi-stage aggregation of coverage in CI pipelines.
- ansible-test - Added the ``-remote rhel/7.9`` option to run tests on RHEL 7.9
- ansible-test - Allow custom ``--remote-stage`` options for development and testing.
- ansible-test - CentOS 8 container is now 8.2.2004 (https://github.com/ansible/distro-test-containers/pull/45).
- ansible-test - Changed the internal name of the custom plugin used to identify use of unwanted imports and functions.
- ansible-test - Cleaned up code to resolve warnings and errors reported by PyCharm.
- ansible-test - Code cleanup in the ``import`` sanity test.
- ansible-test - Code cleanup in the internal logic for code coverage collection of PowerShell modules.
- ansible-test - Collections can now specify pip constraints for unit and integration test requirements using ``tests/unit/constraints.txt`` and ``tests/integration/constraints.txt`` respectively.
- ansible-test - Containers used with the ``--remote`` option have been updated to version 1.29.0 to include the latest Ansible requirements.
- ansible-test - Files used to track remote instances no longer have a region suffix.
- ansible-test - Fix ``ansible-test coverage`` reporting sub-commands (``report``, ``html``, ``xml``) on Python 2.6.
- ansible-test - Fix container hostname/IP discovery for the ``acme`` test plugin.
- ansible-test - FreeBSD 11.4 and 12.2 provisioning can now be used with the ``--python 3.8`` option.
- ansible-test - FreeBSD instances provisioned with ``--remote`` now make ``libyaml`` available for use with PyYAML installation.
- ansible-test - Generation of an ``egg-info`` directory, if needed, is now done after installing test dependencies and before running tests. When running from an installed version of ``ansible-test`` a temporary directory is used to avoid permissions issues. Previously it was done before installing test dependencies and adjacent to the installed directory.
- ansible-test - Implemented CloudStack test container selection by ENV variable `ANSIBLE_CLOUDSTACK_CONTAINER` with a default to `quay.io/ansible/cloudstack-test-container:1.4.0`.
- ansible-test - Improved handling of minimum Python version requirements for sanity tests. Supported versions are now included in warning messages displayed when tests are skipped.
- ansible-test - More sanity test requirements have been pinned to specific versions to provide consistent test results.
- ansible-test - Most sanity test specific ``pip`` constraints are now used only when running sanity tests. This should reduce conflicts with ``pip`` requirements and constraints when testing collections.
- ansible-test - Most sanity tests are now skipped on Python 3.5 and earlier with a warning. Previously this was done for Python 2.7 and earlier.
- ansible-test - Now supports freebsd/11.4 remote (https://github.com/ansible/ansible/issues/48782).
- ansible-test - Now supports freebsd/12.2 remote (https://github.com/ansible/ansible/issues/72366).
- ansible-test - OpenSuse container now uses Leap 15.2 (https://github.com/ansible/distro-test-containers/pull/48).
- ansible-test - Pin the ``virtualenv`` version used for ``--remote`` pip installs to the latest version supported by Python 2.x, which is version 16.7.10.
- ansible-test - Provisioning of RHEL instances now includes installation of pinned versions of ``packaging`` and ``pyparsing`` to match the downstream vendored versions.
- ansible-test - RHEL 8.2+ provisioning can now be used with the ``--python 3.8`` option, taking advantage of the Python 3.8 AppStream.
- ansible-test - Raise the number of bytes scanned by ansible-test to determine if a file is binary to 4096.
- ansible-test - Refactor code for installing ``cryptography`` to allow re-use in the future.
- ansible-test - Refactor code to remove unused logic for obsolete support of multiple provisioning endpoints.
- ansible-test - Remove ``pytest < 6.0.0`` constraint for managed installations on Python 3.x now that pytest 6 is supported.
- ansible-test - Remove em dash from the Pytest configuration file in order to be readable on systems where preferred encoding is ASCII. (https://github.com/ansible/ansible/issues/71739)
- ansible-test - Remove outdated ``--docker`` completion entries: fedora30, fedora31, ubuntu1604
- ansible-test - Remove outdated ``--remote`` completion entries: freebsd/11.1, freebsd/12.1, osx/10.11, macos/10.15, rhel/7.6, rhel/7.8, rhel/8.1, rhel/8.2
- ansible-test - Remove outdated ``--windows`` completion entries: 2008, 2008-R2
- ansible-test - Remove the discontinued ``us-east-2`` choice from the ``--remote-aws-region`` option.
- ansible-test - Remove unused ``--remote`` completion entry: power/centos/7
- ansible-test - Removed ``pip`` constraints related to integration tests that have been moved to collections. This should reduce conflicts with ``pip`` requirements and constraints when testing collections.
- ansible-test - Removed the obsolete ``--remote-aws-region`` provisioning option.
- ansible-test - Removed the obsolete ``tower`` test plugin for testing Tower modules.
- ansible-test - Removed unused provisioning code and cleaned up remote provider management logic.
- ansible-test - Rename internal functions to match associated constant names that were previously updated.
- ansible-test - Reorganize internal ``pylint`` configuration files for easier comparison and maintenance.
- ansible-test - Report the correct line number in the ``yamllint`` sanity test when reporting ``libyaml`` parse errors in module documentation.
- ansible-test - Request remote resources by provider name for all provider types.
- ansible-test - Show a warning when the obsolete ``--remote-aws-region`` option is used.
- ansible-test - Silence ``pip`` warnings about Python 3.5 being EOL when installing requirements.
- ansible-test - Support custom remote endpoints with the ``--remote-endpoint`` option.
- ansible-test - The ``--remote`` option no longer pre-installs the ``virtualenv`` module on Python 3.x instances. The Python built-in ``venv`` module should be used instead.
- ansible-test - The ``default`` container for both collections and core have been updated to versions 2.11.0 and 1.9.0 respectively.
- ansible-test - The ``pylint`` sanity test is now skipped with a warning on Python 3.9 due to unresolved upstream regressions.
- ansible-test - The ``pylint`` sanity test is now supported on Python 3.8.
- ansible-test - The ``rstcheck`` sanity test is no longer used for collections, but continues to be used for ansible-core.
- ansible-test - The generated ``resource_prefix`` variable now meets the host name syntax requirements specified in RFC 1123 and RFC 952. The value used for local tests now places the random number before the hostname component, rather than after. If the resulting value is too long, it will be truncated.
- ansible-test - Ubuntu containers as well as ``default-test-container`` and ``ansible-base-test-container`` are now slightly smaller due to apt cleanup (https://github.com/ansible/distro-test-containers/pull/46).
- ansible-test - Update ``pylint`` and its dependencies to the latest available versions to support Python 3.9.
- ansible-test - Update built-in service endpoints for the ``--remote`` option.
- ansible-test - Update distribution test containers from version 2.0.1 to 2.0.2.
- ansible-test - Update the Ansible Core and Ansible Collection default test containers to 3.2.0 and 3.2.2 respectively.
- ansible-test - Updated the default test containers to version 3.1.0.
- ansible-test - Upgrade ansible-runner version used in compatibility tests, remove some tasks that were only needed with older versions, and skip in python2 because ansible-runner is soon dropping it.
- ansible-test - Use new endpoint for Parallels based instances with the ``--remote`` option.
- ansible-test - ``default-test-container`` and ``ansible-base-test-container`` now use Python 3.9.0 instead of 3.9.0rc1.
- ansible-test - add https endpoint for ansible-test
- ansible-test - add macOS 11.1 as a remote target (https://github.com/ansible/ansible/pull/72622)
- ansible-test - add the collection plugin directories ``plugin_utils`` and ``sub_plugins`` to list of plugin types. This ensures such plugins are tested for the ``import`` sanity test (https://github.com/ansible/ansible/pull/73599).
- ansible-test - centos6 end of life - container image updated to point to vault base repository (https://github.com/ansible/distro-test-containers/pull/54)
- ansible-test - centos6 image now has multiple fallback yum repositories for CentOS Vault.
- ansible-test - default container now uses default-test-container 2.7.0 and ansible-base-test-container 1.6.0. This brings in Python 3.9.0rc1 for testing.
- ansible-test - now makes a better attempt to support podman when calling ``docker images`` and asking for JSON format.
- ansible-test - python-cryptography is now bounded at <3.2, as 3.2 drops support for OpenSSL 1.0.2 upon which some of our CI infrastructure still depends.
- ansible-test - remote macOS instances no longer install ``virtualenv`` during provisioning
- ansible-test - the ACME test container was updated, it now supports external account creation and has a basic OCSP responder (https://github.com/ansible/ansible/pull/71097, https://github.com/ansible/acme-test-container/releases/tag/2.0.0).
- ansible-test - the ``import`` sanity test now also tries to import all non-module and non-module_utils Python files in ``lib/ansible/`` resp. ``plugins/`` (https://github.com/ansible/ansible/pull/72497).
- ansible-test - virtualenv helper scripts now prefer ``venv`` on Python 3 over ``virtualenv``
- ansible-test Now supports RHEL 8.3
- ansible-test pylint - ensure that removal collection version numbers conform to the semantic versioning specification at https://semver.org/ (https://github.com/ansible/ansible/pull/71679).
- ansible-test pylint sanity test - stop ignoring ``used-before-assignment`` errors (https://github.com/ansible/ansible/pull/73639).
- ansible-test runtime-metadata - compare deprecation and tombstone versions to the current version to ensure that they are correct (https://github.com/ansible/ansible/pull/72625).
- ansible-test runtime-metadata - ensure that removal collection version numbers conform to the semantic versioning specification at https://semver.org/ (https://github.com/ansible/ansible/pull/71679).
- ansible-test runtime-metadata - ensure that the tombstone removal date is not in the future (https://github.com/ansible/ansible/pull/72625).
- ansible-test runtime-metadata - validate removal version numbers, and check removal dates more strictly (https://github.com/ansible/ansible/pull/71679).
- ansible-test validate-modules - ensure that removal collection version numbers and version_added collection version numbers conform to the semantic versioning specification at https://semver.org/ (https://github.com/ansible/ansible/pull/71679).
- ansible-test validate-modules - no longer assume that ``default`` for ``type=bool`` options is ``false``, as the default is ``none`` and for some modules, ``none`` and ``false`` mean different things (https://github.com/ansible/ansible/issues/69561).
- ansible-test validate-modules - option names that seem to indicate they contain secret information that should be marked ``no_log=True`` are now flagged in the validate-modules sanity test. False positives can be marked by explicitly setting ``no_log=False`` for these options in the argument spec. Please note that many false positives are expected; the assumption is that it is by far better to have false positives than false negatives (https://github.com/ansible/ansible/pull/73508).
- ansible-test validate-modules - validate removal version numbers (https://github.com/ansible/ansible/pull/71679).
- ansible.utils.encrypt now returns `AnsibleError` instead of crypt.crypt's `OSError` on Python 3.9
- apt - module now works under any supported Python interpreter
- apt_repository - module now works under any supported Python interpreter
- callback plugins - ``meta`` tasks now get sent to ``v2_playbook_on_task_start``. Explicit tasks are always sent. Plugins can opt in to receiving implicit ones.
- callbacks - Add feature allowing forks to send callback events (https://github.com/ansible/ansible/issues/14681)
- conditionals - change the default of CONDITIONAL_BARE_VARS to False (https://github.com/ansible/ansible/issues/70682).
- config - more types are now automatically coerced to string when ``type: str`` is used and the value is parsed as a different type
- constructed - Add a toggle to allow the separator to be omitted if no prefix has been provided.
- constructed inventory plugin - Sanitize group names created from the ``groups`` option silently.
- create ``get_type_validator`` standalone function and move that functionality out of ``AnsibleModule`` (https://github.com/ansible/ansible/pull/72667)
- create ``get_unsupported_parameters`` validation function (https://github.com/ansible/ansible/pull/72447/files)
- debconf - add a note about no_log=True since module might expose sensitive information to logs (https://github.com/ansible/ansible/issues/32386).
- default callback - add ``show_task_path_on_failure`` option to display file and line number of tasks only on failed tasks when running at normal verbosity level (https://github.com/ansible/ansible/issues/64625)
- default callback - task name is now shown for ``include_tasks`` when using the ``free`` strategy (https://github.com/ansible/ansible/issues/71277).
- default callback - task name is now shown for ``include_tasks`` when using the ``linear`` strategy with ``ANSIBLE_DISPLAY_SKIPPED_HOSTS=0``.
- default_callback - moving 'check_mode_markers' documentation in default_callback doc_fragment (https://github.com/ansible-collections/community.general/issues/565).
- distribution - add facts about Amazon Linux Distribution facts (https://github.com/ansible/ansible/issues/73742).
- distribution - add support for DragonFly distribution (https://github.com/ansible/ansible/issues/43739).
- distribution - added distribution fact and hostname support for Parrot OS (https://github.com/ansible/ansible/pull/69158).
- distribution - handle NetBSD OS Family (https://github.com/ansible/ansible/issues/43739).
- distribution facts - ``distribution_release`` is now ``"Stream"`` on CentOS Stream (https://github.com/ansible/ansible/issues/73027).
- dnf - Add nobest option (https://github.com/ansible/ansible/issues/69983)
- dnf - When ``state: absent``, package names are now matched similarly to how the ``dnf`` CLI matches them (https://github.com/ansible/ansible/issues/72809).
- dnf - module now works under any supported Python interpreter
- dnf - now shows specific package changes (installations/removals) under ``results`` in check_mode. (https://github.com/ansible/ansible/issues/66132)
- facts - ``/dev/kvm`` is now consulted in Linux virtualization facts, and the host is considered a KVM host if this file exists and none of the pre-existing checks matched.
- facts - add new fact ``date_time['tz_dst']``, which returns the daylight saving timezone (https://github.com/ansible/ansible/issues/69004).
- facts - add uptime to openbsd
- find module - Now has a ``read_whole_file`` boolean parameter which allows for reading the whole file and doing an ``re.search()`` regex evaluation on it when searching using the ``contains`` option. This allows (for example) for ensuring the very end of the file matches a pattern.
- galaxy - add documentation about galaxy parameters in examples/ansible.cfg (https://github.com/ansible/ansible/issues/68402).
- galaxy - handle token as dict while loading from yaml file (https://github.com/ansible/ansible/issues/70887).
- get_url - allow checksum urls to point to file:// resources, moving scheme test to function
- get_url - handle same SHA sum for checksum file (https://github.com/ansible/ansible/issues/71420).
- git - add ``single_branch`` parameter (https://github.com/ansible/ansible/pull/28465)
- hash filter - fail when unsupported hash type is passed as an argument (https://github.com/ansible/ansible/issues/70258)
- inventory cache - do not show a warning when the cache file does not (yet) exist.
- iptables - add a note about ipv6-icmp in protocol parameter (https://github.com/ansible/ansible/issues/70905).
- iptables - fixed get_chain_policy API (https://github.com/ansible/ansible/issues/68612).
- iptables - reorder comment postition to be at the end (https://github.com/ansible/ansible/issues/71444).
- lineinfile - add search_string parameter for non-regexp searching (https://github.com/ansible/ansible/issues/70470)
- linux facts - Add additional check to ensure 'container' virtual fact gets added to guest_tech when appropriate (https://github.com/ansible/ansible/pull/71385)
- meta - now include a ``skip_reason`` when skipped (https://github.com/ansible/ansible/pull/71355).
- module payload builder - module_utils imports in any nested block (eg, ``try``, ``if``) are treated as optional during module payload builds; this allows modules to implement runtime fallback behavior for module_utils that do not exist in older versions of Ansible.
- module_utils - ``get_file_attributes()`` now takes an optional ``include_version`` boolean parameter. When ``True`` (default), the file's version/generation number is included in the result (but requires ``lsattr -v`` to work on the target platform).
- now !unsafe works on all types of data, not just strings, even recursively for mappings and sequences.
- package_facts - module support for apt and rpm now works under any supported Python interpreter
- pipe lookup - update docs for Popen with shell=True usages (https://github.com/ansible/ansible/issues/70159).
- plugin examples - Allow non-YAML examples, so that examples for plugins like the INI and TOML inventory plugins can be directly represented (https://github.com/ansible/ansible/pull/71184)
- plugin option validation - now the option type ``dict``/``dictionary`` is also validated by the config manager (https://github.com/ansible/ansible/pull/71928).
- reboot - add ``reboot_command`` parameter to allow specifying the command used to reboot the system (https://github.com/ansible/ansible/issues/51359)
- remove ``excommunicate`` debug command from AnsiballZ
- selinux - return selinux_getpolicytype facts correctly.
- service_facts - return service state information on AIX.
- service_facts - return service state information on OpenBSD.
- setup - allow list of filters (https://github.com/ansible/ansible/pull/68551).
- setup - fix distribution facts for Older Amazon Linux with ``/etc/os-release`` (https://github.com/ansible/ansible/issues/73946).
- setup.py - Declare that Python 3.9 is now supported (https://github.com/ansible/ansible/pull/72861).
- setup.py - Skip doing conflict checks for ``sdist`` and ``egg_info`` commands (https://github.com/ansible/ansible/pull/71310)
- subelements - clarify the lookup plugin documentation for parameter handling (https://github.com/ansible/ansible/issues/38182).
- subversion - ``validate_certs`` option, which, when true, will avoid passing ``--trust-server-cert`` to ``svn`` commands (https://github.com/ansible/ansible/issues/22599).
- unarchive - Add support for .tar.zst (zstd compression) (https://github.com/ansible/ansible/pull/73265).
- unarchive - add ``RETURN`` documentation (https://github.com/ansible/ansible/issues/67445).
- unarchive - add ``include`` parameter to allow extracting specific files from an archive (https://github.com/ansible/ansible/pull/40522)
- update sphinx to 2.1.2 and rstcheck to 3.3.1 for building documentation.
- uri - add ``ca_path`` argument to allow specification of a CA certificate (https://github.com/ansible/ansible/pull/71979).
- user - add new parameters ``password_expire_max`` and ``password_expire_min`` for controlling password expiration (https://github.com/ansible/ansible/issues/68775)
- varnames lookup plugin - Fixed grammar error in exception message when the plugin is given a non-string term.
- vault - Provide better error for single value encrypted values to indicate the file, line, and column of the errant vault (https://github.com/ansible/ansible/issues/72276)
- version test - Add semantic version functionality
- virtual facts - containerd cgroup is now recognized as container tech (https://github.com/ansible/ansible/issues/66304).
- virtualization facts - Detect ``vdsmd`` in addition to ``vdsm`` when trying to detect RHEV hosts. (https://github.com/ansible/ansible/issues/66147)
- winrm - Added ``ansible_winrm_kinit_args`` that can be used to control the args that are sent to the ``kinit`` call for Kerberos authentication.
- yum - module now works under any supported Python interpreter
- yum_repository - added boolean option module_hotfixes which allows to enable functionality for dnf.
Breaking Changes / Porting Guide
--------------------------------
- Made SCM collections be reinstalled regardless of ``--force`` being present.
- NetBSD virtualization facts (specifically ``ansible_virtualization_type``) now returns a more accurate value by checking the value of the ``machdep.hypervisor`` ``sysctl`` key. This change is breaking because in some cases previously, we would erroneously report ``xen`` even when the target is not running on Xen. This prevents that behavior in most cases. (https://github.com/ansible/ansible/issues/69352)
- Replaced the in-tree dependency resolver with an external implementation that pip >= 20.3 uses now by default — ``resolvelib``. (https://github.com/ansible/ansible/issues/71784)
- The ``meta`` module now supports tags for user-defined tasks. Internal ``meta`` tasks continue to always run. (https://github.com/ansible/ansible/issues/64558)
- ansible-galaxy login command has been removed (see https://github.com/ansible/ansible/issues/71560)
Deprecated Features
-------------------
- Starting in 2.14, shell and command modules will no longer have the option to warn and suggest modules in lieu of commands. The ``warn`` parameter to these modules is now deprecated and defaults to ``False``. Similarly, the ``COMMAND_WARNINGS`` configuration option is also deprecated and defaults to ``False``. These will be removed and their presence will become an error in 2.14.
- apt_key - the paramater ``key`` does not have any effect, has been deprecated and will be removed in ansible-core version 2.14 (https://github.com/ansible/ansible/pull/70319).
- psrp - Set the minimum version of ``pypsrp`` to ``0.4.0``.
Removed Features (previously deprecated)
----------------------------------------
- Removed `SharedPluginLoaderObj` class from ansible.plugins.strategy. It was deprecated in favor of using the standard plugin loader.
- Removed `_get_item()` alias from callback plugin base class which had been deprecated in favor of `_get_item_label()`.
- The "user" parameter was previously deprecated and is now removed in favor of "scope"
- The deprecated ``ansible.constants.BECOME_METHODS`` has been removed.
- The deprecated ``ansible.constants.get_config()`` has been removed.
- The deprecated ``ansible.constants.mk_boolean()`` has been removed.
- `with_*` loops are no longer optimized for modules whose `name` parameters can take lists (mostly package managers). Use `name` instead of looping over individual names with `with_items` and friends.
Security Fixes
--------------
- **security issue** - Mask default and fallback values for ``no_log`` module options (CVE-2021-20228)
- **security issue** - copy - Redact the value of the no_log 'content' parameter in the result's invocation.module_args in check mode. Previously when used with check mode and with '-vvv', the module would not censor the content if a change would be made to the destination path. (CVE-2020-14332)
- Sanitize no_log values from any response keys that might be returned from the uri module (CVE-2020-14330).
- dnf - Previously, regardless of the ``disable_gpg_check`` option, packages were not GPG validated. They are now. (CVE-2020-14365)
Bugfixes
--------
- A handler defined within a role will now search handlers subdir for included tasks (issue https://github.com/ansible/ansible/issues/71222).
- ALLOW_WORLD_READABLE_TMP, switched to 'moved' message as 'deprecation' is misleading since config settings still work w/o needing change.
- ANSIBLE_COLLECTIONS_PATHS - remove deprecation so that users of Ansible 2.9 and 2.10+ can use the same var when specifying a collection path without a warning.
- Added unsafe_writes test.
- Address compat with rpmfluff-0.6 for integration tests
- Address the deprecation of the use of stdlib distutils in packaging. It's a short-term hotfix for the problem (https://github.com/ansible/ansible/issues/70456, https://github.com/pypa/setuptools/issues/2230, https://github.com/pypa/setuptools/commit/bd110264)
- Adjust various hard-coded action names to also include their ``ansible.builtin.`` and ``ansible.legacy.`` prefixed version (https://github.com/ansible/ansible/issues/71817, https://github.com/ansible/ansible/issues/71818, https://github.com/ansible/ansible/pull/71824).
- Allow TypeErrors on Undefined variables in filters to be handled or deferred when processing for loops.
- Allow `~` to be present in file names in galaxy roles (https://github.com/ansible/ansible/issues/72966)
- Always mention the name of the deprecated or tombstoned plugin in routing deprecation/tombstone messages (https://github.com/ansible/ansible/pull/73059).
- Ansible output now uses stdout to determine column width instead of stdin
- AnsibleModule - added arg ``ignore_invalid_cwd`` to ``AnsibleModule.run_command()``, to control its behaviour when ``cwd`` is invalid. (https://github.com/ansible/ansible/pull/72390)
- Apply ``_wrap_native_text`` only for builtin filters specified in STRING_TYPE_FILTERS.
- Automatically remove async cache files for polled async tasks that have completed (issue https://github.com/ansible/ansible/issues/73206).
- Be smarter about collection paths ending with ansible_collections, emulating a-galaxy behaviour. Issue 72628
- CLI - Restore git information in version output when running from source
- Collection callbacks were ignoring options and rules for stdout and adhoc cases.
- Collections - Ensure ``action_loader.get`` is called with ``collection_list`` to properly find collections when ``collections:`` search is specified (https://github.com/ansible/ansible/issues/72170)
- Command module now returns stdout & stderr if executable is missing or an unknown error occurs
- ConfigManager - Normalize ConfigParser between Python2 and Python3 to for handling comments (https://github.com/ansible/ansible/issues/73709)
- Continue execution when 'flatten' filter when it hits a None/null value as part of the list.
- Correct the inventory source error parse handling, specifically make the config INVENTORY_ANY_UNPARSED_IS_FAILED work as expected.
- Correctly set template_path and template_fullpath for usage in template lookup and action plugins.
- Deal with failures when sorting JSON and you have incompatible key types.
- Display - Use wcswidth to calculate printable width of a text string (https://github.com/ansible/ansible/issues/63105)
- Enabled unsafe_writes for get_url which was ignoring the paramter.
- Ensure Ansible's unique filter preserves order (https://github.com/ansible/ansible/issues/63417)
- Ensure if a traceback halts ``strategy.run`` that we still attempt to clean up (https://github.com/ansible/ansible/issues/23958)
- Ensure password passed in by -k is used on delegated hosts that do not have ansible_password set
- Ensure the correct options are used when ssh executables are used that don't match ssh executable names.
- Facts collection - get serial number of NVMe device without sg_inq (https://github.com/ansible/ansible/issues/66663).
- Fix --list-tasks format `role_name : task_name` when task name contains the role name. (https://github.com/ansible/ansible/issues/72505)
- Fix ``RecursionError`` when templating large vars structures (https://github.com/ansible/ansible/issues/71920)
- Fix ``delegate_facts: true`` when ``ansible_python_interpreter`` is not set. (https://github.com/ansible/ansible/issues/70168)
- Fix adding unrelated candidate names to the plugin loader redirect list.
- Fix an exit code for a non-failing playbook (https://github.com/ansible/ansible/issues/71306)
- Fix ansible-galaxy collection list to show collections in site-packages (https://github.com/ansible/ansible/issues/70147)
- Fix bytestring vs string comparison in module_utils.basic.is_special_selinux_path() so that special-cased filesystems which don't support SELinux context attributes still allow files to be manipulated on them. (https://github.com/ansible/ansible/issues/70244)
- Fix execution of the meta tasks 'clear_facts', 'clear_host_errors', 'end_play', 'end_host', and 'reset_connection' when the CLI flag '--flush-cache' is provided.
- Fix fileglob bug where it could return different results for different order of parameters (https://github.com/ansible/ansible/issues/72873).
- Fix incorrect msg in the results dict in loops
- Fix incorrect re-run of roles with tags (https://github.com/ansible/ansible/issues/69848)
- Fix incorrect variable scoping when using ``import with context`` in Jinja2 templates. (https://github.com/ansible/ansible/issues/72615)
- Fix jsonfile cache plugin option '_uri' to be a type path instead of a string. (https://github.com/ansible/ansible/issues/38002)
- Fix notifying handlers via `role_name : handler_name` when handler name contains the role name. (https://github.com/ansible/ansible/issues/70582)
- Fix parsing of values when using empty string as a key (https://github.com/ansible/ansible/issues/57132)
- Fix statistics reporting when rescue block contains another block (issue https://github.com/ansible/ansible/issues/61253).
- Fix to previous deprecation change (#70504) which caused command warning deprecation to show in all cases, even when not specified by the user.
- Fixed TypeError instancemethod expecting at least 2 arguments for apt_repository(issue https://github.com/ansible/ansible/issues/69308, PR https://github.com/ansible/ansible/pull/69463)
- Fixed issue when `netstat` is either missing or doesn't have execution permissions leading to incorrect command being executed.
- Fixes ``ansible-galaxy role info`` to support multiple roles on the command line (https://github.com/ansible/ansible/pull/70148)
- Fixes ansible-test traceback when plugin author is not a string or a list of strings (https://github.com/ansible/ansible/pull/70507)
- Handle more varnames that can create conflicts, expand a function in general, handle jinja2 globals in particular (https://github.com/ansible/ansible/issues/41955).
- INTERPRETER_PYTHON_DISTRO_MAP - prefer ``/usr/libexec/platform-python`` on ``oraclelinux 8`` when other pythons are present.
- Improve Ansible config deprecations to show the source of the deprecation (ansible-core). Also remove space before a comma in config deprecations (https://github.com/ansible/ansible/pull/72697).
- Improved/fixed regular expressions in ``validate-modules/validate_modules/schema.py`` and ``utils/collection_loader/_collection_finder.py`` (https://github.com/ansible/ansible/pull/73577).
- Includes - Explicitly get the include task, and not assume it is the parent (https://github.com/ansible/ansible/issues/65710)
- InventoryManager - Fix unhandled exception when given limit file was actually a directory.
- InventoryManager - Fix unhandled exception when inventory directory was empty or contained empty subdirectories (https://github.com/ansible/ansible/issues/73658).
- JSON Encoder - Ensure we treat single vault encrypted values as strings (https://github.com/ansible/ansible/issues/70784)
- Lookup user by UID in password database if login name is not found (https://github.com/ansible/ansible/issues/17029)
- OpenBSD module_utils - update sysctl variable name
- Pass expression in angle-bracket notation as filename argument to a ``compile()`` built-in function, so that Python debuggers do not try to parse it as filename.
- Pass the connection's timeout to connection plugins instead of the task's timeout.
- Provide more information in AnsibleUndefinedVariable (https://github.com/ansible/ansible/issues/55152)
- Python module_utils finder - refactor logic to eliminate many corner cases, remove recursion, fix base module_utils redirections
- Remove an embedded function from RoleMixin and add tests for it (https://github.com/ansible/ansible/pull/72754).
- Remove the warning displayed when validating the arg spec of a role with dependencies and add it to the documentation.
- Restore the ability for changed_when/failed_when to function with group_by (#70844).
- Restored unsafe_writes functionality which was being skipped.
- Restructured pipelining settings to be at the connection plugins leaving base config as global and for backwards compatiblity.
- SSH plugin - Improve error message when ssh client is not found on the host
- Setup virtualization_facts - add RHV and oVirt type. This change will fully work for VMs in clusters at cluster level 4.4 or newer (https://github.com/ansible/ansible/pull/72876).
- Skip invalid collection names when listing in ansible-doc instead of throwing exception. Issue#72257
- Skip literal_eval for string filters results in native jinja. (https://github.com/ansible/ansible/issues/70831)
- Stop adding the connection variables to the output results
- Strategy - When building the task in the Strategy from the Worker, ensure it is properly marked as finalized and squashed. Addresses an issue with ``ansible_failed_task``. (https://github.com/ansible/ansible/issues/57399)
- Suppress warning when user directory used in --playbook-dir option with ansible-inventory command (https://github.com/ansible/ansible/issues/65262).
- TOML inventory - Ensure we register dump functions for ``AnsibleUnsafe`` to support dumping unsafe values. Note that the TOML format has no functionality to mark that the data is unsafe for re-consumption. (https://github.com/ansible/ansible/issues/71307)
- Terminal plugins - add "\e[m" to the list of ANSI sequences stripped from device output
- The ``docker`` and ``k8s`` action groups / module default groups now also support the moved modules in `community.docker <https://galaxy.ansible.com/community/docker>`_, `community.kubevirt <https://github.com/ansible-collections/community.kubevirt>`_, `community.okd <https://galaxy.ansible.com/community/okd>`_, and `kubernetes.core <https://galaxy.ansible.com/kubernetes/core>`_ (https://github.com/ansible/ansible/pull/72428).
- The ``flush()`` method of ``CachePluginAdjudicator`` now calls the plugin's ``flush()`` method instead of iterating over the keys that the adjudicator knows about and deleting those from the cache. (https://github.com/ansible/ansible/issues/68770)
- The `ansible_become` value was not being treated as a boolean value when set in an INI format inventory file (fixes bug https://github.com/ansible/ansible/issues/70476).
- The machine-readable changelog ``changelogs/changelog.yaml`` is now contained in the release.
- Try to avoid kernel 'blocking' state on reading files while fact gathering.
- Updated docs and added warning on max_fail_percentage and free strategy usage. fixes issue 16666.
- VariableManager - Add the 'vars' key before getting delegated variables (https://github.com/ansible/ansible/issues/71092).
- Vault - Allow single vault encrypted values to be used directly as module parameters. (https://github.com/ansible/ansible/issues/68275)
- WorkerProcess - Implement workaround for stdout deadlock in multiprocessing shutdown to avoid process hangs.
- WorkerProcess - Python 3.5 fix for workaround for stdout deadlock in multiprocessing shutdown to avoid process hangs. (https://github.com/ansible/ansible/issues/74149)
- [set_fact] Corrected and expanded documentation as well as now raise errors that were previously ignored.
- account for bug in Python 2.6 that occurs during interpreter shutdown to avoid stack trace
- action plugins - change all action/module delegations to use FQ names while allowing overrides (https://github.com/ansible/ansible/issues/69788)
- add AlmaLinux to fact gathering (https://github.com/ansible/ansible/pull/73458)
- add constraints file for ``ansible_runner`` test since an update to ``psutil`` is now causing test failures
- add magic/connection vars updates from delegated host info.
- add support for alpine linux 'apk' package manager in package_facts
- allow become method 'su' to work on 'local' connection by allocating a fake tty.
- ansible-console - Ctrl+C (in a task) abort current task, and put you back on prompt (this behavior doesn't change) (ditto)
- ansible-console - Ctrl+C (on prompt) used to exit the shell, unlike most shells, it should just reset the current line (ie. abort it and spawn a new prompt) (https://github.com/ansible/ansible/issues/68529)
- ansible-console - Ctrl+D (on prompt) now exit the shell, this is the expected behavior in a shell (cf bash, sh, zsh, ipython, ...) (ditto)
- ansible-console - add more documentation, specifically on various commands[1] (https://github.com/ansible/ansible/issues/72195)
- ansible-console - fixes few strings' typos
- ansible-console - remove useless and poorly formatted comment section (replaced with [1])
- ansible-doc - account for an empty ``meta/main.yml`` file when displaying role information (https://github.com/ansible/ansible/pull/73590)
- ansible-doc - collection name for plugin top-level deprecation was not inserted when deprecating by version (https://github.com/ansible/ansible/pull/70344).
- ansible-doc - improve error message in text formatter when ``description`` is missing for a (sub-)option or a return value or its ``contains`` (https://github.com/ansible/ansible/pull/70046).
- ansible-doc - improve man page formatting to avoid problems when YAML anchors are used (https://github.com/ansible/ansible/pull/70045).
- ansible-doc - include the collection name in the text output (https://github.com/ansible/ansible/pull/70401).
- ansible-doc - plugin option deprecations now also get ``collection_name`` added (https://github.com/ansible/ansible/pull/71735).
- ansible-doc - properly show plugin name when ``name:`` is used instead of ``<plugin_type>:`` (https://github.com/ansible/ansible/pull/71966).
- ansible-galaxy - Cache the responses for available collection versions after getting all pages. (https://github.com/ansible/ansible/issues/73071)
- ansible-galaxy - Instead of assuming the first defined server is galaxy, filter based on the servers that support the v1 API, and return the first of those (https://github.com/ansible/ansible/issues/65440)
- ansible-galaxy - Use ``sys.exit`` instead of ``exit`` when reporting an error for the removed login command.
- ansible-galaxy - correct ``collections-path`` command line argument (https://github.com/ansible/ansible/issues/73127)
- ansible-galaxy - fixed galaxy role init command (https://github.com/ansible/ansible/issues/71977).
- ansible-galaxy collection download - fix downloading tar.gz files and collections in git repositories (https://github.com/ansible/ansible/issues/70429)
- ansible-galaxy collection install - fix fallback mechanism if the AH server did not have the collection requested - https://github.com/ansible/ansible/issues/70940
- ansible-galaxy download - fix bug when downloading a collection in a SCM subdirectory
- ansible-pull - Run all playbooks that when multiple are supplied via the command line (https://github.com/ansible/ansible/issues/72708)
- ansible-test - Add ``pytest < 6.0.0`` constraint for managed installations on Python 3.x to avoid issues with relative imports.
- ansible-test - Add a ``six < 1.14.0`` constraint for Python 2.6.
- ansible-test - Always connect additional Docker containers to the network used by the current container (if any).
- ansible-test - Always map ``/var/run/docker.sock`` into test containers created by the ``--docker`` option if the docker host is not ``localhost``.
- ansible-test - Attempt to detect the Docker hostname instead of assuming ``localhost``.
- ansible-test - Avoid using ``/tmp`` to resolve occasional failures starting tests with the ``--docker`` option.
- ansible-test - Change classification using ``--changed`` now consistently handles common configuration files for supported CI providers.
- ansible-test - Change detection now properly resolves relative imports instead of treating them as absolute imports.
- ansible-test - Correctly detect changes in a GitHub pull request when running on Azure Pipelines.
- ansible-test - Correctly detect running in a Docker container on Azure Pipelines.
- ansible-test - Do not try to validate PowerShell modules ``setup.ps1``, ``slurp.ps1``, and ``async_status.ps1``
- ansible-test - Prefer container IP at ``.NetworkSettings.Networks.{NetworkName}.IPAddress`` over ``.NetworkSettings.IPAddress``.
- ansible-test - Running tests using an installed version of ``ansible-test`` against one Python version from another no longer fails due to a missing ``egg-info`` directory. This could occur when testing plugins which import ``pkg_resources``.
- ansible-test - Running tests using an installed version of ``ansible-test`` no longer generates an error attempting to create an ``egg-info`` directory when an existing one is not found in the expected location. This could occur if the existing ``egg-info`` directory included a Python version specifier in the name.
- ansible-test - Skip installing requirements if they are already installed.
- ansible-test - Symbolic links are no longer used to inject ``python`` into the environment, since they do not work reliably in all cases. Instead, the existing Python based exec wrapper is always used.
- ansible-test - Temporarily limit ``cryptography`` to versions before 3.4 to enable tests to function.
- ansible-test - The ``--export`` option for ``ansible-test coverage`` is now limited to the ``combine`` command. It was previously available for reporting commands on which it had no effect.
- ansible-test - The ``--raw`` option for ``ansible-test shell --remote`` now uses ``sh`` for the shell instead of ``bash``, which may not be present.
- ansible-test - The ``--remote`` option has been updated for Python 2.7 to work around breaking changes in the newly released ``get-pip.py`` bootstrapper.
- ansible-test - The ``--remote`` option has been updated to use a versioned ``get-pip.py`` bootstrapper to avoid issues with future releases.
- ansible-test - The ``ansible-doc`` sanity test now works for ``netconf`` plugins.
- ansible-test - The ``ansible-test coverage combine`` option ``--export`` now exports relative paths. This avoids loss of coverage data when aggregating across systems with different absolute paths. Paths will be converted back to absolute when generating reports.
- ansible-test - The ``changelog`` sanity test has been updated to ensure ``rstcheck`` does not load the ``sphinx`` module.
- ansible-test - The ``cs`` and ``openshift`` test plugins now search for containers on the current network instead of assuming the ``bridge`` network.
- ansible-test - The ``resource_prefix`` variable provided to tests running on Azure Pipelines is now converted to lowercase to match other CI providers.
- ansible-test - Unified SSH key management for all instances created with the ``--remote`` or ``--docker`` options.
- ansible-test - Using the ``--remote`` option on Azure Pipelines now works from a job running in a container.
- ansible-test - ``cryptography`` is now limited to versions prior to 3.2 only when an incompatible OpenSSL version (earlier than 1.1.0) is detected
- ansible-test - add constraint for ``cffi`` to prevent failure on systems with older versions of ``gcc`` (https://foss.heptapod.net/pypy/cffi/-/issues/480)
- ansible-test - convert target paths to unicode on Python 2 to avoid ``UnicodeDecodeError`` (https://github.com/ansible/ansible/issues/68398, https://github.com/ansible/ansible/pull/72623).
- ansible-test - ensure the correct unit test target is given when the ``__init__.py`` file is modified inside the connection plugins directory
- ansible-test - ensure unit test paths for connection and inventory plugins are correctly identified for collections (https://github.com/ansible/ansible/issues/73876).
- ansible-test - improve classification of changes to ``.gitignore``, ``COPYING``, ``LICENSE``, ``Makefile``, and all files ending with one of ``.in`, ``.md`, ``.rst``, ``.toml``, ``.txt`` in the collection root directory (https://github.com/ansible/ansible/pull/72353).
- ansible-test - integration and unit test change detection now works for filter, lookup and test plugins
- ansible-test now always uses the ``--python`` option for ``virtualenv`` to select the correct interpreter when creating environments with the ``--venv`` option
- ansible-test sanity changelog test - bump dependency on antsibull-changelog to 0.9.0 so that `fragments that add new plugins or objects <https://github.com/ansible-community/antsibull-changelog/blob/main/docs/changelogs.rst#adding-new-roles-playbooks-test-and-filter-plugins>`_ will not fail validation (https://github.com/ansible/ansible/pull/73428).
- ansible-test units - fixed collection location code to work under pytest >= 6.0.0
- ansible-test validate-modules - ``version_added`` on module level was not validated for modules in collections (https://github.com/ansible/ansible/pull/70869).
- ansible-test validate-modules - return correct error codes ``option-invalid-version-added`` resp. ``return-invalid-version-added`` instead of the wrong error ``deprecation-either-date-or-version`` when an invalid value of ``version_added`` is specified for an option or a return value (https://github.com/ansible/ansible/pull/70869).
- ansible-test validate-modules - when a module uses ``add_file_common_args=True`` and does not use a keyword argument for ``argument_spec`` in ``AnsibleModule()``, the common file arguments were not considered added during validation (https://github.com/ansible/ansible/pull/72334).
- ansible_pkg_mgr fact - now correctly returns ``atomic_container`` when run on "RHEL for Edge" images and Fedora/RHEL/CentOS Atomic Host (https://github.com/ansible/ansible/issues/73084).
- api - time.clock is removed in Python 3.8, add backward compatible code (https://github.com/ansible/ansible/issues/70649).
- apt - add ``fail_on_autoremove`` param to apt module to avoid unintended package removals (https://github.com/ansible/ansible/issues/63231)
- apt - fix policy_rc_d parameter throwing an exception when restoring original file (https://github.com/ansible/ansible/issues/66211)
- apt - include exception message from apt python library in error output
- apt_key - Specifying ``file`` as mutually exclusive with ``data``, ``keyserver``, ``url`` (https://github.com/ansible/ansible/pull/70492).
- apt_repository - fixes ``mode`` doc to remove ineffective default (https://github.com/ansible/ansible/pull/70319).
- argument spec validation - fix behavior of ``apply_defaults=True`` when an empty dictionary is specified for such an option (https://github.com/ansible/ansible/pull/74029).
- assemble - fix decrypt argument in the module (https://github.com/ansible/ansible/issues/65450).
- async - Fix Python 3 interpreter parsing from module by comparing with bytes (https://github.com/ansible/ansible/issues/70690)
- async_wrapper - Fix race condition when ``~/.ansible_async`` folder tries to be created by multiple async tasks at the same time - https://github.com/ansible/ansible/issues/59306
- avoid possible errors accessing os.environ by not assuming existance of variables.
- basic - handle exceptions for default selectors in Python 2.7 (https://github.com/ansible/ansible/issues/71704).
- basic - use PollSelector implementation when DefaultSelector fails (https://github.com/ansible/ansible/issues/70238).
- bcrypt hashing - Ensure we repair the salt, to avoid warnings (https://github.com/ansible/ansible/issues/36129)
- blockinfile - properly insert a block at the end of a file that does not have a trailing newline character (https://github.com/ansible/ansible/issues/72055)
- blockinfile now returns name of backup file when this option is used.
- clarified changed status to reflect existing rule that had never been written down.
- collection loader - fix bogus code coverage entries for synthetic packages
- collection metadata - ensure collection loader uses libyaml/CSafeLoader to parse collection metadata if available
- connection/ssh, ensure parameters come from correct source get_option, so functionality matches docs.
- connection/ssh, fix reset to use same parameters to check if socket exists as actually used, was hardcoded to default string construction previouslly.
- cron - cron file should not be empty after adding var (https://github.com/ansible/ansible/pull/71207)
- cron - encode and decode crontab files in UTF-8 explicitly to allow non-ascii chars in cron filepath and job (https://github.com/ansible/ansible/issues/69492)
- debug action, prevent setting facts when displaying ansible_facts.
- default callback - Ensure that the ``host_pinned`` strategy is not treated as lockstep (https://github.com/ansible/ansible/issues/73364)
- delegate_to - Ensure that calculating ``delegate_to`` vars with a loop uses the correct context to correctly evaluate the loop (https://github.com/ansible/ansible/issues/37132)
- display correct error information when an error exists in the last line of the file (https://github.com/ansible/ansible/issues/16456)
- distribution - add support for Pardus Linux distribution (https://github.com/ansible/ansible/issues/71636).
- distribution facts - Allow ``distribution_major_version`` and ``distribution_version`` to work for RC and PRERELEASE versions of FreeBSD (and derived distributions) (https://github.com/ansible/ansible/issues/72331).
- dnf - fix filtering to avoid dependncy conflicts (https://github.com/ansible/ansible/issues/72316)
- dnf - it is now possible to specify both ``security: true`` and ``bugfix: true`` to install updates of both types. Previously, only security would get installed if both were true. (https://github.com/ansible/ansible/issues/70854)
- ensure 'local' connection always has the correct default user for actions to consume.
- ensure delegated vars can resolve hostvars object and access vars from hostvars[inventory_hostname].
- ensure find_mount_point consistently returns text.
- ensure we don't clobber role vars data when getting an empty file
- expect - Operate pexpect with bytes to avoid potential encoding issues (https://github.com/ansible/ansible/issues/29351)
- facts - account for Slackware OS with ``+`` in the name (https://github.com/ansible/ansible/issues/38760)
- facts - fix distribution fact for SLES4SAP (https://github.com/ansible/ansible/pull/71559).
- facts - fix incorrect UTC timestamp in ``iso8601_micro`` and ``iso8601``
- facts - properly report virtualization facts for Linux guests running on bhyve (https://github.com/ansible/ansible/issues/73167)
- file - prevent link src from being rewritten when src is not specified explicitly (https://github.com/ansible/ansible/issues/65448)
- file - the module should warn in check_mode when path an owner/group don't exist (https://github.com/ansible/ansible/issues/67307).
- find module - Don't treat empty excludes as a match (https://github.com/ansible/ansible/issues/70640)
- find module - Stop traversing directories past the requested depth. (https://github.com/ansible/ansible/issues/73627)
- find module, fix default pattern when use_regex is true.
- fix issue with inventory_hostname and delegated host vars mixing on connection settings.
- fortimanager httpapi plugin - fix redirect to point to the ``fortinet.fortimanager`` collection (https://github.com/ansible/ansible/pull/71073).
- galaxy - handle plus sign in user token appearing in role url (https://github.com/ansible/ansible/issues/45475).
- get_sysctl now handles multiline values and does not die silently anymore.
- get_url - skip checksum during ``--check`` (https://github.com/ansible/ansible/issues/61369).
- git - Only pass ``--raw`` flag to git verify commands (verify-tag, verify-commit) when ``gpg_whitelist`` is in use. Otherwise don't pass it so that non-whitelist GPG validation still works on older Git versions. (https://github.com/ansible/ansible/issues/64469)
- gluster modules - fix redirect to point to the ``gluster.gluster`` collection (https://github.com/ansible/ansible/pull/71240).
- hostname - Fixed an issue where the hostname on the alinux could not be set.
- hostname - add Almalinux support (https://github.com/ansible/ansible/pull/73619)
- hostname - add macOS support (https://github.com/ansible/ansible/pull/54439)
- if the ``type`` for a module parameter in the argument spec is callable, do not pass ``kwargs`` to avoid errors (https://github.com/ansible/ansible/issues/70017)
- import_playbook - change warning about extra parameters to deprecation (https://github.com/ansible/ansible/issues/72745)
- improve deprecation message when using bare variable (https://github.com/ansible/ansible/pull/70687)
- inventory - pass the vars dictionary to combine_vars instead of an individual key's value (https://github.com/ansible/ansible/issues/72975).
- inventory plugins - Let plugins define the sanitization method for the constructed ``groups`` feature.
- inventory_hostnames - Use ``InventoryManager`` instead of trying to replicate its behavior (https://github.com/ansible/ansible/issues/17268)
- is_string/vault - Ensure the is_string helper properly identifies AnsibleVaultEncryptedUnicode as a string (https://github.com/ansible/ansible/pull/71609)
- j2 plugin loader clarified comments, made note with better fqcn detection.
- lineinfile - fix not subscriptable error in exception handling around file creation
- linux network facts - get the correct value for broadcast address (https://github.com/ansible/ansible/issues/64384)
- native jinja2 types - properly handle Undefined in nested data.
- notify keyword is not ignored anymore on import_tasks, also able to apply to blocks now.
- package - use list of built in package managers from facts rather than creating a new list
- paramiko connection plugin - Ensure we only reset the connection when one has been previously established (https://github.com/ansible/ansible/issues/65812)
- password hashing - Ensure we validate salts against allowed characters and length when using ``crypt`` (https://github.com/ansible/ansible/issues/71107)
- password lookup - Try to automatically generate salts using known salt sizes (https://github.com/ansible/ansible/issues/53750)
- pause - Fix indefinite hang when using a pause task on a background process (https://github.com/ansible/ansible/issues/32142)
- pause - catch additional error on setting up curses (https://github.com/ansible/ansible/pull/73588).
- pause - do not accept enter to continue when a timeout is set (https://github.com/ansible/ansible/issues/73948)
- pause - do not warn when running in the background if a timeout is provided (https://github.com/ansible/ansible/issues/73042)
- pause - handle exception when there is no stdout (https://github.com/ansible/ansible/pull/47851)
- powershell - fix escaping of strings that broken modules like fetch when dealing with special chars - https://github.com/ansible/ansible/issues/62781
- powershell - fix the CLIXML parser when it contains nested CLIXML objects - https://github.com/ansible/ansible/issues/69550
- powershell - remove getting the PowerShell version from the env var ``POWERSHELL_VERSION``. This feature never worked properly and can cause conflicts with other libraries that use this var
- psrp - Fix hang when copying an empty file to the remote target
- psrp - Use native PSRP mechanism when copying files to support custom endpoints
- quote filter - normalize how ``None`` is handled, to match Python3 behavior (https://github.com/ansible/ansible/issues/32174)
- reboot - Add support for the runit init system, used on Void Linux, that does not support the normal Linux syntax.
- remove contradictory recomendation from template docs. https://github.com/ansible/ansible/issues/63484
- remove redundant remote_user setting in play_context for local as plugin already does it, also removes fork/thread issue from use of pwd library.
- reset logging level to INFO due to CVE-2019-14846.
- restrict module valid JSON parsed output to objects as lists are not valid responses.
- runas - create a new token when running as ``SYSTEM`` to ensure it has the full privileges assigned to that account
- service - Fix for the BSD rcconf code using a Python 2 specific string replace function
- set_mode_if_different - handle symlink if it is inside a directory with sticky bit set (https://github.com/ansible/ansible/pull/45198)
- setup module, fix error handling on bad subset given
- setup, don't give up on all local facts gathering if one script file fails.
- several fixes to make apt_key better at identifying needs for change and also to avoid changes in check_mode.
- shell - fix quoting of mkdir command in creation of remote_tmp in order to allow spaces and other special characters (https://github.com/ansible/ansible/issues/69577).
- splunk httpapi plugin - switch from splunk.enterprise_security to splunk.es in runtime.yml to reflect upstream change of Collection Name
- ssh connection plugin - use ``get_option()`` rather than ``_play_context`` to ensure ``ANSBILE_SSH_ARGS`` are applied properly (https://github.com/ansible/ansible/issues/70437)
- stat - handle colons in filename while parsing the mimetype output (https://github.com/ansible/ansible/issues/70256).
- strftime filter - Input epoch is allowed to be a float (https://github.com/ansible/ansible/issues/71257)
- su become plugin, ensure correct type for localization option.
- systemd - account for templated unit files using ``@`` when searching for the unit file (https://github.com/ansible/ansible/pull/72347#issuecomment-730626228)
- systemd - fixed chroot usage on new versions of systemd, that broke because of upstream changes in systemctl output
- systemd - follow up fix to https://github.com/ansible/ansible/issues/72338 to use ``list-unit-files`` rather than ``list-units`` in order to show all units files on the system.
- systemd - made the systemd module work correctly when the SYSTEMD_OFFLINE environment variable is set
- systemd - preserve the full unit name when using a templated service and ``systemd`` failed to parse dbus due to a known bug in ``systemd`` (https://github.com/ansible/ansible/pull/72985)
- systemd - work around bug with ``systemd`` 245 and 5.8 kernel that does not correctly report service state (https://github.com/ansible/ansible/issues/71528)
- task parsing - strip spaces from action name when using ``action: foo bar=baz`` form. (https://github.com/ansible/ansible/issues/62136)
- templating - fix error message for ``x in y`` when y is undefined (https://github.com/ansible/ansible/issues/70984)
- the unvault lookup plugin returned a byte string. Now returns a real string.
- to_text(stdout) before json.loads in psrp.Connection.put_file in case stdout is bytes
- unarchive - ``zip`` unarchive no longer errors on RHEL/CentOS 6 and old Fedora when attempting to use a numeric gid (https://github.com/ansible/ansible/issues/71903).
- unarchive - check ``fut_gid`` against ``run_gid`` in addition to supplemental groups (https://github.com/ansible/ansible/issues/49284)
- undeprecate hash_merge setting and add more docs clarifying its use and why not to use it.
- uri - ``status_code`` elements are type ``int``
- url lookup - make sure that options supplied in ansible.cfg are actually used (https://github.com/ansible/ansible/pull/71736).
- url lookup - set default user agent to ``ansible-httpget`` (https://github.com/ansible/ansible/pull/72324)
- urls - Close filedescriptor of certificate chain tempfile to prevent stale filedescriptor leakage (https://github.com/ansible/ansible/pull/71825).
- user - AnsibleModule.run_command returns a tuple of return code, stdout and stderr. The module main function of the user module expects user.create_user to return a tuple of return code, stdout and stderr. Fix the locations where stdout and stderr got reversed.
- user - Local users with an expiry date cannot be created as the ``luseradd`` / ``lusermod`` commands do not support the ``-e`` option. Set the expiry time in this case via ``lchage`` after the user was created / modified. (https://github.com/ansible/ansible/issues/71942)
- user - do the right thing when ``password_lock=True`` and ``password`` are used together (https://github.com/ansible/ansible/issues/72992)
- user - don't create home directory and missing parents when create_home == false (https://github.com/ansible/ansible/pull/70600).
- validate-modules - do not raise an ``AttributeError`` if a value is assigned to a module attribute in a try/except block.
- vault - Support reading raw binary data from stdin under python3
- virtual facts - kubevirt is now identified as "KubeVirt" and with a "guest" role instead of "kvm" and "host" role (https://github.com/ansible/ansible/issues/72001).
- wait_for - catch and ignore errors when getting active connections with psutil (https://github.com/ansible/ansible/issues/72322)
- wait_for module, move missing socket into function to get proper comparrison in time.
- win setup - Fix redirection path for the windows setup module
- windows async - use full path when calling PowerShell to reduce reliance on environment vars being correct - https://github.com/ansible/ansible/issues/70655
- winrm - preserve winrm forensic data on put_file failures
- yamllint - do not raise an ``AttributeError`` if a value is assigned to a module attribute at the top of the module.
Known Issues
------------
- ansible-test - The ``pylint`` sanity test no longer correctly detects "bad" variable names for non-constants. See https://github.com/PyCQA/pylint/issues/3701 for additional details.
New Modules
-----------
- validate_argument_spec - Validate role argument specs.

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,12 @@
---
title: Ansible Base
title: ansible-core
release_tag_re: '(v(?:[\d.ab\-]|rc)+)'
pre_release_tag_re: '(?P<pre_release>(?:[ab]|rc)+\d*)$'
changes_file: changelog.yaml
changes_format: combined
keep_fragments: true
always_refresh: true
ignore_other_fragment_extensions: true
mention_ancestor: false
notesdir: fragments
prelude_section_name: release_summary

View File

@ -0,0 +1,3 @@
minor_changes:
- callbacks - Add feature allowing forks to send callback events
(https://github.com/ansible/ansible/issues/14681)

View File

@ -0,0 +1,2 @@
bugfixes:
- display correct error information when an error exists in the last line of the file (https://github.com/ansible/ansible/issues/16456)

View File

@ -0,0 +1,2 @@
minor_changes:
- Allow for the skipped filter to be used on a registered looped task results. (https://github.com/ansible/ansible/issues/16949)

View File

@ -0,0 +1,2 @@
bugfixes:
- Lookup user by UID in password database if login name is not found (https://github.com/ansible/ansible/issues/17029)

View File

@ -0,0 +1,3 @@
bugfixes:
- inventory_hostnames - Use ``InventoryManager`` instead of trying to replicate its behavior
(https://github.com/ansible/ansible/issues/17268)

View File

@ -1,3 +0,0 @@
bugfixes:
- uri - Don't return the body even if it failed
(https://github.com/ansible/ansible/issues/21003)

View File

@ -0,0 +1,2 @@
minor_changes:
- subversion - ``validate_certs`` option, which, when true, will avoid passing ``--trust-server-cert`` to ``svn`` commands (https://github.com/ansible/ansible/issues/22599).

View File

@ -0,0 +1,3 @@
bugfixes:
- Ensure if a traceback halts ``strategy.run`` that we still attempt to clean up
(https://github.com/ansible/ansible/issues/23958)

View File

@ -0,0 +1,3 @@
bugfixes:
- expect - Operate pexpect with bytes to avoid potential encoding issues
(https://github.com/ansible/ansible/issues/29351)

View File

@ -0,0 +1,4 @@
bugfixes:
- >
pause - Fix indefinite hang when using a pause task on a background
process (https://github.com/ansible/ansible/issues/32142)

View File

@ -0,0 +1,3 @@
bugfixes:
- quote filter - normalize how ``None`` is handled, to match Python3 behavior
(https://github.com/ansible/ansible/issues/32174)

View File

@ -0,0 +1,2 @@
bugfixes:
- hostname - add macOS support (https://github.com/ansible/ansible/pull/54439)

View File

@ -0,0 +1,2 @@
minor_changes:
- debconf - add a note about no_log=True since module might expose sensitive information to logs (https://github.com/ansible/ansible/issues/32386).

View File

@ -1,2 +0,0 @@
minor_changes:
- ssh - connection plugin now supports a new variable ``sshpass_prompt`` which gets passed to ``sshpass`` allowing the user to set a custom substring to search for a password prompt (requires sshpass 1.06+)

View File

@ -0,0 +1,2 @@
bugfixes:
- subversion - fix stack trace when getting information about the repository (https://github.com/ansible/ansible/issues/36498)

View File

@ -0,0 +1,4 @@
bugfixes:
- delegate_to - Ensure that calculating ``delegate_to`` vars with a loop
uses the correct context to correctly evaluate the loop
(https://github.com/ansible/ansible/issues/37132)

View File

@ -0,0 +1,2 @@
minor_changes:
- subelements - clarify the lookup plugin documentation for parameter handling (https://github.com/ansible/ansible/issues/38182).

View File

@ -0,0 +1,2 @@
bugfixes:
- facts - account for Slackware OS with ``+`` in the name (https://github.com/ansible/ansible/issues/38760)

View File

@ -0,0 +1,4 @@
minor_changes:
- >
unarchive - add ``include`` parameter to allow extracting specific files
from an archive (https://github.com/ansible/ansible/pull/40522)

View File

@ -0,0 +1,2 @@
minor_changes:
- distribution - add support for DragonFly distribution (https://github.com/ansible/ansible/issues/43739).

View File

@ -0,0 +1,2 @@
bugfixes:
- galaxy - handle plus sign in user token appearing in role url (https://github.com/ansible/ansible/issues/45475).

View File

@ -0,0 +1,2 @@
minor_changes:
- Force the template module to use non-native Jinja2 (https://github.com/ansible/ansible/issues/46169)

View File

@ -1,3 +0,0 @@
---
bugfixes:
- copy - Fixed copy module not working in case that remote_src is enabled and dest ends in a / (https://github.com/ansible/ansible/pull/47238)

View File

@ -0,0 +1,2 @@
minor_changes:
- Allow an attribute to be passed to the min and max filters with Jinja 2.10+

View File

@ -1,4 +0,0 @@
---
bugfixes:
- apt - Fixed the issue the cache being updated while auto-installing its
dependencies even when ``update_cache`` is set to false.

View File

@ -0,0 +1,2 @@
bugfixes:
- vault - Support reading raw binary data from stdin under python3

View File

@ -1,2 +0,0 @@
minor_changes:
- Raise error when no task file is provided to import_tasks (https://github.com/ansible/ansible/issues/54095).

View File

@ -0,0 +1,2 @@
bugfixes:
- Provide more information in AnsibleUndefinedVariable (https://github.com/ansible/ansible/issues/55152)

View File

@ -0,0 +1,2 @@
minor_changes:
- default_callback - moving 'check_mode_markers' documentation in default_callback doc_fragment (https://github.com/ansible-collections/community.general/issues/565).

View File

@ -1,6 +0,0 @@
bugfixes:
- synchronize - fix password authentication on Python 2 (https://github.com/ansible/ansible/issues/56629)
- >
AnsibleModule.run_command() - set ``close_fds`` to ``False`` on Python 2 if ``pass_fds`` are passed to
``run_command()``. Since ``subprocess.Popen()`` on Python 2 does not have the ``pass_fds`` option,
there is no way to exclude a specific list of file descriptors from being closed.

View File

@ -1,2 +0,0 @@
bugfixes:
- Remove the unnecessary warning about aptitude not being installed (https://github.com/ansible/ansible/issues/56832).

View File

@ -1,2 +0,0 @@
minor_changes:
- apt_repository - Implemented an exponential backoff behaviour when retrying to update the apt cache with new params ``update_cache_retry_max_delay`` and ``update_cache_retries`` to control the behavior.

View File

@ -0,0 +1,2 @@
bugfixes:
- Add unicode support to ``ansible-inventory`` CLI (https://github.com/ansible/ansible/issues/57378)

View File

@ -0,0 +1,5 @@
bugfixes:
- Strategy - When building the task in the Strategy from the Worker,
ensure it is properly marked as finalized and squashed. Addresses an
issue with ``ansible_failed_task``.
(https://github.com/ansible/ansible/issues/57399)

View File

@ -1,3 +0,0 @@
---
bugfixes:
- Add missing gcp modules to gcp module defaults group

View File

@ -1,4 +0,0 @@
bugfixes:
- combine filter - ``[dict1, [dict2]] | combine`` now raise an error; previously ``combine`` had an undocumented behaviour where it was flattening the list before combining it (https://github.com/ansible/ansible/pull/57894#discussion_r339517518).
minor_changes:
- combine filter - now accept a ``list_merge`` argument which modifies its behaviour when the hashes to merge contain arrays/lists.

View File

@ -1,2 +0,0 @@
bugfixes:
- copy - recursive copy with ``remote_src=yes`` now recurses beyond first level. (Fixes https://github.com/ansible/ansible/issues/58284)

View File

@ -0,0 +1,2 @@
minor_changes:
- Added name of aliases in user error (https://github.com/ansible/ansible/issues/58752).

View File

@ -1,5 +0,0 @@
bugfixes:
- "ansible-test - during module validation, improve alias handling."
- "ansible-test - during module validation, handle add_file_common_args only for top-level arguments."
minor_changes:
- "ansible-test - extend alias validation."

View File

@ -1,2 +0,0 @@
bugfixes:
- Use hostnamectl command to get current hostname for host while using systemd strategy (https://github.com/ansible/ansible/issues/59438).

View File

@ -1,2 +0,0 @@
bugfixes:
- CLI - the `ANSIBLE_PLAYBOOK_DIR` envvar or `playbook_dir` config can now substitute for the --playbook-dir arg on CLIs that support it (https://github.com/ansible/ansible/issues/59464)

View File

@ -1,2 +0,0 @@
bugfixes:
- cron and cronvar - use get_bin_path utility to locate the default crontab executable instead of the hardcoded /usr/bin/crontab. (https://github.com/ansible/ansible/pull/59765)

View File

@ -1,5 +0,0 @@
bugfixes:
- >
group - The group module was not correctly detecting whether a local
group is existing or not with local set to yes if the same group
exists in a non local group repository e.g. LDAP. (https://github.com/ansible/ansible/issues/58619)

View File

@ -1,4 +0,0 @@
bugfixes:
- template lookup - ensure changes to the templar in the lookup, do not
affect the templar context outside of the lookup
(https://github.com/ansible/ansible/issues/60106)

View File

@ -1,2 +0,0 @@
minor_changes:
- apt - Implemented an exponential backoff behaviour when retrying to update the cache with new params ``update_cache_retry_max_delay`` and ``update_cache_retries`` to control the behavior.

View File

@ -1,2 +0,0 @@
bugfixes:
- Handle exception encountered while parsing the argument description in module when invoked via ansible-doc command (https://github.com/ansible/ansible/issues/60587).

View File

@ -1,2 +0,0 @@
minor_changes:
- Add an additional check for importing journal from systemd-python module (https://github.com/ansible/ansible/issues/60595).

View File

@ -0,0 +1,2 @@
minor_changes:
- constructed - Add a toggle to allow the separator to be omitted if no prefix has been provided.

View File

@ -1,6 +0,0 @@
---
minor_changes:
- vars plugins - Support vars plugins in collections by adding the ability to whitelist plugins.
- host_group_vars plugin - Require whitelisting and whitelist by default.
- Add a global toggle to control when vars plugins are executed (per task by default for backward compatibility or after importing inventory).
- Add a per-plugin stage option to override the global toggle to control the execution of individual vars plugins (per task, after inventory, or both).

View File

@ -0,0 +1,2 @@
bugfixes:
- AnsibleModule.set_mode_if_different - don't check file existence when check_mode is activated (https://github.com/ansible/ansible/issues/61185).

View File

@ -0,0 +1,2 @@
minor_changes:
- Add yum/dnf version comparison documentation for package install

View File

@ -0,0 +1,2 @@
bugfixes:
- get_url - skip checksum during ``--check`` (https://github.com/ansible/ansible/issues/61369).

View File

@ -1,4 +0,0 @@
bugfixes:
- ansible-inventory - Properly hide arguments that should not be shown
(https://github.com/ansible/ansible/issues/61604)
- ansible-inventory - Restore functionality to allow ``--graph`` to be limited by a host pattern

View File

@ -1,2 +0,0 @@
bugfixes:
- ansible-galaxy - Fix url building to not truncate the URL (https://github.com/ansible/ansible/issues/61624)

View File

@ -1,2 +0,0 @@
minor_changes:
- "``AnsibleModule.load_file_common_arguments`` now allows to simply override ``path``."

View File

@ -1,2 +0,0 @@
minor_changes:
- Remove the deprecation message for the ``TRANSFORM_INVALID_GROUP_CHARS`` setting. (https://github.com/ansible/ansible/issues/61889)

View File

@ -1,2 +0,0 @@
minor_changes:
- get_url - Remove deprecated string format support for the headers option (https://github.com/ansible/ansible/issues/61891)

View File

@ -1,3 +0,0 @@
bugfixes:
- get_url - Don't treat no checksum as a checksum match
(https://github.com/ansible/ansible/issues/61978)

View File

@ -1,2 +0,0 @@
bugfixes:
- ansible-test coverage - Fix the ``--all`` argument when generating coverage reports - https://github.com/ansible/ansible/issues/62096

View File

@ -1,2 +0,0 @@
minor_changes:
- user - allow groups, append parameters with local

View File

@ -0,0 +1,2 @@
bugfixes:
- "task parsing - strip spaces from action name when using ``action: foo bar=baz`` form. (https://github.com/ansible/ansible/issues/62136)"

View File

@ -1,5 +0,0 @@
security_fixes:
- >
**security issue** - TaskExecutor - Ensure we don't erase unsafe context in TaskExecutor.run on bytes.
Only present in 2.9.0beta1
(https://github.com/ansible/ansible/issues/62237)

View File

@ -1,2 +0,0 @@
bugfixes:
- Remove a temp directory created by wait_for_connection action plugin (https://github.com/ansible/ansible/issues/62407).

View File

@ -1,4 +0,0 @@
minor_changes:
- callbacks - Allow modules to return `None` as before/after entries for diff.
This should make it easier for modules to report the "not existing" state of
the entity they touched.

View File

@ -1,2 +0,0 @@
bugfixes:
- AnsibleDumper - Add a representer for AnsibleUnsafeBytes (https://github.com/ansible/ansible/issues/62562).

View File

@ -1,2 +0,0 @@
minor_changes:
- core filters - Adding ``path_join`` filter to the core filters list

View File

@ -1,2 +0,0 @@
bugfixes:
- "package_facts - fix value of ``vital`` attribute which is returned when ``pkg`` manager is used"

View File

@ -1,3 +0,0 @@
---
minor_changes:
- dnf - Properly handle idempotent transactions with package name wildcard globs (https://github.com/ansible/ansible/issues/62809)

View File

@ -1,2 +0,0 @@
bugfixes:
- ansible-galaxy - Default collection install path to first path in COLLECTIONS_PATHS (https://github.com/ansible/ansible/pull/62870)

View File

@ -0,0 +1,3 @@
bugfixes:
- Display - Use wcswidth to calculate printable width of a text string
(https://github.com/ansible/ansible/issues/63105)

View File

@ -1,2 +0,0 @@
bugfixes:
- lineinfile - fix bug that caused multiple line insertions (https://github.com/ansible/ansible/issues/58923).

Some files were not shown because too many files have changed in this diff Show More