Compare commits

...

497 commits

Author SHA1 Message Date
Rick Elrod 0f6c6f89ec Update Ansible release version to v2.10.11.post0. 2021-06-22 02:52:23 -05:00
Rick Elrod 4d849f9a4f New release v2.10.11 2021-06-22 00:17:41 -05:00
Rick Elrod de4a08e22d Update Ansible release version to v2.10.11rc1.post0. 2021-06-14 22:16:35 -05:00
Rick Elrod 96681819e8 New release v2.10.11rc1 2021-06-14 17:41:42 -05:00
Jordan Borean 9e90c873c4
psrp - cleanup command (#74985) (#75000)
(cherry picked from commit 58d8397771)
2021-06-14 17:12:10 -05:00
Sloane Hertel e30ffb8499
[2.10] Fix using module-specific module_defaults in action plugins (#74850)
* 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

(cherry picked from commit 267b7215b3)
2021-06-14 10:08:10 -05:00
Jordan Borean c6d647a8f0
psrp - Fix reset connection on failed scenarios (#74967) (#74983)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit cf3a304ce1)
2021-06-14 08:54:39 -05:00
Brian Coca 8aa850e357
fix unsafe preservation across newlines (#74960) (#74975)
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:22 -05:00
Felix Fontein 67d2d13997
Update inventory script references from c.g to ansible-community/contrib-scripts. (#74905) (#74927)
(cherry picked from commit acf09e56a2)
2021-06-07 13:53:14 -05:00
Rick Elrod b5f15999d7 Update Ansible release version to v2.10.10.post0. 2021-05-24 17:50:56 -05:00
Rick Elrod 2c75abf14d New release v2.10.10 2021-05-24 14:49:48 -05:00
Rick Elrod 2e3c5df8eb Update Ansible release version to v2.10.10rc1.post0. 2021-05-17 18:47:05 -05:00
Rick Elrod 85dd907d0f New release v2.10.10rc1 2021-05-17 16:56:55 -05:00
Sloane Hertel 093986dfaf
[2.10] ansible-galaxy - increase page size and add retry decorator (#74649)
* ansible-galaxy - increase page size and add retry decorator for throttling (#74240)

* 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

ci_complete

Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
(cherry picked from commit ee725846f0)

* Add changelog for ansible-galaxy improvements (#74738)

Changelog for #74240

(cherry picked from commit 9cfedcd9c9)
2021-05-17 16:04:16 -05:00
Sam Doran ee4e3564f0 [stable-2.10] Remove leftover test file from incidental_setup_rabbitmq removal 2021-05-17 11:25:43 -07:00
Brian Coca e949469a17
Correctly set path and fullpath for template vars (#73924) (#74050)
* Correctly set path and fullpath for template vars

 don't expect path to always be full path
 also added exception/tb on action fail

(cherry picked from commit 22330dd322)
2021-05-17 12:11:59 -05:00
elara-leitstellentechnik 2b29428f22
[2.10] Do not remove non-empty cron tabs (#74697)
* 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:12:28 -05:00
Abhijeet Kasurde a6a2af7814
[bp-2.10] service - compare version without LooseVersion (#74619)
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 00:26:32 -05:00
Sam Doran 8c95db4b8d
[stable-2.10] Use our own copy of the Codecov uploader (#74460) (#74492)
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-05-17 00:25:58 -05:00
David Shrewsbury 62d69fc724
Fix fileglob parameter order bug (#72879) (#72904)
(cherry picked from commit fe17cb6eba)
2021-05-17 00:23:06 -05:00
Sam Doran c34bfc58cc [stable-2.10] 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:33 -07:00
Matt Clay a28aa38f6c Remove incidental_lookup_rabbitmq test.
It is no longer contributing unique code coverage.

(cherry picked from commit 26e8c07f32)
2021-05-14 12:05:57 -07:00
Sam Doran d1978c64e8
[stable-2.10] Remove incidental Azure tests (#74681) 2021-05-12 14:40:11 -07:00
Sam Doran b345760393 [stable-2.10] 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-12 10:10:44 -07:00
Matt Clay 357714a7c4 [stable-2.10] Fix ansible-test AZP build lookup.
(cherry picked from commit 877e5b3dfe)

Co-authored-by: Matt Clay <matt@mystile.com>
2021-05-04 10:13:28 -07:00
Matt Clay 369af59c6c [stable-2.10] 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-05-04 10:13:08 -07:00
Sandra McCann 2642ddd7f3
update versions (#74432) (#74451)
(cherry picked from commit a75bae8a62)
2021-05-04 10:02:24 -05:00
Bill Nottingham c332359121
Product-related updates. (#74462) 2021-05-03 22:10:27 -05:00
Alicia Cozine e6fd6361bd
Change look and feel of the ansible-core docs (#74200) (#74482)
* Change look and feel of the `ansible-core` docs (#74200)

(cherry picked from commit d7f826c987)

* 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)

Co-authored-by: Sandra McCann <samccann@redhat.com>
2021-05-03 22:09:51 -05:00
Rick Elrod 6748ec169c Update Ansible release version to v2.10.9.post0. 2021-05-03 22:03:54 -05:00
Rick Elrod d1c49f2e1c New release v2.10.9 2021-05-03 14:34:37 -05:00
Sam Doran b69a23fe0e
[stable-2.10] incidental_setup_rabbitmq test - Use official repo for rabbitmq-erlang (#74452)
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:30:54 -05:00
Rick Elrod 9afd6e8f52 Update Ansible release version to v2.10.9rc1.post0. 2021-04-27 11:46:58 -05:00
Rick Elrod a5d4122076 New release v2.10.9rc1 2021-04-27 09:09:06 -05:00
Martin Krizek 316dbd50ed
Prevent ansible_failed_task from further templating (#74290) (#74307)
(cherry picked from commit 664531d7d6)
2021-04-27 08:35:39 -05:00
Brian Coca cd81eddb80
fix wait_for looping when missing net module (#73963) (#74007)
fixes #43486

(cherry picked from commit c1eed681aa)
2021-04-27 08:18:24 -05:00
Matt Clay 768c165a84 [stable-2.10] Fix pypi-test-container port conflict.
(cherry picked from commit cb7f4f1971)

Co-authored-by: Matt Clay <matt@mystile.com>
2021-04-26 23:00:18 -07:00
Martin Krizek 115e5998f4
Actually run blocks/finalized_task test (#74291) (#74311)
(cherry picked from commit 7fecb7ccc3)
2021-04-26 10:29:27 -05:00
Brian Coca 55ad72992d defend against bad or missing crypt (#74304)
* defend against bad or missing crypt

  fixes #74279

(cherry picked from commit 4494ef3a9d)
2021-04-26 10:28:56 -05:00
Brian Coca 80f8b90b43 removed unused imports (#74299)
(cherry picked from commit e3eeb88f7c)
2021-04-26 10:28:56 -05:00
Matt Davis 768f3d75f9
Map Debian 8 to Python 2 (#74152) (#74360)
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-04-26 10:22:27 -05:00
Matt Clay cb4209489f
[stable-2.10] Fix ansible-test docker container IP detection.. (#74389)
(cherry picked from commit 14ff5e213c)

Co-authored-by: Matt Clay <matt@mystile.com>
2021-04-26 10:21:32 -05:00
Fernando Correia 0d25d392aa
Detect Homebrew on Mac M1 (Apple Silicon) (#74378) (#74400)
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-04-26 10:20:33 -05:00
Sandra McCann db5b2faf2e
pin docutils to 0.16 until theme problem is fixed (#74193) (#74399)
(cherry picked from commit 7443e9d659)
2021-04-23 10:09:35 -05:00
Alicia Cozine c2f2041be1
Backport/2.10/docs config (#74278)
* update intersphinx links for Ansible 3

(cherry picked from commit 481c036632)

* updates list of available versions for Ansible 3 (#74265)

(cherry picked from commit 126e9244c2)

Co-authored-by: Sandra McCann <samccann@redhat.com>
2021-04-16 16:04:44 -05:00
Rick Elrod 621d1a94ab
undeprecated hash_merge setting (#73328) (#74219)
Co-authored-by: Brian Coca <bcoca@users.noreply.github.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-04-13 13:22:18 -05:00
Alexander Sowitzki cc99cfbf9b [stable-2.10] 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:58:46 -07:00
Matt Clay 3d11b480d0
[stable-2.10] Switch to hashlib.sha256() for ansible-test (#72411) (#74169)
When FIPs mode is enable on centos-8, we are not able to load md5
functions.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
(cherry picked from commit a95213d2f5)

Co-authored-by: Paul Belanger <pabelanger@redhat.com>

Co-authored-by: Paul Belanger <pabelanger@redhat.com>
2021-04-12 20:57:10 -05:00
Sam Doran 19ab9ed7b9
[stable-2.10] ansible-test - ensure trailing separator is added for connection unit test target (#74176) (#74181)
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 20:56:19 -05:00
Matt Clay f5e27ef7ea
[stable-2.10] Add PyPI proxy container for tests on Python 2.6. (#74205)
(cherry picked from commit becf941673)

Co-authored-by: Matt Clay <matt@mystile.com>
2021-04-12 20:55:45 -05:00
Rick Elrod 3c19c9e02b Update Ansible release version to v2.10.8.post0. 2021-04-12 20:53:07 -05:00
Rick Elrod 675691ce52 New release v2.10.8 2021-04-12 17:13:49 -05:00
Rick Elrod e11c2a7b16 Update Ansible release version to v2.10.8rc1.post0. 2021-04-05 21:50:45 -05:00
Rick Elrod 6011ef5f55 New release v2.10.8rc1 2021-04-05 19:34:12 -05:00
Brian Coca 9f74f0663a
Nonfatal facts (#73804) (#73830)
continue with local facts vs at script error
 actually capture execution errors
 better error messages in general
 add more local facts tests

 fixes #52427

(cherry picked from commit 9db557e431)
2021-04-05 12:53:10 -05:00
Brian Coca 1995b1b6e0
find - set proper default based on use_regex (#73961) (#73965)
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>
(cherry picked from commit 089d0a0508)

* Fix up bad rebase, nuke duplicate "elements:" lines

Signed-off-by: Rick Elrod <rick@elrod.me>
Co-authored-by: Rick Elrod <rick@elrod.me>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-04-05 09:16:45 -05:00
Brian Coca 7683dfb727
Fix setup subset (#74022) (#74047)
* fix error msg on bad subset
* added test
* handle more raised but not handled fact exceptions

(cherry picked from commit 4a82e2c486)

* Update fix_setup_bad_subset.yml

Co-authored-by: Rick Elrod <rick@elrod.me>
2021-04-05 01:34:26 -05:00
Brian Coca adae63e053
Fix debug factsetter (#74067) (#74084)
* Fix debug factsetter (#74067)

* prevent debug from setting namespaced facts as tlv
* also added tests

(cherry picked from commit f9f839fa08)

* Update debug_dont_set_facts.yml

Co-authored-by: Rick Elrod <rick@elrod.me>
2021-04-05 01:31:51 -05:00
Brian Coca 40543aa8db
fix su localization option [2.10] (#73878)
* fix su localization optoin

  fixes #73837

(cherry picked from commit 37cb550185)

* Update su_fix.yml

Co-authored-by: Rick Elrod <rick@elrod.me>
2021-04-05 00:22:26 -05:00
Brian Coca 69d18e61ed
module output is only json objects (#73765) (#73777)
remove json lists as they are not valid from modules
 fixes #73744

(cherry picked from commit 43300e2279)
2021-04-04 23:02:23 -05:00
Matt Davis 51852557df
add optional module_utils import support (#73832) (#73918)
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

(cherry picked from commit 3e1f6484d7)
2021-04-04 21:46:28 -05:00
Sloane Hertel 7ce0b390b2
Fix a bug adding unrelated candidates to the plugin loader redirect_list (#73863) (#73958)
* 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

(cherry picked from commit 48c0fbd1cb)
2021-04-04 21:45:52 -05:00
Matt Martz f01227ea42
[stable-2.10] Ensure task from the worker is finalized/squashed (#73881) (#73928)
* Ensure task from the worker is finalized/squashed. Fixes #57399. Fixes #49942
(cherry picked from commit 832631b)

Co-authored-by: Matt Martz <matt@sivel.net>
2021-04-04 21:41:38 -05:00
Sam Doran b6b7e0081b
[stable-2.10] find: Specify elements type in paths (#70139) (#73970)
Fixes: #35990

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

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-04-04 21:36:08 -05:00
Xabier Napal f1f2d96456
Fix wrong backup directory var name in apt module (#73840) (#74002)
(cherry picked from commit 2bff120db6)
2021-04-04 21:35:24 -05:00
Matt Clay 502f7c22d9 [stable-2.10] Fix ansible-test coverage exporting.
ci_complete
ci_coverage
(cherry picked from commit b75844af45)

Co-authored-by: Matt Clay <matt@mystile.com>
2021-03-30 18:17:51 -07:00
Sam Doran e29a78104f [stable-2.10] 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
(cherry picked from commit fa1b52ce55)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-03-24 13:16:54 -07:00
Mark Chappell 7ef1a2f830 Ensure unit test paths for connection and inventory plugins are based on the context (#73877) 2021-03-19 08:44:10 -07:00
Sandra McCann 3dcdde996c
fix 2.10 version (#73788) 2021-03-16 15:52:36 -05:00
Rick Elrod da0481c6b3 Update Ansible release version to v2.10.7.post0. 2021-03-15 19:54:40 -05:00
Rick Elrod 4226af2718 New release v2.10.7 2021-03-15 17:35:04 -05:00
Alicia Cozine 0d4146cb64
Mention that minor releases end once the next ansible release is made. (#73836) (#73868)
(cherry picked from commit 197e8f5640)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2021-03-11 17:28:15 -06:00
Sandra McCann 1741ba2d67
Docs: Update installation page for package split (#73790) (#73866)
(cherry picked from commit 31932f5fa3)

Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2021-03-11 17:25:55 -06:00
Felix Fontein 2cca1c509a
Add note on infoblox inventory script. (#73676) (#73759)
(cherry picked from commit c888705493)
2021-03-11 17:25:34 -06:00
Rick Elrod 1eaa02c880 Update Ansible release version to v2.10.7rc1.post0. 2021-03-09 00:10:26 -06:00
Rick Elrod 573d767dcb New release v2.10.7rc1 2021-03-08 21:44:34 -06:00
Brian Coca df5d595984
Don't fail for mixed typed keys (#73726) (#73776)
but warn that content cound not be sorted because of this

* added tests

(cherry picked from commit 527bff6b79)
2021-03-08 14:58:02 -06:00
Bruno Travouillon d78867e493
move firewalld to ansible.posix (#70692) (#73689)
* move firewalld to ansible.posix (#70692)

Signed-off-by: Adam Miller <admiller@redhat.com>
(cherry picked from commit b479adddce)

* Update changelogs/fragments/73689-move-firewalld-to-ansible-posix.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Adam Miller <admiller@redhat.com>
2021-03-08 11:57:02 -06:00
Abhijeet Kasurde 9a86f8c10e
[2.10][InventoryManager] Fix two unhandled exceptions (#73798)
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>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit fa046d302c)

Co-authored-by: Rick Elrod <rick@elrod.me>
2021-03-08 04:55:55 -06:00
Brian Coca a1a57c699e
module_utils: ensure find_mount_point consistently returns text (#73625) (#73710)
(cherry picked from commit dabfee4d5c)
2021-03-08 04:52:54 -06:00
Matt Martz 65037d4781
[stable-2.10] Normalize ConfigParser between Python2 and Python3 (#73715) (#73723)
* [stable-2.10] 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
(cherry picked from commit 950ab74)

* Update config entry
2021-03-08 04:29:58 -06:00
Sam Doran ebe0ed9331
[stable-2.10] hostname - add Almalinux support (#73619) (#73648)
(cherry picked from commit ac0dedda72)

Co-authored-by: Aaron Guise <guisea@users.noreply.github.com>
2021-03-08 04:28:07 -06:00
Sloane Hertel 3e95e3c0a0
galaxy: Handle ignored directory names in role skeleton (#72035) (#73806)
* 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>
(cherry picked from commit eb72c36a71)

Co-authored-by: manas-init <70483021+manas-init@users.noreply.github.com>
2021-03-08 04:26:47 -06:00
Sloane Hertel ece31e1b51
[2.10] find module - stop dir traversal when depth is exceeded (#73808)
* find module - stop traversing directories with os.walk when depth is already exceeded (#73718)

(cherry picked from commit 8628c12f30)

* Update tests since there are fewer prior tasks creating files/directories
2021-03-08 04:18:02 -06:00
Gonéri Le Bouder b1d278a595
ansible-test: yamllint, check the assigment (#73583)
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
(cherry picked from commit 0a8d5c0983)
2021-03-08 04:16:09 -06:00
Alexander Sowitzki ab8bbe269d
[stable-2.10] Let vault lookup output unicode string. (#73571) (#73573)
Until now, the lookup plugin returned a byte string.
Changed this to output a unicode string instead.
(cherry picked from commit d0fda3e901)

Co-authored-by: Alexander Sowitzki <asowitzk@redhat.com>
2021-03-08 04:15:28 -06:00
Gonéri Le Bouder e85732f7e6
[ansible-test] attempt to work around podman (#72096) (#73569)
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>
(cherry picked from commit 0332046699)

Co-authored-by: Rick Elrod <rick@elrod.me>
2021-03-08 04:12:38 -06:00
Brian Coca 2f51105936
only add data when there is data to add (#54559) (#73566)
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

(cherry picked from commit ec8a556538)
2021-03-08 04:07:44 -06:00
Alexander Sowitzki 5647f8aa55
[stable-2.10] Bump azure-pipelines-test-container to version 1.8.0 (#73549)
(cherry picked from commit c3e2bdd3a8)

Co-authored-by: Alexander Sowitzki <asowitzk@redhat.com>
2021-03-08 03:15:10 -06:00
Sam Doran 77b76a3270
[stable-2.10] Add AlmaLinux to the family of Red Hat-like operating systems (#73541) (#73543)
* Add changelog and fixtures for AlmaLinux support

Co-authored-by: Christoph Schug <com+github@schug.net>
(cherry picked from commit 2f5c83dfb1)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-03-08 03:14:54 -06:00
Matt Martz d720a5e42c
[stable-2.10] Don't treat host_pinned as lockstep (#73484) (#73504)
* [stable-2.10] Don't treat host_pinned as lockstep (#73484)

* Don't treat host_pinned as lockstep. Fixes #73364

* Add intg tests.
(cherry picked from commit d3f3784b86)

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

* Make non-lockstep callback tests more deterministic (#73511)

(cherry picked from commit 125c220343)
2021-03-08 03:14:02 -06:00
Sandra McCann 0a6004d9ca
add base 2.10 to docs version switcher (#73770) (#73773)
(cherry picked from commit 6514027957)
2021-03-03 14:23:06 -06:00
Alicia Cozine c86a498a67
Backport of Split Ansible docs from core docs (#73616) (#73637)
* 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>
(cherry picked from commit ccbfdec334)

* fix CI failures, correct version switcher and makefile logic, set args in all cases, allow 2.10 build

Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-03-03 09:42:00 -06:00
Matt Clay b998f7050b
[stable-2.10] Fix ansible-test handling of egg-info. (#73595)
* Add test to verify pkg_resources imports work.

(cherry picked from commit 133a29acb4)

* [stable-2.10] Fix ansible-test handling of egg-info.

Resolves https://github.com/ansible/ansible/issues/67990.
(cherry picked from commit d092356fc5)

Co-authored-by: Matt Clay <matt@mystile.com>
2021-03-02 11:12:44 -08:00
Sam Doran a5f0bc0165 Update signing key used in incidental_setup_flatpak_remote tests
The original key was created using the default expiration time of two years.
Signed the repo again using a key that expires in twenty years.
2021-02-22 12:30:16 -08:00
Rick Elrod 894df504b7 Update Ansible release version to v2.10.6.post0. 2021-02-18 18:31:43 -06:00
Rick Elrod 9ea56ff292 New release v2.10.6 2021-02-17 16:10:38 -06:00
Rick Elrod 510ef832ae Update Ansible release version to v2.10.6rc1.post0. 2021-02-08 23:06:02 -06:00
Rick Elrod 244fdf324c New release v2.10.6rc1 2021-02-08 19:01:35 -06:00
Matt Clay aedc7301f6
[stable-2.10] Temporary fix for cryptography issues. (#73530). (#73533)
(cherry picked from commit 1a2da990a4)

Co-authored-by: Matt Clay <mclay@redhat.com>
2021-02-08 17:21:15 -06:00
Felix Fontein 5411090f51 Bump antsibull-changelog version for changelog sanity test.
(cherry picked from commit 82cdd7e735)
2021-02-08 09:04:07 -08:00
Sam Doran f9572a377d
[stable-2.10] pause - adjust warning when run in background (#73182) (#73231)
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.
(cherry picked from commit 0e6c334115)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-02-07 17:57:31 -06:00
Jordan Borean bca57ec65a
bugfix: use to_text(stdout) in psrp.Connection.put_file method (#73491) - 2.10 (#73496)
(cherry picked from commit f271d02a9f)

Co-authored-by: jakegatsby <39974194+jakegatsby@users.noreply.github.com>
2021-02-07 17:56:59 -06:00
Sam Doran e75570ba83
[stable-2.10] Fix YAML error message when error is at the end of the file (#73241) (#73296)
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
(cherry picked from commit e8d4b62b41)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-02-07 17:56:17 -06:00
Brian Coca 3ef061bdc4
Use a pty for local connections (#73023) (#73281)
Fixes #38696

Co-authored-by: James Cammarata <jimi@sngx.net>
(cherry picked from commit 30d93995dd)
2021-02-07 17:53:10 -06:00
Felix Fontein 63ead90ab9
Always mention the name of the deprecated plugin in routing deprecation messages (#73059) (#73237)
(cherry picked from commit df9cf368c0)
2021-02-07 17:52:29 -06:00
Sam Doran 70fb5ae36a
[stable-2.10] facts - properly report virtualization facts for Linux guests on bhyve (#73204). (#73233)
(cherry picked from commit df451636e7)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-02-07 17:50:49 -06:00
Brian Coca 9478b59da5
fix inventory source parse error handling (#73160) (#73276)
fixes #51025

added test cases

(cherry picked from commit 1e27d4052a)
2021-02-07 17:29:07 -06:00
Martin Krizek 2c8c02c816
Local vars should have highest precedence in AnsibleJ2Vars (#72830) (#73370)
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

(cherry picked from commit a2af8432f3)
2021-02-07 01:30:47 -06:00
Jordan Borean e41d1f0a3f
no_log mask suboption fallback values and defaults CVE-2021-20228 (#73487) (#73494)
(cherry picked from commit 0cdc410dce)
2021-02-07 01:11:27 -06:00
Akira Yokochi 67a018b815
fix typo (#73479)
(cherry picked from commit f72dec16ea)
2021-02-07 01:09:28 -06:00
Rick Elrod 015ec3eda8
git: verify, only use --raw when we need it (#70900) (#73473)
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>
2021-02-07 01:08:04 -06:00
Sloane Hertel 6df8a9ec53
Fix warning for nonexistent inventory cache (#72840) (#73443)
* Fix inventory cache warning by checking if the key exists before loading it

(cherry picked from commit 840bdc1e10)
2021-02-07 01:05:20 -06:00
Brian Coca 148240099a
ensure unsafe writes fallback (#70722) (#73144)
* 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

(cherry picked from commit 932ba36160)

* Added clog missing for issue 70722 (#73175)

(cherry picked from commit d6670da1d7)
2021-02-07 01:03:43 -06:00
Sam Doran e9c6b382ea
[stable-2.10] import_playbook - change additional params to deprecation (#72987) (#73015)
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
(cherry picked from commit 8e022ef00a)

Co-authored-by: Sam Doooran <sdoran@redhat.com>
2021-02-07 00:52:15 -06:00
Rick Elrod 3eafe0f255
[setup_rpm_repo test] Ensure rpm-build is present (#73516) (#73518)
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>
(cherry picked from commit aca5b0e43b)
2021-02-05 15:37:46 -06:00
Sam Doran 457dcf1313 [stable-2.10] 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.
(cherry picked from commit 997b2d2a19)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-02-03 23:01:07 -08:00
Gonéri Le Bouder 985a395cd9 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

(cherry picked from commit 7cf80f50d1)
2021-02-03 09:07:14 -08:00
Andrew Klychkov 6cde1cdf35
Documentation: fix formatting (#73186) 2021-02-03 10:18:41 -06:00
Felix Fontein dcec0ec806
Make sure to mention collection version for version_added as well. (#73270) (#73280)
(cherry picked from commit 73aa571305)
2021-02-03 09:20:30 -06:00
David Moreau Simard d7b562b393
add new glossary terms for 2.10 (#71813) (#73293)
* add new terms for 2.10
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>

(cherry picked from commit 4aedd1b987)

Co-authored-by: Sandra McCann <samccann@redhat.com>
2021-02-03 09:19:46 -06:00
Felix Fontein d5acbfd6e3
Remove 'type: complex' from the example, and mention that it should be avoided. (#73171) (#73222)
(cherry picked from commit 270385f949)
2021-02-03 09:18:06 -06:00
Sviatoslav Sydorenko 4488b91699
Fix versionadded syntax @ galaxy user guide (#73350)
(cherry picked from commit 6abeabaff1)
2021-02-02 11:17:13 -06:00
Felix Fontein 25962888ac
Mention that C(...) should be used for inline code. (#73312) (#73374)
(cherry picked from commit 76604397cb)
2021-02-02 11:16:03 -06:00
Rick Elrod a3175e9979
Revert "[ansible-test] Bump CentOS 6 image (yum repos) (#73446) (#73447)" (#73450)
This reverts commit e4f8d528b9.
2021-02-01 22:02:55 -06:00
Rick Elrod e4f8d528b9
[ansible-test] Bump CentOS 6 image (yum repos) (#73446) (#73447)
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 18:37:24 -06:00
Rick Elrod 356aae0e23
[2.10] Add Ubuntu 20.04 to CI and ansible-test (#69161) (#73365)
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-26 13:01:31 -06:00
Matt Clay c47ec375fa
[stable-2.10] Use a versioned pip bootstrapper in ansible-test. (#73359)
(cherry picked from commit fc590aeb21)

Co-authored-by: Matt Clay <matt@mystile.com>
2021-01-25 15:37:30 -06:00
Matt Clay 1f90c11782 [stable-2.10] Handle get-pip.py breaking change on Python 2.7.
(cherry picked from commit 484e4af4d0)

Co-authored-by: Matt Clay <matt@mystile.com>
2021-01-23 12:36:28 -08:00
Rick Elrod e5b6d2aaae Update Ansible release version to v2.10.5.post0. 2021-01-18 18:19:05 -06:00
Rick Elrod 890601dcef New release v2.10.5 2021-01-18 14:34:40 -06:00
Sandra McCann a8ebe99c98 Revert "update the docs requirements versions (#73108) (#73251)"
This reverts commit ee46fe2910.
2021-01-15 14:38:05 -08:00
Sandra McCann 0803063424 Revert "update rstcheck and sphinx versions in contraints (#73176) (#73249)"
This reverts commit 2a91ba71b2.
2021-01-15 14:34:58 -08:00
Sandra McCann ee46fe2910
update the docs requirements versions (#73108) (#73251)
(cherry picked from commit 0936623901)
2021-01-15 12:45:17 -06:00
Sandra McCann 2a91ba71b2
update rstcheck and sphinx versions in contraints (#73176) (#73249)
* and fix test error

(cherry picked from commit 88763c7347)
2021-01-15 12:44:36 -06:00
Rick Elrod 0b77ffb980 Update Ansible release version to v2.10.5rc1.post0. 2021-01-11 21:28:30 -06:00
Rick Elrod 422b9c09ee New release v2.10.5rc1 2021-01-11 17:33:09 -06:00
Sloane Hertel 08ba838a8e
[2.10] Pass the top level dictionaries to combine_vars (#72979) (#73146)
combine_vars uses dict.update() to replace keys

(cherry picked from commit 5e03e322de)

* Add tests for merging and replacing vars from inventory sources (#73181)

(cherry picked from commit 9de2da8a7e)
2021-01-11 17:20:48 -06:00
Sam Doran abc6658ac2
[stable-2.10] Add macOS 11 to CI (#72622) (#73180)
* [stable-2.10] Add macOS 11 to CI (#72622)

* Fix connection_paramiko_ssh test for macOS 11
* Update Azure Pipelines config
* Add changelog
(cherry picked from commit a7e834071c)

Co-authored-by: Sam Doran <sdoran@redhat.com>

* Prefer venv for tests

* Update pip integration test to use venv on py3.

(cherry picked from commit 456e9b7a33)

Co-authored-by: Matt Clay <matt@mystile.com>
2021-01-11 16:45:58 -06:00
Sam Doran b4b1bf9932
[stable-2.10] user - properly handle password and password lock when used together (#73016) (#73177)
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..
(cherry picked from commit 264e08f21a)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-01-11 13:11:26 -06:00
Matt Martz 6ba066fc9e
[stable-2.10] Fix async interpreter parsing (#72636) (#72923)
Fixes #70690
(cherry picked from commit 83764ad)
2021-01-11 01:02:33 -06:00
Sam Doran b22d97b2c1
[stable-2.10] Fix string/bytestring comparsion in m_u.basic (#70439) (#73129)
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>.
(cherry picked from commit 688cd8657b)
2021-01-11 00:55:15 -06:00
Sam Doran 1cd09b1ebc
[stable-2.10] systemd - do not overwrite unit name when searching (#72985) (#73013)
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
* Remove 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
(cherry picked from commit 48803604cd)

Co-authored-by: Sam Doooran <sdoran@redhat.com>
2021-01-11 00:47:00 -06:00
Matt Clay cf21e699d4
Update ansible-test pylint Python support. (#72997)
* Rename pylint plugin and add tests. (#70225)
* Update ansible-test pylint Python support. (#72972)
* Add integration tests for sanity test failures.
(cherry picked from commit fa48678a08)

* Python 3.8 is now officially supported.
* Python 3.9 is now skipped with a warning.
(cherry picked from commit 37d09f2488)

* Allow key None to prevent errors with import test.
(cherry picked from commit dbc2c996ab)

Backport of https://github.com/ansible/ansible/pull/73003

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-01-11 00:46:21 -06:00
Sam Doran 31ef9dffa1
[stable-2.10] Remove exit code from traps in tests (#72968)
Having the trap exit with a specific code will override
the exit code that caused the trap to run, which could
mask errors
(cherry picked from commit 5157a92139)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-01-11 00:42:18 -06:00
Jordan Borean c5248f756c
Collection list site packages (#70173) (#72940)
* 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

Co-authored-by: David Moreau Simard <moi@dmsimard.com>
Co-authored-by: Jordan Borean <jborean93@gmail.com>
(cherry picked from commit e7dee73774)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2021-01-11 00:41:56 -06:00
Matt Martz 511ffdeff7
[stable-2.10] Fix reset_connection paramiko, winrm, psrp (#72688) (#72925)
* Ensure we only reset the connection when one has been previously established. Fixes #65812

* Ensure psrp doesn't trace

* winrm too

* Indentation fix
(cherry picked from commit a3b6485)

Co-authored-by: Matt Martz <matt@sivel.net>
2021-01-11 00:36:05 -06:00
Sloane Hertel 82b75282fc
Fix task get_name to always prepend the role name (#72511) (#72919)
* 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>
(cherry picked from commit 0ed7bfc694)
2021-01-11 00:28:57 -06:00
Martin Krizek a5df30e2bf
Use _wrap_native_text only for builtin STRING_TYPE_FILTERS (#71801) (#72915)
(cherry picked from commit 252685092c)
2021-01-11 00:22:01 -06:00
Andrew Klychkov 7006b62ff4
Documentation: fix modules doc formatting (#72851) 2021-01-10 23:25:48 -06:00
Andrew Klychkov 7c44c24456
modules: fix documentation formatting (#72737) (#72850)
(cherry picked from commit ebd8c101fd)
2021-01-10 23:25:13 -06:00
Andrew Klychkov c4adf62220
Docsite: update "Migrating Ansible content to a different collection" info (#72710) (#72849)
* 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>
(cherry picked from commit 0a7fcd135c)
2021-01-10 23:24:49 -06:00
Andrew Klychkov 9601d3ef20
Docsite: update complex_data_manipulation and playbooks_advanced_syntax rst files to use FQCNs (#72848) 2021-01-10 23:24:04 -06:00
Jon "The Nice Guy" Spriggs 2f3e9a38b6
Backport/2.10/73079 (#73165)
* Update apt.py, add an example that references the suggested workaround in #25414
(cherry picked from commit 1e1b8e7aca)
(cherry picked from commit 180bbfed6a)

* Added changelog fragment
2021-01-08 16:38:44 -06:00
Matt Clay 4452d98662
Support venv in ansible-test virtualenv scripts (#73163)
* 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).

(cherry picked from commit 850a77f639)

* Make the new ansible-test venv behavior opt-in

Co-authored-by: Sam Doooran <sdoran@redhat.com>
2021-01-08 16:31:17 -06:00
Andrew Klychkov 17566d7a17
Documentation: fix modules doc formatting (#73037) 2021-01-08 13:19:05 -06:00
flowerysong 3df8811ace
Remove inaccurate Vault documentation (#72938) (#72978)
This is not functionality that exists.
(cherry picked from commit 8450858651)
2021-01-08 13:04:51 -06:00
Sam Doran ee97763a3a [stable-2.10] Update azure pipelines container
(cherry picked from commit 0eb1e22cd9)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-01-08 09:15:47 -08:00
Felix Fontein 4d231a86b7
Rewrite Docker scenario guide (#73069) (#73135)
(cherry picked from commit c9f28c1735)
2021-01-07 15:45:37 -06:00
Abhijeet Kasurde 2246e1a0fb
[2.10] galaxy: Update example for git+file (#73115)
Use correct syntax for installation of role from local git repository. Fixes: #72217

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 776274143f)
2021-01-07 14:12:56 -06:00
Felix Fontein dc8d0c4d62
Add link to all module and plugin indexes (#72743) (#73099)
* Add link to all module and plugin indexes, use glob setting for toctree.
* Adjust .gitignore
* 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>
(cherry picked from commit b514200126)
2021-01-07 14:10:52 -06:00
Sandra McCann 6b935947c1
left a stray </div> by mistake (#73132) (#73133)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
(cherry picked from commit 1d8760779c)
2021-01-06 11:35:34 -06:00
Alicia Cozine 26e207d344
remove doc survey banner (#73119) (#73125)
(cherry picked from commit 0a3c5d9dcc)

Co-authored-by: Sandra McCann <samccann@redhat.com>
2021-01-05 16:25:12 -06:00
Sam Doooran db41f2e384 [stable-2.10] 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
(cherry picked from commit 003a9e890d)

Co-authored-by: Sam Doooran <sdoran@redhat.com>
2021-01-04 13:54:36 -08:00
Matt Clay 8f71aead87 [stable-2.10] 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.
(cherry picked from commit 3274e02fd8)

Co-authored-by: Matt Clay <mclay@redhat.com>
2020-12-15 17:05:13 -08:00
Rick Elrod 02e3e679a2 Update Ansible release version to v2.10.4.post0. 2020-12-14 20:26:43 -06:00
Rick Elrod 436d8a13b4 New release v2.10.4 2020-12-14 14:44:44 -06:00
Matt Clay 12b33c79ee
[stable-2.10] Fix cryptography constraints in ansible-test. (#72914) (#72922)
(cherry picked from commit 36ab3d1189)

Co-authored-by: Matt Clay <mclay@redhat.com>
2020-12-09 14:41:15 -06:00
Sandra McCann 7461f873ef
add docs survey banner (#72907) (#72909)
* add docs survey banner, with date

(cherry picked from commit 6098793315)
2020-12-08 15:46:36 -06:00
Rick Elrod c72d53218a Update Ansible release version to v2.10.4rc1.post0. 2020-12-08 09:22:14 -06:00
Rick Elrod dc7faeaf6e New release v2.10.4rc1 2020-12-07 19:05:36 -06:00
Brian Coca 1f55a3d15a
avoid fatal exception on invalid collection name (#72296) (#72570)
* avoid fatal exception on invalid collection name used in ansible-doc filter

(cherry picked from commit 4f0e2fff95)
2020-12-07 18:37:01 -06:00
Egor Margineanu 847a2c87e5
Fix AIX networks facts when nestat is either missing or has incorrect permissions (#72516) (#72713)
* Added check for none on netstat_path variable

* Added changelog

(cherry picked from commit e879f12fb9)
2020-12-07 18:31:29 -06:00
Brian Coca d852fa4135
remove redundant remote_user for local setting (#72507)
* 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

(cherry picked from commit 488b9d6c35)

* 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

(cherry picked from commit aa4d53ccdf)
2020-12-07 18:30:58 -06:00
Sam Doran ab417f373a
[stable-2.10] pause - do not hang if run in the background (#72065) (#72605)
* 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.
(cherry picked from commit 4b8cb6582b)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-12-07 18:08:56 -06:00
Jordan Borean c67d7225e9
ansible-galaxy - source deps from all servers and not just parent - 2.10 (#72684)
* Added integration tests for this scenario

(cherry picked from commit fb092a82a1)

* Slight tweak to galaxy source selection (#72685)

(cherry picked from commit 18e5628b19)
2020-12-07 18:08:23 -06:00
Alexei Znamensky 71ef981191
Backport/2.10/72390 (#72690)
* Return error if cwd directory does not exist (#72390)

* Return warning or error if cwd directory does not exist, in AnsibleModule.run_command()

(cherry picked from commit 5654de6fce)

* added flag in run_command signature to control behaviour when cwd does not exist
2020-12-07 18:07:29 -06:00
Sam Doran 7f1ee07634
[stable-2.10] iptables: Reorder comment postition (#71496) (#72548)
(cherry picked from commit c1da427a5e)

Co-authored-by: Amin Vakil <info@aminvakil.com>
2020-12-07 17:34:32 -06:00
Sam Doran 2a6b411a80
[stable-2.10] ansible-test - skip installing PowerShell sanity test reqs if they are already installed (#72423) (#72424)
(cherry picked from commit 809d5fc398)

Co-authored-by: Jordan Borean <jborean93@gmail.com>
2020-12-07 17:33:52 -06:00
Sam Doran 4e34aa0c19
[stable-2.10] wait_for - ignore psutil related errors (#72401) (#72406)
When enumerating connections with psutil, catch and ignore errors to avoid returning a stack trace.

Co-authored-by:  Matt Martz <matt@sivel.net>
(cherry picked from commit fb09fd2a23)
2020-12-07 17:33:34 -06:00
Sam Doran c422bc64dc
[stable-2.10] blockinfile - properly insert block when no trailing new line exists (#72350) (#72360)
(cherry picked from commit c51438312a)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-12-07 17:32:56 -06:00
Sam Doran 19bffccd36
[stable-2.10] systemd - fix issue with capbpf and newer kernel (#72337) (#72347)
* [stable-2.10] 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.
(cherry picked from commit db84e2c989)

Co-authored-by: Sam Doran <sdoran@redhat.com>

* [stable-2.10] 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>
(cherry picked from commit d6115887fa)

* 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>
(cherry picked from commit a788ea0132)
2020-12-07 17:03:12 -06:00
Felix Fontein 2ff5bf0f21
Fix processing of add_file_common_args=True when argument_spec is not specified as kwarg. (#72334) (#72361)
(cherry picked from commit 233e7beb5b)
2020-12-07 17:01:33 -06:00
Felix Fontein 42da480721
ansible-doc: export has_action when --json is used (#72359) (#72414)
* 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.

(cherry picked from commit 4fb336cef1)
2020-12-07 16:59:33 -06:00
Felix Fontein 27f547b4d3
[2.10] Fix missing ansible.builtin FQCNs in hardcoded action names (#72457)
* 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.

(cherry picked from commit da60525610)

* Replace some more FQCNs.

(cherry picked from commit 72302dd611)
2020-12-07 16:59:12 -06:00
Felix Fontein 07cdb709ae
Adjust action groups to moved modules (#72428) (#72496)
* 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.

* Fix changelog fragment.

* Remove community.okd.

* Revert "Remove community.okd."

This reverts commit 812b5aa6e2.

(cherry picked from commit c7a4b39633)
2020-12-07 16:58:42 -06:00
Sam Doran ba25a1cdf1
[stable-2.10] AnsibleModule.set_mode_if_different: handle symlink is in a sticky directory (#45198) (#72863)
* 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.
(cherry picked from commit b464d18fd1)

Co-authored-by: Pilou <pierre-louis.bonicoli@libregerbil.fr>
2020-12-07 16:52:40 -06:00
Felix Fontein 6dc2e9c2f4
[2.10] The implicit default for type=bool options is not 'false', but 'none' (#72864)
* The implicit default for type=bool options is not 'false', but 'none' (#72699)

* Fix modules, resp. add ignore.txt entries.

(cherry picked from commit 5226ac5778)

* Add ignore.txt entries and fix deprecated option that was already removed in 2.11.
2020-12-07 16:51:35 -06:00
Felix Fontein a15550c0c8
ansible-test sanity: fix UnicodeDecodeError for --python 2.7 --docker (#72623) (#72865)
* Store target paths as unicode.

* Add changelog fragment.

(cherry picked from commit f94ba68d8f)
2020-12-07 16:48:19 -06:00
Felix Fontein 138a5bd2d6
[2.10] Improve deprecations (#72871)
* 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.

(cherry picked from commit f569d80fde)

* 2.10 is ansible-base, not ansible-core
2020-12-07 16:47:38 -06:00
Matt Clay 856a932ca0 [stable-2.10] Remove shippable.yml.
(cherry picked from commit 711064a073)

Co-authored-by: Matt Clay <matt@mystile.com>
2020-12-07 14:44:44 -08:00
Felix Fontein 7e2faa25d7 Improve ansible-test classifications for collections (#72353)
(cherry picked from commit 64a809d2b6)
2020-12-03 17:27:29 -08:00
Matt Clay dbdacbd48c [stable-2.10] Use AZP config for integration-aliases test.
No changelog entry since this test is limited to the ansible/ansible repo.

Backport of https://github.com/ansible/ansible/pull/72842
2020-12-03 16:17:21 -08:00
Matt Clay 7813b1248b [stable-2.10] Fix Azure Pipelines change detection. (#72824)
(cherry picked from commit 08842cd6bb)

Co-authored-by: Matt Clay <mclay@redhat.com>
2020-12-03 10:10:08 -08:00
Matt Clay eb4f30cd03 [stable-2.10] Fix CI schedule. 2020-12-02 20:49:13 -08:00
Matt Davis 2d5f549a98
update PyPI badge to use ansible-base (#72814) 2020-12-02 18:26:58 -08:00
Matt Davis a1288def89
update build badge for AZP (#72807) (#72810)
(cherry picked from commit d567a553a9)
2020-12-02 17:27:43 -08:00
Matt Clay 99d5afaad0 [stable-2.10] Azure Pipelines configuration. 2020-12-02 14:57:34 -08:00
Rick Elrod 0d7ab375eb
[centos6] update container for EOL (#72795)
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 16:04:38 -06:00
Jordan Borean 7802ca2b06
Add RHEL 7.9 (#72558) - 2.10 (#72568)
* Add RHEL 7.9 - ci_complete (#72558)

(cherry picked from commit d451433e5d)

* Added changelog for RHEL 7.9 (#72572)

(cherry picked from commit bdd0c48837)
2020-12-01 12:51:15 -08:00
Sam Doran 6322630360 [stable-2.10] 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
(cherry picked from commit 1db9588279)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-12-01 09:49:17 -08:00
David Shrewsbury 3297c221f1
Test pip fix (#72764)
(cherry picked from commit 2eb9795543)
2020-12-01 10:36:48 -06:00
Baptiste Mille-Mathias 633396c71b
Update playbooks_filters_ipaddr.rst (#72705) (#72755)
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.

(cherry picked from commit 454ac6420e)

Co-authored-by: Pablo Martinez <pablo@docecosas.com>
2020-11-30 15:25:22 -06:00
Sloane Hertel 8bdda8792d
Remove incorrect changelog (#72682)
* also remove offending code
2020-11-30 10:02:26 -06:00
Sam Doran 581337a6d5
[stable-2.10] Fix super annoying Python 2.6 multiprocessing.Queue stack trace in CI (#72604) (#72608)
* 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
(cherry picked from commit bbef250c2b)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-11-20 13:10:11 -06:00
Felix Fontein ed78b479ec
Improve argument spec documentation (#72335) (#72486)
* 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.

(cherry picked from commit 01d207a3e3)
2020-11-13 15:17:31 -06:00
Andrew Klychkov 913aebb140
Docsite: update user_guide/playbooks_module_defaults (#72051) (#72493)
* Docsite: update user_guide/playbooks_module_defaults, add name: lines and use FQCN consistently
(cherry picked from commit dbe43e071e)
2020-11-13 14:51:37 -06:00
Felix Fontein fc4411adcd
Improve config.rst formatting (#72354) (#72487)
* 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.

(cherry picked from commit 569d937df8)
2020-11-13 14:31:32 -06:00
Matt Clay cfa8075537 [stable-2.10] 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.
(cherry picked from commit fa2be89cd4)

Co-authored-by: Matt Clay <matt@mystile.com>
2020-11-09 23:29:39 -08:00
Matt Clay 8f767f7180 [stable-2.10] Fix container discovery for the acme test plugin.
(cherry picked from commit f022dedd0a)

Co-authored-by: Matt Clay <matt@mystile.com>
2020-11-09 15:30:07 -08:00
Rick Elrod 5bd0df7621
[ansible-test] use newer container images (#72126) (#72550)
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>
(cherry picked from commit e7bf0696ef)
2020-11-09 14:23:48 -06:00
Matt Martz 81ce0f8fc4 Remove sanity ignores 2020-11-06 11:47:09 -06:00
Matt Martz 1f5afcd072 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

(cherry picked from commit c8590c7482)
2020-11-06 11:47:09 -06:00
Matt Martz 65470f48bd 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

(cherry picked from commit 880087748c)
2020-11-06 11:47:09 -06:00
Matt Martz e555358c32 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

(cherry picked from commit ccc63abc8e)
2020-11-06 11:47:09 -06:00
Matt Martz 5b5870886b 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

(cherry picked from commit 6543c7bc5d)
2020-11-06 11:47:09 -06:00
Matt Martz 73991233fb 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

(cherry picked from commit 2f8dbf673e)
2020-11-06 11:47:09 -06:00
Matt Martz dca64d3c74 Remove incidental_aws_codebuild (#72140)
* Remove incidental_aws_codebuild

* ci_complete ci_coverage

(cherry picked from commit cf0cd4b50b)
2020-11-06 11:47:09 -06:00
Felix Fontein ce47796db9
Add info on how to contribute to **community**-maintained collections as well. (#72494) (#72512)
(cherry picked from commit da1c1e8bb8)
2020-11-06 11:42:18 -06:00
Sam Doran 8c5910efe7
[stable-2.10] [dnf] Some fixes around filtering (#72483) (#72500)
* [stable-2.10] [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>
(cherry picked from commit d8c637da37)

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

* Add changelog (#72502)

(cherry picked from commit b33d7e2e29)

Co-authored-by: Rick Elrod <rick@elrod.me>
2020-11-06 08:56:18 -06:00
Sandra McCann 31ab3d8a64
clarify upstream release status of 2.10 (#72269) (#72489)
* clarify upstream release status of 2.10

(cherry picked from commit d76f85208d)
2020-11-05 14:34:53 -06:00
Rick Elrod 10871f3246 Update Ansible release version to v2.10.3.post0. 2020-11-02 19:04:58 -06:00
Rick Elrod 3e9afdae2e New release v2.10.3 2020-11-02 15:34:41 -06:00
Matt Martz 7cd080b10d
[stable-2.10] Update pip tests to omit install dev extras to avoid dep issues (#72436) (#72438)
(cherry picked from commit 2ee5af5)

Co-authored-by: Matt Martz <matt@sivel.net>
2020-11-02 11:05:48 -06:00
Sloane Hertel 1f485dccaa [stable-2.10] 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
(cherry picked from commit 960e4c0809)

Co-authored-by: Sloane Hertel <shertel@redhat.com>
2020-10-29 07:31:53 -07:00
Matt Clay 522f167d27
Replace incidental tests with intentional argspec tests (#72370)
* 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

(cherry picked from commit a99212464c)

* 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

(cherry picked from commit 6f4aed5377)

* 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

(cherry picked from commit 9081b22868)

* 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

(cherry picked from commit ab2b339dd6)

* 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

(cherry picked from commit 460ba041c8)

* 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

(cherry picked from commit 50c8c87fe2)

* 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

(cherry picked from commit cfa41898c4)

* 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.

(cherry picked from commit 1489bf9190)

* Remove incidentals without coverage (#71788)

* Remove incidental_lookup_hashi_vault
* Remove incidental_connection_chroot
* Remove incidental_selinux
* Remove incidental_win_hosts

(cherry picked from commit e6e9840717)

Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-28 09:12:09 -07:00
Rick Elrod dcae6d20d2 Update Ansible release version to v2.10.3rc1.post0. 2020-10-26 19:01:43 -05:00
Rick Elrod 10922d58f0 New release v2.10.3rc1 2020-10-26 14:32:55 -05:00
Matt Davis 69d5ce9b41
Remove ansible-galaxy login (#72288) (#72320)
* 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 porting guide entry

* remove dead code/config, update messages and porting guides

(cherry picked from commit 83909bfa22)
2020-10-26 14:31:52 -05:00
Rick Elrod 4159c73db2
[ansible-test] Limit cryptography to <3.2 (#72342) (#72345)
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 13:44:16 -05:00
Felix Fontein 69744aa0a7
[2.10] Fix various sanity errors in plugins (#72168)
* 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.

(cherry picked from commit aff78f4cbc)

* Undo potentially disrupting normalizations.

* Add changelog fragment for #71736. (#72323)

(cherry picked from commit 0b2b82c0b6)
2020-10-24 06:03:18 -05:00
Sam Doran 8471814f86
[stable-2.10] Fix the reversed order of return values (#72088) (#72300)
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.

Co-authored-by: Ruediger Pluem <53253255+rpluem-vf@users.noreply.github.com>
2020-10-23 15:58:23 -05:00
Jordan Borean d4b7b8bae7
Fix example to use correct shebang (#72129) (#72146)
* Fix example to use correct shebang

* Fix other example modules as well

* Ignore shebang test

(cherry picked from commit 1ae3683d0c)
2020-10-23 15:57:20 -05:00
Brian Coca 4293718b2a
make collection callbacks follow normal flow (#59932) (#72227)
* 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
2020-10-23 15:54:38 -05:00
Andrew Klychkov 843ebcc436
Docsite: update user_guide/playbooks_async (#72115) (#72193)
(cherry picked from commit 30a651bca3)
2020-10-23 15:29:38 -05:00
Matt Martz 132346cb6a
[stable-2.10] Ensure we call action_loader.get with collection_list (#72206) (#72252)
(cherry picked from commit be5fc4e)
2020-10-23 15:29:16 -05:00
Jordan Borean ae1ee31b99
Fix race condition when creating async dir (#72069) (#72259)
* Fix race condition when creating async dir

* Simplify exception wrapper

* Remove var used for testing

(cherry picked from commit c9fa1d0e7e)
2020-10-23 15:28:05 -05:00
Andrew Klychkov dbbc44b1f4
[2.10] Docsite backport of 71973, 71975, 71980 (#71991)
* Docsite: improve user_guide/playbooks_vars_facts (#71973)

* Docsite: improve user_guide/playbooks_vars_facts

* Docsite: update user_guide/vault (#71975)

* Docsite: update user_guide/playbooks_filters (#71980)
2020-10-23 15:27:03 -05:00
Sam Doran 775d6e6752
[stable-2.10] Changes required for macOS 10.15 (#71841) (#71954)
* 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
(cherry picked from commit 35b0fef536)

Co-authored-by: Matt Martz <matt@sivel.net>
2020-10-23 15:18:24 -05:00
Rick Elrod 83c34eb7de
[dnf] accumulate update filters (#71726) (#72181)
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>
(cherry picked from commit fdf80690e4)
2020-10-23 14:15:47 -05:00
Sandra McCann b9c8b79d60
remove ansibleFest banner (#72253) (#72266)
(cherry picked from commit 3ece57c01a)
2020-10-23 10:27:35 -05:00
Matt Clay 3bd6daa4a4 [stable-2.10] 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..
(cherry picked from commit 3c2e8b99be)

Co-authored-by: Matt Clay <mclay@redhat.com>
2020-10-22 21:40:23 -07:00
Abhijeet Kasurde 98cc9cb834
[2.10] AnsibleVaultEncryptedUnicode should be considered a string (#72216)
* AnsibleVaultEncryptedUnicode should be considered a string
* linting fix
* clog frag

(cherry picked from commit 48f12c14e9)

Co-authored-by: Matt Martz <matt@sivel.net>
2020-10-21 18:08:18 -05:00
Ruediger Pluem 7499848cb1
user - allow local users with an expiry date to be created (#72022) (#72085)
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.

(cherry picked from commit a7170da851)
2020-10-21 17:04:35 -05:00
Matt Clay 6c8d6a3182 [stable-2.10] Fix ansible-test Azure Pipelines container auth.
(cherry picked from commit 2ef4b7e07e)

Co-authored-by: Matt Clay <matt@mystile.com>
2020-10-21 14:15:39 -07:00
Felix Fontein 961ead55c6
Add deprecation collection name to plugin options (#71735) (#72081)
* Add changelog fragment.

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

* Add basic unit tests.

(cherry picked from commit 1107aace1b)
2020-10-21 15:58:51 -05:00
Sandra McCann 5a3a2d1a39
replace porting guides with stub pages - issue 71687 (#71988) 2020-10-21 15:36:40 -05:00
Christian Loos 505df0d564
fix distribution fact for SLES4SAP (#71559) (#72026)
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.

(cherry picked from commit ea119d3089)
2020-10-21 15:35:36 -05:00
Martin Krizek d53d247c84
Only apply the unroll wrapper once (#72003) (#72017)
Co-authored-by: Matt Martz <matt@sivel.net>

Fixes #71920

(cherry picked from commit 4197666179)
2020-10-21 15:32:45 -05:00
Jordan Borean cd89aadec1
powershell - remove env var (#72010) (#72012)
(cherry picked from commit 3c33618cf6)
2020-10-21 15:27:57 -05:00
Rick Elrod e6a4585807
[dnf] show installations/removals in check_mode (#70892) (#72180)
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>
(cherry picked from commit 7d32129efb)
2020-10-21 14:42:26 -05:00
Andrew Klychkov b8e718cccd
[2.10] Docsite backports of 71938, 71907 (#71972)
* Docsite: improve user_guide/playbooks_variables (#71938)
(cherry picked from commit c19af92be6)

* Docsite: improve inventory-related pages (#71907)
Update docs/docsite/rst/plugins/inventory.rst
(cherry picked from commit 2fed63a930)
2020-10-20 16:03:29 -05:00
Rick Elrod 2c5e4b5a88
[tests/dnf] work around dnf packaging issue (#72249) (#72251)
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>
(cherry picked from commit 9ddb1d76af)
2020-10-19 11:04:32 -05:00
Toshio Kuratomi 2e0eb330a1
Update the porting guide for a new ansible version (#72212)
(cherry picked from commit 0a5985c4a6)
2020-10-13 12:37:03 -05:00
Andrew Klychkov f9ecb4fe74
[2.10] Docsite backport of 72049, 72052, 72053 (#72071)
* Docsite: update user_guide/playbooks_prompts (#72049)

(cherry picked from commit 3efc8b6de8)

* Docsite: update user_guide/playbooks_checkmode (#72052)

(cherry picked from commit c12fce3aa9)

* Docsite: update user_guide/playbooks_debugger (#72053)

(cherry picked from commit 77840f886e)
2020-10-09 10:53:47 -05:00
Baptiste Mille-Mathias c24bdfa7df
Add example values and results for theory filters (#72087)
(cherry picked from commit 69c3e5644c)
2020-10-09 10:52:16 -05:00
Matt Clay 49504da1ed
[stable-2.10] Support collection constraints in ansible-test. (#72157)
This allows collections to specify requirements and constraints for packages that ansible-test has requirements or constraints for.
(cherry picked from commit 5f76bd2af7)

Co-authored-by: Matt Clay <matt@mystile.com>
2020-10-08 16:17:28 -05:00
Rick Elrod f57b149ec8
Intentional coverage, incidental_azure_rm_resource (#71052) (#72159)
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>
(cherry picked from commit cdcf0aa42a)
2020-10-08 16:16:53 -05:00
Rick Elrod 70172dde27
Add intentional unit tests for basic._set_cwd and common.dict_merge (#70283) (#72160)
* Add unit tests for basic._set_cwd

* incidental coverage for dict_merge

* add test for async stderr inclusion

(cherry picked from commit b019029bf3)

Co-authored-by: jctanner <tanner.jc@gmail.com>
2020-10-08 16:16:34 -05:00
Rick Elrod d60a4c064c Update Ansible release version to v2.10.2.post0. 2020-10-05 18:55:41 -05:00
Rick Elrod 656c228abe New release v2.10.2 2020-10-05 15:50:46 -05:00
Rick Elrod d88fb87fd0 Update Ansible release version to v2.10.2rc1.post0. 2020-09-28 14:50:47 -05:00
Rick Elrod 68f0fcfbd5 New release v2.10.2rc1 2020-09-28 11:54:17 -05:00
Felix Fontein 8e00447aef
ansible-doc: show correct plugin name (#71966) (#71984)
(cherry picked from commit 0c3a9c7ae6)
2020-09-28 11:36:00 -05:00
Martin Krizek 4df129c6ae
Provide more information in AnsibleUndefinedVariable (#71666) (#71876)
* Provide more information in AnsibleUndefinedVariable

Fixes #55152

(cherry picked from commit 00b22ab55e)
2020-09-28 00:34:38 -05:00
Matt Clay c4e3552c8d
[stable-2.10] CI provider fixes for ansible-test. (#71929) (#71932)
* Make Azure Pipelines resource_prefix lowercase.

* Make classification of CI files consistent.

* Update package-data sanity test for AZP.
(cherry picked from commit 92b66e3e31)

Co-authored-by: Matt Clay <mclay@redhat.com>
2020-09-28 00:34:12 -05:00
Sam Doran 988d410e17
[stable-2.10] Test changes to allow using "macos" test image (#71849) (#71861)
* Add link to remote.sh from macos.sh
* Add skip/macos to tests that have skip/osx.
(cherry picked from commit 6984081111)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-09-28 00:33:11 -05:00
Sloane Hertel 198cffcb52
Fix passing the connection timeout to connection plugins (#71722) (#71785)
(cherry picked from commit 7048542199)
2020-09-28 00:32:04 -05:00
Jordan Borean 2327ef9da8
runas - create new SYSTEM token on become (#71714) (#71751)
(cherry picked from commit fc08c1f3c5)
2020-09-28 00:29:45 -05:00
Matt Davis 07a9de1247
fix coverage output from synthetic packages (#71727) (#71748)
* 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

(cherry picked from commit e813b0151c)
2020-09-28 00:29:24 -05:00
Jordan Borean 68278f36fd
psrp - fix hang when copying an empty file (#71649) (#71651)
(cherry picked from commit b615789fcc)
2020-09-28 00:28:01 -05:00
Rick Elrod ab100f8ee5
[tests] Make setup_docker clean up better (#71949) (#71959)
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>
(cherry picked from commit 6a7e637c5f)
2020-09-26 03:41:03 -05:00
Alicia Cozine 12874bbdea
[2.10] updates intersphinx references for docs links (#71921) (#71945)
* 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>
(cherry picked from commit 27826827e9)

* adds changelog for already-merged PR (#71947)
* adds changelogs/fragments/71921-raise-bytes-for-binary-test.yml

Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit 91b0dfb659)
2020-09-25 13:53:44 -05:00
Andrew Klychkov 5282ab853d
[2.10] Docsite backport 71909, 71859, 71858, 71857, 71854, 71834 (#71937)
* Docsite: improve user_guide/intro_inventory (#71859)

(cherry picked from commit 25bfda8417)

* Docsite: improve user_guide/playbooks_tags (#71858)

(cherry picked from commit c3841b8440)

* Docsite: improve user_guide/playbooks_reuse_roles (#71857)

* Docsite: improve user_guide/playbooks_reuse_roles

* fix
(cherry picked from commit 7a0a2f188b)

* Docsite: update Migrating Ansible content to a different collection (#71854)

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 2655fc0c23)

* Docsite: improve user_guide/intro_adhoc (#71909)

(cherry picked from commit ed6fb2e3f6)

* Docsite: improve user_guide/playbooks_reuse (#71834)

(cherry picked from commit 3db4be2c3b)
2020-09-25 09:42:21 -05:00
Sandra McCann 5fc0dc1956
update install instructions for pip (#71891) (#71922)
(cherry picked from commit e358946b98)
2020-09-24 13:41:14 -05:00
Rick Elrod d7f6d8c8f0
[incidental_setup_docker] changes to upstream repo (#71897) (#71899)
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>
(cherry picked from commit 31ddca4c0d)
2020-09-23 21:36:53 -05:00
Rick Elrod 806acf9cd9
hacking: fix announce script version parsing (#71008) (#71893)
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>
(cherry picked from commit 75e8da0950)
2020-09-23 16:16:52 -05:00
Sandra McCann 77408dccab
fix version label to 2.10 (#71870) 2020-09-22 18:25:52 -05:00
Sandra McCann a10e76a64c
update version switcher for 2.10 release (#71866)
(cherry picked from commit bf4e102d97)
2020-09-22 14:23:41 -05:00
Sandra McCann 51517a6232
Update the porting guide for a new ansible version (#71863) (#71868)
(cherry picked from commit 606924a4b4)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2020-09-22 14:20:50 -05:00
Sandra McCann 86de15ea53
add cli parser documentation (#71497) (#71864)
* with native network example, linux example

(cherry picked from commit 0e5911d650)
2020-09-22 14:18:24 -05:00
Matt Clay df150a2780 [stable-2.10] 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.
(cherry picked from commit 17765cd4e8)

Co-authored-by: Matt Clay <mclay@redhat.com>
2020-09-21 15:06:26 -07:00
Sandra McCann b739bbe0a5
[Docs][backport][2.10] Backportapalooza 12 (#71842)
* Fix typo in the documentation (#71701)

Fix typo in the documentation: casting instead of casing

(cherry picked from commit 1a06587f3b)

* 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

(cherry picked from commit 7a0e545700)

* Fix typo in delveloping_plugins_network (#71737)

(cherry picked from commit 4bf61f0714)

* Fix broken bullet list (#71728)

(cherry picked from commit 00ed5b1f2e)

* vmware: Add docs for filters (#71670)

Add a scenario guide for filters in VMware documentation

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

* [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>
(cherry picked from commit 7a38c470ba)

* 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

(cherry picked from commit c36e939414)

* Update EXAMPLES in package_facts.py documentation (#71838)

this module is not limited to rpm , so remove rpm in tasks name

(cherry picked from commit 7f62b4733d)

* change duplicated label

(cherry picked from commit bcfead8e0f)

Co-authored-by: Guillaume Vincent <guillaume@oslab.fr>
Co-authored-by: Amin Vakil <info@aminvakil.com>
Co-authored-by: Shufeng <fenghhk@gmail.com>
Co-authored-by: Evaristo Rojas <evaristo.rojas@islas.org.mx>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Rick Elrod <rick@elrod.me>
Co-authored-by: Shounak <25407872+shounak1@users.noreply.github.com>
Co-authored-by: roumano <roumano@gmail.com>
2020-09-21 15:42:39 -05:00
Andrew Klychkov 47cabb1d32
[2.10] Doc backports: 71753, 71754, 71769, 71770, 71771, 71772 (#71807)
* Docsite: misc fixes of playbooks_delegation (#71753)

(cherry picked from commit 05a45f63ff)

* Docsite: fix playbooks_conditionals (#71754)

(cherry picked from commit aa1f0bd062)

* Docsite: fix user_guide/playbooks_blocks (#71769)

(cherry picked from commit 79dc6fa948)

* Docsite: fix user_guide/playbooks_handlers (#71770)

(cherry picked from commit 1cf42897d2)

* Docsite: fix user_guide/playbooks_error_handling (#71771)

(cherry picked from commit 2c6661d4c1)

* Docsite: fix user_guide/playbooks_environment (#71772)

(cherry picked from commit a204f5f955)
2020-09-21 11:20:57 -05:00
Jordan Borean aacff5e35f
setup - update docs for win setup fact_path (#71791) (#71799)
(cherry picked from commit 2d2c5d5ed7)
2020-09-21 11:01:18 -05:00
Andrew Klychkov ea9a223ab6
[2.10] Doc fixes backporting 71697, 71718, 71717 (#71768)
* Docsite: misc fixes (#71697)

(cherry picked from commit a80131a283)

* Docsite: improve playbooks_loops.rst (#71718)

(cherry picked from commit 13ab9f5932)

* Docsite: fix a typo in user_guide/index.rst (#71717)
2020-09-21 10:59:05 -05:00
Sam Doran b6637c0afc [stable-2.10] 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.
(cherry picked from commit 65cdb86c8a)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-09-17 08:44:41 -07:00
Rick Elrod 2b9e5b931a Update Ansible release version to v2.10.1.post0. 2020-09-14 16:21:16 -05:00
Rick Elrod 355a69f416 Revert "[deb packaging] Change maintainer email for now"
This reverts commit 6cf4a33f35.
2020-09-14 16:02:23 -05:00
Rick Elrod 6cf4a33f35 [deb packaging] Change maintainer email for now
Change:
- For getting debug/error notifs from launchpad

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-09-14 15:46:28 -05:00
Rick Elrod 72a8b55920 New release v2.10.1 2020-09-14 13:04:22 -05:00
Sandra McCann 45c8c9909d
[Docs][2.10] Backportapalooza 11 (#71702)
* Add note on where inventory scripts moved to' (#71638)

(cherry picked from commit 2f240f5dd7)

* clarify that collection names use same requirements as namespaces (#71639)

(cherry picked from commit bbd4ec13f1)

* Fix typo in documentation (#71652)

Fix typo on the page about unit testing modules,

(cherry picked from commit 1ad0f666d5)

* Changed all_modules references to list_of_collections in the documentation (#71656)

(cherry picked from commit a34043c6be)

* Adds FAQ and other pointers for collections (#71606)

(cherry picked from commit b430f9b9aa)

* Docs(lineinfile): Update link to python regex docs (#71688)

There was a link still pointing at the python2 documentation.

(cherry picked from commit 11ba30183e)

* Docsite: add reference to Style guide (#71694)

(cherry picked from commit 73bed95ead)

Co-authored-by: Zois Pagoulatos <zpagoulatos@hotmail.com>
Co-authored-by: esmersmith <62951573+esmersmith@users.noreply.github.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
Co-authored-by: Valentin Krasontovitsch <v.krasontov@gmail.com>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2020-09-10 10:48:28 -05:00
Sandra McCann 57b5069990
Update the porting guide for 2.10.0b2 (#71677) (#71684)
(cherry picked from commit 9fcf1db871)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2020-09-09 11:38:04 -05:00
Rick Elrod eb165c0a9b Update Ansible release version to v2.10.1rc3.post0. 2020-09-07 14:56:34 -05:00
Rick Elrod 387a7199fc New release v2.10.1rc3 2020-09-07 13:52:06 -05:00
Toshio Kuratomi 2797322fd3
[stable-2.10] Update to the ansible-2.10.0 pre-release schedule (#71647) (#71648)
(cherry picked from commit 4d4e75ee05)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2020-09-04 21:11:30 -05:00
Alicia Cozine 43e0aa5b57
WIP: Backport/2.10/71588 (#71626)
* Add dual index pages for roadmaps (part of #71566)

(cherry picked from commit b518a5db14)

* 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

(cherry picked from commit 7bfeed3e24)

* fix index page and TOCs

* adds old roadmap index

* adds toctree ref for old roadmaps

Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2020-09-04 14:44:13 -05:00
Sandra McCann 1af7c6c003
[docs][backport]Backportapalooza 10 (#71621)
* Feature freeze date has been merged with Ansible-2.10.0beta1 (#71494)

(cherry picked from commit c586d436fa)

* Add --allow-disabled to sanity docs (#71524)

(cherry picked from commit bc6461432e)

* Update intro_patterns.rst (#71542)

Call out the trailing comma when specifying a single host. Small snag that took me a while to notice.

(cherry picked from commit ec3920cef1)

* ansible-vault: Fix typo in help message (#71485)

(cherry picked from commit 215eb730e1)

* update install for 2.10 (#71543)

* update install for 2.10

(cherry picked from commit f75223d2c6)

* User guide overhaul, Table of Contents (#71553)

(cherry picked from commit b694dbadfe)

* 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>
(cherry picked from commit 7f9258b024)

* More docs updates to reflect collections ecosystem (#71597)

(cherry picked from commit 96aee766f4)

* DOCS: Mentions ansible-base, adds collections pointers to Community and Dev Guides (#71480)

(cherry picked from commit 29b20bd1b1)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
Co-authored-by: Amin Vakil <info@aminvakil.com>
Co-authored-by: Matt Deacalion <matt@dirtymonkey.co.uk>
Co-authored-by: Fabien Malfoy <fabien.malfoy@laposte.net>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2020-09-03 18:07:02 -05:00
Andrew Klychkov 7caa7e1162
Docsite: improve developing_modules_documenting.rst (#71590) (#71613)
* add necessary dots to returns descriptions
(cherry picked from commit bfba0ffc45)
2020-09-03 14:42:31 -05:00
Andrew Klychkov 3fadb5eb28
Docsite: improve spelling_word_choice.rst (#71592) (#71612)
(cherry picked from commit cda5854099)
2020-09-03 14:41:45 -05:00
Andrew Klychkov a2d8d45c61
testing_sanity.rst: add argument for running in docker (#71223) (#71587)
(cherry picked from commit 56423b1648)
2020-09-03 14:41:19 -05:00
Matt Clay fd27c4db71 [stable-2.10] Add pause to avoid same mtime in test.
(cherry picked from commit 3d769f3a76)

Co-authored-by: Matt Clay <matt@mystile.com>
2020-09-02 15:49:08 -07:00
Matt Clay ec8878ced4 [stable-2.10] Use new endpoint for Parallels based instances.
(cherry picked from commit 98febab975)

Co-authored-by: Matt Clay <matt@mystile.com>
2020-09-02 15:08:32 -07:00
Rick Elrod 333f7bc088
[tests] Bump container versions (#71518) (#71598)
Change:
- This pulls in python 3.9.0rc1

Test Plan:
- CI, hopefully

Signed-off-by: Rick Elrod <rick@elrod.me>
(cherry picked from commit db519bc17c)
2020-09-02 14:44:23 -05:00
Rick Elrod 8d88d4550b Update Ansible release version to v2.10.1rc2.post0. 2020-09-02 12:48:07 -05:00
Matt Clay 4273443686 [stable-2.10] Support macOS 10.15 for ansible-test --remote.
Use of this new version is experimental, so it is not enabled in CI yet.
(cherry picked from commit 2bbcbe99fd)

Co-authored-by: Matt Clay <matt@mystile.com>
2020-09-01 19:07:10 -07:00
Matt Clay 356ea0b8d0
[stable-2.10] Fix ansible-test coverage traceback. (#71446) (#71578)
* [stable-2.10] 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.
(cherry picked from commit f5b6df14ab)

Co-authored-by: Matt Clay <mclay@redhat.com>

* Add empty ignore.txt file for tests.
2020-09-01 17:05:19 -07:00
Toshio Kuratomi 7d8b6dc779
[stable-2.10] Update the porting guide for ansible-2.10.0b1 (#71583). (#71584)
(cherry picked from commit 1882c60b04)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2020-09-01 17:58:18 -05:00
Rick Elrod 6aaef596d6
[docs] Fix up porting guides for CVE revert (#71581)
Change:
- Fix up wording and do proper backports for porting guide entries.

Signed-off-by: Rick Elrod <rick@elrod.me>
(cherry picked from commit ed48a2dd62)
2020-09-01 17:34:33 -05:00
Matt Clay d699d38dd5 [stable-2.10] 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.
(cherry picked from commit d099591964)

Co-authored-by: Matt Clay <mclay@redhat.com>
2020-09-01 14:54:17 -07:00
Rick Elrod 0e68601002 New release v2.10.1rc2 2020-09-01 01:01:32 -05:00
Rick Elrod 9a48ffd61b
Attempt at reverting CVE-2020-1736 changes [2.10] (#71514)
* Revert atomic_move changes
* add note about mode reverts in porting guide

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-09-01 01:00:26 -05:00
Rick Elrod 314834c6d3 New release v2.10.1rc1 2020-08-31 19:42:18 -05:00
Rick Elrod 1678577681
[tests] fix fallout from dnf gpg fix (#71552)
Change:
- Missed needed gpg ignores

Test Plan:
- CI
- ci_complete

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-08-31 18:24:00 -05:00
Rick Elrod dc97027453
[dnf] ensure packages are gpg-verified (#71539)
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:05:30 -05:00
Sandra McCann d3e0cb4320
[docs][2.10] Backportapalooza 9 (#71493)
* 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

(cherry picked from commit 3e4377300b)

* Docs: ansible_host can contain FQDN (#71186)

(cherry picked from commit 13ab73cd89)

* clarify inventory plugin user documentation (#71387)

(cherry picked from commit fb035da3b2)

* Keep caution tape for older versions (#71400)

(cherry picked from commit 156b1c5245)

* document securing editor for vault (#71404)

(cherry picked from commit 6c48c62f93)

* 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>
(cherry picked from commit 3f3bcbf05e)

* 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.

(cherry picked from commit 66e38bf499)

* Update uri.py (#67688)

Adds an example of creating workspaces in Log analytics Azure
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>

(cherry picked from commit 4317c2c80c)

* docs: Update Kubernetes Guide (#71372)

Fixes: #61681

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

* fix broken links due to master -> main branch rename (#71426)

(cherry picked from commit 2b7461eb52)

* 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

(cherry picked from commit a6537b59ab)

* 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>
(cherry picked from commit 5c1594916a)

* 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>
(cherry picked from commit 3c8744f0c1)

* user_guide: Fix reuse role examples (#71440)

Fixes: #53919

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

* 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>
(cherry picked from commit 1257b0a184)

* updates network plugin docs pages for 2.10 (#71467)

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

* 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.

(cherry picked from commit 7127d37466)

* quick update to changelog instructins (#71492)

(cherry picked from commit addee0699e)

* update Network Advanced Topics for FQCN (#71325)

* update Network Advanced Topics for FQCN

(cherry picked from commit b6f10b9b52)

* fix shippable error

Co-authored-by: David M. Lee <leedm777@yahoo.com>
Co-authored-by: Eric G <e+github1690@linuxw.info>
Co-authored-by: Sloane Hertel <shertel@redhat.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: flowerysong <paul.arthur@flowerysong.com>
Co-authored-by: Jose l. Azagra <azagramac@gmail.com>
Co-authored-by: Patrick Reader <pxeger@protonmail.com>
Co-authored-by: John Westcott IV <32551173+john-westcott-iv@users.noreply.github.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
Co-authored-by: Timothy Visser <team@sacrome.com>
2020-08-31 09:59:52 -05:00
David Shrewsbury 393412dc64
Fix play stats when rescue block is a child block (#70922) (#71334)
* check run state of current block only

* Add changelog and test

* Add test for issue 29047

(cherry picked from commit f2f6c34632)
2020-08-28 12:23:30 -05:00
Jordan Borean 7131c75d93
powershell - fix quoting values (#71411) (#71449)
* powershell - fix quoting values

* Add ignore for smart quote skip

(cherry picked from commit 72a7cb4a2c)
2020-08-28 12:22:22 -05:00
Jordan Borean 5688fef486
psrp - use native copy mechanism - 2.10 (#71434)
* psrp - use native copy mechanism (#71409)

* psrp - use native copy mechanism

* Fix sanity issues

* Split the bugfix and deprecation into separate changelog fragments

(cherry picked from commit 985ba187b2)

* Removed deprecation warnings for backport
2020-08-28 12:21:53 -05:00
Jordan Borean b936539ae1
powershell - fix nested CLIXML parser (#71412) (#71451)
(cherry picked from commit 8897d7e2ff)
2020-08-28 09:54:14 -07:00
Martin Krizek ce7b95499f
native types: properly handle Undefined in nested data (#68432) (#71105)
(cherry picked from commit 5ca3aec3c4)
2020-08-28 07:57:17 -05:00
Felix Fontein d38a7ff577
Fix changelog fragment type. (#70902) (#71114)
(cherry picked from commit fc83055425)
2020-08-27 14:07:22 -05:00
Sam Doran c39753d7ad
[stable-2.10] linux facts - return proper broadcast address (#64528) (#71064)
Check that the value being returned is actually a broadcast address

(cherry picked from commit e6bf202738)
2020-08-27 13:48:50 -05:00
Martin Krizek 0c32a4f793
Emit proper error for x in y when y is undefined (#70990) (#71011)
Fixes #70984

(cherry picked from commit bf7276a4e8)
2020-08-27 13:46:52 -05:00
Sam Doran 0c6edb34f9
[stable-2.10] unarchive - Check 'fut_gid' against 'run_gid' in addition to supplemental groups (#65666) (#71001)
* [stable-2.10] 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>
(cherry picked from commit ac5f3f8bef)

Co-authored-by: Philip Douglass <philip@philipdouglass.com>

* [stable-2.10] Fix unstable unarchive test (#71004)

* Add mode to copy tasks
* Fix unreliable test by ignoring errors

(cherry picked from commit f99f96ceb6)

Co-authored-by: Philip Douglass <philip@philipdouglass.com>
2020-08-27 13:45:19 -05:00
Abhijeet Kasurde a253c93fd1
[2.10] iptables: Add a note about ipv6-icmp (#71010)
ipv6-icmp and icmpv6 are valid protocols and adding note about
it in protocol parameter.

Fixes: #70905

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit e139739ab3)
2020-08-27 13:43:11 -05:00
Sloane Hertel 714cd2ad2e
copy - redact 'content' from invocation in check mode (#71033) (#71067)
* sanitize copy module invocation secrets in check mode

(cherry picked from commit 991714b9d1)
2020-08-27 13:41:14 -05:00
Jordan Borean f41ff33ca6
ansible-galaxy - fix download for subdirs in SCM (#71005) (#71093)
(cherry picked from commit f6b3b4b430)
2020-08-27 13:39:54 -05:00
Brian Coca 00caeff928
dont clobber facts in loop (#71032) (#71095)
(cherry picked from commit f9af27c631)
2020-08-27 13:39:19 -05:00
Toshio Kuratomi 6b639f147d
[stable-2.10] Update ansible doc formats (#71070) (#71111)
* 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>
(cherry picked from commit fb144c4)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2020-08-27 13:33:24 -05:00
Jordan Borean 4b1df6cc05
Remove ANSIBLE_COLLECTIONS_PATHS dep warning (#71094) (#71099)
(cherry picked from commit aab9beccf7)
2020-08-27 13:26:17 -05:00
Felix Fontein e33fff922a
ansible-test: bump acme test container version to 2.0.0 (#71097) (#71165)
(cherry picked from commit 050841324c)
2020-08-27 12:58:06 -05:00
Jordan Borean 092ec680e6
Ensure -k is set to delegated hosts without a pass (#71136) (#71168)
* 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>
(cherry picked from commit 3f22f79e73)
2020-08-27 12:57:24 -05:00
GomathiselviS e95b45c5ec
Update network integration auth timeout (#71057) (#71238)
*  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

(cherry picked from commit 6160e82bf2)

Co-authored-by: Ganesh Nalawade <ganesh634@gmail.com>
2020-08-27 12:55:04 -05:00
Rick Elrod 7b3d2a00a0
Fix cron file regression (#71207) (#71243)
Co-authored-by: Florent PIGOUT <toopy@users.noreply.github.com>
2020-08-27 12:54:15 -05:00
Toshio Kuratomi 7662568bd8
Antsibull build format backport 71080 (#71285)
* 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

(cherry picked from commit 22d2c97b81)

* 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

(cherry picked from commit 99cac0b135)

* Force an upgrade to a newer version of antsibull

(cherry picked from commit d816a5966e)
2020-08-27 12:53:29 -05:00
Ganesh Nalawade 67b2b8caf1
Fix netconf validate capability check (#71195) (#71252)
*  Use ``:validate`` string to check if the netconf
   server supports validate capability as per netconf RFC

(cherry picked from commit 7635d23cee)
2020-08-27 12:52:49 -05:00
Ganesh Nalawade ca118613aa
Fixes https://github.com/ansible-collections/cisco.iosxr/issues/74 (#71292)
*  ncclient API expects commit timeout value in either unicode
   or bytes format, hence convert the timeout value explicitly
   to string type.
2020-08-27 12:47:40 -05:00
Martin Krizek 02f4fc1a14
Skip literal_eval for string filters results in native jinja. (#70988) (#71313)
Fixes #70831

(cherry picked from commit b66d66027e)
2020-08-27 12:47:02 -05:00
Matt Martz 90a8d07f31
[stable-2.10] Don't do conflict check on sdist and egg_info (#71310) (#71316) 2020-08-27 12:44:30 -05:00
Matt Martz c04a751f0e
Reject unknown types from results queue. Fixes #70023 (#71336) 2020-08-27 12:43:20 -05:00
Matt Martz 3f41c76564
[stable-2.10] Allow the TOML inventory to dump unsafe. Fixes #71307 (#71309) (#71317)
(cherry picked from commit 9da8801)

Co-authored-by: Matt Martz <matt@sivel.net>
2020-08-27 12:35:36 -05:00
Matt Martz 6d1cc0dede
[stable-2.10] epoch can be a float with strftime filter. Fixes #71257 (#71314) (#71319)
(cherry picked from commit 6289570)

Co-authored-by: Matt Martz <matt@sivel.net>
2020-08-27 12:35:21 -05:00
Lorenzo Castelli ac248cf34a
systemd - supports new systemctl output message for chroot (#71197) (#71330)
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.

(cherry picked from commit a1a50bb3cd)
2020-08-27 12:34:59 -05:00
Sloane Hertel 4cfe2cf8dc
Fix meta tasks used with --flush-cache (#71311) (#71358)
* Remove incorrect code

(cherry picked from commit 88bfc7977d)
2020-08-27 12:23:58 -05:00
Felix Fontein 4dece71417
skydive.skydive was renamed to community.skydive (#71357) (#71364)
(cherry picked from commit 705c666521)
2020-08-27 12:23:39 -05:00
Martin Krizek 724b3648ea
_check_failed_state: always use the current/nested state (#71347) (#71457)
Fixes #71306

(cherry picked from commit 9792d631b1)
2020-08-27 12:22:45 -05:00
Sandra McCann 3be597419d
point all older release pages to devel (#71428) 2020-08-24 14:39:11 -05:00
Felix Fontein 1252323e34
Make changelog tool be more strict about suffixes (#70909) (#71135)
* Bump antsibull-changelog version.

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

* Enable ignoring other fragment extensions.

(cherry picked from commit fbfc0f99eb)
2020-08-21 09:33:08 -07:00
Felix Fontein 5f40a4efa6
Fix module links. (#71030) (#71389)
(cherry picked from commit a479b003e8)
2020-08-21 09:35:27 -05:00
Andrew Klychkov 72e9974f10
Documentation: improve dev_guide/testing_integration.rst (#71370) (#71390)
(cherry picked from commit 5498b0bb71)
2020-08-21 09:33:43 -05:00
Sandra McCann 26bb114ccb
[backport][docs][2.10]Docsbackportapalooza 8 (#71379)
* 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
(cherry picked from commit e507c127e5)

* a few writing style updates (#71212)

(cherry picked from commit 4f0bd5de38)

* Fix code markups and add link to CVE (#71082)

(cherry picked from commit 92d59a58c0)

* Fix 404 links (#71256)

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

* Writing style updates to Developing dynamic inventory topic (#71245)

* modified the writing style

* incorporated peer feedback

(cherry picked from commit ecd3b52ad7)

* Fix roadmap formatting. (#71275)

(cherry picked from commit ee48e0b0ad)

* Update password.py (#71295)

List md5_crypt, bcrypt, sha256_crypt, sha512_crypt as hash schemes in the password plugin.

(cherry picked from commit 1d1de2c6fd)

* Update ansible european IRC channel (#71326)

Signed-off-by: Rémi VERCHERE <remi@verchere.fr>
(cherry picked from commit 824cd4cbeb)

* 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>
(cherry picked from commit 606604bb97)

* 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>
(cherry picked from commit 6d17736ef4)

* Writing style updates to Using Variables topic (#71194)

* updated topic title, underline length for headings, and incorporated peer feedback

(cherry picked from commit 4d68efbe24)

* cron module defaults to current user, not root (#71337)

(cherry picked from commit 4792d83e13)

* 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

(cherry picked from commit f79a7c5585)

* Add documentation about info/facts module development (#71250)

Fixes: #40151

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

* 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>
(cherry picked from commit a1257d75aa)

* tidies up vars page (#71339)

(cherry picked from commit 02ea80f6d7)

* base.yml: Fix typos (#71346)

(cherry picked from commit 41d7d53573)

* 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>
(cherry picked from commit 74f88c56a5)

* Add note about integration tests for new modules to the dev guide (#71345)

(cherry picked from commit b82889eef5)

* update fest link (#71376)

(cherry picked from commit 80b8fde946)

* incorporate minimalism feedback on debugging page (#71272)

Co-authored-by: bobjohnsrh <50667510+bobjohnsrh@users.noreply.github.com>

(cherry picked from commit 5073cfc8bc)

* fix header problem

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
Co-authored-by: Sayee <57951841+sayee-jadhav@users.noreply.github.com>
Co-authored-by: Baptiste Mille-Mathias <baptiste.millemathias@gmail.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: rovshango <rovshan.go@gmail.com>
Co-authored-by: Remi Verchere <rverchere@users.noreply.github.com>
Co-authored-by: Jake Howard <RealOrangeOne@users.noreply.github.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
Co-authored-by: Per Lundberg <perlun@gmail.com>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2020-08-20 17:44:50 -05:00
Sandra McCann 9a26fbe58e
update Ansible-maintained platform guides with FQCN (#70369) (#71263)
* 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>

(cherry picked from commit 172230d7b8)
2020-08-20 16:27:58 -05:00
Sandra McCann 8775001671
Add the ansible_2_10 intersphinx reference. (#71028) (#71384)
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

(cherry picked from commit e10902d744)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2020-08-20 16:13:45 -05:00
Alicia Cozine a007176d7e
Backport/2.10/70530 (#71380)
* add FQCN to M() references (#70530)

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
(cherry picked from commit dd048a5197)

* Fix make webdocs warnings (#71340)

(cherry picked from commit 7f97a62d87)

Co-authored-by: Baptiste Mille-Mathias <baptiste.millemathias@gmail.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
2020-08-20 15:45:15 -05:00
Andrew Klychkov 4442661611
dev_guide: improve developing_collections.rst (#71332) (#71365)
(cherry picked from commit 180507c62b)
2020-08-20 09:48:02 -05:00
Andrew Klychkov 13dff99f50
developing_modules_in_groups.rst: add note about releasing (#71305) (#71366)
(cherry picked from commit 9296ee9329)
2020-08-20 09:47:28 -05:00
Andrew Klychkov e0a550efea
overview_architecture.rst: fix playbook example (#71303) (#71367)
(cherry picked from commit a496b89d6f)
2020-08-20 09:46:40 -05:00
Sandra McCann 1984a34c2b
Add Fest banner (#71360) (#71361)
Adds Fest banner, with fixes; updates existing banners, adds links.

(cherry picked from commit 9be8d723da)
2020-08-19 15:41:37 -05:00
Felix Fontein aa51c6000a
Fix fortimanager httpapi redirect (#71073) (#71081)
* The fortimanager httpapi plugin is in fortinet.fortimanager, not in fortinet.fortios.

* Add changelog fragment.

(cherry picked from commit 4bd7580dd7)
2020-08-19 13:29:55 -05:00
Felix Fontein a06730cdb0
Redirect gluster modules to gluster.gluster. (#71240) (#71264)
(cherry picked from commit 9f72ff80e3)
2020-08-19 13:28:01 -05:00
Felix Fontein c96e955c76
Fix roadmap formatting. (#71275) (#71322)
(cherry picked from commit ee48e0b0ad)
2020-08-17 15:32:18 -05:00
Felix Fontein 1895b7ab5e
Update auto-generated 2.10 porting guide in devel. (#71276) (#71323)
(cherry picked from commit 61b7f234bd)
2020-08-17 15:31:47 -05:00
Matt Clay fa18566c3e [stable-2.10] 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.
(cherry picked from commit b53e7f8720)

Co-authored-by: Matt Clay <matt@mystile.com>
2020-08-17 11:16:56 -07:00
Matt Davis 3b9ee86381 [stable-2.10] fix collection package root location under pytest >=6.0.0 (#70963)
(cherry picked from commit 86b6c4bbb6)

Co-authored-by: nitzmahone <nitzmahone@users.noreply.github.com>
2020-08-17 11:16:08 -07:00
Rick Elrod 8c4af4bc3b Update Ansible release version to v2.10.0.post0. 2020-08-13 15:29:34 -05:00
Rick Elrod a6ed955132 New release v2.10.0 2020-08-13 12:30:50 -05:00
Sandra McCann ae9c1167e4
[2.10] Docs Backportapalooza 7 (#71261)
* 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.

(cherry picked from commit fb9c9570d5)

* Docs:  Fix typo (#71119)

(cherry picked from commit cb9336ab6d)

* remove network for 2.10 base porting guide (#71158)

(cherry picked from commit 56748a8060)

* Updating Getting Started with Resources section #68962 (#71102)

* Updating Getting Started with Resources section #68962
* Add links, including Workshops URL #68962

(cherry picked from commit 5f8b45a70e)

* 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>
(cherry picked from commit f46b124d65)

* 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>
(cherry picked from commit edac065bd2)

* filters: minor doc fix (#71178)

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

* 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.

(cherry picked from commit e72e12aa27)

* Fix references to Ansible Collections Overview (#71227)

(cherry picked from commit 19589db10c)

* 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>

(cherry picked from commit f4388de14d)

* Adds fest link (#71241)

(cherry picked from commit ae3b8eec12)

* 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>

(cherry picked from commit 553ccedcd3)

Co-authored-by: Daniel Finneran <dan@thebsdbox.co.uk>
Co-authored-by: Liviu Chircu <liviu@opensips.org>
Co-authored-by: kshitijcode <ikshitijsharma@gmail.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Håkon Solbjørg <hakon@solbj.org>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2020-08-13 12:23:46 -05:00
Rick Elrod 6e3271aa61
[stable-2.10] Revert default mode changes (#71260)
* Revert "[stable-2.10] Revert "Change default file permissions so they are not world readable (#70221) (#70824)" (#71236)"

This reverts commit c968020d52.

* Revert "Remove porting guide entry related to reverted change (#71242)"

This reverts commit 006a21eae2.
2020-08-13 12:17:47 -05:00
Sam Doran 006a21eae2
Remove porting guide entry related to reverted change (#71242)
Related to #71236
2020-08-13 02:23:03 -05:00
Sam Doran c968020d52
[stable-2.10] Revert "Change default file permissions so they are not world readable (#70221) (#70824)" (#71236)
* [stable-2.10] Revert "Fix warning for new default permissions when mode is not specified (#70976) (#70985)"

This reverts commit 5cb96087e6.

* [stable-2.10] Revert "Change default file permissions so they are not world readable (#70221) (#70824)"

This reverts commit 7e4cffc5d2.
2020-08-12 14:30:47 -05:00
Sandra McCann b9a406f890
Docs [2.10] Backportapalooza 6 (#71129)
* Misc typo fixes (#71089)

(cherry picked from commit 504ef607f3)

* 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

(cherry picked from commit a9eb8b0488)

* 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

(cherry picked from commit 72d3d44163)

* 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>
(cherry picked from commit 0055673c70)

* 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>
(cherry picked from commit 701c638757)

* docs: Add a note about package requirements for fact gathering (#70796)

Fixes: #26148

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

* added note about fakeroot (#71018)

see #70895

(cherry picked from commit 11a31e99e6)

* Update documentation of httpapi's handle_httperror method for clarity (#70991)

(cherry picked from commit a0523e5b8a)

* 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>
(cherry picked from commit 9879da8e23)

* 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>
(cherry picked from commit 4f4436c124)

* 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

(cherry picked from commit 864573a38d)

* Update intro_getting_started.rst (#71039)

Added two additional learning resources in the See also: section- forgot closing backticks

(cherry picked from commit 9850915bd6)

* 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.

(cherry picked from commit 0c855dc70b)

* 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.

(cherry picked from commit 61b36c6f30)

* Update network platform guides with FQCN (#70699)

* fqcn all the docs things!

(cherry picked from commit 54bee7152b)

* Document how to upgrade to ansible with pip (#70768)

Fixes #70348

(cherry picked from commit 5019335660)

* 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>
(cherry picked from commit 58145dff9c)

* remove github link from plugins (#70951)

(cherry picked from commit e28b20d729)

* Add latest rc from ansible-base (#70974)

* Add latest rc from ansible-base

(cherry picked from commit d62dffafb3)

* Document to_json will convert to ASCII strings by default (#70954)

... as reported in issue #68702

(cherry picked from commit 8c48366f1c)

* Update the porting guide for ansible-2.10.0a8 (#71141)

(cherry picked from commit 0a9638ce4b)

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sloane Hertel <shertel@redhat.com>
Co-authored-by: Rick Elrod <rick@elrod.me>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Nathaniel Case <ncase@redhat.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
Co-authored-by: Terciero <terciero@users.noreply.github.com>
Co-authored-by: Brendon O'Sullivan <49501251+bjosullivan@users.noreply.github.com>
Co-authored-by: EthanHur <ethan0311@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Baptiste Mille-Mathias <baptiste.millemathias@gmail.com>
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2020-08-07 16:04:19 -05:00
Rick Elrod 4b03d898f3
Update integration tests to support rpmfluff-0.6 (#71155) (#71159)
Co-authored-by: Matt Martz <matt@sivel.net>
2020-08-07 14:52:17 -05:00
Rick Elrod a187613da8
Add CVE reference to changelog for PR 70762 (#71151) (#71156)
Co-authored-by: David Shrewsbury <Shrews@users.noreply.github.com>
2020-08-07 11:50:34 -05:00
Toshio Kuratomi 72aa55d514
[stable-2.10] Fix version comparison for determining what ansible to build against (#71152)
* 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
(cherry picked from commit 37a7485)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2020-08-07 10:18:25 -05:00
Sam Doran be5aab177c
[stable-2.10] Drop "rhui-" prefix from RHEL repositories in AMI (#71130) (#71131)
The repository names seem to have changed and no longer have the "rhui-" prefix
(cherry picked from commit 6ac4439a6a)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-08-06 16:58:58 -05:00
Alicia Cozine 3e7e3ee352
Warning banner should only show on /devel/ docs, not on pages with 'devel' in their titles (#70849) (#71075)
* Update docs/docsite/_themes/sphinx_rtd_theme/ansible_banner.html
* Only match paths at the beginning

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
(cherry picked from commit 8313cc8fb1)
2020-08-06 16:19:59 -05:00
Felix Fontein 58517e52e2
Porting guides for ansible-base 2.10 and ansible 2.10 (#70891) (#71029)
* 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.

(cherry picked from commit 61b36c6f30)
2020-07-31 15:52:55 -05:00
Sandra McCann 224a0b4809
[DOCS] Backportapalooza 5 (#70999)
* misc typo fixes (#70736)

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

* How to use rst :ref: for modules in collections (#70567)

(cherry picked from commit 748ba96610)

* Update network_best_practices_2.5.rst (#70962)

Fix a small typo in the playbook tasks sample section

(cherry picked from commit 69e5c6c14a)

* 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".

(cherry picked from commit 37e9d2278a)

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: PJ Waskiewicz <pjwaskiewicz@gmail.com>
Co-authored-by: Emilien Macchi <EmilienM@users.noreply.github.com>
2020-07-31 15:51:54 -05:00
Rick Elrod b8eb35ef76 Update Ansible release version to v2.10.0rc4.post0. 2020-07-30 18:27:32 -05:00
Rick Elrod 3900f82d00 New release v2.10.0rc4 2020-07-30 16:17:16 -05:00
Sloane Hertel 9f4748cb2d
fix downloading collections in git repos and tar.gz artifacts (#70524) (#71000)
* Fix downloading tar files

* Fix downloading SCM collections

* changelog

(cherry picked from commit 54e2ae79e7)
2020-07-30 13:37:59 -07:00
Sam Doran 719c40bfdf
[stable-2.10] facts - fix incorrect time for some date_time_facts (#70665) (#70996)
* [stable-2.10] 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
(cherry picked from commit c4f442ed5a)

Co-authored-by: Sam Doran <sdoran@redhat.com>

* Remove tests for tz_dst since that only exists in newer versions
2020-07-30 13:37:19 -07:00
Matt Clay b764d381f0
[stable-2.10] Fix ansible-test relative import analysis. (#70993)
(cherry picked from commit 2e0097ada3)

Co-authored-by: Matt Clay <matt@mystile.com>
2020-07-30 13:36:49 -07:00
Akira Yokochi abfedb06c3
default_callback: Move 'check_mode_markers' in doc_fragments (#70228) (#70989)
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>
(cherry picked from commit 4885ebad27)

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-30 13:36:24 -07:00
Sam Doran 5cb96087e6
Fix warning for new default permissions when mode is not specified (#70976) (#70985)
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

(cherry picked from commit dc79528cc6)
2020-07-30 10:10:23 -07:00
Jordan Borean a8217f1bd4
ansible-galaxy - fix fallback for AH searches (#70957) - 2.10 (#70980)
* ansible-galaxy - fix fallback for AH searches (#70957)

(cherry picked from commit b1cb2553af)

* Fix tests after backport
2020-07-30 10:08:25 -07:00
Sam Doran 8389f4df0b
[stable-2.10] Update module debugging docs (#70847) (#70972)
- 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>
(cherry picked from commit 7f0c84ea15)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-07-29 14:33:36 -07:00
Brian Coca a75b3601d9
Allow changed/failed mgmt on strategy actions (#70919) (#70968)
* Allow changed/failed mgmt on strategy actions

(cherry picked from commit f9c3c6cba6)
2020-07-29 14:32:33 -07:00
Sorin Sbarnea 4c459f341b
Document galaxy install from local clones (#70941) (#70967) 2020-07-29 13:55:15 -07:00
Felix Fontein c39e536d84
validate-modules: fix version_added validation for top-level, fix error codes (#70869) (#70947)
* 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.

(cherry picked from commit 7e2cc7db12)
2020-07-29 13:54:45 -07:00
Sam Doran 6f70d40d51
[stable-2.10] lineinfile - fix broken exception handling (#70846) (#70944)
* prevent (ExceptionType) is not subscriptable errors
* tweak error message and use text conversion
* add to_text import
(cherry picked from commit 45c2eb6c0a)

Co-authored-by: nitzmahone <nitzmahone@users.noreply.github.com>

Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
2020-07-29 13:53:54 -07:00
Sam Doran 293d6c59bb
[stable-2.10] reboot - fix Void Linux (#70704) (#70916)
Add entry for appropriate commands for Void Linux
(cherry picked from commit 4cc4cebc97)

Co-authored-by: fosslinux <fosslinux@aussies.space>

Co-authored-by: fosslinux <fosslinux@aussies.space>
2020-07-29 13:52:45 -07:00
Rick Elrod bf479eb7f3
[ansible_builtin_runtime.yml] fix text[fs]m typo (#70893) (#70894)
Change:
- textsfm -> textfsm

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

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-29 13:52:09 -07:00
Felix Fontein 155041d8ee
Fix ansible-test error in community.aws (#70507) (#70873)
* 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>
(cherry picked from commit b0d9deeae3)

Co-authored-by: Alan Rominger <arominge@redhat.com>
2020-07-29 13:51:47 -07:00
Sviatoslav Sydorenko be28e98cf2
[backport][2.10][PR #70446] Refactor Python API examples and docs (#70850)
* Add boilerplate snippet into `examples/`

It is a partial backport of #70224

(partially cherry picked from commit 4816bb4f43)

* 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.

(cherry picked from commit 20bb915092)
2020-07-29 13:51:21 -07:00
Matt Clay 4280efccc4 [stable-2.10] Cap pytest version to avoid relative import issue.
(cherry picked from commit 3a8ac62596)

Co-authored-by: Matt Clay <matt@mystile.com>
2020-07-28 17:14:30 -07:00
Sandra McCann 8d2b25d490
Docs backportapalooza 4 (#70875)
* Pipe lookup plugin usage example documentation fix (#70679)

(cherry picked from commit 58d24584c0)

* 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>
(cherry picked from commit 633c2d0522)

* Fix incorrect statement to set a variable for a playbook (#70712)

Fixes #70638

(cherry picked from commit 59513ae673)

* 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.

(cherry picked from commit fb3db170cc)

* fix rstcheck problem and gitignore collections dir (#70764)

(cherry picked from commit 24e5d3a51c)

* 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>
(cherry picked from commit 2a7df5e07b)

* 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>

(cherry picked from commit 1733253297)

* 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>
(cherry picked from commit b28d59124b)

* 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>
(cherry picked from commit 7a42d27462)

* 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.

(cherry picked from commit 92e16c2838)

Co-authored-by: Roman Gorshunov <34521622+gorshunovr@users.noreply.github.com>
Co-authored-by: David Rieger <david@isan.engineer>
Co-authored-by: Baptiste Mille-Mathias <baptiste.millemathias@gmail.com>
Co-authored-by: Stef B <regendo@users.noreply.github.com>
Co-authored-by: Sayee <57951841+sayee-jadhav@users.noreply.github.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
Co-authored-by: Fixmetal <fixmetal@gmail.com>
2020-07-28 17:38:17 -05:00
Rick Elrod 12784beb87 Update Ansible release version to v2.10.0rc3.post0. 2020-07-24 18:16:57 -05:00
Rick Elrod f28fa88448 New release v2.10.0rc3 2020-07-24 15:59:04 -05:00
Brian Coca 9b992c0b78
reset logging to INFO (#70878) (#70881)
- due to CVE-2019-14846
 - also added comments and test to avoid 'oportunistic' reversion

(cherry picked from commit 1223ce656a)
2020-07-24 15:47:57 -05:00
Rick Elrod cea2544943 Update Ansible release version to v2.10.0rc2.post0. 2020-07-23 23:16:58 -05:00
Rick Elrod c528e648a6 New release v2.10.0rc2 2020-07-23 21:38:44 -05:00
Rick Elrod c53a68bf16
Update ansible-base test container to 1.5.0. (#70856) (#70857)
Co-authored-by: Matt Clay <mclay@redhat.com>
2020-07-23 21:36:41 -05:00
Jordan Borean e9c9c02e0a
Do not add connection vars to the output results (#70853) (#70855)
* Do not add connection vars to the output results

* Also revert the delgated scenario JIC

* Added regression test

(cherry picked from commit 5e1a968983)
2020-07-23 19:48:45 -05:00
Rick Elrod 6dd05dfe67 Update Ansible release version to v2.10.0rc1.post0. 2020-07-23 17:33:24 -05:00
Rick Elrod 3ee5b46ba7 New release v2.10.0rc1 2020-07-23 14:44:50 -05:00
Matt Davis cc8d180801
fix internal cases of actions calling unqualified module names (#70818) (#70840)
* 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>
(cherry picked from commit 4c0af6c808)
2020-07-23 10:29:09 -07:00
Sviatoslav Sydorenko 7969b60552
Fix the internal Python API usage examples (#70841)
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.

(cherry picked from commit 8d97c8c222)
2020-07-23 10:10:42 -07:00
Sloane Hertel 180eea8089
Update default from True to False for CONDITIONAL_BARE_VARS (#70709) (#70838)
ci_complete

(cherry picked from commit 2811d9486f)
2020-07-23 10:09:58 -07:00
Sam Doran 7e4cffc5d2
[stable-2.10] Change default file permissions so they are not world readable (#70221) (#70824)
* 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.
(cherry picked from commit 5260527c4a)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-07-23 09:07:18 -07:00
Brian Coca 8c2754e6d3
Allow hostvars delegation (#70331) (#70810)
* 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

(cherry picked from commit 84adaba6f5)
2020-07-22 18:29:07 -07:00
David Shrewsbury 7cdba7c923
Sanitize URI module keys with no_log values (#70762) (#70820)
* 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

(cherry picked from commit bf98f031f3)
2020-07-22 18:28:24 -07:00
Rick Elrod 529dad9a39
Add ansible-releases@redhat.com to announce template (#70813)
Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-22 18:27:44 -07:00
Nathaniel Case 4cbfb08da5
[stable-2.10] Document existing ansi_re sequences and add ESC[m (#70683) (#70807)
* Document existing ansi_re sequences and add `ESC[m`

* Add changelog
(cherry picked from commit 06a4fc2)

Co-authored-by: Nathaniel Case <ncase@redhat.com>
2020-07-22 18:27:21 -07:00
Abhijeet Kasurde 18dd73c147
[2.10] basic: use PollSelector implementation (#70800)
Some platform such as ESXi does not implement EpollSelector,
which is selected by DefaultSelector. Use PollSelector.
This works perfectly with a platform like VMware ESXi.

Fixes: #70238

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 8cccede0d4)
2020-07-22 18:26:47 -07:00
psi / Ryo Hirafuji 61f8f8ce7f
cron - Allow non-ascii (UTF-8) chars in cron file paths and jobs (#70426) (#70794)
* 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-22 18:26:10 -07:00
Matt Martz 7eb5f53294
[stable-2.10] Ensure single vaulted values aren't counted as sequences. Fixes #70784 (#70786) (#70791)
(cherry picked from commit 96b74d3)

Co-authored-by: Matt Martz <matt@sivel.net>
2020-07-22 18:25:38 -07:00
Baptiste Mille-Mathias 1eb2afac63
Create home and parent directories only when requested (#70790)
The home user and the parents directories should only be created when
create_home == True

(cherry picked from commit f3dd8d3052)
2020-07-22 18:23:47 -07:00
Martin Krizek 4170786cd9
2.10: Detect failure in always block after rescue (#70094) (#70204)
* Detect failure in always block after rescue (#70094)

* Detect failure in always block after rescue

Fixes #70000

ci_complete

* Add more tests

(cherry picked from commit 0ed5b77377)

* add changelog

Co-authored-by: Matt Davis <mrd@redhat.com>
2020-07-22 14:00:27 -07:00
John R Barker 32c818a1c8
Update Molecule support contact (#70797) (#70804)
As Molecule started to use https://github.com/ansible-community/molecule/discussions we need to update documentation before retiring
the molecule-users mailing list.

(cherry picked from commit b7ee07215d)

Co-authored-by: Sorin Sbarnea <ssbarnea@users.noreply.github.com>
2020-07-22 12:15:12 +01:00
John R Barker 75be854360
runtime: aws_netapp_cvs_filesystems (#70781) (#70803)
(cherry picked from commit 481cd30129)
2020-07-22 12:14:45 +01:00
John R Barker 9cd47492be
runtime os_image_facts is now called os_image_info (#70776) (#70780)
(cherry picked from commit 1e0d83524c)
2020-07-21 11:24:22 -07:00
Matt Martz 448f17e9a5
[stable-2.10] Guard against allowing ansible to ansible-base upgrades (#70529) (#70760)
* 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>
(cherry picked from commit 918388b85f)

* 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

(cherry picked from commit 54b002e1ac)

Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
2020-07-21 11:23:55 -07:00
Baptiste Mille-Mathias ffd3757fc3
Fix missing quoting for remote_tmp in second mkdir of shell module. Issue #69577 (#69578) (#70757)
* 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>
(cherry picked from commit 77d0effcc5)

Co-authored-by: Brian Kohles <briankohles@users.noreply.github.com>
2020-07-21 11:23:25 -07:00
Abhijeet Kasurde 0d230b4f56
[2.10] debconf: add a note about no_log usage (#70752)
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>
(cherry picked from commit 84b4387702)
2020-07-21 11:21:45 -07:00
Sam Doran 9b8a649f2e
[stable-2.10] Handle Slackware OS version strings containing a plus (“+”) (#68142) (#70717)
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>>
(cherry picked from commit 566c5e6ce1)

Co-authored-by: Eduard Rozenberg <2648417+edrozenberg@users.noreply.github.com>

Co-authored-by: Eduard Rozenberg <2648417+edrozenberg@users.noreply.github.com>
2020-07-21 11:21:07 -07:00
Jordan Borean a7f4c6a37f
win async - use full path for powershell (#70703) (#70714)
(cherry picked from commit 154efd97f2)
2020-07-21 11:20:35 -07:00
Sloane Hertel d329985d4c
[2.10] template connection variables accessed directly before using (#70657) (#70688)
* template connection variables accessed directly before using (#70657)

* template variables accessed directly when using them instead of FieldAttributes

(cherry picked from commit 8c213c9334)

* changelog
2020-07-21 11:19:52 -07:00
Abhijeet Kasurde ed07821a59
[2.10] api: time.clock compatible code (#70677)
time.clock is removed in Python 3.8. Add time.clock
compatible code.

Fixes: #70649

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 055871cbb8)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-21 11:19:27 -07:00
John R Barker 524d4b08dc
runtime Remove vmware_httpapi entries that were not released (#70777)
These modules and plugins were added to ansible/ansible *after*
stable-2.9 was branched, ie they've not been released yet.

The new collection https://github.com/ansible-collections/vmware_rest
will not be released till later in the year.
2020-07-21 17:56:41 +01:00
John R Barker 895fc1d659
Redirect restored modules to community.general. (#70769) (#70775)
(cherry picked from commit 8188bce0ff)

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-07-21 13:01:04 +01:00
Matt Davis 652ac88931
ansible_builtin_runtime.yml fixes (#70767) (#70771)
* 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.

(cherry picked from commit 707e8b6e0c)

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-07-20 16:50:15 -07:00
Toshio Kuratomi 46b1a999c6
Collections docs generation backport (#70515)
* 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.

* Docs: User guide overhaul, part 5 (#70307)

(cherry picked from commit db354c0300)

* Need to return any error code from running antsibull-docs (#70763)

This way we fail early if there's a problem

(cherry picked from commit 1e3989c9f7)

Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2020-07-20 14:28:35 -07:00
John R Barker 3eba8b8792
dellemc related module name changes (#70749) (#70761)
(cherry picked from commit f9bb5c9c5a)

Co-authored-by: Mohamed Javeed <mohamed_javeed_faroo@dell.com>
2020-07-20 14:33:53 -05:00
Felix Fontein a5b46b6372
Followup to #70610: fix ansible_builtin_runtime.yml redirects to wrong collections (#70725) (#70743)
* 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.

(cherry picked from commit cf217178c7)
2020-07-20 15:24:40 +01:00
Akira Yokochi 6b6ecaf742
fix netbox inventory plguin name to redirect (#70708)
(cherry picked from commit 75c5087ccf)

Co-authored-by: akira <akira6592@example.com>
2020-07-17 13:00:26 -07:00
Felix Fontein 9b7ed6b81b
Fix spelling errors. (#70664) (#70696)
(cherry picked from commit 08b20c9c08)
2020-07-17 12:59:38 -07:00
Matt Martz 255dfca7f6
[stable-2.10] Allow single vault encrypted values to be used directly as module parameters. Fixes #68275 (#70607) (#70641)
(cherry picked from commit a77dbf0)

Co-authored-by: Matt Martz <matt@sivel.net>
2020-07-17 12:54:32 -07:00
Rick Elrod 86b24498b7
Add intentional coverage for an async_wrapper case (#70593) (#70630)
* Add intentional coverage for an async_wrapper case (#70593)

Change:
- Test async_wrapper when the module it runs has stderr output

Test Plan:
- CI
- Looked at coverage report and saw green for a few lines that weren't
  previously green.

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

* sigh

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-17 12:52:45 -07:00
Rick Elrod 33e5f1d661
Get m_u.facts.utils coverage up to 100% (#70614) (#70629)
* 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-17 12:52:00 -07:00
Abhijeet Kasurde 963bdd9983
[2.10] pipe: update docs for Popen with shell=True usage (#70602)
pipe lookup plugin uses Popen with shell=True intentionally.
This is considered a security issue if user input is not validated.
Updated docs to reflect this information for the user. Also, added
Bandit B602 documentation link for further reading.

Fixes: #70159

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit e5649ca3e8)
2020-07-17 12:51:35 -07:00
Brian Coca 6cd015d7e2
Make filter type errors 'loop friendly' (#70417) (#70574)
- ensure we preserve the typeerror part of the exception so loop defereed error handling
 can postpone those caused by undefined variables until the when check is done.
 - fix tests to comply with the 'new normal'

 - human_to_bytes and others can issue TypeError not only on 'non string'
 but also bad string that is not convertable.

Co-authored-by: Sloane Hertel <shertel@redhat.com>

Co-authored-by: Sloane Hertel <shertel@redhat.com>
(cherry picked from commit cf89ca8a03)
2020-07-17 12:51:18 -07:00
Felix Fontein 15355ed059
[2.10] ansible-doc: include collection name in text output / plugin loader: return collection name; ansible-doc: handle ansible.builtin correctly (#70572)
* ansible-doc: include collection name in text output (#70401)

* ansible-doc: include collection name in text output

* Be more careful to not accidentally pass ansible.builtin for user-supplied modules.

(cherry picked from commit f4c89eab23)

* plugin loader: return collection name; ansible-doc: handle ansible.builtin correctly (#70026)

* Determine collection in plugin loader.

* Fix test.

* Use PluginPathContext objects in PluginLoader._plugin_path_cache instead of tuples.

(cherry picked from commit 24dcaf8974)
2020-07-17 12:50:23 -07:00
Brian Coca 827c47d9bc
try to capture better winrm/put_file error (#70508) (#70570)
* 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>
(cherry picked from commit 8789d7968d)
2020-07-17 12:49:11 -07:00
Mykola Grygoriev 5ea6de4e7d
Fix decrypt argument in assemble module (#70465) (#70560)
* Do not pass decrypt parameter to assemble module

* Add integration tests where decrypt=True

* Add changelog #70465

(cherry picked from commit 71c378e139)
2020-07-17 12:48:38 -07:00
David Shrewsbury 94a81f7b44
Make sure ansible_become treated as a boolean (#70484) (#70526)
* Make sure ansible_become treated as a boolean

(cherry picked from commit 8aca464b8b)
2020-07-17 12:46:33 -07:00
Felix Fontein a5c0b11913
ansible-doc man formatter: fail with better error message when description isn't there (#70046) (#70485)
* ansible-doc man formatter: do not crash when description isn't there.
* Change to report a better error message when description is not there.
* Add test.

(cherry picked from commit 9164b96774)
2020-07-17 12:44:03 -07:00
Sam Doran 422e976649
[stable-2.10] apt - make errors more transparent (#70099) (#70478)
Include error from apt Python library in module error output

Co-authored-by: Andreas Schleifer <aschleifer@bigpoint.net>
(cherry picked from commit 7d7f15fc9b)

Co-authored-by: Andreas Schleifer <a.schleifer@bigpoint.net>

Co-authored-by: Andreas Schleifer <a.schleifer@bigpoint.net>
2020-07-17 12:43:19 -07:00
Sam Doran df3246b7d1
[stable-2.10] ssh connection - use get_option() rather than _play_context (#70438) (#70443)
The ssh_args were sometimes not correctly applied to the connection
when using _play_context. Use get_option() instead to ensure the
correct ssh_args are always applied.
(cherry picked from commit b4184aa50e)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-07-17 12:42:51 -07:00
Matt Davis 865ba1953b
misc collection metadata fixes (#70403) (#70428)
* misc collection metadata fixes

* parse collection meta with libyaml if available
* require only Mapping for validation
* add explanatory text for _meta_yml_to_dict

* ignore custom pylint rule

* this code shouldn't import a bunch of stuff from ansible, since it's run under the import sanity test

(cherry picked from commit b9e38e8b55)
2020-07-17 12:42:20 -07:00
Sloane Hertel 212d2024f4
[2.10] Handle post_validate templating errors and fix tests (#70240) (#70389)
* 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

(cherry picked from commit 30e70f4b63)

* changelog

ci_complete
2020-07-17 12:41:43 -07:00
Sam Doran d0e37aeec1
[stable-2.10] Improve error message when ssh client is not found on the host (#70122) (#70386)
* Add changlelog
(cherry picked from commit 70bb2b33ca)

Co-authored-by: Mykola Grygoriev <nickgryg@gmail.com>

Co-authored-by: Mykola Grygoriev <nickgryg@gmail.com>
2020-07-17 12:40:38 -07:00
Martin Krizek 7dfda4026e
Fix delegate_facts with interpreter not being set (#70293) (#70384)
Fixes #70168

ci_complete

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit b05e00e99a)
2020-07-17 12:40:00 -07:00
Abhijeet Kasurde e1c0688e43
[2.10] Improve ansible-galaxy STDOUT messages for collections (#70379)
- 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>
(cherry picked from commit 2d59e548f6)

Co-authored-by: Hideki Saito <saito@fgrep.org>
2020-07-17 12:39:16 -07:00
Sandra McCann c936b8b638
[backport][2.10]Docs backportapalooza3 (#70695)
* Suggest ansible ad-hoc command while developing module (#70308)

If a local module has no documentation, the doc command will fail without any hints of what is wrong. Add another way to confirm the presence of a local module.
* Update docs/docsite/rst/dev_guide/developing_locally.rst

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

* Update AWS Integration test docmentation (#70454)

(cherry picked from commit e1ba7dc52a)

* Update hacking/shippable docs.

The `--all` option downloads more than is needed for analyzing code coverage.

(cherry picked from commit fb7740ae3b)

* Document that subversion module requires subversion (#70537)

(cherry picked from commit 64c2cb273f)

* update documentation link to python 3 (#70509)

update the docs link for strftime on the filters page to point to the python3 docs

(cherry picked from commit f7db428375)

* Update windows_winrm.rst (#70306)

gcc also needed to be installed alongside python-devel, krb5-devel, krb5-libs, and krb5-workstation.

(cherry picked from commit f4ea43c4a0)

* updated requirements file for docs build (#70609)

(cherry picked from commit 38ccfb4a3e)

* Clarify that index_var is 0 indexed (#70548)

A little further down the page is another index, ansible_loop.index, which shares a similar description but is 1 indexed.
Its zero indexed twin has a 0 suffix.

``ansible_loop.index``      The current iteration of the loop. (1 indexed)
``ansible_loop.index0``     The current iteration of the loop. (0 indexed)

To remove ambiguity around the usage of index_var, explicitly mention that this variable is 0 indexed.

(cherry picked from commit c410311f55)

* docs: update module development docs (#70594)

Update module development docs for flattened modules directory.

Fixes: #70261 (at least partially)

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

* Doc: fix examples of changelog entries. (#70551)

(cherry picked from commit edcd1a1a70)

* Document tags are not supported with task meta. (#70590)

fixes #70338

(cherry picked from commit 40591d5fbb)

* docs: update date format in removed_at_date (#70597)

removed_at_date requires YYYY-MM-DD format.

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

* partial update of community docs to reflect collections transition (#70488)

(cherry picked from commit f1f782fc37)

Co-authored-by: Michael Ritsema <michaelritsema@users.noreply.github.com>
Co-authored-by: Mark Chappell <mchappel@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Alan Rominger <arominge@redhat.com>
Co-authored-by: FloMiau <37121807+FloMiau@users.noreply.github.com>
Co-authored-by: mahadelmi <mahadelmi@cmail.carleton.ca>
Co-authored-by: Sayee <57951841+sayee-jadhav@users.noreply.github.com>
Co-authored-by: Karl Goetz <goetzk@users.noreply.github.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Baptiste Mille-Mathias <baptiste.millemathias@gmail.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2020-07-17 13:50:40 -05:00
Felix Fontein f9a737b9b2
Top-level deprecation of plugin did not get collection_name added when deprecating by version (#70344) (#70370)
* Top-level deprecation of plugin did not get collection_name added when deprecating by version.

* Add changelog fragment.

(cherry picked from commit 689cfd1983)
2020-07-17 10:58:54 -07:00
Matt Davis 1e03b54d23
refactor Python module_utils locator (#70610) (#70711)
* 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

(cherry picked from commit c616e54a6e)
2020-07-17 10:57:44 -07:00
Sam Doran 367c9b7eda
[stable-2.10] pause - fix curses.setupterm() error (#47851) (#70363)
* [Bugfix] curses.setupterm() error

When run playbook in celery task, curses.setupterm()  will be failed

```
  File "<frozen importlib._bootstrap>", line 675, in _load
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "/Users/guang/.virtualenvs/ansible/lib/python3.6/site-packages/ansible/plugins/action/pause.py", line 45, in <module>
    curses.setupterm()
TypeError: argument must be an int, or have a fileno() method.

```

* Add changelog

Co-authored-by: Sam Doran <sdoran@redhat.com>
(cherry picked from commit c3fc2d27d9)

Co-authored-by: 老广 <ibuler@qq.com>

Co-authored-by: 老广 <ibuler@qq.com>
2020-07-17 10:57:20 -07:00
Abhijeet Kasurde 3afa0424b3
[2.10] display: use stdout for column width (#70290)
stdout may differ from stdin so it should be used to determine the column
width, especially since it is the target file descriptor.

(cherry picked from commit 45e0f74702)

Co-authored-by: Pavel Březina <pbrezina@redhat.com>
2020-07-17 10:56:40 -07:00
Felix Fontein 273159da4c
Include changelogs/changelog.yaml in distribution. (#70260) (#70266)
(cherry picked from commit ebd20ddca6)
2020-07-17 10:55:25 -07:00
Sam Doran 95ec1618ef
[stable-2.10] Only pass kwargs to our string checker not callable checkers (#70151) (#70170)
Since only check_type_str() accepts extra param, only pass to our checker and
do not pass kwargs to custom checkers.

* Add unit tests
(cherry picked from commit bc05415109)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-07-17 10:53:56 -07:00
Sam Doran b6f6067dfd
[stable-2.10] ansible_runner test - Add constraints (#70667) (#70669)
A recent updated to psutil, which is a dependency of ansible-runner, fails
to install on older versions of pip.

Commit with the breaking change:

  135628639b
(cherry picked from commit 9d27d7c8b1)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-07-15 17:32:09 -05:00
Matt Clay c2b69fd30e [stable-2.10] Fix ansible-test virtualenv management.
(cherry picked from commit 1e02a201a6)

Co-authored-by: Matt Clay <matt@mystile.com>
2020-07-14 02:08:17 -07:00
Matt Clay ddc78622a4 [stable-2.10] Update ansible-test change detection for plugins.
(cherry picked from commit 09f02980a4)

Co-authored-by: Matt Clay <matt@mystile.com>
2020-07-13 23:55:15 -07:00
Matt Clay 957f0c27fc [stable-2.10] Fix boilerplate in setup.py and lib/ansible/ dir..
(cherry picked from commit 234994fc07)

Co-authored-by: Matt Clay <matt@mystile.com>
2020-07-13 18:57:17 -07:00
Matt Clay a707466c0b [stable-2.10] Fix yamllint sanity test line numbers.
Parse errors from libyaml now compensate for the offset of the documentation within a module.
(cherry picked from commit 1a0d8a51cd)

Co-authored-by: Matt Clay <matt@mystile.com>
2020-07-13 18:28:30 -07:00
Matt Clay 8cd66ce95a [stable-2.10] Clean up unit test boilerplate.
(cherry picked from commit 98a0995fd0)

Co-authored-by: Matt Clay <matt@mystile.com>
2020-07-13 18:28:02 -07:00
Matt Clay 3204d260dd [stable-2.10] Add integration tests for basic.py _set_cwd.
These tests verify that AnsibleModule can be instantiated when cwd does not exist or is unreadable.
(cherry picked from commit d6fb42d1c5)

Co-authored-by: Matt Clay <matt@mystile.com>
2020-07-13 18:16:00 -07:00
Matt Clay f28fabe6ef [stable-2.10] Add integration tests for test plugins. (#70576)
(cherry picked from commit df45dcdae0)

Co-authored-by: Matt Clay <mclay@redhat.com>
2020-07-13 18:15:21 -07:00
Matt Clay ba645400bf [stable-2.10] Correct name of fileglob lookup integration test.
(cherry picked from commit bbd8f15a58)

Co-authored-by: Matt Clay <matt@mystile.com>
2020-07-13 18:15:00 -07:00
Matt Clay 73d9054b32 [stable-2.10] Test netconf plugins in ansible-doc sanity test.
(cherry picked from commit 8d92df4537)

Co-authored-by: Matt Clay <matt@mystile.com>
2020-07-13 18:14:42 -07:00
Felix Fontein 143827b0ad
Updated infini* redirects to transition to infinidat collection (#70565) (#70568)
(cherry picked from commit b285f4c675)

Co-authored-by: ekaulberg <2768206+ekaulberg@users.noreply.github.com>
2020-07-10 22:41:16 +01:00
Felix Fontein e57afc774c
Migrating MySQL to community.mysql (#70523) (#70557)
* Migrating MySQL to community.mysql

* Removed aliases to fix yaml linting

Co-authored-by: Ben Mildren <bmildren@digitalocean.com>
(cherry picked from commit b149a89e07)

Co-authored-by: Ben Mildren <ben.mildren@gmail.com>
2020-07-10 18:46:48 +01:00
Felix Fontein 7872d60413
Fix ansible_builtin_runtime.yml w.r.t. c.g and c.n (#70322) (#70400)
* Fix module_utils for community.general.
* Fix module_utils for community.network.
* Add forgotten entry for community.general.

(cherry picked from commit 24915b2ccf)
2020-07-10 14:07:47 +01:00
Sandra McCann 374d4ecd98
Doc backportapalooza 2 (#70440)
* doc: avoid mix of single and double quotes (#70115)

Avoid mix of single and double quotes in the `ternary`, this way
we can copy/past the example without any surprise.

(cherry picked from commit b491f776b9)

* document FQCN for M()  and :seealso: in DOCUMENTATION blocks (#70245)

* document FQCN for M() in DOCUMENTATION blocks

* add note about c

(cherry picked from commit 83f6e4850b)

* Fix bullet points in intro_getting_started.rst. (#70365)

The layout was jumbled due to issues with whitespace.

(cherry picked from commit dc6f4b6502)

* Add steps for how to create changelog.rst for a collection (#70262)

* Update docs/docsite/rst/dev_guide/developing_collections.rst
* add steps to create changelogs, add sentence about not using the tool
* add note for rerunning the command

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 5a28b2b86c)

* ansible-doc: avoid problems with YAML anchors when formatting man page (#70045)

* Avoid problems with YAML anchors when formatting man page.

* Add changelog.

(cherry picked from commit 5e4f708241)

* Minor grammatical fix (#70405)

'you' -> 'your'

(cherry picked from commit a1ac595d42)

* incorporate minimalism feedback on filters page (#70366)

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

* more correct info about role main.yml (#70326)

fixes #40496

(cherry picked from commit 5d3d097de3)

* Fix a small typo in cache plugin description @ `config/base.yml`

PR #70420

(cherry picked from commit 626df08d9d)

* with_sequence: example using vars (#69369)

Added an example for using vars in with_sequence.

Fixes: #68836

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

* Update pull.py (#70393)

(cherry picked from commit 46ad3c1162)

* Update playbooks.rst (#70317)

(cherry picked from commit 7c90a2d2a6)

* Add documentation for ipaddr filters  (#70343)

(cherry picked from commit 9eb904ea61)

* update platform table with links to collections (#70373)

(cherry picked from commit aa59c23aed)

* Add description of collections and become_exe keywords (#68055)

* Add description of collections keyword
* Update based on feedback.
- Add link to become plugins.
- Add note about how the collections keyword works with roles.

(cherry picked from commit 5833af9e2a)

Co-authored-by: Gonéri Le Bouder <goneri@lebouder.net>
Co-authored-by: Mark Sanders <ziplokk.mark.sanders@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Sir Mobus Gochfulshigan Dorphin Esquire XXIII <celestialtuba@gmail.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Michael Scherer <mscherer@users.noreply.github.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Ethan <smithe2413@gmail.com>
Co-authored-by: jafiala <56597272+jafiala@users.noreply.github.com>
Co-authored-by: Baptiste Mille-Mathias <baptiste.millemathias@gmail.com>
Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-07-08 16:05:41 -05:00
John R Barker d07a84e233
DigitalOcean content has been moved to community.digitalocean. (#70483) (#70498)
(cherry picked from commit 535fde3c0f)

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-07-07 21:08:13 +01:00
John R Barker 0890d9fbb2
migrating ProxySQL to community.proxysql (#70490) (#70497)
* migrating ProxySQL to community.proxysql

* Removed remaining ProxySQL ref to community.general

Co-authored-by: Ben Mildren <bmildren@digitalocean.com>
(cherry picked from commit 1a542e9824)

Co-authored-by: Ben Mildren <ben.mildren@gmail.com>
2020-07-07 13:19:35 +01:00
René Moser 14997f0309
[2.10] runtime and botmeta backports (#70451)
* botmeta: vultr migrated to ngine_io.vultr (#68916)


(cherry picked from commit 1787a3dbf5)

* 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>
(cherry picked from commit 73139df36c)

* 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

(cherry picked from commit 8cb1272ca4)

* botmeta: cloudscale: add missing migrations (#70447)


(cherry picked from commit 0198ceebe4)

* All cloudscale.ch modules are moved to a collection (#70358)


(cherry picked from commit c600f8df58)

Co-authored-by: Gaudenz Steinlin <gaudenz@users.noreply.github.com>
2020-07-03 12:44:36 +01:00
Rick Elrod 43ef13d206
command module, nix warnings for moved modules (#70444)
Change:
- Remove warnings from command module which point to modules that no
  longer ship with ansible-base but have moved to collections.

Test Plan:
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-02 14:26:18 -05:00
Samer Deeb a1224760c4
[stable 2.10] [backport] Migrate onyx modules from community.network to mellanox.onyx (#70280)
* Migrate onyx modules from community.network to mellanox.onyx

Signed-off-by: Samer Deeb <samerd@mellanox.com>

* Redirect all onyx plugins from network.common to mellanox.onyx

Signed-off-by: Samer Deeb <samerd@mellanox.com>
2020-07-02 19:54:56 +01:00
Mohamed Javeed 4f8e1c0cee
Rename from dellemc_networking to dellemc (#70321)
Rename from dellemc_networking to dellemc
2020-07-02 19:52:17 +01:00
Adam Miller ad61774acf
fix runtime.yml splunk.enterprise_security -> splunk.es (#70305) (#70310)
Signed-off-by: Adam Miller <admiller@redhat.com>
2020-07-02 10:32:01 -05:00
Abhijeet Kasurde 0abb5e597e
[2.10] known_hosts: update documentation (#70406)
* Update documentation as per sanity tests
* Added example about custom SSH port in example section

Fixes: #29236

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 74bedab8a9)
2020-07-02 10:31:23 -05:00
Abhijeet Kasurde e35e4b4ab0
[2.10] Docs: mention about Ansible workshops (#70377)
Lightbulb is deprecated in favor of https://ansible.github.io/workshops/. Update docs links accordingly.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit e4f48c920c)
2020-07-02 10:29:45 -05:00
Jordan Borean 70da336de9 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>
(cherry picked from commit 40ce448657)
2020-06-30 15:15:13 -07:00
Matt Clay 73ee85145b [stable-2.10] 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.
(cherry picked from commit 70c59423fc)

Co-authored-by: Matt Clay <matt@mystile.com>
2020-06-26 11:32:16 -07:00
Rick Elrod bcd7c860e2 pip tests, use py2 compat sampleproject fork
Change:
- sampleproject has gone py3 only. Use a py2 compatible fork.

Test Plan:
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-06-26 09:17:28 -07:00
Sandra McCann 222d35ebbd
[backport][2.10] Docsbackportapaloosa (#70302)
* Fix broken link in AWS Guide (#70153)

Point to collection rather than ansible/ansible for example.

(cherry picked from commit 0ef75f65d9)

* remove gendered example (#70117)

Changed example to not assume things about names and genders

(cherry picked from commit 5885ed4455)

* docs: Add note about ansible-doc (#70162)

ansible-doc can only parse Python modules, added a note about
this is developer guide; Fixes: #69109

(cherry picked from commit da868d9d60)

* Update config.yml (#70154)

typos & branding
* Update .github/ISSUE_TEMPLATE/config.yml

Co-authored-by: Rick Elrod <rick@elrod.me>
(cherry picked from commit 4b358c6641)

* async_status: Update documentation (#70196)

Fixes: #38164

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

* updates to ansible-maintained collections guidelines (#70178)

(cherry picked from commit 647c6cd289)

Co-authored-by: Jill R <4121322+jillr@users.noreply.github.com>
Co-authored-by: Westley Argentum Hennigh-Palermo <WestleyArgentum@gmail.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: John R Barker <john@johnrbarker.com>
2020-06-25 10:17:49 -05:00
anshulbehl 2a4f4dd526
redirecting the conjur lookup plugin to correct collection (#70106) (#70182)
(cherry picked from commit 33e25504ac)
2020-06-23 19:08:33 +01:00
Sandra McCann 82a3366701
adds japanese translation as a version-switcher option (#70214) (#70215)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
(cherry picked from commit 4a0f42923b)
2020-06-22 15:41:05 -05:00
Sam Doran 0b7e3694c7 [stable-2.10] Rebalance CI groups to avoid macOS timeouts (#70126)
(cherry picked from commit b2d6db7916)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-06-22 10:19:54 -07:00
Jordan Borean a45d4fe80d
Fix up the redirection of the win setup module (#70158) (#70181)
(cherry picked from commit 8b24a4c5ed)
2020-06-19 17:12:32 -07:00
Jill R aa8f73f7e7
Update note about AWS collection test requirements in docs (#70176) (#70179)
(cherry picked from commit 8ad46870a4)
2020-06-19 14:17:54 -05:00
Rick Elrod 8002b4d4fc Update Ansible release version to v2.10.0b1.post0. 2020-06-17 17:06:28 -05:00
Rick Elrod cbfe2e642f New release v2.10.0b1 2020-06-17 14:38:15 -05:00
Rick Elrod ed2de20bca bump porting guide link
Signed-off-by: Rick Elrod <rick@elrod.me>
2020-06-17 13:12:52 -05:00
1722 changed files with 32716 additions and 69512 deletions

View file

@ -0,0 +1,252 @@
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.2
test: rhel/8.2
- name: FreeBSD 11.1
test: freebsd/11.1
- name: FreeBSD 12.1
test: freebsd/12.1
groups:
- 1
- 2
- 3
- 4
- 5
- stage: Docker
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: linux/{0}
targets:
- name: CentOS 6
test: centos6
- name: CentOS 7
test: centos7
- name: CentOS 8
test: centos8
- name: Fedora 31
test: fedora31
- name: Fedora 32
test: fedora32
- name: openSUSE 15 py2
test: opensuse15py2
- name: openSUSE 15 py3
test: opensuse15
- name: Ubuntu 16.04
test: ubuntu1604
- name: Ubuntu 18.04
test: ubuntu1804
- name: Ubuntu 20.04
test: ubuntu2004
groups:
- 1
- 2
- 3
- 4
- 5
- stage: Fallaxy
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Python {0}
testFormat: fallaxy/{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.2
test: rhel/8.2
- name: FreeBSD 11.1
test: freebsd/11.1
- name: FreeBSD 12.1
test: freebsd/12.1
- 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 31
test: fedora31
- name: Fedora 32
test: fedora32
- name: openSUSE 15 py2
test: opensuse15py2
- name: openSUSE 15 py3
test: opensuse15
- name: Ubuntu 16.04
test: ubuntu1604
- 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
- Fallaxy
- 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(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)"

1403
.github/BOTMETA.yml vendored

File diff suppressed because it is too large Load diff

View file

@ -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

5
.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

View file

@ -2,9 +2,11 @@ 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
@ -32,5 +34,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,6 +5,7 @@
# 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
@ -268,6 +269,10 @@ epub:
webdocs:
(cd docs/docsite/; CPUS=$(CPUS) $(MAKE) docs)
.PHONY: coredocs
coredocs:
(cd docs/docsite/; CPUS=$(CPUS) $(MAKE) coredocs)
.PHONY: linkcheckdocs
linkcheckdocs:
(cd docs/docsite/; CPUS=$(CPUS) $(MAKE) linkcheckdocs)
@ -275,7 +280,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

@ -96,12 +96,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-base.svg
:target: https://pypi.org/project/ansible-base
.. |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=stable-2.10
:target: https://dev.azure.com/ansible/ansible/_build/latest?definitionId=20&branchName=stable-2.10
.. |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

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -6,6 +6,7 @@ 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,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,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,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

@ -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,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

@ -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

@ -0,0 +1,2 @@
bugfixes:
- 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)

View file

@ -0,0 +1,3 @@
bugfixes:
- paramiko connection plugin - Ensure we only reset the connection when one has been
previously established (https://github.com/ansible/ansible/issues/65812)

View file

@ -0,0 +1,2 @@
minor_changes:
- dnf - now shows specific package changes (installations/removals) under ``results`` in check_mode. (https://github.com/ansible/ansible/issues/66132)

View file

@ -0,0 +1,4 @@
security_fixes:
- >
**security issue** atomic_move - change default permissions when creating
temporary files so they are not world readable (https://github.com/ansible/ansible/issues/67794) (CVE-2020-1736)

View file

@ -0,0 +1,4 @@
bugfixes:
- >
Fix warning for default permission change when no mode is specified. Follow up
to https://github.com/ansible/ansible/issues/67794. (CVE-2020-1736)

View file

@ -0,0 +1,3 @@
bugfixes:
- Vault - Allow single vault encrypted values to be used directly as module
parameters. (https://github.com/ansible/ansible/issues/68275)

View file

@ -0,0 +1,2 @@
minor_changes:
- galaxy - add documentation about galaxy parameters in examples/ansible.cfg (https://github.com/ansible/ansible/issues/68402).

View file

@ -1,4 +1,3 @@
minor_changes:
- ansible-galaxy - Allow installing collections from git repositories.
- ansible-galaxy - Requirement entries for collections now support a 'type' key to indicate whether the collection is a galaxy artifact, file, url, or git repo.
- ansible-galaxy - Support both 'galaxy.yml' and 'galaxy.yaml' files for collections.

View file

@ -0,0 +1,2 @@
bugfixes:
- 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).

View file

@ -0,0 +1,2 @@
bugfixes:
- playbooks - detect and propagate failures in ``always`` blocks after ``rescue`` (https://github.com/ansible/ansible/issues/70000)

View file

@ -0,0 +1,4 @@
bugfixes:
- >-
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)

View file

@ -0,0 +1,5 @@
bugfixes:
- Strategy - Ensure we only process expected types from the results queue
and produce warnings for any object we receive from the queue that doesn't
match our expectations.
(https://github.com/ansible/ansible/issues/70023)

View file

@ -0,0 +1,2 @@
bugfixes:
- "ansible-doc - improve man page formatting to avoid problems when YAML anchors are used (https://github.com/ansible/ansible/pull/70045)."

View file

@ -0,0 +1,2 @@
bugfixes:
- "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)."

View file

@ -0,0 +1,2 @@
bugfixes:
- apt - include exception message from apt python library in error output

View file

@ -0,0 +1,2 @@
bugfixes:
- SSH plugin - Improve error message when ssh client is not found on the host

View file

@ -0,0 +1,2 @@
bugfixes:
- "Fix ``delegate_facts: true`` when ``ansible_python_interpreter`` is not set. (https://github.com/ansible/ansible/issues/70168)"

View file

@ -0,0 +1,2 @@
bugfixes:
- basic - use PollSelector implementation when DefaultSelector fails (https://github.com/ansible/ansible/issues/70238).

View file

@ -0,0 +1,2 @@
bugfixes:
- TaskExecutor - Handle unexpected errors as failed while post validating loops (https://github.com/ansible/ansible/issues/70050).

View file

@ -0,0 +1,2 @@
bugfixes:
- 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)

View file

@ -0,0 +1,2 @@
minor_changes:
- pipe lookup - update docs for Popen with shell=True usages (https://github.com/ansible/ansible/issues/70159).

View file

@ -0,0 +1,2 @@
bugfixes:
- "ansible-doc - collection name for plugin top-level deprecation was not inserted when deprecating by version (https://github.com/ansible/ansible/pull/70344)."

View file

@ -0,0 +1,2 @@
bugfixes:
- 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)

View file

@ -0,0 +1,4 @@
bugfixes:
- >
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)

View file

@ -0,0 +1,2 @@
bugfixes:
- assemble - fix decrypt argument in the module (https://github.com/ansible/ansible/issues/65450).

View file

@ -0,0 +1,3 @@
bugfixes:
- 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).

View file

@ -0,0 +1,2 @@
bugfixes:
- Fixes ansible-test traceback when plugin author is not a string or a list of strings (https://github.com/ansible/ansible/pull/70507)

View file

@ -0,0 +1,2 @@
bugfixes:
- ansible-galaxy collection download - fix downloading tar.gz files and collections in git repositories (https://github.com/ansible/ansible/issues/70429)

View file

@ -0,0 +1,7 @@
bugfixes:
- >
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)

View file

@ -0,0 +1,2 @@
bugfixes:
- "user - don't create home directory and missing parents when create_home == false (https://github.com/ansible/ansible/pull/70600)."

View file

@ -0,0 +1,2 @@
bugfixes:
- api - time.clock is removed in Python 3.8, add backward compatible code (https://github.com/ansible/ansible/issues/70649).

View file

@ -0,0 +1,2 @@
bugfixes:
- Template connection variables before using them (https://github.com/ansible/ansible/issues/70598).

View file

@ -0,0 +1,3 @@
---
bugfixes:
- Terminal plugins - add "\e[m" to the list of ANSI sequences stripped from device output

View file

@ -0,0 +1,3 @@
bugfixes:
- async - Fix Python 3 interpreter parsing from module by comparing with bytes
(https://github.com/ansible/ansible/issues/70690)

View file

@ -0,0 +1,3 @@
bugfixes:
- reboot - Add support for the runit init system, used on Void Linux, that
does not support the normal Linux syntax.

View file

@ -0,0 +1,2 @@
security_fixes:
- Sanitize no_log values from any response keys that might be returned from the uri module (CVE-2020-14330).

View file

@ -0,0 +1,3 @@
bugfixes:
- JSON Encoder - Ensure we treat single vault encrypted values as strings
(https://github.com/ansible/ansible/issues/70784)

View file

@ -0,0 +1,2 @@
bugfixes:
- Skip literal_eval for string filters results in native jinja. (https://github.com/ansible/ansible/issues/70831)

View file

@ -0,0 +1,2 @@
bugfixes:
- "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)"

View file

@ -0,0 +1,3 @@
bugfixes:
- "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 - ``version_added`` on module level was not validated for modules in collections (https://github.com/ansible/ansible/pull/70869)."

View file

@ -0,0 +1,2 @@
minor_changes:
- iptables - add a note about ipv6-icmp in protocol parameter (https://github.com/ansible/ansible/issues/70905).

View file

@ -0,0 +1,2 @@
bugfixes:
- Fix statistics reporting when rescue block contains another block (issue https://github.com/ansible/ansible/issues/61253).

View file

@ -0,0 +1,2 @@
bugfixes:
- templating - fix error message for ``x in y`` when y is undefined (https://github.com/ansible/ansible/issues/70984)

View file

@ -0,0 +1,2 @@
bugfixes:
- "fortimanager httpapi plugin - fix redirect to point to the ``fortinet.fortimanager`` collection (https://github.com/ansible/ansible/pull/71073)."

View file

@ -0,0 +1,2 @@
minor_changes:
- "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)."

View file

@ -0,0 +1,2 @@
bugfixes:
- Fixed Ansible reporting validate not supported by netconf server when enabled in netconf - (https://github.com/ansible-collections/ansible.netcommon/issues/119).

View file

@ -0,0 +1,3 @@
bugfixes:
- systemd - fixed chroot usage on new versions of systemd, that broke because of upstream changes in systemctl output
- systemd - made the systemd module work correctly when the SYSTEMD_OFFLINE environment variable is set

View file

@ -0,0 +1,2 @@
minor_changes:
- Updated network integration auth timeout to 90 secs.

View file

@ -0,0 +1,2 @@
bugfixes:
- "gluster modules - fix redirect to point to the ``gluster.gluster`` collection (https://github.com/ansible/ansible/pull/71240)."

View file

@ -0,0 +1,3 @@
bugfixes:
- strftime filter - Input epoch is allowed to be a float
(https://github.com/ansible/ansible/issues/71257)

View file

@ -0,0 +1,3 @@
minor_changes:
- setup.py - Skip doing conflict checks for ``sdist`` and ``egg_info`` commands
(https://github.com/ansible/ansible/pull/71310)

View file

@ -0,0 +1,2 @@
bugfixes:
- Fix an exit code for a non-failing playbook (https://github.com/ansible/ansible/issues/71306)

View file

@ -0,0 +1,4 @@
bugfixes:
- 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)

View file

@ -0,0 +1,2 @@
minor_changes:
- iptables - reorder comment postition to be at the end (https://github.com/ansible/ansible/issues/71444).

View file

@ -0,0 +1,4 @@
bugfixes:
- >
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)

View file

@ -0,0 +1,4 @@
bugfixes:
- >
systemd - account for templated unit files using ``@`` when searching for
the unit file (https://github.com/ansible/ansible/pull/72347#issuecomment-730626228)

View file

@ -0,0 +1,5 @@
bugfixes:
- >
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.

View file

@ -0,0 +1,2 @@
bugfixes:
- facts - fix distribution fact for SLES4SAP (https://github.com/ansible/ansible/pull/71559).

View file

@ -0,0 +1,3 @@
bugfixes:
- is_string/vault - Ensure the is_string helper properly identifies AnsibleVaultEncryptedUnicode
as a string (https://github.com/ansible/ansible/pull/71609)

View file

@ -0,0 +1,2 @@
bugfixes:
- Pass the connection's timeout to connection plugins instead of the task's timeout.

View file

@ -0,0 +1,2 @@
bugfixes:
- "ansible-doc - plugin option deprecations now also get ``collection_name`` added (https://github.com/ansible/ansible/pull/71735)."

View file

@ -0,0 +1,2 @@
bugfixes:
- "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)."

View file

@ -0,0 +1,2 @@
bugfixes:
- Fix ``RecursionError`` when templating large vars structures (https://github.com/ansible/ansible/issues/71920)

View file

@ -0,0 +1,2 @@
minor_changes:
- ansible-test - Raise the number of bytes scanned by ansible-test to determine if a file is binary to 4096.

View file

@ -0,0 +1,2 @@
bugfixes:
- "ansible-doc - properly show plugin name when ``name:`` is used instead of ``<plugin_type>:`` (https://github.com/ansible/ansible/pull/71966)."

View file

@ -0,0 +1,2 @@
bugfixes:
- "ansible-galaxy - fixed galaxy role init command (https://github.com/ansible/ansible/issues/71977)."

View file

@ -0,0 +1,4 @@
bugfixes:
- >
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)

View file

@ -0,0 +1,3 @@
bugfixes:
- 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)

View file

@ -0,0 +1,2 @@
bugfixes:
- dnf - fix filtering to avoid dependncy conflicts (https://github.com/ansible/ansible/issues/72316)

View file

@ -0,0 +1,2 @@
bugfixes:
- wait_for - catch and ignore errors when getting active connections with psutil (https://github.com/ansible/ansible/issues/72322)

View file

@ -0,0 +1,2 @@
bugfixes:
- basic.AnsibleModule - AnsibleModule.run_command silently ignores a non-existent directory in the ``cwd`` argument (https://github.com/ansible/ansible/pull/72390).

View file

@ -0,0 +1,2 @@
minor_changes:
- Switch to hashlib.sha256() for ansible-test to allow for FIPs mode.

Some files were not shown because too many files have changed in this diff Show more