Compare commits

...

2628 Commits

Author SHA1 Message Date
4976685a6a Remove scheduled CI runs
The ansible-core 2.13 release will be EOL next week with the release of ansible-core 2.16.
2023-11-01 17:50:47 -07:00
d9160f6005 [stable-2.13] ansible-test - Fix parsing of cgroup entries
(cherry picked from commit e933d9d8a6)

Co-authored-by: Matt Clay <matt@mystile.com>
2023-10-23 09:48:27 -07:00
9a3ca0b08c [stable-2.13] Fix subversion integration test (#82029)
- Remove dependency on the htpasswd module (and thus passlib)
- Fix setup/teardown of the httpd process
- Fix cleanup of temporary directories.
(cherry picked from commit 09d943445c)

Co-authored-by: Matt Clay <matt@mystile.com>
2023-10-23 09:47:22 -07:00
c8de45e553 ansible-test - Use Azure for Windows 2012/2012-R2 (#81973) 2023-10-13 16:26:43 -07:00
457baad4c4 Update Ansible release version to v2.13.13.post0. (#81938) 2023-10-09 17:51:11 +00:00
c2b0ea52e2 New release v2.13.13 (#81935) 2023-10-09 10:51:30 -05:00
1a9edcd1b6 win_fetch - improve test time by not scanning Win dir (#81884) (#81885)
(cherry picked from commit dfc62589f6)
2023-10-04 10:25:00 -07:00
5fc7e9c86f Update Ansible release version to v2.13.13rc1.post0. (#81877) 2023-10-03 22:16:25 +00:00
b8ebc3653d New release v2.13.13rc1 (#81860) 2023-10-03 17:34:36 -04:00
3f12097a41 Fix reporting role as not found when remote_data is None (#81829) (#81835)
(cherry picked from commit 7fab552563)
2023-10-02 15:22:25 -04:00
820dae4aff [stable-2.13] Prevent roles from using symlinks to overwrite files outside of the installation directory (#81780) (#81787)
* [stable-2.13] Prevent roles from using symlinks to overwrite files outside of the installation directory (#81780)

* Sanitize linkname during role installs

* Add tests

* add clog frag.
(cherry picked from commit ddf0311c63)

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

* Update syntax for py3.8
2023-09-27 08:43:58 -05:00
d3b531fc73 Update Ansible release version to v2.13.12.post0. (#81686) 2023-09-12 08:33:59 -05:00
a4bab0bae2 New release v2.13.12 (#81683) 2023-09-11 17:12:11 -05:00
644c1d0f8c Update Ansible release version to v2.13.12rc1.post0. (#81642) 2023-09-05 16:18:13 -05:00
551b672247 New release v2.13.12rc1 (#81637) 2023-09-05 14:59:51 -05:00
590e46c422 [stable-2.13] tarfile: Handle deprecation warning for extract and extractall (#81545) (#81634)
* [stable-2.13] tarfile: Handle deprecation warning for extract and extractall (#81545)

* Python 3.11.4 introduces a new parameter 'filter' in extract and
extractall in tarfile. Handle deprecation warning message emitted
in Python 3.12.
* added probing mechanism in ansible-galaxy code to detect broken
data filter implementation in tarfile.

Fixes: #80832

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit 1cc5efa)

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

* py3.8 doesn't have functools.cache

---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-05 12:44:59 -05:00
fca71e4357 [stable-2.13] ansible-test - Always use managed entry points (#81537). (#81541)
(cherry picked from commit 390e508d27)
2023-08-22 12:27:44 -07:00
a5400d5e92 [stable-2.13] Remove obsolete text from release.py PR template (#81526) (#81529)
(cherry picked from commit 9afaf2216b)
2023-08-16 11:19:27 -07:00
e302f5cdb8 [stable-2.13] Fix f-string whitespace in release script (#81477) (#81480)
(cherry picked from commit 85d3305889)
2023-08-14 13:35:40 -07:00
d05ddfe8bb [stable-2.13] Clean up release script (#81488) (#81491)
* Enable mypy for the entire packaging directory

* Return CompletedProcess only when capturing output

This allows stdout/stderr on CompletedProcess to be `str` instead of `str | None`.
The unused args on CompletedProcess have been removed.
Overload type hints have been added to reflect these changes.

* Relax return type on ensure_venv

This improves consistency with its usage, since `run` accepts `env` of `dict[str, t.Any]`.
Also removed unnecssary `str()` usage when updating `env`.

* Fix type hint on suppress_when

* Fix callable annotation

* Add type hint for command_parser

PyCharm complains about using a protected member, and also that it can't find the type in the type stubs.
However, mypy properly recognizes the type.

* Avoid unnecessary TypeVar usage.
(cherry picked from commit 47ab59753c)
2023-08-14 13:35:05 -07:00
5c7d361b6e [stable-2.13] Replace FreeBSD 12.{3->4} & 13.{0->1} @ testing (#81498)
* Replace FreeBSD 12.3 w/ 12.4 in CI & ansible-test

FreeBSD 12.3 bootstrap packages stopped being available.

* Replace FreeBSD 13.0 w/ 13.1 in CI & ansible-test
2023-08-14 13:34:33 -07:00
28fb37d6c2 [stable-2.13] ansible-test - Update source layout detection (#81418) (#81436)
(cherry picked from commit c525514994)
2023-08-03 20:43:12 -07:00
586392519b [stable-2.13] Overhaul package-data sanity test (#81427) (#81437)
The sanity test now only inspects the sdist and wheel instead of trying to install the sdist using setup.py..
(cherry picked from commit f894ce89b4)
2023-08-03 20:43:01 -07:00
6da138c61f Skip apt_repository test on Ubuntu 18.04 (#81441) 2023-08-03 19:44:13 -07:00
54a489c396 [stable-2.13] Update update-sanity-requirements.py script (#81424) (#81433)
Frozen requirements can now preserve any explicitly installed package that would normally be omitted, not just setuptools.
(cherry picked from commit dbb3feddaf)
2023-08-03 13:31:17 -07:00
31d948e1d8 [stable-2.13] Revert "define code owners to support branch-protection rules on docs (#81041)" (#81228) (#81430)
This reverts commit 9117762358.
(cherry picked from commit 7c6564ad0e)
2023-08-03 13:06:29 -07:00
c391cf01e4 [stable-2.13] Clean up MANIFEST.in (#81416)
* Clean up MANIFEST.in (#80688)

* Remove unnecessary MANIFEST.in commands

This eliminates more setuptools warnings during build.

* Sort MANIFEST.in

Now that only include commands are used, the order of the commands no longer effects the build output.

(cherry picked from commit 6e325d9e4d)

* Omit hacking directory from MANIFEST.in (#81245)

* Omit `hacking` directory from `MANIFEST.in`

* Update package-data sanity test

(cherry picked from commit b93a628aed)
2023-08-02 13:34:38 -07:00
1a22a1be8a [stable-2.13] Add changelog fragment for docs/examples removal (#81410) (#81413)
(cherry picked from commit 0c03a6bcf6)
2023-08-02 13:00:11 -07:00
3999c5bc45 Remove BOTMETA.yml and sanity tests for it (#81198) (#81265)
(cherry picked from commit 39ef570e16)
2023-08-02 12:44:54 -07:00
abab52a7b4 [stable-2.13] Docs removal and other backports (#81409)
* Remove straight.plugin dependency (#80084)

(cherry picked from commit f587856beb)

* Update package-data sanity test (#80344)

The test no longer relies on the Makefile.

(cherry picked from commit 46362bbd27)

* Remove obsolete release bits (#80347)

Releases are now built using the `packaging/release.py` tool.
This makes the `Makefile` and associated files in `packaging/release/` and `packaging/sdist/` obsolete.

(cherry picked from commit 6a66761e0e)

* Use --no-isolation for package-data sanity test (#80377)

The dependencies are already in the sanity test venv. This avoids use of unpinned dependencies and a dependency on a network connection.

(cherry picked from commit 7fcb9960e6)

* Set the minimum setuptools to 45.2.0 (#80649)

Also update the package-data sanity test to use the minimum setuptools version.

(cherry picked from commit 4d25e3d54f)

* Use package_data instead of include_package_data (#80652)

This resolves warnings generated by setuptools such as the following:

_Warning: Package 'ansible.galaxy.data' is absent from the `packages` configuration.

(cherry picked from commit 5ac292e12d)

* Fix os.walk issues in package-data sanity test (#80703)

(cherry picked from commit eea7137449)

* Remove `docs` and `examples` directories (#81011)

* Remove docs dir

* Updates to reflect docs removal

* Fix integration test

* Remove examples dir

* Updates to reflect examples removal

* Remove build_library and build-ansible.py

* Remove refs to build_library and build-ansible.py

* Remove obsolete template

* Remove obsolete template reference

* Remove the now obsolete rstcheck sanity test

(cherry picked from commit 72e038e823)

* Omit pre-built man pages from sdist (#81395)

Since man pages aren't accessible to users after a `pip install`, there's no need to include them in the sdist.
This change makes it trivial to build man pages from source, which makes them much easier to iterate on.
It also simplifies creation and testing of the sdist, since it no longer requires building man pages.

The new `packaging/cli-doc/build.py` script can generate both man pages and RST documentation.
This supports inclusion on the docs site without a dependency on `ansible-core` internals.
Having a single implementation for both simplifies keeping the two formats in sync.

(cherry picked from commit 691c8e8603)
2023-08-02 12:26:38 -07:00
3e08ed79b0 Fix backport of #81379 (#81387)
Two copies of the file existed in this branch, but only one was updated previously.
2023-07-31 18:03:53 -07:00
1a71911041 [stable-2.13] Include subcommands in generated man pages (#81378) (#81384)
Sub commands of `ansible-galaxy role` and `ansible-galaxy collection` are now documented.
(cherry picked from commit 081c60b9d3)
2023-07-31 15:48:35 -07:00
dea32ac962 [stable-2.13] Fix misrendered sections in manpage generation (#81381)
This change fixes bugs in the manpage generator that existed since it
was first added.

It exposes CLI `ARGUMENTS` value to manpage templates.

Before this change, the code contained a typo, causing the `for`-loop
iterate over individual characters of the `'ARGUMENTS'` string rather
than iterating over a tuple. A missing comma was at fault.

The updated code gets rid of the `for`-loop and conditionals since it
seems to have been a premature complexity increase and no other things
than `'ARGUMENTS'` were ever added into the broken iterable.

The functional change is that `arguments` is now always present in the
Jinja2 context, unlike being missing sometimes because of the previous
design (not that it was ever present, because of the bug! sigh...)

The Jinja2 templates perform an `{% if arguments %}` check, letting
the template engine silently ignore the missing variable. The clause
was always falsy, meaning that the arguments section was not included
in the manpages for at least the last 6 years. With this fix, it will
be.

This patch also deduplicates calling `opt_doc_list` @ generate_man.

It was called late in the execution, more times than necessary. This
patch makes sure it happens once by putting it at the top of the scope.

It fixes rendering library and inventory in manpages.

The corresponding Jinja2 templates have blocks wrapped with
conditionals like `{% if inventory %}` and `{% if library %}` but said
variables were never injected into the context, nor were they even
deduced on the Python side of the generator. This means that the
conditional clauses were always falsy, never showing the portions of
the manpages.

The Python script has hints for how the `inventory` variable was to be
calculated, which is confirmed through the Git paleontology efforts.

The block of code that references to the `inventory` bit was
incorrectly checking a variable with a list of nested objects for the
presence of a string which was never going to work.

This patch fixes this check by verifying the CLI flag against the
correct variable containing a list of options and exposes it to the
Jinja2 templates.
It also exposes the `library` variable in a similar way.

The block displaying other binaries in Sphinx CLI docs has been
synchronized with the manpage template.
Previously, the current binary was displayed also. This patch gets rid
of the unwanted trailing comma there too.

Finally, the CLI executables list in the manpage template now reuses
the same variable as the RST template that doesn't need any
post-processing in Jinja2.
Before, it was already used in the RST template so this patch aligns
both templates to use the same logic as they got out-of-sync over time.

PR #80450.
(cherry picked from commit a84b3a4e72)

Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
2023-07-31 14:04:31 -07:00
c3dd88e770 [stable-2.13] Fix missing command descriptions in manpages/docs (#81366). (#81372)
(cherry picked from commit 32b388b4ca)
2023-07-28 19:26:20 -07:00
e58f1b47b7 [stable-2.13] Fix command doc lookup in man page generation (#81365) (#81367)
(cherry picked from commit f9d674fcfd)
2023-07-28 18:08:14 -07:00
94281e77f0 [stable-2.13] Exclude internal options from man pages and docs (#81360) (#81363)
(cherry picked from commit fead654671)
2023-07-28 15:26:15 -07:00
66f04c276a [stable-2.13] ansible-test - update module_utils/urls.py unit test to support cryptography >= 41.0.0 (#81296) (#81318)
(cherry picked from commit d20a0c02cc)

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2023-07-20 12:26:43 -07:00
b203e0a285 [stable-2.13] Convert non-docs *.rst files to *.md (#81217) (#81224)
* [stable-2.13] Convert non-docs *.rst files to *.md (#81217)

* Rename README.rst to README.md

* Change README format from reStructuredText to Markdown

* Fix whitespace in README.md

* Update setup.cfg to use README.md

* Replace changelog placeholder with README.md

* Update package-data sanity test
(cherry picked from commit 38e50c9f81)

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

* Remove README.rst from MANIFEST.in
2023-07-18 20:14:59 -07:00
bbf1aacf16 [stable-2.13] Add missing skip entries for selinux module_util (#81305) (#81309)
(cherry picked from commit 18cbfc688b)
2023-07-18 20:14:40 -07:00
191cdf5ae5 [stable-2.13] ansible-test - Pre-build PyYAML wheels (#81300) (#81311)
* [stable-2.13] ansible-test - Pre-build PyYAML wheels (#81300)

This works around Cython failures when attempting to install PyYAML >= 5.4 <= 6.0..
(cherry picked from commit e964078a83)

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

* Skip PEP 517 tests on FreeBSD
2023-07-18 20:14:29 -07:00
3ad838b86c [stable-2.13] Disable cron integration test on Alpine (#81301) (#81304)
The tests are now failing due to the lack of `libfaketime` in the Alpine repos.
(cherry picked from commit 261a12b8a9)
2023-07-18 18:12:24 -07:00
0951694932 Update Ansible release version to v2.13.11.post0. (#81288) 2023-07-17 20:26:53 -07:00
a1bad8755a New release v2.13.11 (#81285) 2023-07-17 19:07:25 -07:00
d03bf6430c Replace reboot_command integration test with unit tests (#78956) (#81268)
Co-authored-by: Matt Clay <matt@mystile.com>

(cherry picked from commit b6ebb9d41a)
2023-07-14 14:27:51 -07:00
c8b5d96ee0 [stable-2.13] Use *.md instead of *.rst for test READMEs (#81009). (#81231)
(cherry picked from commit 6ac0ea3567)
2023-07-12 00:17:29 +00:00
4589e30b02 [stable-2.13] Reorganize CI sanity test matrix (#81004) (#81227)
(cherry picked from commit ff359fa8e1)
2023-07-11 23:32:41 +00:00
3bce7bc1c5 Update Ansible release version to v2.13.11rc1.post0. (#81211) 2023-07-10 19:45:41 +00:00
dc54ab1ad9 New release v2.13.11rc1 (#81206) 2023-07-10 21:03:39 +02:00
58ae119ccf Re-introduce RHEL 9 modularity testing in CI (#81160) (#81194)
(cherry picked from commit 7b2647f3b2)
2023-07-10 11:17:28 -07:00
b2114ef794 [stable-2.13] define code owners to support branch-protection rules on docs (#81041) (#81045)
* during interim docs/ (and related dirs) split to separate repo, prevent merges that might require a rebase of the target repo
(cherry picked from commit 9117762358)
2023-06-12 11:41:39 -07:00
c745853d4c Bump azure-pipelines-test-container to v4.0.1 @ CI (#80939)
This patch updates the test container used in CI to the new v4 that
defaults to using Python 3.10 and is based on Ubuntu 22.04 Jammy[[1]].

[1]: https://github.com/ansible/azure-pipelines-test-container/pull/17
2023-06-12 09:26:35 -07:00
ffee15678d [stable-2.13] Remove hacking dir dependency from build backend (#81027)
* Copy man generation files into build backend

* Use copied files in build backend
2023-06-09 21:02:33 -07:00
be6a990a89 [stable-2.13] Remove docs dir dependency from man page build (#81003) (#81024)
* [stable-2.13] Remove docs dir dependency from man page build (#81003)
(cherry picked from commit b3f1290bcd)

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

* Update path in Makefile
2023-06-09 20:29:41 -07:00
2765ab6f28 Remove straight.plugin dependency (#80084) (#81020)
(cherry picked from commit f587856)
2023-06-09 17:03:11 -07:00
bf09febd98 [stable-2.13] ansible-test - local change detection without --fork-point (#79734) (#80901)
(cherry picked from commit a5bb4c7dee)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-05-26 15:57:01 -07:00
c55729d3cd update version switcher for 2.15 (#80792)
Co-authored-by: Sandra McCann <samccann@redhat.com>
2023-05-22 13:10:47 -05:00
2babffb5c5 [stable-2.13] ansible-test - Fix traceback when mixing sources (#80801) (#80830)
* ansible-test - Fix traceback when mixing sources

* ansible-test - Refactor layout error handling.

(cherry picked from commit b16041f1a9)
2023-05-22 10:26:10 -07:00
44605cae72 Update Ansible release version to v2.13.10.post0. (#80864) 2023-05-22 10:25:06 -07:00
d4f0771c9b New release v2.13.10 (#80859) 2023-05-22 10:20:09 -05:00
4d01ecb865 Update Ansible release version to v2.13.10rc1.post0. (#80802) 2023-05-15 15:49:07 -05:00
e69ca3420c New release v2.13.10rc1 (#80797) 2023-05-15 12:34:18 -05:00
1141376de5 [stable-2.13] ansible-test - Fix handling of long timeouts (#80769) (#80774)
(cherry picked from commit aacab0633a)
2023-05-10 20:04:41 -07:00
9ce8eb56be [stable-2.13] ansible-test - Fix timeout handling (#80764). (#80767)
(cherry picked from commit 4c6aa70662)
2023-05-10 20:03:35 -07:00
8f07fda2b5 [stable-2.13] ansible-test - Avoid use of deprecated utcnow (#80750) (#80759)
The timestamps are only used by ansible-test, not the junit callback, so this change only impacts ansible-test.

(cherry picked from commit fd341265d0)
2023-05-10 17:07:26 -07:00
ab220107d5 ansible-test - Relax pylint config for backports (#80770) 2023-05-10 17:05:26 -07:00
339d42332c [stable-2.13] pep517 backend - Copy symlinks when copying source (#80690) (#80702)
(cherry picked from commit 54576cd794)
2023-05-09 14:26:50 -05:00
7aefdb493b [ansible-galaxy] Fix installing signed collections (#80661) (#80667)
* Fix installing signed collections by using the fqcn, version, source, and type as a unique identifier.

Define __hash__ and __eq__ methods to handle Candidate/Requirement comparison excluding signatures which aren't fully populated until install time.

* Remove PinnedCandidateRequests since it is redundant now.

* Fix verifying against a signed remote when the keyring isn't configured

(cherry picked from commit d5e2e7a0a8)
2023-05-09 14:26:39 -05:00
8bf75b6686 [stable-2.13] Release tool improvements (#80641) (#80681)
* Provide reproducible sdist builds.
* Use reproducible wheel builds.
* Add PyPI artifact checks.

(cherry picked from commit d37678c5ff)
2023-05-01 09:41:14 -07:00
4aa5de7a8b Disable failing incidental_inventory_docker_swarm (#80659)
Also remove remote incidental tests from the test matrix, as this was the last one.
2023-05-01 09:05:37 -07:00
8fb7c10498 [stable-2.13] ansible-test - Use FreeBSD packaged setuptools (#80615) (#80618)
This will avoid issues during bootstrapping caused by breaking changes in setuptools.

(cherry picked from commit abc58c026b)
2023-04-24 13:44:30 -07:00
80c7cff394 Update Ansible release version to v2.13.9.post0. (#80613) 2023-04-24 12:42:02 -05:00
1e80e4319f New release v2.13.9 (#80610) 2023-04-24 10:52:31 -05:00
67a0cf505f Update Ansible release version to v2.13.9rc1.post0. (#80538) 2023-04-17 15:52:50 -05:00
2449b9a09e New release v2.13.9rc1 (#80535) 2023-04-17 14:13:40 -05:00
ae02b5353d password lookup, handle ident properly when saved (#80251) (#80312)
* password lookup, handle ident properly when saved (#80251)

* password lookup, handle ident properly when saved

  Currently we format and save ident when present but we didn't account for this when reading the saved file
  Also added some more robust error handling.

(cherry picked from commit 0fd88717c9)

* fix try indent

* clog

* fix bad merge indentation
2023-04-17 12:26:07 -05:00
261e5b74cc Ansible.Basic - Improve temporary file cleanup process (#80293) (#80325)
* Ansible.Basic - Improve temporary file cleanup process

* Add comment on struct value used

(cherry picked from commit ba4505f5cb)
2023-04-14 14:49:13 -07:00
e267230a6b Improve Ansible.Basic.cs tempdir uniqueness (#80328) (#80330)
* Improve Ansible.Basic.cs tempdir uniqueness

The current tempdir naming scheme can result in the same name if the
remote worker starts at the same time as another. By using the process
id it should add enough uniqueness to avoid this situation.

* Fix sanity issues

* Fix up compile issue on older hosts

(cherry picked from commit fb6b90fe42)
2023-04-14 13:07:45 -07:00
25e77b7c98 Fetch signatures from galaxy after the dependency resolver runs (#80334) (#80399)
Reduce the number of Galaxy API calls made during dependency resolution by fetching remote signatures afterwards, since these are not used in backtracking.

Reduce the verbosity to `-vvvv` (to match other Galaxy API calls) to see this activity.

Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
(cherry picked from commit 460abe0cef)
2023-04-14 13:07:11 -07:00
dab3640527 [stable-2.13] ansible-galaxy collection install retry improvements (#80180) (#80275)
* clog frag

* Fix retries so that each explicit call to _call_galaxy is retried for the correct number of attempts. Fixes #80174

* Extend retry logic to common URL related connection errors. Fixes #80170

* Extend retries to downloading artifacts

* Extend param docs for change

* Rework the exception handling

* Don't be overly broad, reduce to TimeoutError, and BadStatusLine for now

* _download_file needs to raise AnsibleError.orig_exc

* Remove unused import

* Add IncompleteRead

* Add socket.timeout for py39

* Add 502 to retry codes

* Move http error code checking first

* Use itertools.tee to replay the backoff_iterator instead of using a callable

* Actually set a CLI default of 60s for timeout, to prevent implicit galaxy from using 10s as default from Request.open

* Import typing

* fix type hints

* Use http.HTTPStatus instead of int HTTP error codes where feasible

* Split exception handling



* Add missing import

---------

.
(cherry picked from commit 2ae013667e)
2023-04-12 15:13:45 -05:00
2e50a9e482 [stable-2.13] pep517 backend - Use correct import_module import (#80480) (#80503)
(cherry picked from commit e87802cf2c)
2023-04-12 10:25:58 -07:00
af1cbc9bb6 [stable-2.13] ansible-test - Add support for argcomplete 3 (#80482) (#80486)
(cherry picked from commit 0371ea08d6)
2023-04-11 13:31:52 -07:00
ef0924883b [stable-2.13] ansible-test - Fix packaging change classification (#80360). (#80362)
(cherry picked from commit 5d64024f1a)
2023-03-29 19:25:12 -07:00
18d6ae1e1f Fix entry_points integration test for PEP 517 (#80357)
This patch pre-builds the sdist via build using the self-eliminating
in-tree build backend and then, feeds the result to a pottentially
outdated pip (below v20) so that it uses the setuptools' native
PEP 517 build backend to build a wheel on install.
2023-03-29 15:58:14 -07:00
77d221c0ac [backport-2.13] 📦 Integrate manpage builds into PEP 517 build backend (#80130)
This change includes backports of the PRs #79606, #80098, #80253, #80255 and #80262, with a number of backward compatibility changes that make it work and be testable in older CI environments.

This patch creates a thin wrapper around the `setuptools`' PEP 517 build backend in-tree. It features an ability to request generating the manpage files in-memory, in the process of building a source distribution. The build is happening in an isolated temporary directory. This toggle is implemented using the `config_settings` mechanism of PEP 517.
One must explicitly pass it a CLI option to the build front-end to trigger said behavior. The packagers are expected to use the following call:

    python -m build --config-setting=--build-manpages

This option has no effect on building wheels.

🧪 The change includes integration tests

This test runs building and re-building sdists and wheels with and without the `--build-manpages` config setting under the oldest-supported and new `setuptools` pinned.

It is intended to preserve the interoperability of the packaging setup across Python runtimes.

An extra smoke test also verifies that non PEP 517 interfaces remain functional.

📦 The sdist build-system is switched to pure setuptools upon the first build from Git checkout

This patch modifies the in-tree build backend to build sdists that swap
out pointers to it in the `pyproject.toml`'s `[build-system]` section.

The effect of this is that the first build from source (for example,
from a Git checkout) uses our PEP 517 in-tree build backend. But the
produced tarball has `build-backend` set to `setuptools.build_meta`
which is the native build backend of `setuptools`. So any following
builds from that sdist will skip using the in-tree build backend,
calling the setuptools' one.
The good news is that if the first build generated the manpages, they
will be included and won't go anywhere even though, a different build
system is in place.

Combined with #80253, this makes sure not to modify the current
source checkout on that first build.

Co-Authored-By: Matt Clay <matt@mystile.com>
Co-Authored-By: Matt Davis <6775756+nitzmahone@users.noreply.github.com>

(cherry picked from commit 56036013cd)
(cherry picked from commit 67bafafbc0)
(cherry picked from commit 888abf5d6e)
(cherry picked from commit 7097df3eed)
(cherry picked from commit eebfd71a6d)
2023-03-28 17:14:07 -07:00
e9603d233c [2.13] ansible-doc: fix broken seealso links in text output (#80286)
* ansible-doc: fix broken seealso links in text output (#80280)

* Fix broken URLs.

* Also remove auto-generated description for modules outside ansible.builtin.

(cherry picked from commit fafb23094e)

* Fix URL processing. (#80295)

(cherry picked from commit 086ae42209)
2023-03-28 11:06:58 -07:00
c6e717cdf0 [stable-2.13] New upstream release tool (#80179) (#80322)
(cherry picked from commit a6bfa82bd0)
2023-03-27 13:38:24 -07:00
ff3f06a8c4 [stable-2.13] Use variable instead of container resource in AZP (#80299) (#80317)
(cherry picked from commit 93d0253292)
2023-03-27 12:42:24 -07:00
6e6b6f1a55 [stable-2.13] Fix url lookup test to use test container (#80284) (#80288)
(cherry picked from commit 054aa92158)
2023-03-23 14:26:37 -07:00
a35e8015e5 [stable-2.13] ansible-test - Update git diff handling (#80202)
This change allows ansible-test to work with newer versions of git on AZP.

(cherry picked from commit bad8843124)

Co-authored-by: Matt Clay <matt@mystile.com>
2023-03-15 13:08:23 -07:00
8cc8aa268d [stable-2.13] Relocate the AZP entry point scripts (#80114)
Scripts previously under `test/utils/shippable/` are now under `.azure-pipelines/commands/` instead..
(cherry picked from commit f47bc03599)

Co-authored-by: Matt Clay <matt@mystile.com>
2023-03-14 17:50:24 -07:00
130fbe8ba5 [stable-2.13] ansible-test - Remove pointless comparison (#80168)
(cherry picked from commit 31658031ed)

Co-authored-by: Matt Clay <matt@mystile.com>
2023-03-14 17:50:13 -07:00
a5d7c73cc9 [stable-2.13] ansible-test - Fix vendoring support (#80074)
- Support loading of vendored Python packages.
- Exclude vendored Python packages from payloads.
(cherry picked from commit 6bfe6b899a)

Co-authored-by: Matt Clay <matt@mystile.com>
2023-03-14 17:50:02 -07:00
ef5842798d [stable-2.13] ansible-test - Show Python version before install (#80022)
Always indicate the Python version being used before installing requirements.
(cherry picked from commit 5e3db6e441)

Co-authored-by: Matt Clay <matt@mystile.com>
2023-03-14 17:49:52 -07:00
866d91bb7d [stable-2.13] ansible-test - Allow target prefixes to use _ (#80021)
Integration test target prefixes defined in a `tests/integration/target-prefixes.{group}` file can now contain an underscore (`_`) character.
(cherry picked from commit e6cffce0eb)

Co-authored-by: Matt Clay <matt@mystile.com>
2023-03-14 17:49:41 -07:00
8e2148943b [stable-2.13] ansible-test - Fix file permissions for delegation (#80204)
* [stable-2.13] ansible-test - Fix file permissions for delegation (#79932)

* ansible-test - Fix file permissions for delegation

* Set more restrictive permissions for SSH key

* Check all execute bits, not just owner

* Add a breaking_changes changelog entry.
(cherry picked from commit c8c1402ff6)

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

* ansible-test - Fix collection delegation (#79947)

(cherry picked from commit 0793833847)

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-14 15:56:21 -07:00
15e9438b06 [stable-2.13] ansible-test - Fix pylint error with old home dir (#80151) (#80153)
* [stable-2.13] ansible-test - Fix pylint error with old home dir (#80151)
(cherry picked from commit 27287b40c0)

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

* ansible-test - Fix error with missing pylint home (#80155)

(cherry picked from commit 367d45facd)
2023-03-07 09:00:52 -08:00
74ea1b8f85 [stable-2.13] Fix MANIFEST.in includes (#80147) (#80149)
(cherry picked from commit 7c62cdeecd)
2023-03-06 15:59:05 -08:00
6cffa10de0 [stable-2.13] Do not use hardcoded httpbin.org in uri tests (#80101) (#80103)
(cherry picked from commit 060a27f)
2023-02-28 14:58:53 -06:00
ff17c23359 Update Ansible release version to v2.13.8.post0. (#80099) 2023-02-27 19:21:40 -05:00
009089d4c5 New release v2.13.8 (#80082) 2023-02-27 10:00:06 -05:00
65376df2bd Update Ansible release version to v2.13.8rc1.post0. (#80042) 2023-02-20 11:16:39 -05:00
4deb8bc4c5 New release v2.13.8rc1 (#80028) 2023-02-20 09:59:34 -05:00
d5fd83265d [2.13] don't ignore templated _raw_params that k=v parser failed to parse (#79913) (#79965)
* don't ignore templated _raw_params that k=v parser failed to parse (#79913)

fixes #79862

* backport test changes
2023-02-15 13:34:54 -06:00
344230fca5 [stable-2.13] ansible-test - Support Podman 4.4.0+
(cherry picked from commit 67d49734f7)

Co-authored-by: Matt Clay <matt@mystile.com>
2023-02-14 13:20:13 -08:00
695d3c7927 Bump acme test container. (#79783) (#79815)
(cherry picked from commit 5fb8bc3ddb)
2023-02-10 14:58:14 -08:00
696b7936a9 [stable-2.13] ansible-test - Specify config path in plugin error (#79881) (#79978)
(cherry picked from commit d48d1c23df)
2023-02-10 14:56:54 -08:00
522019c317 [stable-2.13] ansible-test - fix warning to include image name (#79560) (#79974)
(cherry picked from commit 0a12d8a5bc)

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2023-02-10 14:55:36 -08:00
63429138d9 [stable-2.13] Ansible.Basic.cs - Fix compile error on PS 7.3.x (#79848) (#79851)
(cherry picked from commit 83fe75db07)
2023-02-02 16:24:13 -08:00
df0e58f20b [stable-2.13] Remove outdated note on relative imports in docs (#79873) (#79876)
(cherry picked from commit 58461bc204)
2023-02-02 16:08:48 -08:00
e12ff0a734 Document callback types in documentation (#79651) (#79654)
(cherry picked from commit 51bddd862b)
2023-01-18 15:32:56 -06:00
2e541a5450 ansible-test - fix ps argspec check inside cmdlet (#79699)
* ansible-test - fix ps argspec check inside cmdlet

* Added error condition test

* Fix sanity problem

(cherry picked from commit ee33be9484)
2023-01-11 10:13:27 -08:00
7e7908a3e1 Remove redundant RHEL extras setup. 2023-01-04 17:52:59 -08:00
a76adbccca [stable-2.13] Fix EPEL setup for integration tests on RHEL 7
(cherry picked from commit 1243d2ace0)

Co-authored-by: Matt Clay <matt@mystile.com>
2023-01-04 17:52:59 -08:00
9e3363f8b7 [stable-2.13] ansible-test - Improve container startup handling.
Also improve the ansible-test-container integration test:

 - Add coverage for the no-probe code path.
 - Add work-arounds for centos6 containers (to support backporting).
 - Avoid systemd debug when the container doesn't use cgroup.
(cherry picked from commit 04fc98c794)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-12-15 20:35:33 -08:00
e6ac16674c [stable-2.13] Add more retries to ansible-test-container test.
(cherry picked from commit f6c0e22f98)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-12-14 15:56:08 -08:00
55a198da11 [stable-2.13] ansible-test - Support RSA SHA-1 for SSH clients..
(cherry picked from commit 75b60b17ee)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-12-14 12:43:29 -08:00
862047cafd Ansible 6 is EOL (#79555) 2022-12-13 16:47:27 -06:00
ad59db8256 [stable-2.13] ansible-test - Fix --prime-containers and --explain (#79581)
* Remove unused code.
* Fix explain errors.
* Fix `--prime-containers` with docker on cgroup v2.
(cherry picked from commit da3b1d3f50)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-12-12 13:59:29 -08:00
7783c9b1ee [stable-2.13] ansible-test - Fix target PyPI proxy config..
(cherry picked from commit dcc08eec35)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-12-12 12:17:10 -08:00
000f3244a4 [stable-2.13] Improve split integration test. (#78738)
* Omit redundant fact gathering.

* Add connection type to split test.

* Add user info to split integration test.
(cherry picked from commit 2e5e802)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-12-12 09:50:06 -08:00
1d7436935f [stable-2.13] ansible-test - Improve container management. (#79538)
* ansible-test - More flexible become support.

(cherry picked from commit 5666c6d6a3)

* ansible-test - Add support for more remotes.

(cherry picked from commit 24d91f552c)

* ansible-test - Enable ACLs on FreeBSD remotes.

This allows integration tests to switch from one unprivileged user
to another, sharing files between the users using ACLs.

(cherry picked from commit b63812bc08)

* ansible-test - Enable ACL support on more remotes. (#78299)

(cherry picked from commit 8bb20fe06b)

* ansible-test - Install `acl` on Alpine remotes. (#78303)

(cherry picked from commit 8565deaae3)

* ansible-test - Use sudo for all remotes. (#78310)

(cherry picked from commit f3f4ad9332)

* ansible-test - Fix Ubuntu 20.04 bootstrapping. (#78551)

(cherry picked from commit d683c5bd21)

* ansible-test - Verify executables are executable. (#78606)

(cherry picked from commit ece85abbc4)

* ansible-test - Use --tmpfs to run containers. (#78605)

(cherry picked from commit 4187707f03)

* ansible-test - Remove Fedora 35 support. (#78720)

(cherry picked from commit 38a82a5cc4)

* ansible-test - Fix container error handling. (#78739)

(cherry picked from commit 79f67ed561)

* ansible-test - Improve container management. (#78550)

See changelogs/fragments/ansible-test-container-management.yml for details.

(cherry picked from commit cda16cc5e9)

* ansible-test - Fix container detection. (#79530)

(cherry picked from commit 80d2f8da02)

* Update test matrix symlinks. (#78737)

* Add remote platform symlinks.

These were already supported by ansible-test.
This change adds the symlinks for use in the CI test matrix.

* Remove obsolete AIX test symlink.

AIX was already removed from ansible-test.

(cherry picked from commit 62221a3be2)

* Use patched containers without VOLUME instruction.

* Make test suite compatible with older ansible.

* Fix compatibility with Python 3.8.
2022-12-06 14:29:45 -08:00
0dfd6c868e [stable-2.13] Fix file touch check mode result (backport of #79422) (#79526)
* Fix file touch check mode result (#79360) (#79422)

Fixes #79360

(cherry picked from commit 3936b5c471)

* Rename changelog fragment according to PR number
2022-12-06 14:27:17 -08:00
03233e676a [backport][2.13][PRs #78402 #79289] Enable the reboot integration test in CI (#79491)
* Enable the `reboot` integration test in CI

Co-Authored-By: Matt Clay <matt@mystile.com>
(cherry picked from commit bb7ad0f0d8)

* [CI] Move running `reboot` integration test to group 2

PR #79289, follow-up for #78402.

It was breaking the integration-aliases sanity test, but only
became apparent post-merge. This patch fixes that.

(cherry picked from commit 26a4775611)

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2022-12-06 14:26:46 -08:00
5a2e551999 Set explicit meta long_description_content_type (#79468) (#79487)
This is necessary for `twine check --strict` to pass.

(cherry picked from commit 80551633c7)
2022-12-06 14:26:25 -08:00
84695c9158 [stable-2.13] Don't use color in jinja_plugins test.
This should prevent color codes from interfering with string matches.
(cherry picked from commit 31f9d60b8d)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-12-05 12:03:42 -08:00
f039a1d229 Update Ansible release version to v2.13.7.post0. (#79529) 2022-12-05 19:00:52 +01:00
fbefd45600 New release v2.13.7 (#79528) 2022-12-05 17:40:35 +01:00
c91c4d6fa5 Update Ansible release version to v2.13.7rc1.post0. (#79494) 2022-11-28 16:32:17 -05:00
8faeed30f9 New release v2.13.7rc1 (#79477) 2022-11-28 15:56:49 +01:00
ea9b9716f0 [stable-2.13] ansible-test - Improve pylint command consistency. (#78896)
* ansible-test - Improve pylint command consistency.

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
(cherry picked from commit bc274f5)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-11-22 18:56:05 -08:00
5f6537b644 file lookup now works with general lookup error framework (#79339) (#79388)
* file lookup now works with general lookup error framework

(cherry picked from commit 3448fcabc5)

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2022-11-16 12:36:36 -06:00
fd63b2f306 Fix typo 'Ansbile'. (#79318) (#79331)
(cherry picked from commit 2a03c8028e)
2022-11-10 15:48:36 -08:00
63c8719a76 Add Ansible community 6.6.0 porting guide (#79340) (#79349)
(cherry picked from commit d5e90e1737)

Co-authored-by: Christian Adams <chadams@redhat.com>
2022-11-08 16:39:15 -08:00
fd9dd09377 Japanese version switcher (#79276) (#79345)
* update japanese version switcher for 2.14

* update latest version

(cherry picked from commit 196084773b)
2022-11-08 16:37:56 -08:00
b80680559a update version switcher to include 2.14 (#79273) (#79326)
(cherry picked from commit d0b6ce7473)
2022-11-07 09:16:20 -08:00
90f389c11b Update Ansible release version to v2.13.6.post0. (#79323) 2022-11-07 10:30:26 -05:00
b14bbf1c11 New release v2.13.6 (#79315) 2022-11-07 09:22:29 -05:00
99ff446a3b [2.13] Log runme.sh execution in integration tests (#79283)
* Log `runme.sh` execution in integration tests (#79263)

* Log `runme.sh` execution in integration tests

This patch adds `set -x` where it's missing in the integration tests.
It also enables `pipefail` in `runme.sh` scripts that use pipes.

* Add a change note for PR #79263

(cherry picked from commit 6674c43edd)

* Delete a bad PR #79263 change note

(cherry picked from commit 9cfb3f73e8)
2022-11-03 20:39:29 -07:00
53f2ef7774 [stable-2.13] ansible-test - Fix and update documentation links..
(cherry picked from commit 938c0fa944)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-11-03 20:38:06 -07:00
33852737fd Update Ansible release version to v2.13.6rc1.post0. (#79261) 2022-10-31 16:16:37 +01:00
485a9e9c9d New release v2.13.6rc1 (#79258) 2022-10-31 14:32:58 +01:00
cb6e106d7d File lookup handle missing file more gracefully (#79230) (#79245)
previously it would have a 2nd tb due to bad error raising
 also remove superfluous warning

(cherry picked from commit aaab0791d9)
2022-10-28 16:18:24 -07:00
25f8b9829d mention acl in permissions errors (#79209) (#79251)
as chmod/mode is not the only thing we attempt and Ubuntu not shipping acl
  in newer versions can lead to some confusion

  fixes #79146

(cherry picked from commit 0f18ddca9f)
2022-10-28 16:17:13 -07:00
5c8928fa44 stable docs build: do not use YAML parsing/serialization for .deps files (#79233) (#79237)
* Do not use YAML parsing/serialization for .deps files.

* Prevent crash.

(cherry picked from commit 9545f2e0de)
2022-10-27 13:07:27 -05:00
b6a24d0031 Communication docs: note that editing Matrix messages causes IRC spam (#79238) (#79241)
(cherry picked from commit bc83da9a1b)
2022-10-27 13:07:13 -05:00
e0d20bc478 [stable-2.13] Don't assume column index for netmask and broadcast (#79121) (#79133)
* Don't assume column index for netmask and broadcast. Fixes #79117

* fix typo
(cherry picked from commit f53dbf9)

Co-authored-by: Matt Martz <matt@sivel.net>
2022-10-26 16:07:29 -05:00
1a583e3c0d [stable-2.13] Use python re to parse service output instead of grep (#79015) (#79051)
* Use python re to parse service output instead of grep. Fixes #78541

* Add clog frag

* Add an extra guard to abort if rc is 4, and /etc/init.d is missing
(cherry picked from commit 4458128)

Co-authored-by: Matt Martz <matt@sivel.net>
2022-10-26 16:06:43 -05:00
65fd4e182b [2.13] ansible-galaxy - fix unnecessary api check when installing role (#79143)
* ansible-galaxy install - fix unnecessary api check when installing a role from git repo (#79090)

* delay server api evaluation until a GalaxyRole needs to make an api call for info, list, and install

(cherry picked from commit cb2e434dd2)

* fix type for older python

* Fix isinstance check (#79159)

Use GalaxyAPI for isinstance check instead of RoleDistributionServer, since the latter is defined in __main__ sometimes (when running integration tests or ansible-galaxy from source) and importing from ansible.cli.galaxy won't reference the same object.

(cherry picked from commit 89d682464b)
2022-10-26 16:05:17 -05:00
a5480c330d copy, avoid moving non temp remote 'non' files (#79102) (#79155)
* copy, avoid moving non temp remote files that are not dirs/files
fix tests

(cherry picked from commit f66016df0e)
2022-10-26 16:05:03 -05:00
5dd04e54a8 fix password lookup's use of f=v settings (#76551) (#79108)
* fix password lookup's  use of f=v settings (#76551)

update tests

(cherry picked from commit 5d253a1380)

* fix password unit tests (#79113)

(cherry picked from commit c4d6629bce)

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2022-10-26 14:09:46 -05:00
a61016fb97 [stable-2.13] Fix ansible-test-git test for newer git versions.
The latest versions of `git` include a fix for CVE-2022-39253. The fix blocks the file protocol by default.

See: 45c9f05c44/Documentation/RelNotes/2.30.6.txt
(cherry picked from commit 4202acb41b)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-10-25 10:03:26 -07:00
2d6747bcbf [stable-2.13] Restrict wheel below v0.38.0 under Pythons < 3.7 (#79187)
* Restrict `wheel` below v0.38.0 under Pythons < 3.7

* Add a change note for PR #79187

* Update changelogs/fragments/79187--wheel-0.38.0.yml

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

* Use constraints file when installing wheel.

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

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2022-10-24 16:19:23 -07:00
b44cb7aa99 remove AnsibleFest banner (#79156) (#79158) 2022-10-18 09:13:27 -05:00
7e85f94349 Add Ansible community 6.5.0 porting guide (#79124)
Co-authored-by: Ansible Service Account <chadams@redhat.com>
2022-10-12 17:20:33 -04:00
be95a3a8ad Update Ansible release version to v2.13.5.post0. (#79099) 2022-10-11 10:51:55 -04:00
09cf0ed123 New release v2.13.5 (#79075) 2022-10-10 10:27:11 -04:00
dcc60165d1 Update Ansible release version to v2.13.5rc1.post0. (#78995) 2022-10-03 15:20:03 -05:00
2935773482 New release v2.13.5rc1 (#78937) 2022-10-03 11:53:54 -04:00
43cfdf3822 apt module, prevent tb from invalid type for pkg (#78666) (#78908)
* apt module, prevent tb from invalid type for pkg

 see #78663

(cherry picked from commit 7acd4f75c0)
2022-09-29 16:57:40 -07:00
1a7f3b403c [stable-2.13] Add ssh_args and friends back, add var for proxy_command (#78826) (#78837)
* [stable-2.13] Add ssh_args and friends back, add var for proxy_command (#78826)

Fixes #78750
(cherry picked from commit 1b47def)

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

* Remove non-backportable changes

(cherry picked from commit ba2938a388)
2022-09-29 16:56:13 -07:00
45abd5b685 [2.13] apt - fix failure when package is not installed and only_upgrade=True (#78791)
* apt - fix failure when package is not installed and only_upgrade=True (#78781)

* apt - fix module failure when package is not installed and only_upgrade is True

* changelog

(cherry picked from commit 4b45b4b09d)

* apt - fix module short-circuiting when a package is not installed and only_upgrade is True

(cherry picked from commit 14f46845f9)
2022-09-29 16:55:51 -07:00
551ddebeab [2.13] Limit Galaxy API calls during ansible-galaxy dependency resolution (#78722)
* Limit Galaxy API calls during ansible-galaxy collection dependency resolution when possible

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

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
(cherry picked from commit 41b62f7db4)
2022-09-28 09:12:30 -05:00
00d60a45fa [stable 2.13] Fix known host changed status when removing non-existing key #78598 (#78878)
* Fix known_hosts changed status when removing non-existing key (#78748)

* Ensure no change is reported when removing missing key for host with other keys

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

* Add changelog for fix known hosts wrong changed status cherry pick

* Remove old changelog for fix known hosts wrong changed status

* Rename changelog according to PR number

Co-authored-by: Matt Martz <matt@sivel.net>
2022-09-28 08:16:57 -05:00
0d188114c6 plugin loader fix existing config testing (#78859) (#78890)
create specific function to find config entry to avoid repopulating constantly

(cherry picked from commit 4115ddd135)
2022-09-28 08:16:40 -05:00
fa0655228a [stable-2.13] ansible-test - Fix integration test target filter. (#78862)
- Allow disabled, unsupported, unstable and destructive integration test targets to be selected using their respective prefixes.
- Allow unstable tests to run when targeted changes are made and the ``--allow-unstable-changed`` option is specified (resolves https://github.com/ansible/ansible/issues/74213).
(cherry picked from commit d3d7785472)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-09-22 13:38:19 -07:00
cd58c50b97 [stable-2.13] Don't request repo updates when only testing modes (#78843) (#78849)
(cherry picked from commit 2542048)

Co-authored-by: Matt Martz <matt@sivel.net>
2022-09-21 15:24:52 -07:00
e69c1812c9 Backportapalooza 9 15 (#78787)
* add galaxy docs back to core' (#78764)

(cherry picked from commit df6a564abd)

* Ansible 6.4.0: Porting Guide (#78775)

(cherry picked from commit d4407ca688)

* Documented connection parameters required to enable scp (OpenSSH >=9.0) (#78745)

(cherry picked from commit 952ee88f33)

* Fix Issue #78564 (#78741)

(cherry picked from commit f50ff1c2db)

* faq legacy vs builtin (#78769)

(cherry picked from commit db33ca8e1a)

* Removed repeated introduction paragraph (#78691)

(cherry picked from commit e276770ee9)

Co-authored-by: Ompragash Viswanathan <21008429+Ompragash@users.noreply.github.com>
Co-authored-by: wnjuguna <jbworldus@gmail.com>
Co-authored-by: Ronan <ronandoudies@gmail.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2022-09-15 14:40:55 -05:00
811d05e1ba Update Ansible release version to v2.13.4.post0. (#78753) 2022-09-12 15:17:26 -04:00
faa7be50e1 New release v2.13.4 (#78751) 2022-09-12 13:45:14 -04:00
ba18134ad8 Update Ansible release version to v2.13.4rc1.post0. (#78718) 2022-09-06 14:03:23 -04:00
c31541a3c9 New release v2.13.4rc1 (#78717) 2022-09-06 12:41:01 -04:00
2e760f6bda Fix typos in stat module examples (#78651) (#78687)
(cherry picked from commit 38c3b5e8f1)

Co-authored-by: NitrogenPointBlue <110332643+NitrogenPointBlue@users.noreply.github.com>
2022-09-01 14:36:31 -05:00
770a4a35d6 new: documentation update for galaxy usr guide (#78649) (#78688)
Co-authored-by: Adrian Brown <ap.brown011@gmail.com>
2022-09-01 14:36:20 -05:00
c51c5f97a4 [stable-2.13] Guard urllib3 imports against all exceptions. Fixes #78648 (#78667) (#78672)
(cherry picked from commit f8e24e4)

Co-authored-by: Matt Martz <matt@sivel.net>
2022-08-31 15:45:56 -07:00
9917b9f9f9 [stable-2.13] wait_for - Read file and perform comparisons using bytes to avoid decode errors (#78317) (#78660)
* wait_for - Read file and perform comparisons using bytes to avoid decode errors. Fixes #78214

* Write non-ascii via script instead of static file

* Use contexlib.closing to support py27 context manager

* Use executable from task, instead of shebang

* Update encoded bytes to utf16
(cherry picked from commit 9d4ced1)

Co-authored-by: Matt Martz <matt@sivel.net>
2022-08-31 15:44:42 -07:00
96d0053925 Fix pytest collection during test_host partial run (#78594)
Sometimes pytest errors out with an `ImportError` during its tests
collection stage when a Python package/directory containing the test
module does not have an `__init__.py` in it. This is being observed
under Python 3.9 and higher.

The patch provides a workaround for this problem but does not address
the root cause which is currently unknown.

Ref:
https://github.com/ansible/ansible/pull/78585#issuecomment-1220885431
(cherry picked from commit beb70daf14)
2022-08-31 15:43:12 -07:00
6b77033d63 [stable-2.13] Fix exit codes for role search and delete. Fixes #78516 (#78578) (#78583)
(cherry picked from commit 4c8b8a0)

Co-authored-by: Matt Martz <matt@sivel.net>
2022-08-31 15:42:37 -07:00
1cef724544 [stable-2.13] Fix --role-file arg detection (#78475) (#78522)
* Fix --role-file arg detection. Fixes #78204

* Do not traceback, give better error

* Add coverage for compound shortopts to match -r. Fixes #78491
(cherry picked from commit 86298b7)

Co-authored-by: Matt Martz <matt@sivel.net>
2022-08-31 15:42:11 -07:00
47d34ce582 Fail fast in stuck ansible-galaxy-collection (#78627)
This specific integration test gets stuck periodically causing the
Galaxy jobs to be killed on timeout wasting an hour of runtime. The
module that gets stuck waiting on Pulp is an in-test one, called
`setup_collections`. When it works, the task is complete in around 70
seconds but when it doesn't, it just freezes the whole play.

This patch attempts to make it fail faster by putting a reasonable
timeout value of 2 minutes.

(cherry picked from commit f1c56e988d)
2022-08-31 12:23:14 -05:00
f75ecde228 Replace get_persistent_connection_options in task_executor with get_options (#74446) (#78590)
Replace get_persistent_connection_options with get_options
Remove special case for network sub_plugin in _set_plugin_options
Try to avoid mock connection pretending to be persistent
Rename variables->options to reflect what they actually are
Gather options for ssh_type_conn on network_cli
Drop reliance on sub_plugin["type"]

(cherry picked from commit bf1ef5a1f3)
2022-08-31 12:22:59 -05:00
702eadf21b Fix apt making changes in check mode (#78496) (#78530)
* Don't actually update the cache in check mode

Add tests for updating the cache in check mode

* Don't mark packages as manually installed in check mode and add a test for it

* changelog

* Update test/integration/targets/apt/tasks/apt.yml

* fix test

(cherry picked from commit 3add5e9321)
2022-08-31 12:22:47 -05:00
b2553d162d apt: include apt preferences (e.g. pinning) when selecting packages (#78327) (#78462)
Fixes #77969

(cherry picked from commit 04e8927579)

Co-authored-by: Patrick Hemmer <phemmer@users.noreply.github.com>
2022-08-31 12:22:32 -05:00
046c59d851 Filter on any Fedora-Cloud-Base image (#78669) 2022-08-30 12:16:39 -07:00
a55ffb8d17 Backportapalooza 08 25 (#78647)
* fix adhoc dev example (#78593)

(cherry picked from commit 5ac40b358d)

* Docs: fix issue-76133-apt-repository (#78586)

(cherry picked from commit 3b9f1871e5)

* Fixes parameter name in expect module examples (#78635)

(cherry picked from commit 81813b7f23)

* doc: Correct mixed up commentary and task name (#78610)

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
(cherry picked from commit 87ba1e29d3)

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Arnold Kamanzi <kamstan6@gmail.com>
Co-authored-by: gmdmi <gmdmi@ya.ru>
Co-authored-by: rawtaz <rawtaz@users.noreply.github.com>
2022-08-25 13:33:03 -07:00
8071f014f6 [2.13] Disable connection_paramiko_ssh under FreeBSD 13.0 (#78643) 2022-08-25 13:12:37 -07:00
6f6e38feaf Add Porting Guide for ansible-community v6 (#78625) (#78631)
(cherry picked from commit df497ea13b)

Co-authored-by: Christian Adams <chadams@redhat.com>
2022-08-24 09:39:27 -05:00
45b064f3fd [stable-2.13] Fix file integration test chattr/lsattr check. (#78614) (#78618)
On BusyBox systems such as Alpine, chattr on a tmpfs fails with a status of 0 and output only on stderr.

This change updates the test to not assume output on stdout.

(cherry picked from commit 2e536c0afb)
2022-08-22 14:54:02 -07:00
fe60c4eb08 Backportapalooza 08 16 (#78584)
* Supply some descriptions for settings used in ansible.cfg (#78536)

(cherry picked from commit 4604ea38dd)

* Targeting a small typo correction (#78531)

(cherry picked from commit b6f42547f4)

* clarify collection signature not available from Community Galaxy (#78386)

(cherry picked from commit 7ae1eabaa4)

* update FAQ with not about libyaml (#78483)

(cherry picked from commit 33ee5d4c1b)

* add note to use package_facts module (#78484)

(cherry picked from commit 8dc097989b)

* Fix ansible-docs: shipping ansible in wheel format  #78485 (#78524)

(cherry picked from commit 7f69629fa7)

* update link for RH customers in docs banner (#78563)

(cherry picked from commit 2fdaee143a)

Co-authored-by: Andrew Latham <lathama@users.noreply.github.com>
Co-authored-by: Ian Wienand <iwienand@redhat.com>
Co-authored-by: Arnold Kamanzi <kamstan6@gmail.com>
2022-08-19 10:24:15 -07:00
e97c2cd178 Fix version switcher for Japanese site (#78543)
* Fix version switcher for Japanese docs (#78432)

(cherry picked from commit 660aceaa77)

* update version to match branch
2022-08-19 10:17:18 -07:00
e03527e722 Backportapalooza 08 11 (#78526)
* update the documentation for the _collection init_ command (#78404)

(cherry picked from commit 69c7e3f4a3)

* fix configuration name in porting guide 2.12  (#78472)

(cherry picked from commit 82246df5b7)

* docs: misc fixes in The Ansible Development Cycle (#78513)

(cherry picked from commit 0d3523df8f)

Co-authored-by: Alex <aizquier@redhat.com>
Co-authored-by: Akira Yokochi <akira6592@gmail.com>
2022-08-19 10:16:48 -07:00
fd1935048c Update mypy test. Fix type hints for Python 3.9. (#78587)
This also bumps the minimum controller version (for mypy only) to Python 3.9.

(cherry picked from commit cc5ac88c4c)
2022-08-19 10:05:43 -07:00
d6b40a5bc6 [stable-2.13] ansible-test - Fix ansible-doc sanity test FQCN. (#78518). (#78519)
(cherry picked from commit 2b63fdd1b8)
2022-08-15 14:47:44 -07:00
9ec6e331bf [stable-2.13] ansible-test - Fix self-test change handling. (#78521) (#78523)
(cherry picked from commit 99016653a2)
2022-08-15 14:47:30 -07:00
bb675432b2 Update Ansible release version to v2.13.3.post0. (#78547) 2022-08-15 16:13:15 -04:00
c1bb0c6ab8 New release v2.13.3 (#78527) 2022-08-15 14:03:26 -04:00
4e0f81a01f Update Ansible release version to v2.13.3rc1.post0. (#78476) 2022-08-08 14:18:36 -04:00
00c3da9d51 New release v2.13.3rc1 (#78470) 2022-08-08 11:34:22 -04:00
7a24541d18 Backportapalooza 08 04 (#78450)
* fix broken link (#78434)

(cherry picked from commit eb46ab1399)

* Fix escaped asterisk in code block demonstrating wildcards (#78375)

The code block is rendered verbatim. This currently results in `\*` being shown, which is incorrect (i.e., not parsed as a wildcard pattern).
Removing the superfluous `\` fixes the rendering.
This PR fixes all instances of this issue on that page.

(cherry picked from commit 9bf5da8f75)

* add example to import a playbook from collection (#78443)

(cherry picked from commit eb462edb16)

* docs: Fix control node reference links (#78424)

(cherry picked from commit f5cac6bc5d)

* Update galaxy_server_list (#78398)

(cherry picked from commit d92f6da592)

* Improve grammar (#78391)

(cherry picked from commit ddd8b8bfd9)

Co-authored-by: Tom Janson <priv.tom.janson@gmail.com>
Co-authored-by: Sebastian Gumprich <rndmh3ro@users.noreply.github.com>
Co-authored-by: Ian Wienand <iwienand@redhat.com>
Co-authored-by: Tabah Baridule <dulemartins07@gmail.com>
Co-authored-by: Geoffrey van Wyk <geoffrey@vanwyk.biz>
2022-08-04 15:48:41 -05:00
b2481eb158 Module/plugin docs: (#78380) (#78447)
(cherry picked from commit 7e634f54c3)
2022-08-04 15:48:18 -05:00
a2984758dc [2.13] Add basic docs on how to create a collection docsite with antsibull-docs (#78446)
* Add basic docs on how to create a collection docsite with antsibull-docs. (#78387)

(cherry picked from commit 733a767948)

* Fix typo: missing 'install'. (#78448)

(cherry picked from commit 2218b63aef)
2022-08-04 15:47:59 -05:00
775cf85491 Fix default value documentation for pipelining. (#78441) (#78445)
(cherry picked from commit 51f94570a6)
2022-08-04 15:47:38 -05:00
2efb33d200 Fix listing collections that are missing the metadata required by build (#76596) (#78411)
* Rethread pr/70185 through the dependency resolver

Hang optional metadata toggle on the ConcreteArtifactsManager instead of threading it through whole list codepath

Don't error while listing collections if a collection's metadata is missing keys required for building a collection.

Give an informative warning if metadata has been badly formatted.

Co-authored-by: Sam Doran <sdoran@redhat.com>
(cherry picked from commit 05608b20e8)
2022-08-03 11:20:58 -07:00
253c30441b Fix removing existing dir/files with ansible-galaxy collection init --force (#78403) (#78412)
* Remove collection contents when re-initializing with --force

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

(cherry picked from commit a2174fc6d9)
2022-08-03 10:33:01 -07:00
d6555399b8 [ansible-galaxy] Fix listing collections with null namespace/name/version metadata (#77014) (#78410)
* Fall back to implicit namespace.name from the path if the metadata is invalid

* Test listing a collection with null namespace/name/version fields in its galaxy.yml

(cherry picked from commit f8ec660e62)
2022-08-03 10:32:08 -07:00
ced2b93697 config error origin (#78407) (#78409)
(cherry picked from commit 9b79d6ba35)
2022-08-03 10:31:19 -07:00
f6fcb56695 [stable-2.13] swallow all exceptions in type annotation support shim imports (#77860) (#78373)
* swallow all exceptions in type annotation support shim imports

* add changelog
(cherry picked from commit 813afcb)

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2022-08-03 10:30:23 -07:00
ff4bb5500a PluginLoader now installs module-to-be-imported in sys.modules before exec (as Python import does). (#78364) (#78367)
(cherry picked from commit 1368bfa348)
2022-08-03 10:29:51 -07:00
426e4899a3 [stable-2.13] ansible-test - Parse content config only once. (#78418) (#78426)
(cherry picked from commit f2abfc4b3d)
2022-08-03 10:11:22 -07:00
cbec27fefc chmod aix errors with 255 is not unreachable (#78249) (#78356)
* chmod aix errors with 255 is not unreachable

  fixes #78210

* added another 'aix chmod msg'
check stderr also

(cherry picked from commit c135a47f44)
2022-08-03 09:59:53 -07:00
2aa3cc9e40 2.13: template module/lookup: fix convert_data for macros (#78259) (#78269)
* template module/lookup: fix convert_data for macros (#78259)

Fixes #78141

(cherry picked from commit 9afdb7fec1)

* Fix templating nested vars with convert_data=False (#78273)

Regression introduced in #78259.

(cherry picked from commit d070b03ad8)
2022-08-03 09:58:19 -07:00
bf1e031eb2 honor use_proxy parameter (#77312) (#78261)
* honor use_proxy parameter
* fix uri test with "use_proxy: no"
* fix urls.py module

Co-authored-by: Carlos <Juan.Carlos.Cardenas.Viera@ibm.com>
(cherry picked from commit 1d9c68d27e)

Co-authored-by: h4rr21 <juankchess13@hotmail.com>
2022-08-03 09:56:22 -07:00
fc82d215a6 yum: fix releasever for latest (#78066) (#78242)
Fixes #78058

(cherry picked from commit 2bc2153c01)
2022-08-03 09:54:24 -07:00
63f6fa0714 dnf: fix output parsing on non-English LANGUAGE systems (#78233) (#78241)
Fixes #78193

(cherry picked from commit 630616103e)
2022-08-03 09:53:42 -07:00
31db1a3a11 Decode vaulted args before sending over ansible-connection. (#78236) (#78246)
I'm not aware of a way to easily get vault secrets decoded on the
ansible-connection side without sending the vault secrets over the
connection in the same way, so just decode them for transport.

(cherry picked from commit fff14d7c1d)
2022-08-03 10:56:40 -05:00
70e5673319 [stable-2.13] Fix KeyError for ansible-galaxy when caching paginated responses from v3 (#78325) (#78405)
* Fix KeyError for ansible-galaxy when caching paginated responses from v3

* changelog

* generate responses in loop for test

Co-authored-by: Matt Martz <matt@sivel.net>
(cherry picked from commit 5728d72)

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2022-08-03 10:56:25 -05:00
b095367eab Ansible 6.2.0: porting_guide changes (#78408) (#78416)
(cherry picked from commit 27ce607a14)

Co-authored-by: Ompragash Viswanathan <21008429+Ompragash@users.noreply.github.com>
2022-08-02 15:18:43 -05:00
a290e187cc Docs Backportapalooza (#78379)
* Add missing colon to a snippet in complex data doc (#78349)

(cherry picked from commit e4087baa83)

* update the out-of-date ansible-test sanity ignores (#78342)

(cherry picked from commit 0f688f07af)

* Update information on the Intro_patterns.rst (#78192)

(cherry picked from commit 85bc2bcfcd)

* add note about permission change (#78128)

(cherry picked from commit b6ec06ab25)

Co-authored-by: Sviatoslav Sydorenko <wk@sydorenko.org.ua>
Co-authored-by: Muhammad Rafly Andrianza <luphieanza@gmail.com>
Co-authored-by: Tabah Baridule <dulemartins07@gmail.com>
2022-07-30 13:18:43 -07:00
e81bca3634 update Fest url per marketing (#78361) (#78363)
(cherry picked from commit eba15885cf)
2022-07-30 13:18:14 -07:00
24359537bb [stable-2.13] ansible-test - Fix TTY and output handling. (#78350).
(cherry picked from commit a3c90dd0bc)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-07-27 11:34:58 -07:00
4bb1907084 [stable-2.13] ansible-test - Fix handling of args after -- (#78328)
(cherry picked from commit 0012263c7a)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-07-27 10:43:41 -07:00
e806c4e64d [stable-2.13] Refactor ansible-test integration tests. (#78168) (#78362)
* Relocate update-ignore.py for easier re-use.

* Add script to ease collection testing.

* Skip ignore rewrite if file does not exist.

* Add integration test for the shebang sanity test.

* Fix ansible-test-no-tty integration test.

Previously the test only verified a TTY was not used if a TTY already existed.
This prevented the test from verifying behavior when run in CI.
Now the test creates a PTY before invoking ansible-test.

* Clean up ansible-test-docker integration test.
(cherry picked from commit f70cc2fb7e)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-07-27 10:43:13 -07:00
8f96331f4c Backportapalooza 07 21 (#78326)
* Update cheetsheet to fix meaning of -k (#78271)

(cherry picked from commit 691dde645c)

* Add note about package managers (#78260)

(cherry picked from commit fedd386998)

* dnf: clarify comparison operators in docs (#78316)

Fixes #78295

(cherry picked from commit b0a84cc9ca)

* Fix minor typos (#78294)

Signed-off-by: Hu Shuai <hus.fnst@fujitsu.com>
(cherry picked from commit fd810e88d6)

* Add cli docs for interacting with gpg for collection signing (#78321)

Co-authored-by: Jan-Piet Mens <jp@mens.de>
Co-authored-by: Desmond Obisi <51109125+DesmondSanctity@users.noreply.github.com>
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
Co-authored-by: Hu Shuai <hus.fnst@fujitsu.com>
Co-authored-by: Matt Martz <matt@sivel.net>
2022-07-21 14:01:38 -07:00
b6fc894010 add AnsibleFest 2022 registration banner (#78291) (#78309)
(cherry picked from commit 5e74693215)
2022-07-21 13:57:48 -07:00
3cffcfda9b Drop custom repo from libuser install @ Alpine CI (#78305) (#78306)
`group` and `setup_cron` integration tests currently install `libuser` and `faketime`
packages respectively, from the non-default edge/testing repositories. It is no
longer necessary to do so for the former so this patch drops the repo option. As
for the latter, this patch includes a note explaining when the same could be done
for it too.

This patch also adds a note on installing `faketime` on Alpine in CI.

(cherry picked from commit 619a1fa7e2)
2022-07-20 13:19:55 -07:00
591f39b6e0 Documentation: Update japanese translation (#78292)
* Documentation: Update japanese translation

* Replace MySQL by Ansible where it was mistakenly translated

Co-authored-by: Sandra McCann <samccann@redhat.com>
2022-07-19 14:10:48 -05:00
0f986325bb Update Ansible release version to v2.13.2.post0. (#78290) 2022-07-18 12:05:14 -04:00
0863427230 New release v2.13.2 (#78276) 2022-07-18 10:48:41 -04:00
5d8bf08e06 Backportapalooza 7 15 (#78277)
* Pr 72292- Add context to inventory plugins (#78070)

* Add context to inventory plugins documentation

* Show how to add the inventory plugin to the `enable_plugins` configuration item - not just replace it.
* Show adding tags to `keyed_groups` without specifying the separator.
* Show adding more complex `groups` and `compose` statements, including using the ternary filter.
* As I added an additional group, I've updated the resulting `ansible-inventory` output accordingly.

(cherry picked from commit a77fc2e822)

* Update dpkg_selections.py (#78177)

* Update dpkg_selections.py to include an syntax example showing how to remove package holds

* Fix pep8 issue: dpkg_selections.py

Missed some trailing spaces when adding example text.

(cherry picked from commit 489b7f1859)

* fix ternary problem (#78186)

(cherry picked from commit 7ec8916097)

* documentation: become plugins: correct pluralization in description (#78196)

fixes #78195

(cherry picked from commit e10851d495)

* Update python_3_support.rst (#78239)

Fix invalid characters warning when using example group names. (Replace dashes in example group name with underscores.)

(cherry picked from commit be88250a83)

* Adding applicable licensing requirements (#78162)

(cherry picked from commit 6ddccc1604)

* Document choice to use Ansible Project in copyright lines (#78164)

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
(cherry picked from commit c9a341902b)

* stat only returns pw_name/gr_name if those can be looked up (#78183)

(cherry picked from commit 221af7640d)

* example showing how to deal with keys w/o apt_key (#78206)

(cherry picked from commit 0590ce065c)

* Migrate vmware.vmware_rest Dev Guide to collection (#78255)

(cherry picked from commit 048adac5b7)

* Updated release_and_maintenance.rst (#78272)

(cherry picked from commit 358a8ad7af)

Co-authored-by: Micah Beasley <MBfromOK@users.noreply.github.com>
Co-authored-by: Alex Willmer <alex@moreati.org.uk>
Co-authored-by: Nathan Hyde <nathanhyde@gmail.com>
Co-authored-by: Desmond Obisi <51109125+DesmondSanctity@users.noreply.github.com>
Co-authored-by: Evgeni Golov <evgeni@golov.de>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Mario Lenz <m@riolenz.de>
Co-authored-by: Ompragash Viswanathan <21008429+Ompragash@users.noreply.github.com>
2022-07-15 13:36:34 -07:00
4b9434788b Ansible 6.1.0: Updated porting_guide_6.rst (#78245) (#78250)
(cherry picked from commit 3658c26ad4)

Co-authored-by: Ompragash Viswanathan <21008429+Ompragash@users.noreply.github.com>
2022-07-12 12:41:04 -07:00
5bc6adf2c2 Update Ansible release version to v2.13.2rc1.post0. (#78238) 2022-07-11 16:15:31 -04:00
a689972b56 New release v2.13.2rc1 (#78229) 2022-07-11 11:08:29 -04:00
69562a8db6 Fix wording for :ref|term: substitution (#78216) (#78221)
* Fix workding for :ref|term: subsitution

 now matches 'seealso' and makes more sense:

  ```
  delay:
  applies_to:
  - Task
  description: Number of seconds to delay between retries. This setting is only used
    in combination with `until`.
  ```
 vs
  ```
  delay:
  applies_to:
  - Task
  description: Number of seconds to delay between retries. This setting is only used
    in combination with website for `until`.
  ```

* updated unit tests

* match see also

* more sanity

(cherry picked from commit d26801e994)
2022-07-07 16:49:49 -05:00
357ca6394e Ensure atomic writes for cache file (#78208) (#78217)
* Ensure atomic writes for cache file

 helps avoid errors in highly concurrent environments

(cherry picked from commit f6419a53f6)
2022-07-07 16:49:34 -05:00
3ef4609bca password lookup argument parsing fix (#78080) (#78102)
fixes #78079

(cherry picked from commit cea18bf60a)
2022-07-06 12:54:22 -05:00
bdeeaa528d Fix 'Permission denied' in user module while generating SSH keys (#78040) (#78054)
* Fix 'Permission denied' in user module while generating SSH keys

Fix #78017
Use try/except for spwd usage to prevent "Permission denied".

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 30a923fb5c)
2022-07-06 12:54:04 -05:00
6468bb0cb6 Move undefined check from concat to finalize (#78165) (#78179)
In the classic Jinja2's Environment str() is called on the return value of the
finalize method to potentially trigger the undefined error. That is not
the case in NativeEnvironment where string conversion of the return value is
not desired. We workaround that by checking for Undefined in all of our concat
functions. It seems simpler to do it earlier in the finalize method(s) instead.
As a side-effect it fixes an undefined variable detection in imported templates.

Fixes #78156

ci_complete

(cherry picked from commit 17d52c8d64)
2022-07-06 10:28:35 -05:00
d4cd1853b0 Make unit test for missing git executable more generic (#78173) (#78174)
* Make unit test for missing git executable more generic

* use MagicMock side_effect to raise exception instead

(cherry picked from commit 1562672bd1)
2022-07-06 10:28:16 -05:00
27890cd659 Backportapalooza 06 30 (#78176)
* fixed hyperlinks to galaxy.ansible for issue #78104 (#78152)

(cherry picked from commit 4bd7e50612)

* Fix documentation with misleading data type (#78157)

##### SUMMARY
The sample value given for the 'mode' parameter is shown without quotes, but the data type is string. If you actually try to use an unquoted numeric string for this value you're in for a nasty surprise! I added quotation marks to the sample value.
##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr

(cherry picked from commit 4c9385dab7)

* Update README.md (#78139)

Update Python version requirement to >= 3.8.

(cherry picked from commit 58b42abede)

* elaborate on import/include conditional example (#78138)

(cherry picked from commit 7ec84c511f)

* Update vault.rst (#78140)

(cherry picked from commit 84105e39f4)

Co-authored-by: Lewis Brogan <ilewisbrogan@gmail.com>
Co-authored-by: mlevens-hw <55262896+mlevens-hw@users.noreply.github.com>
Co-authored-by: Diana S. Cardona <89112552+Flecha21@users.noreply.github.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: jlownie <jlownie@hotmail.com>
2022-07-05 08:35:27 -07:00
036fc02c27 [stable-2.13] ansible-doc: list modules in collections recursively (#78137)
* List modules in collections recursively.

* Skip symlinks when listing plugins and modules.
2022-07-05 08:30:01 -07:00
99217ca2b6 [stable-2.13] ansible-test - Improve pip bootstrap download.
(cherry picked from commit b9d13d222c)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-06-24 12:23:51 -07:00
a2022a37db Backportapalooza 06 23 (#78134)
* Add tutorial links to the docs #78073 (#78084)

(cherry picked from commit 717f178870)

* Updated the document 'src' in URI (#78105)

(cherry picked from commit 08b438c4ba)

* update documentation of 'unarchive' (#77643)

(cherry picked from commit c321e3baad)

* Update list for gather_subset (#78133)

(cherry picked from commit 3e3f8cb004)

* issue #78076 fix diagram (#78077)

(cherry picked from commit 59f3f1b625)

Co-authored-by: paulreece <96156234+paulreece@users.noreply.github.com>
Co-authored-by: Tabah Baridule <dulemartins07@gmail.com>
Co-authored-by: optica-phoffmann <103563417+optica-phoffmann@users.noreply.github.com>
Co-authored-by: Don Naro <dnaro@redhat.com>
2022-06-24 09:04:46 -07:00
6dad4b9f70 update intersphinx links for Ansible 6 (#78121) (#78126)
(cherry picked from commit 70543402c7)
2022-06-24 09:01:15 -07:00
271097434b set current version to 6 (#78110) 2022-06-21 11:40:26 -07:00
16970567bf update conf.py for Ansible 6 release (#78049) (#78109)
(cherry picked from commit e8a77626a3)
2022-06-21 11:40:04 -07:00
d9f999f1c3 update release page to reflect Ansible 6 release (#78047) (#78108)
Co-authored-by: Iheanacho Amarachi Sharon  <58210919+Iheanacho-ai@users.noreply.github.com>
(cherry picked from commit a9ce358f98)
2022-06-21 11:39:40 -07:00
45920f1d2e docs: Update porting guide for Ansible 6.0.0 (#78101) (#78106)
(cherry picked from commit 1b63e7d3fa)

Co-authored-by: Ompragash Viswanathan <ompragash.viswanathan@gmail.com>
2022-06-21 11:38:47 -07:00
f09e6b7769 Backportapalooza 06 16 (#78072)
* Docsite: Updated style guide resources (#78048)

(cherry picked from commit 561cf1956d)

* Create reusable role layout snippet for documentation (#78057)

* reuse role structure
* reuse role snippet in role docs

(cherry picked from commit f4ad1c771e)

* Docsite: update links to community docs (#78043)

(cherry picked from commit 46d86a882d)

* Windows - incorrect python-devel package in WinRM docs (#78037)

Co-authored-by: Emanuele Barbato <manu@Giuseppes-MacBook-Air.local>
(cherry picked from commit 681dc6eab9)

* issue #72449 winrm script rm (#77931)

(cherry picked from commit 3cd2c494bd)

* reword the regex note (#75393)

Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
(cherry picked from commit 66c0882314)

* Document debconf interaction with dpkg-reconfigure (#74196)

Signed-off-by: David Greaves <david@dgreaves.com>
(cherry picked from commit 5b90601ca4)

Co-authored-by: Lewis Brogan <ilewisbrogan@gmail.com>
Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
Co-authored-by: Emanuele Barbato <30394740+emanuelebarbato@users.noreply.github.com>
Co-authored-by: Don Naro <dnaro@redhat.com>
Co-authored-by: David Greaves <david@dgreaves.com>
2022-06-21 09:01:11 -07:00
739fb490c7 Update Ansible release version to v2.13.1.post0. (#78095) 2022-06-20 10:28:23 -04:00
e9f633ec72 New release v2.13.1 (#78086) 2022-06-20 09:40:16 -04:00
34203f6b56 Update Ansible release version to v2.13.1rc1.post0. (#78044) 2022-06-13 10:39:31 -04:00
d34ba977fb New release v2.13.1rc1 (#78033) 2022-06-13 09:47:10 -04:00
fa898f4fcc Docs Backportapalooza 06 09 (#78020)
* Move AWS guidelines to collection (#77959)

(cherry picked from commit 0ff1ba3e12)

* docs: Update porting guide for ansible 5.9.0 (#77982)

(cherry picked from commit f9d4c26143)

* docs: Update porting guide for ansible 6.0.0rc1 (#77991)

(cherry picked from commit a30500144e)

* Fix docs links for the steering committee (#77974)

(cherry picked from commit ca9be6e27e)

* Add macOS fork issue to FAQ (#77965)

* Add macOS fork issue to FAQ

* Remove colon from error msg

(cherry picked from commit 0fae2383da)

* Docs: change community collection inclusion process (#77905)

(cherry picked from commit e589eba506)

* update backport instructions to reflect stable-2.13 (#77958)

Co-authored-by: Divine Odazie <dodazie@gmail.com>
(cherry picked from commit 85329beb90)

* mention different results for password_hash depending on library used (#76863) (#77963)

(cherry picked from commit fa840d4c7c)

* Rephrase-community (#77985)

(cherry picked from commit 556ac89664)

Co-authored-by: Mario Lenz <m@riolenz.de>
Co-authored-by: Ompragash Viswanathan <ompragash.viswanathan@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Philippe Kueck <philfry@users.noreply.github.com>
Co-authored-by: Bennykillua <67695793+Bennykillua@users.noreply.github.com>
2022-06-10 12:43:05 -07:00
cf5c0c9b06 ansible-galaxy - support resolvelib versions >= 0.5.3, < 0.9.0 (#77649) (#78008)
* ansible-galaxy - support resolvelib versions >= 0.5.3, <= 0.8.1

Test incompatibilities are removed for resolvelib >= 0.6.0

Test against the latest 0.8.x version and fix requirements

* Fix tests - use a venv for testing the range of resolvelib versions

* Update temporary hardcoded fallback for ansible-test

* Update hardcoded upperbound for sanity tests

* Make error check more flexible

(cherry picked from commit 143e7fb45e)
2022-06-10 12:39:30 -07:00
44e249df3a [stable-2.13] Update AZP test container to 3.0.0. (#78022)
(cherry picked from commit 1321d6ecd5)
2022-06-09 17:29:26 -07:00
977c2480db [2.13] Fix ansible-galaxy traceback when unexpected version of resolvelib is installed (#77901)
* Fix ansible-galaxy traceback when unexpected version of resolvelib is installed (#77630)

* Fix traceback when a supported version of resolvelib is not installed

Try to read the supported version range from the package distribution info and fall back to a hardcoded lowerbound/upperbound (>=0.5.3,<0.6.0).

* Add tests for unsupported resolvelib versions

* Resolve remaining import sanity test issues.

Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Matt Martz <matt@sivel.net>
(cherry picked from commit 82f3a57bee)

* Fix boolean condition so that ansible-galaxy collection install works when a valid resolvelib is installed. (#77906)

(cherry picked from commit 6fbc8bd2bc)

* ansible-galaxy - ensure variable is defined for any error when getting the ansible-core distribution (#77993)

(cherry picked from commit db335498d0)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-09 10:13:28 -05:00
3957913485 fix pip module resolution (#78000) (#78006)
* `importlib.util` appears to be lazily imported and is sometimes unavailable as an attribute of `importlib` without an explicit import

(cherry picked from commit 6e78425f8d)
2022-06-09 10:11:38 -05:00
be9c208cb4 apt: fix virtual package install version detection (#76781) (#77909)
* apt: fix virtual package install version detection

Change 4a62c4e3e4 introduced version
matching in installation.

The problem stems from

 if version_installable or version:
     pkg_list.append("'%s=%s'" % (name, version_installable or version))

When the package is a virtual-package, package_status() is returning
the "version_installable" of the package *satisfying* the
virtual-package; but then this is trying to install the
virtual-package with this version pin.

For example, "yaml-mode" is a virtual package satisifed by
"elpa-yaml-mode" (currently 0.0.14-1) and trying to install it fails
with

 $ usr/bin/apt-get -y ... install 'yaml-mode=0.0.14-1'
 ... failed: E: Version '0.0.14-1' for 'yaml-mode' was not found ...

In the case of a virtual-package with nothing installed to satisfy it,
we should just return blank values to allow apt-get to do it's thing.

The tests are updated to install and remove this package.

Fixes: #76779
(cherry picked from commit e4c0bbf885)

Co-authored-by: Ian Wienand <iwienand@redhat.com>
2022-06-08 12:06:57 -05:00
63a0860231 Add toggle to fix module_defaults with module-as-redirected-action on a per-module basis (#77265) (#77899)
* If there is a platform specific handler, prefer the resolved module over the resolved action when loading module_defaults

Add a toggle for action plugins to prefer the resolved module when loading module_defaults

Allow moving away from modules intercepted as actions pattern

Fixes #77059

(cherry picked from commit 621e782ed0)
2022-06-08 11:29:20 -05:00
f80f58903b Fix windows connection options (#77844) (#77894)
* winrm, psrps added missing var entry

 this handles issue with the default being set to inventory_hostname
 but defaults not being templated implicitly

 fixes #77841

(cherry picked from commit eecbaee7f4)
2022-06-08 11:29:11 -05:00
02104472e2 Update PSF-license.txt to version from CPython 3.9.5. (#77805) (#77829)
(cherry picked from commit 201aba3d0f)
2022-06-08 11:29:02 -05:00
e5e3bc849d template/__init__.py - fix KeyError when wantlist=False with non-list (#77824)
(cherry picked from commit c9ce7d08a2)
2022-06-08 11:28:52 -05:00
9796d055b9 fix SELinux facts tests (#77707)
* make the pre-flight sniffing more robust to different failure conditions (was failing on Ubuntu 22.04 VMs)
* remove skip aliases (the test needs to function everywhere to assert that the selinux facts bits behave properly when it's N/A)

(cherry picked from commit 4ff10fcd31)
2022-06-08 11:28:41 -05:00
f02e870b1b dont rely on path to set config defs for plugins (#77659) (#77694)
(cherry picked from commit a3cc6a581e)
2022-06-08 11:28:29 -05:00
f026e3dcf9 Fix 'ansible-config dump --only-changed -t all' verbosity (#77898) (#77922)
* Fix 'ansible-config dump --only-changed -t all' to only display headers if plugin options are changed

* changelog

* add a test

(cherry picked from commit 1214b63f4f)
2022-06-08 10:49:30 -05:00
0c76edb63a Pin PyYAML version compatible with Python 3.8+ (#77936) (#77986)
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit e89176caac)
2022-06-08 10:49:16 -05:00
68c2f09ae8 [2.13] fix ansible-galaxy-collection integration test (#77992)
* ansible-galaxy-collection - use --pinentry-mode loopback for gpg key revocation (#77967)

(cherry picked from commit 1706d35fc4)

* fix ansible-galaxy-collection test with revoked key (#77989)

* Remove unnecessary gpg passphrase

(cherry picked from commit a43112290a)
2022-06-08 10:00:11 -05:00
6291280ef8 [stable-2.13] Make fuzzy plugin matching deterministic. (#77997)
(cherry picked from commit 5a0b230e24)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-06-08 09:52:48 -05:00
567a295c00 [stable-2.13] ansible-test - Adjust unit test mock usage. (#77961) (#77999)
(cherry picked from commit 23914d3f0b)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-06-08 09:52:26 -05:00
ae380e3bef [stable-2.13] ansible-test - Multiple backports (#77951)
* ansible-test - Backport `InternalError`

NOTE: This is a partial backport, including only one new class.

(cherry picked from commit b960641759)

* ansible-test - Fix subprocess management. (#77641)

* Run code-smell sanity tests in UTF-8 Mode.
* Update subprocess use in sanity test programs.
* Use raw_command instead of run_command with always=True set.
* Add more capture=True usage.
* Don't expose stdin to subprocesses.
* Capture more output. Warn on retry.
* Add more captures.
* Capture coverage cli output.
* Capture windows and network host checks.
* Be explicit about interactive usage.
* Use a shell for non-captured, non-interactive subprocesses.
* Add integration test to assert no TTY.
* Add unit test to assert no TTY.
* Require blocking stdin/stdout/stderr.
* Use subprocess.run in ansible-core sanity tests.
* Remove unused arg.
* Be explicit with subprocess.run check=False.
* Add changelog.
* Use a Python subprocess instead of a shell.
* Use InternalError instead of Exception.
* Require capture argument.
* Check for invalid raw_command arguments.
* Removed pointless communicate=True usage.
* Relocate stdout w/o capture check.
* Use threads instead of a subprocess for IO.

(cherry picked from commit 5c2d830dea)

* ansible-test - Add support for remote Ubuntu VMs.

(cherry picked from commit 6513453310)

* ansible-test - Fix remote completion validation.

(cherry picked from commit e2200e8dfc)

* ansible-test - Add multi-arch remote support.

(cherry picked from commit 2cc74b04c4)

* ansible-test - Enhance the shell command. (#77734)

* ansible-test - Add shell --export option.

* ansible-test - Support cmd args for shell command.

Also allow shell to be used without a valid layout if no delegation is required.

* ansible-test - Improve stderr/stdout consistency.

By default all output goes to stdout only, with the exception of a fatal error.

When using any of the following, all output defaults to stderr instead:

* sanity with the `--lint` option -- sanity messages to stdout
* coverage analyze -- output to stdout if the output file is `/dev/stdout`
* shell -- shell output to stdout

This fixes issues two main issues:

* Unpredictable output order when using both info and error/warning messages.
* Mixing of lint/command/shell output with bootstrapping messages on stdout.

* ansible-test - Add changelog fragment.

(cherry picked from commit fe349a1ccd)

* ansible-test - Fix remote args restriction.

The platform-specific and global fallbacks were not working with the `--remote` option.

This regression was introduced by https://github.com/ansible/ansible/pull/77711

(cherry picked from commit 76ead1e768)
2022-06-02 16:39:52 -07:00
f3b56ec661 Backportapalooza 06 02 (#77960)
* docs: update porting guide for ansible 6.0.0b1 (#77913)

(cherry picked from commit 7c89562580)

* docs: add missing notes in porting guide for 6.0.0b1 (#77926)

There was an issue with the changelog in community.network 4.0.0, it's
been fixed in 4.0.1 and now properly included.

(cherry picked from commit 9f7956ba30)

* Remove platform dev guides from core docs (#77915)

(cherry picked from commit f3c684564c)

* Migrate community.vmware Dev Guide to collection (#77723)

(cherry picked from commit b69eb28ed2)

* Issue #77681 revamp getting started guide (#77897)

(cherry picked from commit 89e4fb71e6)

* ssh retry docs addition (#77930)

(cherry picked from commit 15750aec52)

* fix: update button text to "Load token" (#77925)

(cherry picked from commit 16e0d4a121)

* fix bad merge conflict resolution

Co-authored-by: David Moreau Simard <moi@dmsimard.com>
Co-authored-by: Mario Lenz <m@riolenz.de>
Co-authored-by: Don Naro <dnaro@redhat.com>
Co-authored-by: Dan Kolepp <10145457+dkolepp@users.noreply.github.com>
2022-06-02 16:34:16 -07:00
2ac74197af [stable-2.13] ansible-test - Prefer unittest.mock for core.
(cherry picked from commit 81351022d8)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-06-01 17:19:04 -07:00
44ce9fe998 [stable-2.13] ansible-test - Fix shell target options handling.
(cherry picked from commit f933314101)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-06-01 13:20:38 -07:00
2b6df9ea36 Add RHEL 9.0 to ansible-test and CI. (#77923)
* ansible-test - Add RHEL 9.0 remote support.

* Add RHEL 9.0 to CI. (#77853)

* Add RHEL 9.0 to CI.

* Restrict network manager inspection to RHEL8

* Skip module tests when astream_name is undefined, undefine it for RHEL9 until 9.1

* Remove redundant test.

Co-authored-by: Matt Martz <matt@sivel.net>
(cherry picked from commit 43d650f924)

* Include test fix from https://github.com/ansible/ansible/pull/77847
2022-06-01 12:51:24 -07:00
e6b16ddeb5 Docs backportapalooza 05 26 (#77921)
* Remove statement about dependencies and includes. Fixes #75055 (#77912)

(cherry picked from commit a2eb472fb6)

* doc: Clarify stride/increment in inventory intro (#77893)

(cherry picked from commit 9010f0fbe3)

* Remove double spaces in errormessage (#77839)

(cherry picked from commit 711b51fad6)

* add anchors for crossreferencing (#77800)

(cherry picked from commit a99623bce1)

* [docs]Mention that global variables are not mapped to hostvars (#77783)

(cherry picked from commit 74469bf54a)

* Point to Kerberos as a safer winrm setup method (#77794)

(cherry picked from commit 45d930e9c1)

* more context on multiple facts modules (#77896)

(cherry picked from commit dbbeea0686)

Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: rawtaz <rawtaz@users.noreply.github.com>
Co-authored-by: Wouter Schoot <wouter@schoot.org>
Co-authored-by: Sergei Petrosian <30409084+spetrosi@users.noreply.github.com>
Co-authored-by: TheBigBear <TheBigBear@users.noreply.github.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2022-05-26 15:35:12 -07:00
c45ba4f9ca docs: Update porting guide for ansible 5.8.0 (#77843) (#77859)
(cherry picked from commit 059204b871)

Co-authored-by: David Moreau Simard <moi@dmsimard.com>
2022-05-26 15:33:14 -07:00
8d99c1cc0c docs: Update porting guide for ansible 6.0.0a3 (#77842) (#77858)
(cherry picked from commit 66e92a3aff)

Co-authored-by: David Moreau Simard <moi@dmsimard.com>
2022-05-26 15:32:54 -07:00
46a1eb6832 [stable-2.13] Prefer unittest.mock over mock. (#77886)
(cherry picked from commit 2595b42aca)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-05-23 14:09:36 -07:00
47e1cc38fd [stable-2.13] Use unittest.mock instead of mock. (#77883)
This can only be done for controller tests.
(cherry picked from commit 3a9a23fb1a)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-05-23 12:21:37 -07:00
93b8ccda21 [stable-2.13] Avoid deprecated method in unit tests.
(cherry picked from commit 5f74350fd5)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-05-23 12:02:38 -07:00
006ea84f70 Update Ansible release version to v2.13.0.post0. (#77809) 2022-05-16 12:09:01 -04:00
ad609fa57e New release v2.13.0 (#77799) 2022-05-16 10:47:48 -04:00
d0d1cc9e54 05 12 backportapalooza (#77787)
* stub out ovirt dev guide with pointer to new location (#77751)

(cherry picked from commit 5e22fe21fd)

* Docsite/communication.rst: fix formatting (#77760)

(cherry picked from commit 97e574fe6e)

* Updated the playbook section in this docs (#77747)

(cherry picked from commit 42086c14a3)

* 2.13 GA has been bumped up a week to release on May 16 (#77772)

(cherry picked from commit 75bc630565)

* Fix plugin dev examples (#77759)

* Fix plugin dev examples

* Update docs/docsite/rst/dev_guide/developing_plugins.rst

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

* docs: Update ansible-core release date in Ansible roadmap (#77775)

(cherry picked from commit 235f2598b1)

* revamp basic concepts docs (#77748)

(cherry picked from commit 8e91403412)

* core-2.13 - update release table (#77780)

(cherry picked from commit 6230244537)

* clarify Ansible EOL details (#77778)

* clarify Ansible EOL details: update docs/docsite/rst/reference_appendices/release_and_maintenance.rst
Co-authored-by: Felix Fontein <felix@fontein.de>

(cherry picked from commit 654fff05e6)

* Update url to quickstart video. (#77779)

(cherry picked from commit f75bb09a8b)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
Co-authored-by: Desmond Obisi <51109125+DesmondSanctity@users.noreply.github.com>
Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: Mario Lenz <m@riolenz.de>
Co-authored-by: David Moreau Simard <moi@dmsimard.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Tabah Baridule <dulemartins07@gmail.com>
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2022-05-13 15:26:58 -07:00
256641b780 set stable-2.13 to latest (#77798) 2022-05-13 15:05:15 -07:00
0d1d1b74b3 update version switcher to include 2.13 (#77786) (#77795)
(cherry picked from commit f5642cea28)
2022-05-13 15:04:10 -07:00
14f64ae38f core-2.13 - update release table (#77780) (#77785)
(cherry picked from commit 6230244537)
2022-05-13 14:59:36 -07:00
a6d7eb8710 [docs][backport] 5 06 docs backportapalooza (#77749)
* Docsite: move a stepped down steering committee member to past members (#77715)

(cherry picked from commit a1ddb83fc1)

* add collection pr review checklist (#77661)

Co-authored-by: Emmanuel Ugwu <32464178+ugwutotheeshoes@users.noreply.github.com>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
(cherry picked from commit ef2fe6823c)

* clarify latest release (#77577)

* clarify latest release
* fix tables

(cherry picked from commit f633b62cbc)

* typo in doc (#77672)

(cherry picked from commit c71faec595)

* Docs: `ansible-test sanity` example with a folder

##### SUMMARY
The docs mentions explicitly that you can run the tests against certain files which might not relay that it works on folders too!

Let's make this clear :)

##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr

(cherry picked from commit 52bd59c481)

* docs: update porting guide for ansible 6.0.0a2 (#77736)

(cherry picked from commit 0cfc291573)

* simplify developing modules (#77647)

(cherry picked from commit 255745b3e6)

* Mention admin requirement for runas become (#77722)

(cherry picked from commit dd094a4413)

* core branch descriptions (#76152)

(cherry picked from commit d352f2ec21)

* Fix ansible-test import analysis warning.

Fix overlooked in https://github.com/ansible/ansible/pull/68372/

(cherry picked from commit 77732ed50d)

* Revert "Fix ansible-test import analysis warning."

This reverts commit 676f1056cb.

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Kristian Heljas <11139388+kristianheljas@users.noreply.github.com>
Co-authored-by: David Moreau Simard <moi@dmsimard.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Jordan Borean <jborean93@gmail.com>
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2022-05-13 14:59:00 -07:00
a07e3eb45b 4 28 docs backportapalooza (#77686)
* docs: Update porting guide for ansible 5.7.0 (#77646)

(cherry picked from commit 709ae7c050)

* remove import_play examples from include module (#77597)

(cherry picked from commit d321fa3f15)

* trim down to use sanity test docs requirements file (#77612)

* trim down to use sanity test docs requirements file
* add requirements back
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update docs/docsite/rst/community/documentation_contributions.rst

(cherry picked from commit a65fbfad5b)

* Typo fix (#77648)

(cherry picked from commit cf5f0690f0)

* Update guide_vultr.rst (#77665)

(cherry picked from commit f6fb402d1f)

* add select distro installs to docs (#77567)

(cherry picked from commit 096393a221)

* community_steering_committee.rst: add new member (#77589)

(cherry picked from commit 3cbfee7852)

* clarify latest release (#77577)

* clarify latest release
* fix tables

(cherry picked from commit f633b62cbc)

* typo in doc (#77672)

(cherry picked from commit c71faec595)

Co-authored-by: David Moreau Simard <moi@dmsimard.com>
Co-authored-by: deosrc <deosrc@g-de.co.uk>
Co-authored-by: Jan-Piet Mens <jp@mens.de>
Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-05-13 14:57:50 -07:00
f4f1f772c1 [stable-2.13] shift to ansible_core_version
(cherry picked from commit 7471c036ec)

Co-authored-by: samccann <samccann@redhat.com>
2022-05-05 12:19:07 -07:00
511389ef3a Update Ansible release version to v2.13.0rc1.post0. (#77718) 2022-05-02 13:54:20 -04:00
f282306b1b New release v2.13.0rc1 (#77717) 2022-05-02 10:26:31 -04:00
89e6dcda26 Prevent losing unsafe from lookups (#77609) (#77650)
* Prevent losing unsafe from lookups

This patch fixes a bug which under certain conditions results in data
returned from lookups not being marked as unsafe.

Each time Templar.do_template is invoked a new AnsibleContext is
created and stored effectively at two places:
1) as an instance variable in templar_obj.cur_context
2) as a local variable called new_context in do_template method of Templar

Due to custom functionality in Ansible's Context that allows for nested
templating it is possible that during resolving variable's value
template/do_template method is called recursively again, again creating
a new context. At that point the problem manifests itself because as
mentioned in 1) above the context is overwriten on the templar object
which means that any subsequent calls to _lookup will use the new
context to mark it as unsafe which is now different to the local
new_context which is used for testing for unsafe property.

The solution to the problem appears to be to restore the original
context inside do_template and also to eliminate the local variable
new_context to prevent problems in the future.

It appears that we don't have a better way of storing the context other
than as some form of global variable and so this appears to be the
"best" solution possible at this point. Hopefully data tagging will be
the solution here.

For more examples see unit and integration tests included in this patch.

Fixes #77535

(cherry picked from commit 3980eb8c09)
2022-04-28 16:16:36 -05:00
8f1c25d154 Update Ansible release version to v2.13.0b1.post0. (#77634) 2022-04-25 12:43:02 -04:00
5d9d0fe39b New release v2.13.0b1 (#77629) 2022-04-25 10:36:03 -04:00
9a7b645c50 ansible-test - Update default containers to 5.9.0. 2022-04-22 12:25:58 -07:00
cad892125c [stable-2.13] Replace antsibull with antsibull-docs (#77504)
(cherry picked from commit 841bdb74eb)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-04-22 10:30:49 -07:00
e03069a444 [docs][backport] Docs backports week 4-18-22 (#77557)
* Update reporting_bugs_and_features.rst (#77518)

(cherry picked from commit fa7c5d9b10)

* docs: Add porting guide for Ansible 6.0.0a1 (#77526)

(cherry picked from commit 0d9a580f24)

* Steering Committee: add new member (#77529)

(cherry picked from commit 553a226da5)

* Update pip example with standard lowercase http[s]_proxy env vars (#77515)

(cherry picked from commit 2ba39fcf8c)

* Update docs to recommend the TTY for prompts over stderr (#77533)

(cherry picked from commit 789d29e895)

* update python devel docs (#77499)

* update python devel docs

Co-authored-by: Sandra McCann <samccann@redhat.com>
(cherry picked from commit 2fc73a9dc3)

* setup: remove 'any' as seemingly valid option (#77532)

fixes #59783

(cherry picked from commit 762d97f1b8)

* Update developing_collections_shared.rst (#77497)

##### SUMMARY
Use of the meta/runtime.yml file to specify the ansible-core version for collections

##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr

(cherry picked from commit eef0a1cef9)

* Update developing_collections_structure.rst (#77496)

(cherry picked from commit 538a19b748)

* Fix a broken link and some grammatical errors (#77531)

(cherry picked from commit 0c1cb0e9d4)

* Add contributor path page (#77494)

Co-authored-by: Emmanuel Ugwu <32464178+ugwutotheeshoes@users.noreply.github.com>
(cherry picked from commit 3b0d74c145)

Co-authored-by: Iheanacho Amarachi Sharon <58210919+Iheanacho-ai@users.noreply.github.com>
Co-authored-by: David Moreau Simard <moi@dmsimard.com>
Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Emmanuel Ugwu <32464178+ugwutotheeshoes@users.noreply.github.com>
Co-authored-by: Kajsa Gauza <nimrod7@gmail.com>
2022-04-21 16:53:52 -05:00
91fb18bf31 [stable-2.13] arg_spec - Return aliases in validation result and update aliases (#77576) (#77601)
When looking up the `no_log` setting for a parameter that is an alias in
`AnsibleModule._log_invocation()`, the alias value will always be an
empty dictionary since `self.aliases` on the `AnsibleModule` instance is
never updated after initialization. Since the `no_log` setting is on the
canonical parameter not the alias, an incorrect warning is issued if the
parameter matches `PASSWORD_MATCH`.

This PR returns the aliases dictionary as an attribute of the
`ValidationResult` and updates the `aliases` attribute on the
`AnsibleModule` instance.
(cherry picked from commit 1b947eaf92)

Co-authored-by: Sam Doran <github@samdoran.com>
2022-04-21 16:53:28 -05:00
3e1db5d753 git fix docs and wrapper script (#77588) (#77603)
* git fix docs and wrapper script

 fixes #77582

 now env var is set to wrapper or full command depending on version
 as was the intent of previous PR
 added ref to git commit from git for why/how we used the env vars

* handle key_file

(cherry picked from commit d06d99cbb6)
2022-04-21 16:53:07 -05:00
e51e36ea6a varaiblemanager, more efficienet vars file reads (#77570) (#77596)
(cherry picked from commit 2c2a204dc6)
2022-04-21 16:52:53 -05:00
9deb5ad45a [stable-2.13] Exclude Python 2.6 from interpreter discovery. (#77528)
(cherry picked from commit 32d67ce998)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-04-13 11:34:38 -05:00
8dedf7f06c Update Ansible release version to v2.13.0b0.post0. (#77508) 2022-04-11 11:39:45 -04:00
220917e2af New release v2.13.0b0 (#77502) 2022-04-11 10:57:40 -04:00
2cba3e8c42 Get git executable for collections in git repos (#77493) (#77500)
* Fix traceback installing collections from git repos if git is not installed

(cherry picked from commit 477c55b0d2)
2022-04-08 13:28:53 -05:00
c4901aa08f [docs][backport] 0407 weekly docs backports (#77490)
* INI: values with spaces can be single or double quoted (#77369)

(cherry picked from commit ac56647f4a)

* community_steering_committee.rst: add chairperson (#77454)

(cherry picked from commit 82c622a26a)

* Document how to release a collection  (#77391)

Co-authored-by: Divine Odazie <dodazie@gmail.com>
(cherry picked from commit 26631de88c)

* docs: Update porting guide for ansible 5.6.0 (#77466)

(cherry picked from commit 36371500b7)

* Trivial (#77467)

Co-authored-by: Iheanacho Amarachi Sharon  <58210919+Iheanacho-ai@users.noreply.github.com>
(cherry picked from commit e8dbc84afe)

* Update installing_collections_file.rst (#77439)

(cherry picked from commit 6da4186f6e)

* template module: document jinja2_native behavior (#77445)

(cherry picked from commit a85261342a)

* avoid recursion in example (#77436)

(cherry picked from commit d7d2afd203)

* Clarifying how handlers are handled (#77372)

(cherry picked from commit 7126bfc61c)

Co-authored-by: Dr. András Korn <korn-github.com@elan.rulez.org>
Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
Co-authored-by: David Moreau Simard <moi@dmsimard.com>
Co-authored-by: Travis Michette <tmichett@redhat.com>
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2022-04-08 12:54:36 -05:00
bd1da60bf2 Ensure correct environment_class is set on Template (#77485) (#77488)
(cherry picked from commit c7e198b907)
2022-04-07 10:46:38 -05:00
30f96bb75e [stable-2.13] ansible-test - Don't fail if network cannot be disconnected (#77472) (#77482)
* Don't fail if network cannot be disconnected

* add clog frag
(cherry picked from commit 66c5844)

Co-authored-by: Matt Martz <matt@sivel.net>
2022-04-07 08:45:23 -05:00
3b20b02272 [stable-2.13] Fix sanity test crash. (#77475)
(cherry picked from commit 6216c9fc93)

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-04-07 08:45:08 -05:00
6b6b324618 [docs][backport][2.13] Backportapalooza 3-31 (#77438)
* add links.yml to collection structure docs (#77415)

* add links.yml to collection structure docs
* fix link
* Update docs/docsite/rst/dev_guide/developing_collections_structure.rst

(cherry picked from commit 8caa6efaab)

* Example is a single play, not a playbook

(cherry picked from commit bf8e186c68)

* Fix list formatting (#77354)

(cherry picked from commit e918cfa588)

* Most Matrix channels are ansible.com and not .im (#77352)

(cherry picked from commit 6557a60d08)

* Docs cheatsheet - skeleton and ansible-playbook (#76655)

(cherry picked from commit 21addac5da)

Co-authored-by: rwhector <richard@walnut.gen.nz>
Co-authored-by: Christian Adamini <christian.adamini@invision.de>
Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2022-04-05 15:29:38 -05:00
f720c58949 winrm - ensure callers PATH for kinit is set (#77401) (#77404)
* winrm - ensure callers PATH for kinit is set

* Fix unit test expectations

* Fix type annotation

(cherry picked from commit 60b4200bc6)
2022-04-05 15:29:28 -05:00
85341c3e5d [stable-2.13] Catch ImportError when pyyaml doesn't have libyaml extension (#77434) (#77459)
* [stable-2.13] Catch ImportError when pyyaml doesn't have libyaml extension (#77434)
(cherry picked from commit e3aa73c)

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

* Add test to assert that missing libyaml doesn't result in an error. Fixes #77437

(cherry picked from commit 2797dc644a)
2022-04-05 15:28:56 -05:00
ee9705a1ce [stable-2.13] ansible-test - Fix origin host target filtering.
(cherry picked from commit 4b51e61645)

Co-authored-by: Matt Clay <matt@mystile.com>
2022-03-30 15:41:19 -07:00
708e4c206a ansible-test - Update default test containers. 2022-03-28 15:27:04 -07:00
7075fa36a1 Bump requirements for antsibull to 0.42.0 (which depends on antsibull-changelog >= 0.14.0). (#77362) 2022-03-28 16:24:29 -04:00
93d0ea0215 Update core porting guide generation. 2022-03-28 13:16:28 -07:00
3e491db466 Porting guide fixes. (#77376)
* Update porting guide generation.
* Fix 2.13 porting guide link.
2022-03-28 11:57:10 -07:00
4723eb9caa Add family fallback for RHEL to register as RedHat (#77371)
* Add family fallback for RHEL to register as RedHat

* Update tests to properly assert RHEL behavior
2022-03-28 11:47:09 -05:00
f03624e295 clarify how to customize ansible cli output (#77357) 2022-03-28 03:32:47 -07:00
babc26adc1 Handle errors during ansible-doc --metadata-dump more gracefully (#77035)
* Add option --no-fail-on-errors to return errors for ansible-doc --metadata-dump in JSON result instead of failing.

* Adjust changelog fragment.

* Add basic tests.
2022-03-26 09:14:57 -04:00
55f90ba31f ansible-test - Remove RHEL 9.0b support.
Support can be restored once RHEL 9 has been released.
2022-03-25 15:18:47 -07:00
afecc6400e Action Plugin argspec validation (#77013) 2022-03-25 11:53:32 -05:00
4635c75ef7 log results for get_best_parsable_locale (#77319)
* log locale outcomes from function
* also included variant forms of same prefs
2022-03-24 18:16:33 -04:00
2e69b5867e Creat steering committee docs (#77330)
Co-authored-by: Aine Riordan <44700011+ariordan-redhat@users.noreply.github.com>
2022-03-24 16:50:29 -04:00
ff184b0815 SID - Use literal UPN value when attempting a user to SID lookup (#77334) 2022-03-25 05:01:45 +10:00
27aa2612d9 Add what to look for in PyYAML documentation (#77323)
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2022-03-24 14:24:24 -04:00
fa12af9042 Revision: "Address Docs: How to report bugs" #53520 (#77269) 2022-03-24 14:21:50 -04:00
1bdcb56249 Improve documentation to fix outdated file paths (#77341)
Co-authored-by: njthanhtrang <njthanhtrang@users.noreply.github.com>
2022-03-24 14:18:33 -04:00
ffda8ccbbd Incorrect parent role paths var description (#77342) 2022-03-24 14:11:36 -04:00
0a5b2e88f3 Fix quotes (#77346) 2022-03-24 14:07:19 -04:00
ea7f24a1d5 Support ignoring of certificates for ansible-galaxy during SCM cloning (#67616)
* Support ignoring of certificates for ansible-galaxy during SCM cloning

* Add integration tests installing a role from an untrusted repository

Test installing the role without --ignore-certs fails
Test installing the role with --ignore-certs is successful
2022-03-24 13:56:21 -04:00
2769f5621b Add find_spec and exec_module to RestrictedModuleLoader (#76427)
* Add find_spec and exec_module to RestrictedModuleLoader

* Fix getting new loader with correct path

Fix pep8 errors

* Use convert_ansible_name_to_absolute_paths instead of the loader path

* Apply suggestions from code review

* Fix type hints and test them in CI

* Fix error message for ansible.module_utils.basic if it's missing

Add mypy ignored missing imports for controller sanity tests

* Add mypy attr-defined ignore entries for python 3.8, 3.9, 3.10 for vendored six

Add mypy attr-defined ignore for python 2.7 in lib/ansible/utils/collection_loader/_collection_finder.py

* Just test controller python versions to simplify ignoring mypy errors
2022-03-23 13:55:37 -07:00
f96a661ada ansible-galaxy - add configuration options for more flexible collection signature verification (#77026)
* Add a toggle to control the number of signatures required to verify the authenticity of a collection

* Make the default number of required valid signatures 1

* Add option to make signature verification strict and fail if there are no valid signatures (e.g. "+1")

* Use a regex to validate --required-valid-signature-count

* Add a toggle to limit the gpg status codes that are considered a failure

* Update documentation and changelog

* Add unit and integration tests for the new options

* Fixes #77146

Fix using user-provided signatures when running 'ansible-galaxy collection verify ns.coll --offline'

Add a test for a user-provided signature when running ansible-galaxy collection verify with --offline

Fix displaying overall gpg failure without extra verbosity

Add a test for displaying gpg failure without verbosity

Improve documentation to be more clear that signature verification only currently applies to collections directly sourced from Galaxy servers
2022-03-23 16:41:27 -04:00
21827522dc Add quickstart testing docs for collections (#77290)
Co-authored-by: Divine Odazie <dodazie@gmail.com>
Co-authored-by: Emmanuel Ugwu <32464178+ugwutotheeshoes@users.noreply.github.com>
2022-03-23 16:07:32 -04:00
82e5f368e1 Reduce intro install to just pip (#77178) 2022-03-23 15:56:45 -04:00
8a86fa602d Simplify documentation for search paths (#73818) 2022-03-23 15:55:40 -04:00
bf00a14f91 linux networking facts: Provide IPv4 prefix (#77193)
For IPv6 addresses, Ansible already provides the prefix length for IP
addresses in the `prefix` fact. This patch adjusts the facts for IPv4
addresses to also contain the prefix length in the prefix fact. This
makes it easier to use the facts consistently when the CIDR notation is
needed.

Signed-off-by: Till Maas <opensource@till.name>
2022-03-24 04:47:01 +10:00
14098d9b04 typo variable reference (#77327) 2022-03-22 16:25:46 +01:00
4baf18c573 Remove more Python 2.x compatibility code from controller. (#77320) 2022-03-22 16:19:53 +01:00
c1a34d5a63 Update systemd strategy to not confuse NetworkManager (#77243)
* Update systemd strategy to not confuse NetworkManager. Fixes #76958

* Add tests
2022-03-21 09:32:41 -05:00
1100289a45 docker_util: Handle error in JSON parsing (#77298)
While getting hostname from container, podman command
fails to return JSON so wrap exception and return
hostname as 'None'

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2022-03-21 08:45:45 -05:00
68b5db328f Update ansible extension information (#77235)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2022-03-17 16:55:52 -04:00
34e60c0a7a ansible_distribution: Add support for Uos/Deepin (#77275)
* ansible_distribution: Add support for Uos/Deepin

* Add changelog fragment.
2022-03-18 05:22:23 +10:00
4d984613f5 validate-modules for plugins: do some more schema validations so that some issues that are currently reported for modules are also reported for plugins (#77268)
* Add more sanity tests on schema level (so they also work for plugins).

* Fix various issues the sanity test reported.

* Add changelog fragment.

* Fix function name.
2022-03-18 05:16:40 +10:00
e3c72230cd unarchive: fix io_buffer_size option, remove ignore.txt entry (#77271)
* Fix io_buffer_size option.

* Remove ignore.txt entry by adding action plugin only options to module's argument spec.

* Add changelog fragment.

* Adjust unit tests.
2022-03-18 05:15:13 +10:00
c555ce1bd9 Update intro_patterns.rst (#77300)
Describe difference between targeting a single host using -i vs. --limit.  In particular, pointing out the behavior difference that -i will not rad inventory variables.
2022-03-17 14:57:37 -04:00
94b73d66d5 inventory manager respect --flush-cache (#77083) 2022-03-17 14:15:03 -04:00
c9db73f04e Add a YAML representer for NativeJinjaText (#77282)
Fixes #77280
2022-03-16 11:24:21 +01:00
d8687bd015 docs: Update porting guide for Ansible 5.5.0 (#77287) 2022-03-15 16:06:07 -04:00
dfda04894f stub out ipaddr page and point to new home (#77281) 2022-03-14 13:27:06 -07:00
6546c484f4 Address Docs: How to report bugs #53520 (#77214) 2022-03-11 10:22:40 -05:00
1a923e307e After 2.10 Collections can use vars plugins (#77216) 2022-03-11 10:17:10 -05:00
e8afdac06e ansible-test - Fix delegation inventory path. 2022-03-10 18:17:49 -08:00
b60a5eefb2 Include links to the modern homes of the windows modules (#77220) 2022-03-10 16:53:57 -05:00
496f51ceac get_url fix word emphasis on documentation (#77247) 2022-03-10 16:23:31 -05:00
3c72aa32d6 Add ansible devtools working group in community communication 2022-03-10 11:19:08 -08:00
7cb581ed2c Support podman-remote in ansible-test (#75753) 2022-03-09 15:59:29 -06:00
1ba3ead0a0 Update developing_modules_general_aci.rst (#73925) 2022-03-09 15:49:02 -05:00
0c514bcf54 ansible-test - Fix PS coverage --all generation. 2022-03-09 12:35:23 -08:00
6f445ca6e5 Remove obsolete Python 2.x controller code. 2022-03-08 16:32:06 -08:00
f68c66a3ef Remove collections compat from controller code. 2022-03-08 16:11:40 -08:00
822fddd627 Fix yaml loader and compat. 2022-03-08 12:51:33 -08:00
f43c54d890 ansible-test - Update default containers to 5.7.0. 2022-03-08 12:51:10 -08:00
3d5637beec Initial mypy sanity test support for core. 2022-03-08 09:26:14 -08:00
27923aad7e Add inline type hint ignores. 2022-03-07 16:45:19 -08:00
2a2b7dc42a Update include role to match the base class.
Use frozenset instead of tuple.
2022-03-07 16:45:03 -08:00
4867ac217b Code cleanup for type hinting issues. 2022-03-07 13:24:39 -08:00
8063643b4c Fix collection redirects for filter and test plugins (#77210)
* Fix collection redirects for jinja2 filters/tests

* Handle recursive redirects

Co-authored-by: Matt Martz <matt@sivel.net>
2022-03-07 15:39:56 -05:00
50d28de9ba Make ansible_index.rst more readable (#77225) 2022-03-07 13:55:59 -05:00
7c81a652c0 Type hint fixes. 2022-03-07 10:26:40 -08:00
3a3c496ade Remove obsolete Python 2.x compat code. 2022-03-07 09:21:46 -08:00
0c4c18bc04 Type hint fixes. 2022-03-04 17:09:50 -08:00
e6f63be7a4 Honor --quiet parameter properly in fish shell (#77180)
* The `^` stderr redirection is deprecated
* Setting `-q` for `setup.py` in `gen_egg_info` is redundant
2022-03-05 07:04:54 +10:00
8b2e628565 galaxy - Clean up type hints and imports. 2022-03-04 10:33:02 -08:00
0990c4ca7c Extend validate-modules to also validate plugins (#71734)
* Let validate-modules also validate plugins.

* Support 'option' in 'cli'.

* Use DOCUMENTABLE_PLUGINS instead of UNDOCUMENTED_PLUGIN_TYPES.

* Support 'keyword', clean up error codes.

* Call settings.process_errors only once; remove __version__.

* Add changelog fragment.
2022-03-04 09:08:34 -05:00
7d234a40ee Point to AH docs (#77200) 2022-03-04 02:33:31 -08:00
af2b1361ff ansible-test - Simplify type hints. 2022-03-03 16:34:25 -08:00
ea66cf189b Fix ansible console to respect ANSIBLE_STDOUT_CALLBACK (#77182)
* Fix ansible console to respect ANSIBLE_STDOUT_CALLBACK

This makes the ansible-console able to customize the stdout callback.
Ansible console currently uses statically minimal callback.

* Add changelog

* Move the fragment changelog in the right directory
2022-03-04 09:40:23 +10:00
871b2ca73a Simplify existing type hints. 2022-03-03 14:26:47 -08:00
ccdb552d90 More type hint fixes for module_utils. (#77198)
* Type hint fixes for module_utils.
* Fix type hints in module_utils.facts.
2022-03-03 11:20:29 -08:00
86f00bd156 Update example to work (#77191)
`with_first_found` only takes a list of things, it's not like `tags`
where it can take a thing or a list of things.

Inspired by locally discovered breakage and then finding
https://github.com/ansible/ansible/issues/77136 where someone was also
doing this and getting into trouble.
2022-03-04 05:09:13 +10:00
e314f4e666 Add typing to module_utils.compat. (#77197) 2022-03-03 10:48:42 -08:00
5a1b891917 Additional type hinting cleanup. (#77188) 2022-03-02 16:10:44 -08:00
74a204e6f1 first_found: allow spaces in names (#77141)
* first_found: allow spaces in names

Fixes #77136
2022-03-02 16:16:47 -05:00
1286513947 module_utils - Fix type hinting issues. 2022-03-02 13:09:07 -08:00
8e45925415 hostname - Use base class on UnimplementedStrategy
This requires moving UnimplementedStrategy below BaseStrategy and Hostname below UnimplementedStrategy.
2022-03-02 12:14:10 -08:00
35ef2af0ce Fix type hints and variable usage in modules. (#77184)
* Remove unused variables.
* Fix conflicting variable name.
* Add type hints.
2022-03-02 11:52:51 -08:00
6de04e8be6 Fix module exception handlers.
Exception handler variable names should not conflict with other variables.

Use Python 2.6+ exception handler syntax.
2022-03-02 11:34:11 -08:00
d31730d781 Fixes for type hinting issues. (#77170) 2022-03-01 17:14:26 -08:00
7b0fb114be Data tagging and sidecar docs are delayed, and will be retargeted for 2.14 (#77173) 2022-03-01 11:37:55 -06:00
b667409d6d ansible-test - Correct a typo in comments (#77148) 2022-03-01 16:04:38 +01:00
a06fa496d3 ansible-test - Code cleanup and refactoring. (#77169)
* Remove unnecessary PyCharm ignores.
* Ignore intentional undefined attribute usage.
* Add missing type hints. Fix existing type hints.
* Fix docstrings and comments.
* Use function to register completion handler.
* Pass strings to display functions.
* Fix CompositeAction handling of dest argument.
* Use consistent types in expressions/assignments.
* Use custom function to keep linters happy.
* Add missing raise for custom exception.
* Clean up key/value type handling in cloud plugins.
* Use dataclass instead of dict for results.
* Add custom type_guard function to check lists.
* Ignore return type that can't be checked (yet).
* Avoid changing types on local variables.
2022-02-28 14:37:09 -08:00
8291dbdf81 add accessibility guidelines to docs style guide (#77145)
Co-authored-by: Jill R <4121322+jillr@users.noreply.github.com>
2022-02-28 16:40:32 -05:00
27fe26edbf Update setup_pexpect to prefer pip user installs.
This works around issues on RHEL 7.9 when an old version of pexpect is installed from an OS package.
2022-02-28 13:22:56 -08:00
7657caa072 Fix 'ansible-galaxy collection verify' to display new files/dirs (#76690)
* Fix 'ansible-galaxy collection verify' to report files/directories not listed in the FILES.json

* changelog

* Fix bug in 2.13+
2022-02-28 16:15:10 -05:00
0d4219f265 Fix IPs for ipaddr filter in user_guide (#77151)
* Fix IPs for ipaddr filter in user_guide

* Apply suggestions from code review

Co-authored-by: Sandra McCann <samccann@redhat.com>
2022-02-28 13:52:19 -05:00
28a278ee48 fix spelling error in details (#77152)
correct inventory_hostname spelling error in include_vars and set_fact
modules

Signed-off-by: jbpratt <jbpratt78@gmail.com>
2022-02-28 13:22:17 -05:00
c3999d89f4 Clarify docs for using tests as filters (#77155) 2022-02-28 13:21:03 -05:00
43c2c983cc Fix type hints in galaxy. 2022-02-28 08:49:37 -08:00
68601601ce Docsite: update communication.rst (#77135)
\
2022-02-25 10:26:59 -05:00
22ba18d7b0 add links to remote_user docs (#77140)
* add links to remote_user docs
* shorten link name
2022-02-25 02:59:11 -08:00
dc6b0d4857 ansible-test - Remove obsolete display of MAXFD.
Use of ``subprocess.MAXFD`` only worked on Python 2.x, which is no longer supported.
2022-02-24 14:12:56 -08:00
3f924b59f2 use same timeout for galaxy api interactions (#77088)
Also, bump the default. A number of people have reported problems with
this 20 second timeout for a couple of years on
https://github.com/ansible/galaxy/issues/2302

It is mentioned in the issue that resolving dns can sometimes take up to
30 seconds, and that this timeout includes dns resolution.

Includes a changelog message
2022-02-24 15:58:13 -05:00
4f48f375a0 parameters: handle blank values when argument is a list (#77119)
Fixes: #77108

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2022-02-25 05:08:33 +10:00
d60efd9768 hostname module - fix TypeError in FileStrategy (#77025) (#77074)
* Use file_get_content() to read the file containing the host name
2022-02-25 05:05:52 +10:00
6a7009a84f use present tense in changelog example (#77138) 2022-02-24 11:05:02 -08:00
749063968b Temporarily remove RHEL 9.0b from the test matrix.
AppStream modules are currently missing.
2022-02-24 10:54:14 -08:00
5f258d2c64 move collection pr quickstart over (#77087)
* move collection pr quickstart over
* add link
* fix CI
* fix formatting
2022-02-24 09:30:00 -08:00
71dfe32ab6 76134 DOCS:Uninstall all packages before Ubuntu reinstall (#77137) 2022-02-24 09:29:06 -05:00
0bb70b6b9f AL2022 package-manager detection support (Amazon Linux) (#77050)
* AL2022 package-manager detection support (Amazon Linux)

* try/except

* use major_version

* check if dnf exists + add changelog fragment

* analogue logic
2022-02-23 15:30:58 -08:00
3f0d5bc351 Fix LooseVersion and StrictVersion refs in docs. 2022-02-23 14:52:45 -08:00
bdf37336c8 Update pylint deprecated plugin to use ansible-invalid* symbols (#77086) 2022-02-23 12:42:45 -08:00
143904f49b More informative playbook attribute errors (#77082)
* More informative playbook attribute errors

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2022-02-23 15:16:03 -05:00
8cbe1435c2 Use full python package for ansiballz cache filenames (#77090)
* Use full python package for ansiballz cache filenames

* Be a little more explicit about test goals
2022-02-23 14:10:43 -06:00
4f9c7fd509 ansible-test - Remove validate-modules symlink. 2022-02-23 10:47:14 -08:00
1a5853d794 Remove obsolete units.compat.mock compat layer. (#77118)
* Remove obsolete units.compat.mock compat layer.
* Update remaining units.compat.mock references.
2022-02-22 18:20:11 -08:00
5a6e05affb More strict pylint checking of ansible-test code. 2022-02-22 17:55:14 -08:00
b613808277 Remove obsolete unit test builtins compat. 2022-02-22 17:55:00 -08:00
2cd6cdc6a7 Fix duplicate unit test function names. (#77115)
* Fix duplicate unit test function names.
* Disable faulty tests.
2022-02-22 16:41:57 -08:00
0bd8106d15 Remove unused mock compat code.
The code is unreachable since Python 3 versions before 3.5 are not supported.
2022-02-22 16:09:22 -08:00
30d1a93d93 update changelog fragment guidance with examples (#77040)
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2022-02-22 14:02:39 -05:00
36121aeee7 docs: Update porting guide for ansible 5.4.0 (#77107) 2022-02-22 13:03:42 -05:00
0f41682473 Remove use of distutils in docs Makefile.
The current usage only works if `python` is Python 2.x since the syntax is invalid on Python 3.x.

When running on Python 3.x it would either be missing, or if Python 2.x was also present, incorrect.
2022-02-22 08:23:56 -08:00
ff25b51178 Fix example return value in docstring. (#77076) 2022-02-22 10:20:39 -05:00
b2bafc054e remove list of container images (#77089)
* remove list of container images
* remove some more centos8
2022-02-22 02:22:22 -08:00
92800a04c2 Add missing integration test dependency. 2022-02-21 19:06:39 -08:00
88bfb7193e Use --no-deps when installing amazon.aws and not testing dependencies (#77091) 2022-02-21 19:07:21 -05:00
901e3d43b1 describe how to generate a sample ansible.cfg (#77053)
* describe how to generate a sample ansible.cfg
* correct commands used
2022-02-21 06:53:14 -08:00
de9a3bda2c Fix warning in unit tests for _yaml import. 2022-02-17 17:48:27 -08:00
d3d5244912 ansible-test - Fail sanity test on distutils use. 2022-02-17 17:48:07 -08:00
c1a271c792 Remove unused task from template integration test. 2022-02-17 17:47:37 -08:00
d286c2e8b3 ansible-test - Fix CParser import in yamllint. 2022-02-17 17:47:18 -08:00
c27fd777f4 ansible-test - Use quay.io containers in plugins. 2022-02-17 13:31:44 -08:00
addb9baec2 ansible-test - Clean up venv code. 2022-02-17 10:52:25 -08:00
f2612ce169 apply owner/group permissions to top folder with unarchive module (#73024)
* apply owner/group permissions to top folder
* remove unused var unarchive30
* fix permissions for top folders if the tarball include multiple top folders
* added test for top folder ownership
2022-02-17 12:17:51 -05:00
84b85a5b5a more explicit moustache docs (#77051) 2022-02-17 10:28:12 -05:00
e620b96f49 Create collection maintainer's guide (#76976)
* initial merge of maintainer guide
* Apply suggestions from code review

Co-authored-by: Aine Riordan <44700011+ariordan-redhat@users.noreply.github.com>

Co-authored-by: Aine Riordan <44700011+ariordan-redhat@users.noreply.github.com>
2022-02-17 01:29:54 -08:00
177336a9d3 Avoid system-site-packages in AZP coverage venvs.
The use of `--venv-system-site-packages` was an optimization to use the `coverage` package pre-installed in the AZP test container.
However, now that the venv is bootstrapped by ansible-test that optimization no longer makes sense, since other downloads are already taking place.

ci_coverage
ci_complete
2022-02-16 23:33:49 -08:00
13d5381e56 ansible-test - Update base and default containers. (#77033) 2022-02-16 17:33:14 -08:00
494cb4e211 Ensure tests that need to validate higher verbosity messages run with vvvv 2022-02-16 16:59:49 -08:00
c688eb824b Add basic support for "apt-get clean" operation to apt module (#76758)
* adding apt-get clean functionality

 documentation and example
2022-02-16 12:01:26 -05:00
68fb3bf90e ansible-test - Fix consistency of managed venvs. (#77028) 2022-02-15 17:06:16 -08:00
fb01616c5a Revert "Temporarily remove RHEL 9.0b from test matrix."
This reverts commit a5eadaf3fd.
2022-02-15 15:36:09 -08:00
18251f3685 dnf: ensure releasever is passed into libdnf as str (#77024)
Fixes #77010
2022-02-15 10:12:47 -05:00
af7c9deb4e add crosslinks for changelog fragments (#77022) 2022-02-15 02:40:50 -08:00
1480503326 Update complex_data_manipulation example uptime in days/h/m/s (#77019) 2022-02-14 16:01:27 -05:00
f82b1ba67c Update indentation for example in playbooks_handlers.rst (#75348) 2022-02-14 15:08:52 -05:00
3779c1f278 restore inadvertently deleted default for convert_data. Fixes #77004 (#77016) 2022-02-14 08:21:17 -06:00
c9d3518d2f Fix final fact delegation (#77008)
* fix facts delegation loop overwrite

 partial revert of change to allow facts to be present in each loop iteration
 was not needed in final results as result processing alreayd had the disctiontion
 and ended up breaking the assumptions in the calling code.

 fixes #76676
2022-02-11 18:19:38 -05:00
56edbd2bbb Handle connection dissonance (#77005)
* play_context, compensate for existing plugins

 some connection plugins are not fully using the correct configuration,
 but this was previously hidden from them as play_context was providing
 the info instead, now play_context provides the 'correct' info, but hitting
 these bad configurations.
2022-02-11 16:26:02 -05:00
32f7490a2c Add note to serial docs (#77006)
* add note to serial docs
* add keyword directly
Fixes #76820
(cherry picked from commit de20f1bae8)
2022-02-11 11:15:12 -08:00
3a662ef2c1 Fix package-data sanity test for newer setuptools. 2022-02-11 10:45:01 -08:00
ef4c5cd61b ansible-test - Use newer pip to bootstrap FreeBSD. 2022-02-11 10:08:04 -08:00
8939f4d2f7 add tasks (#75489) 2022-02-10 16:20:23 -05:00
43e55db208 ansible-galaxy - add signature verification of the MANIFEST.json (#76681)
* ansible-galaxy collection install|verify:

  - Support verifying the origin of the MANIFEST.json when the Galaxy server has provided signatures.
  - Allow supplemental signatures to use during verification on the CLI/requirements file.

* ansible-galaxy collection install:

  - Support disabling signature verification. This silences the warning provided by ansible-galaxy if the Galaxy server provided signatures it cannot use because no keyring is configured.
  - Store Galaxy server metadata alongside installed collections for provenance. This is used by 'ansible-galaxy collection verify --offline'.

* Add unit tests for method that gets signatures from a Galaxy server

* Add integration tests for user-provided signature sources

- Test CLI option combinations
- Test installing collections with valid/invalid signature sources
- Test disabling GPG verification when installing collections
- Test verifying collections with valid/invalid signature sources

* Make signature verification advisory-by-default if signatures are provided by the Galaxy server

- Make the default keyring None
- Warn if the keyring is None but the Galaxy server provided signatures
- Error if the keyring is None but the user supplied signatures
- Error if the keyring is not None but is invalid

* changelog

* add ansible-galaxy user documentation for new options

Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: Andy Mott <amott@redhat.com>
Co-authored-by: John R Barker <john@johnrbarker.com>
2022-02-10 10:48:49 -05:00
d35bef68f5 replace - always return rc (#71963)
* Return rc=0 on success.

Error handling in playbooks generally expects `rc` to be set to 0 when a module has not failed.  Playbook authors should not have to check for the existence of `rc` first.

* Use single definition and added changelog

* Fix up tests with new return value

Co-authored-by: Jordan Borean <jborean93@gmail.com>
2022-02-10 06:23:04 +10:00
b145732973 Resubmit: Use SystemdStrategy for Debian in the hostname module (#76929)
* add DebianStrategy tests
* ensure hostname can be changed by using become
* use Systemd strat for debian and Base for generic.
* add test to ensure all strategies are available

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2022-02-09 10:26:42 -05:00
522f9d1050 Make builtin.file modification times support check_mode (#76973)
* Make builtin.file modification times support check_mode
* Add integration test
2022-02-08 17:19:36 -05:00
0d40423f1c ansible-test - Fix collection loader import. (#76986)
* ansible-test - Fix collection loader import.

Resolves https://github.com/ansible/ansible/issues/76960
2022-02-08 11:38:00 -08:00
699ecb8308 improve warnings from service_facts (#76921)
be more permissive, allow query more statuses
might create a slew of warnings though, but can depend on
how individual services are permissioned
2022-02-08 13:05:21 -05:00
47faa6e206 clean_facts only show variable name (#76974) 2022-02-08 11:27:40 -05:00
eb093ae7c3 Added a powershell example for ansible.builtin.script (#76980)
* Added a powershell example

None of the examples are of a form that actually works with powershell/windows hosts. The added last example actually works with Windows hosts and Ansible. Inspired by: https://devops.stackexchange.com/questions/15409/ansible-how-to-run-local-powershell-script-on-remote-hosts

* Trivial PEP fix
2022-02-08 10:38:49 -05:00
8582df36c5 Remove misleading note in template doc fragment. Fixes #61233 (#76955) 2022-02-08 10:26:37 -05:00
0d5401d950 ansible-test - Remove unused code.
This was overlooked in a previous commit that removed FreeBSD 12.2 support.
2022-02-07 14:36:14 -08:00
00a2b7788e ansible-test - Remove cap on cryptography version. 2022-02-07 14:35:52 -08:00
e27b94c467 ansible-test - Update alpine3 container to 3.3.0.
This updates the base image from 3.14.2 to 3.15.0, which includes support for installing binary wheels using pip.
2022-02-07 14:02:58 -08:00
d4c9c103e2 ansible-pull handlle empty node/hostname return (#76965) 2022-02-07 16:10:30 -05:00
6d2d476113 avoid polluting vars with incorrect settings (#76590)
avoid polluting vars with incorrect settings

 simplify variables and templars
  - variables, original, only updated with final results, reset are copies of this
  - tempvars used for preliminary templating
  - cvars used for connection/shell/become plugins, delegation aware
  - vars_copy ignore tempvars updates and use connection plugin to get 
    finalized version per loop item/delegation,  also used to store temp results
    till we are ready to update 'variables'
 - fine tune nolog just cause we are here
 - also fix inventory_hostname_short for IP addresses
2022-02-07 16:09:28 -05:00
b493c590bc Bypass fragile git ssh wrapper (#73404)
git module now uses env vars exclusively

  - updated docs to clarify usage
  - now env vars append instead of overwrite to allow existing custom setups to keep working
    fixes #38104, #64673, #64674
  - added note for hostkeychecking more securely
    fixes #69846
  - keep script cause old versions still choke on env
  - env var cannot hold more than 'command' for older versions
  - all ssh_opts in one place
2022-02-07 16:05:16 -05:00
be19863e44 ssh connection: use 'correct' host in all cases (#76017)
ssh plugin, use 'correct' information source in all cases
  * still fallback to pc
  * added inventory to new test
  * undef var can still show as parser error on pc
    now task_exectuer has a  more accurate error handling
2022-02-07 15:13:40 -05:00
a5eadaf3fd Temporarily remove RHEL 9.0b from test matrix.
Installation of `gcc` is failing while trying to install dependencies:

```
[MIRROR] libxcrypt-devel-4.4.18-3.el9.x86_64.rpm: Interrupted by header callback: Server reports Content-Length: 32565 but expected size is: 33101
```
2022-02-07 10:56:19 -08:00
5bddecb048 gather_facts sees collection networking connection (#76954)
needed to properly propagate some arguments by convention: subset, filter

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2022-02-07 09:57:38 -05:00
9a4ff01a4f Cleanup of cannned responses (#76689)
* removed those made obsolete by bot
 * tried to rephrase to be more informative and require less updates in the future

Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: John R Barker <john@johnrbarker.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2022-02-04 10:37:53 -05:00
394d216922 add_host/group_by: fix using changed_when in a loop (#71719)
Fixes #71627
Fixes #75971
2022-02-04 12:35:23 +01:00
2749d9fbf9 incidental - remove win_lineinfile coverage (#76952) 2022-02-04 11:59:35 +10:00
e2d4c41ac0 Update codecov download URL.
ci_complete
ci_coverage
2022-02-03 13:59:27 -08:00
65987e86a9 Added package reference for Debian to resolve error (#76876) 2022-02-03 16:22:39 -05:00
17dd9ff924 ansible-test - Update default containers to 5.5.0. 2022-02-03 13:12:37 -08:00
5448661aec Update 'Ansible and BSD' section 'Setting the Python interpreter'. (#76825) 2022-02-03 15:40:04 -05:00
a1af1d94cd vmware: Migrate VMware Scenario Guides (#76640)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2022-02-03 15:32:03 -05:00
0ca19a5b73 Update windows_winrm.rst (#76835)
Co-authored-by: Jordan Borean <jborean93@gmail.com>
2022-02-03 15:30:21 -05:00
9a9ef01997 Update 'Installing Ansible on FreeBSD'. (#76849)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
2022-02-03 15:29:25 -05:00
3108c51764 Add note about installing python on macOS (#76873) 2022-02-03 15:16:57 -05:00
53e4760b8c More accurate help message for verbosity setting (#76887) 2022-02-03 15:09:26 -05:00
a926b1dbab Stop publishing code coverage to the AZP UI.
Azure Pipelines only supports publishing a single code coverage file.
This limits us to reporting on either Python or PowerShell.
It also prevents us from reporting coverage per test command without further aggregation.
Most of our users are only aware of the reports published to codecov.io.
2022-02-03 11:53:18 -08:00
e1cf6af06d add undef() keyword to core 2.12 porting guide (#76880) 2022-02-03 14:45:11 -05:00
10fd7bf12c docs: update porting guide for Ansible 5.3.0 (#76917) 2022-02-03 14:31:52 -05:00
1f4e50f178 Ansible 6 roadmap: simplify collection inclusion process (#76932)
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2022-02-03 14:30:49 -05:00
2767a4cf4a docs - remove broken link in ACI scenario guide (#76940) 2022-02-03 14:29:15 -05:00
bc1e29d722 Bump antsibull version from 0.40.1 to 0.41.0 and ansible sphinx theme version to fix HTML generation in return value tables (#76759)
* Use Jinja2 comment instead of HTML comment to avoid W3C validator warning (-- inside comment).

(For those interested in the history of this: http://www.howtocreate.co.uk/SGMLComments.html#doubledash)
2022-02-03 13:53:22 -05:00
b568e0db6f ansible-test - Remove outdated remote support. 2022-02-03 10:27:36 -08:00
7e64c4fe55 ansible-test - Update bootstrap URL to not use S3. 2022-02-02 18:43:03 -08:00
6c29028f05 Update ci-files URL in integration tests.
This uses the CloudFront URL instead of going directly to S3.
2022-02-02 17:56:50 -08:00
cbb994f174 make Ansible.Basic work on non-Windows (#76924) 2022-02-02 12:48:33 +10:00
41db6d8d35 Fix task path unicode error in junit callback. 2022-02-01 09:58:02 -08:00
3c8861d1ba Fixed handling of sleep arguments during service restarts on AIX (#76878)
Fixes #76877
2022-02-01 16:18:38 +01:00
ea34fdbfe2 Misc typo fixes in plugins directory (#76566) 2022-02-01 07:18:33 +05:30
995d7e4db3 ansible-test - Limit installed pyopenssl version. 2022-01-31 16:12:32 -08:00
2bd074b486 doc: fix Jinja2 doc link templating playbook (#76889)
Signed-off-by: Stephen Lawrence <stephen.lawrence@renesas.com>
2022-01-31 16:15:43 -05:00
fbb5d56bd2 ansible-test - Use relative paths in junit output. (#76871)
* ansible-test - Use relative paths in junit output.

Also fix a traceback in the junit callback during automatic fact gathering.

* ansible-test - Handle out-of-tree JUnit paths.
2022-01-31 11:19:23 -08:00
fee90b15a2 Misc typo fixes in module_utils (#76564) 2022-01-31 22:53:06 +05:30
b1d6750e8b fix block var inheritance (#75287)
* updated tests to conform to new block inheritance

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2022-01-31 12:21:50 -05:00
29b5eb6ba9 updated metadata dump to do full docs dump (#76170)
* minor refactor in other options by pushing common code into functions
 * consolidate coll_filter
 * more normalizing loader
 * dont pass plugin_loader, its global import
 * Also dump roles and collections
 * adjusted tests to new err msg
 * disable namespace filter (unused)
2022-01-31 10:48:16 -05:00
d19b506ce8 ansible-test - Clean up future boilerplate. (#76874)
* ansible-test - Clarify need for empty __init__.py
* ansible-test - Update code-smell boilerplate.
* Update code-smell boilerplate for core.
* Update future boilerplate test for ansible-test.

All ansible-test code (except for targets) and core-specific sanity tests now use the same boilerplate.

The test also checks for unwanted `__future__` and `metaclass` boilerplate.

* Relocate target tools to the correct directory.

Several tools used on target Python versions were incorrectly placed in the controller directory.
2022-01-28 13:48:34 -08:00
3816815db0 Track failures in the includes results to avoid special handling of include errors (#53688)
* Make include_role/include_tasks work with any_errors_fatal v2

Fixes #50897

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

* Add failed to results in free strategy too

* Fix

* Avoid duplicating results

* ci_complete

Co-authored-by: Matt Martz <matt@sivel.net>
2022-01-28 13:35:19 -06:00
f501b579e5 ansible-vault encrypt_string: fix --output to write into file (#76856)
Fixes #75101
Fixes #59590
2022-01-28 09:34:59 +01:00
18ed2c64e5 ansible-test - Add default for Windows remotes. 2022-01-27 18:14:15 -08:00
26b43f425f ansible-test - Validate collection ns and name.
Resolves https://github.com/ansible/ansible/issues/62079
2022-01-27 17:24:40 -08:00
de5f60e374 ansible-test - Improve help for unsupported cwd. (#76866)
* ansible-test - Improve help for unsupported cwd.

* The `--help` option is now available when an unsupported cwd is in use.
* The `--help` output now shows the same instructions about cwd as would be shown in error messages if the cwd is unsupported.
* Add `--version` support to show the ansible-core version.
* The explanation about cwd usage has been improved to explain more clearly what is required.

Resolves https://github.com/ansible/ansible/issues/64523
Resolves https://github.com/ansible/ansible/issues/67551
2022-01-27 12:32:11 -08:00
07bcd13e6f Replace file handling with context managers in files-modules and parsing vault. (#65371) 2022-01-28 06:11:28 +10:00
029c991b0d ansible-test - Update outdated links in comments. 2022-01-27 11:33:18 -08:00
3cf71ddf69 The final output_dir pr (#76862) 2022-01-27 11:26:30 -06:00
bc5672d9ba Update developing_modules_general_windows.rst (#76846) 2022-01-27 09:28:25 +10:00
a5283d67ee add quoted examples (#76858) 2022-01-26 14:12:07 -05:00
ee80e856c2 Remove more whitelist and blacklist occurances (docs only). (#76845) 2022-01-26 14:08:20 -05:00
ebea751805 Roadmap for Ansible 6 (#76772)
Co-authored-by: John R Barker <john@johnrbarker.com
2022-01-26 13:26:20 -05:00
e9af4195be update ansible.legacy docs (#76839)
* update ansible.legacy docs

* correct role description

* Update docs/docsite/rst/dev_guide/developing_locally.rst

* Update docs/docsite/rst/dev_guide/developing_locally.rst
2022-01-26 12:17:18 -05:00
6bca0a5dc2 docs: add fqcn to module examples (#73546)
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-26 11:57:58 -05:00
29de2cccba Fix task debugger to work with run_once using linear strategy (#76814)
* Fix task debugger to work with run_once using linear strategy

Fixes #76049

* Fix clog

* Add integration test
2022-01-26 08:43:12 -06:00
cad200406a group2 - switch to setup_remote_tmp_dir instead of using output_dir (#76853)
* group2 - switch to setup_remote_tmp_dir instead of using output_dir

* output_file needs to be in the tmp dir

* Use comparison that should work with macos

* remove unused dep
2022-01-26 08:31:19 -06:00
73dd2c3607 Added restart to the argument condition for AIX (#76841)
* Added restart to the argument condition for AIX

This should fix the issue https://github.com/ansible/ansible/issues/76840
2022-01-26 09:29:01 -05:00
e9ffcf3c85 ansible-test - Defer loading of completion entries. (#76852)
* ansible-test - Defer loading of completion entries.

This avoids a traceback when running ansible-test outside of a supported directory.
2022-01-25 13:24:17 -08:00
ddc4b1716b Mention ansible-core 2.11 RPM package in Ansible Core Installation Guide (#76801) 2022-01-25 13:56:52 -05:00
61bd779335 add core roadmaps to ansible docs (#76818)
* add core roadmaps to ansible docs
* make older roadmaps also show up
2022-01-25 03:14:55 -08:00
dbde2c2ae3 user module password expiration fixes (#75390)
* allow inputting 0 for password_expire_{min|max}
   0 is meaningful for min days (any time)   
   0 is technically valid for max_days
* add test for setting both min and max expiry
* [0] return result of execute_command from set_password_expire*
* [1] better return for set_password_expire
* [2] handle returns from set_password_expire*
* only set password expiry if user exists
* collect return-handling code
* combine password min and max into one execution
* handle case where spwd is not present like on macOS and FreeBSD

Co-authored-by: Sam Doran <sdoran@redhat.com>
2022-01-24 14:52:38 -05:00
5a69023941 remove ansibot from collection docs (#76817)
* remove ansibot from collection docs
* Update docs/docsite/rst/community/collection_development_process.rst
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-24 10:50:21 -08:00
3889ddeb4b iptables - added a `chain_management` parameter to control chain (#76378)
creation and deletion

fixes #25099
closes #32158
2022-01-24 12:31:20 -05:00
d5a740ddca doc_fragments/files.py: fix "objecs" typo (#76822) 2022-01-24 10:14:20 -05:00
04d4900518 config, moved 'choices info to keys (#76569)
* config, moved 'choices' from wall of text, to keys
* updated to ensure all pythons handle the 2 modes correctly
* Update lib/ansible/config/base.yml

Co-authored-by: Sandra McCann <samccann@redhat.com>
2022-01-21 12:50:24 -05:00
864c2591b6 Use explicit keyword for plugin config (#75158)
* go back to keyword being explicit for plugin configs instead of using option name as implicit match
* switch spec to singular, no changes needed since no one used
2022-01-21 12:48:42 -05:00
96ce4804ee Resolve perf issue with async callback events (#76783)
* Don't send full task with async callback events. Fixes #76729

* Use args for async_status task, instead of k=v

* Make sure we send back the async task attrs for polling

* Add clog frag

* load is a staticmethod
2022-01-21 11:47:32 -06:00
d7d1bd6269 Fallback to os family for interpreter discovery distro map. Fixes #75560 (#76815) 2022-01-21 11:46:45 -06:00
cfe4bdc1b9 Create separate core vs collection contributor guides (#76764)
* updated core guides
* ansible package docs guides
* add core guide to Ansible docs
* Update docs/docsite/rst/community/maintainers.rst
2022-01-21 08:31:52 -08:00
8c06aada10 Module Logging with WSL2 (#76375)
* adding systemd daemon import

* adding coments and AttributeError exception

* adding minor fix to repeated syntax

* adding changelog
2022-01-21 10:27:36 -06:00
8febd37f32 Attach concat func to an environment class (#76282)
* Attach concat func to an environment class

ci_complete

* clog and docstrings
2022-01-21 09:34:15 -06:00
9f46f6eb30 Attempt 2: Catch errors getting filters and tests (#76806) 2022-01-21 05:30:42 +10:00
374720fc97 Do not require SystemdStrategy subclasses for every distro (#76800) 2022-01-21 05:25:52 +10:00
36519ff95e Parameterize disable_lookups (#76770)
Allow inventory plugins to enable/disable lookups in the compose templating
2022-01-19 10:49:50 -05:00
553e75df95 Remove obsolete skip/windows test aliases. 2022-01-18 17:20:25 -08:00
29bdb8bf1e Compare FQCN also in lockstep logic. Fixes #76782 (#76787) 2022-01-18 13:57:42 -06:00
6de06377d0 Fix documentation around the password parameter of builtin.user (#76702) 2022-01-18 13:14:51 -05:00
2e0fb34937 Change "fatal" to "error" in config docs to match actual behaviour (#76760) 2022-01-18 10:38:34 -05:00
7cd94dd452 Fix unsafe handling of variable PYTHON_BIN (#76767)
The previous state lead to errors, when cloning the repo to a path with spaces in it.
2022-01-18 16:13:33 +01:00
a0f6747f07 ansible-test: fix typo in validate-modules (#76765)
The correct error strategy for the to_text method is surrogate_or_strict

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
2022-01-18 16:12:34 +01:00
89c884e2a2 include_vars initialize failed (#76754)
* include_vars initialize failed

  if source dir is given, but not present and traversal is empty you
  can end up trying to access failed w/o it ever being defined.

  also future proof for more corner cases in decision tree
2022-01-18 16:04:41 +01:00
4676c08f18 prevent fact gathering from breaking on bad caps (#76691)
* prevent fact gathering from breaking on bad caps

 fxies #75832
2022-01-14 13:24:50 -05:00
2246ed9678 ansible-config avoid _terms and _input in --only-changed (#76597)
dont display _terms or _intput on only changed
 those always change and it expected for the plugins that support them


Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2022-01-14 13:21:57 -05:00
0ff80a15ba ssh connection avoid parsiing own debug (#76732)
- Avoids false positives on become strings being echoed back 
   by ssh cli itself
  - added test for debug lines
  - also simplified some of existing test code
2022-01-13 16:28:09 -05:00
9142be2f6c Allow specifying specific python via shebang (#76677)
modules with python were always normalized to /usr/bin/python,
  while other interpreters could have specific versions.

* now shebang is always constructed by get_shebang and args are preserved
* only update shebang if interpreter changed
* updated test expectation
* added python shebang test
2022-01-13 15:05:58 -05:00
7fff408652 ansible-test - Remove azure support for Sherlock. 2022-01-13 10:38:22 -08:00
c8dd96b076 fact gathering, prevent "UnboundLocalError: local variable 'datafile' referenced before assignment" when open(path) fails. (#76751)
Co-authored-by: jean kahrs <j.kahrs@hosting.de>
2022-01-13 13:08:10 -05:00
e33e7233d0 docs: Update porting guide for ansible 5.2.0 (#76746) 2022-01-13 10:46:54 -05:00
3a891827b7 ansible-test - Remove AIX provisioning support. (#76747)
* ansible-test - Remove AIX provisioning support.
* Remove `skip/aix` integration test aliases.
* Remove build for AIX binary module.
2022-01-12 14:27:05 -08:00
bab315b780 ansible-test - Add support for FreeBSD 12.3. (#76745)
* ansible-test - Add support for FreeBSD 12.3.
* Use OS package for yaml if available with CLoader.
* Make sure libyaml is available.
2022-01-12 13:00:03 -08:00
20cc87f059 Expect upper case message 'levels' for galaxy publish results (#63530) 2022-01-13 06:36:51 +10:00
71f3996778 Added AIX CA certs search paths (#69776) 2022-01-13 06:19:40 +10:00
c1df36e3ae Update dnf tests to reflect new behavior. (#76743)
* Update dnf tests to reflect new behavior.

Previously dnf would report there was nothing to do when trying to install a package from the cache when it was not present.

A recent update to dnf has changed this behavior to match yum, resulting in a failure instead.

* Allow dnf to fail or report no changes.
2022-01-12 11:27:20 -08:00
665e3dc629 remove outdated note on limitations of R() in module docs (#76736) 2022-01-12 03:07:37 -08:00
b1ebc192b5 ansible-test - Update default containers. 2022-01-11 15:42:42 -08:00
d6588293fb ansible-test - Limit paramiko to < 2.9.0 2022-01-11 13:47:29 -08:00
76220c4a7b ansible-galaxy - fix the --ignore-certs flag for the implicit galaxy server (#76735)
* ansible-galaxy - fix the --ignore-certs flag for the implicit galaxy server

* changelog

* Add a test without the server config

* Fix respecting --ignore-certs for individual --server URLs also

* Update changelogs/fragments/76735-ansible-galaxy-fix-ignore-certs.yaml
2022-01-11 13:46:45 -06:00
01ba6d4a45 Fix C&P error (#76673) 2022-01-11 13:06:15 -05:00
f2c8b59eb1 Add Rocky to INTERPRETER_PYTHON_DISTRO_MAP (#76728) 2022-01-11 10:45:54 -05:00
f78deccec2 end_play: end the current play only (#76674)
Fixes #76672
2022-01-11 10:27:42 -05:00
4a62c4e3e4 apt: add support for package version >= (#75002)
This adds the ability to specify a package version using >=. This will ensure the package is at the specified version or above.

* If the package is not installed, the latest version will be installed.
* If the package is installed and less than the specified version, it will be upgraded.
* If the package is installed and greater than or equal to the specified version, it will be left alone.

The version selection is handled by Apt itself, so things like the system policy, pinning, etc, are considered.
2022-01-11 09:41:12 -05:00
a5bea8b2f5 fix typo (#76699) 2022-01-11 09:12:27 -05:00
0b6d3312dd enable module defaults for implicit gather_facts (#76053)
* deprecated default fact path setting
* subset and timeout on same boat
* avoid pushing module args when none

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2022-01-10 17:25:00 -05:00
c53e6d94e9 Use antsibull 0.40.1 for docsite build (#76675) 2022-01-10 16:30:47 -05:00
c24c479061 Fix markup. 2022-01-10 12:36:19 -08:00
aa022dba2d ssh connection, handle 'fun' control paths (#76424)
* handle 'fun' control paths by quoting the option when passed to ssh cli

Co-authored-by: Matt Clay <matt@mystile.com>
2022-01-10 12:29:35 -05:00
0ef5274a3c Don't assert stdlib behavior, just assert that urllib was called 2022-01-10 08:55:31 -08:00
aaa7944b02 Fix tests failing on pytest 7 (#76670)
* Fix pytest 7 failures with leaky fixture
2022-01-07 15:53:44 -08:00
b30b8fb79c ansible-test - Set pytest rootdir option. 2022-01-07 15:52:55 -08:00
eaeec8a65c ansible-test - Use --forked instead of --boxed
The `--boxed` option is deprecated.
2022-01-07 12:50:45 -08:00
97104f1221 Avoid deprecated TestCase functions in unit tests. (#76678)
* Avoid deprecated TestCase functions in unit tests.
* Add assertRaisesRegex for Python 2.7.
* Fix indentation.
2022-01-07 12:31:11 -08:00
ace04087e7 Make all pipelining agree on ini entries (#76573)
* Make all pipelining agree on ini entries, corrected descriptions
2022-01-07 14:47:18 -05:00
b17557ae8e Add check_mode tests for shell/command/script and make skipped=True/changed=True mutually exclusive (#76429)
* Add additional tests for check_mode with shell/command/script
* update check_mode documentation: if a module/action is not skipped in check mode and accurately reflects whether a change is made to the remote support should be 'full'
* Make reporting skipped in check mode mutually exclusive with 'changed: True'
* Add missing documented attributes
* Fix tests to expect skipped=True and changed=True do not occur together
* Fix script check_mode support documentation
* Fix earlier changelog
* document platforms attribute
* Use tasks's check mode since the value from PlayContext does not reflect loop items

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2022-01-07 14:15:05 -05:00
a08bcca934 Update local_mods in git.py to show destination of conflict (#72405)
Git module, specify that the local modification is in the destination directory so that some of the users clearly understand this..
2022-01-07 14:13:04 -05:00
094a0746b3 ansible_concat: return strings only unless eval (#76634)
Fixes #76610
2022-01-07 17:13:34 +01:00
b984dd9c59 package_facts: Support pkg_info OpenBSD, FreeBSD and NetBSD (#76580) 2022-01-07 09:59:21 -05:00
0502a03579 hostname: add support for openEuler distro (#76619) 2022-01-07 11:51:31 +05:30
2285483a59 Remove obsolete incidental tests from matrix.
The removed matrix entries no longer run any tests.
2022-01-06 19:41:41 -08:00
aa67ff2cf2 Remove shebangs from core Python modules. (#76664)
* Remove module shebangs.
* Relax shebang check in validate-modules.
* Add changelog fragment.
2022-01-06 17:33:14 -08:00
ffd0343670 add systemd alias check (#76608)
* add systemd alias check

* add .yml

* Delete 75538-systemd-alias-check

* Update lib/ansible/modules/systemd.py

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

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2022-01-07 06:10:29 +10:00
4d380dcbaa More auto info (#76598)
* make auto invenory plugin a bit more informative

* clog
2022-01-07 05:21:13 +10:00
66e392d4e2 user: Update logic to check if user exists in macOS (#76592)
'dscl -list' returns 0 even if the user does not exists. This
leads to errorenous condition in user module.
Using 'dscl -read UniqueID' can return if user exists or not.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2022-01-07 05:18:39 +10:00
8e0654504f stat document 'version' return doc (#76589)
* stat document 'version' return doc

	fixes #76588

* str

* no output_dir for you!
2022-01-07 05:16:01 +10:00
15ace5a854 ansible-galaxy - validate version for directories and collections in git repos (#76579)
* Ensure the version is valid for directories and collections in git repos before installing

Fix the error message for invalid semantic versions

* Make requested changes

* Add a test case for unhandled ValueError exception

* Add changelog

* Update lib/ansible/galaxy/collection/galaxy_api_proxy.py

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

* Reword error message

Include link to learn how to compose a semver version

* Move version validation into the caller, find_matches

* Add tests for more invalid version types

* Remove unused import

Fix raising unexpected error

* Update lib/ansible/galaxy/collection/__init__.py

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

* Update lib/ansible/galaxy/dependency_resolution/providers.py

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

* Update lib/ansible/galaxy/dependency_resolution/providers.py

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

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2022-01-07 05:05:20 +10:00
6e57c8c084 Add missing typing import for _distro.py.
See: 116cdad222/distro.py (L42-L72)
2022-01-05 10:55:04 -08:00
7e814dd4db ansible-test - Fix plugin loading.
This fixes a traceback when loading plugins that use dataclasses.
2022-01-05 10:04:32 -08:00
d2daa67b00 ansible-test - Fix type hints. 2022-01-05 10:04:06 -08:00
16def8050a facts - Set correct OS family for EuroLinux (#76624)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2022-01-05 09:57:29 +05:30
a5f4a25d32 Fix wait_for integration test.
Pin the `psutil` package to 5.8.0 since 5.9.0 is broken on macOS.
2022-01-04 11:29:43 -08:00
a1d0e60703 Fixed documentation: "[a] ini file" -> "an ini file" (#76627) 2022-01-04 10:57:37 -05:00
fdf12542b2 Fix typo in task name (#76642) 2022-01-04 10:35:40 -05:00
aa4f23dc97 Fixed documentation: "do not needed -> do not need" (#76617) 2021-12-29 11:40:13 +05:30
594b11dc0c unarchive: Keep stderr when pick_handler fails (#76365)
* fixes #28977

* Include the original error message when pick_handler fails

* Add a test to unarchive a tar file with an invalid extra option

* add a changelog
2021-12-23 16:01:56 -05:00
fa617fcd7b Disable the _distutils_hack in newer setuptools (#76600)
* Disable the _distutils_hack in newer setuptools. Doesn't fix the underlying issue of the venv finding the _distutils_hack of a setuptools that is not its own.

ci_complete

* re-throw blanket
2021-12-23 10:20:24 -08:00
eedf2e476c check for indirect service in systemd (#76462)
* check if service is indirect status / add integration test

* Update changelogs/fragments/76453-indirect-systemd-status.yml

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

* simplify indirect check / remove integration test restriction on rhel9

* add dummy indirect service for integration tests
2021-12-23 10:35:28 -05:00
43e99e4132 Adding modularity tag to task modularity.yml (#76557)
Co-authored-by: Martin Banas <mbanas@redhat.com>
2021-12-22 14:55:09 -05:00
e2d1dbbdc5 Docs: update porting guide for ansible 5.1.0 (#76595) 2021-12-21 13:35:53 -05:00
67e5649a26 Adds documentation about when/why to use roles (#76560)
Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
2021-12-21 11:15:48 -05:00
4c738b08b4 Add docs on Windows module util requirements (#76583) 2021-12-20 14:19:34 -05:00
8a4090f749 Do not format the choice as a definition list for non-mapping values (#76568) 2021-12-20 14:18:04 -05:00
7dd22b8b4b Update Windows host requirements (#76582) 2021-12-20 13:43:01 -05:00
5db1d11c19 Replace "Encrypt" with "Hash" for prompt documentation (#76584)
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2021-12-20 11:53:56 -05:00
66720460d0 more exact wording of system_tmpdirs (#76587) 2021-12-20 11:51:12 -05:00
47e2a26959 Update playbook_tests with type testing (#72732) 2021-12-20 09:48:30 -05:00
601d66c7e5 k8s: Migrated scenario guides to collection (#75249)
Kubernetes scenario guides are moved to
``kubernetes.core`` collection.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-12-17 13:49:26 -05:00
ee777567bc Update intro_inventory.rst (#76340) 2021-12-14 16:36:41 -05:00
f9c24c2899 Document get_url module check_mode support right (#76433) 2021-12-14 16:07:05 -05:00
e5967c02f5 Fix typos in docs (#76526) 2021-12-14 15:54:32 -05:00
29d57b5b97 Clarify include parameter in unarchive (#76543)
Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
2021-12-14 15:36:55 -05:00
9d1898b1ef Use correct markup in documentation (#76545) 2021-12-14 15:30:58 -05:00
6ee58056da docs: Update porting guide for ansible 4.10.0 (#76559) 2021-12-14 15:18:10 -05:00
49e1cb9f42 unarchive: fix non-english locales (#76542)
* unarchive: fix non-english locales

For GNU Gettext, the LANGUAGE environment variable takes precedence over LANG or LC_ALL. On systems where LANGUAGE was set to a non-english locale, the output of the tar command therefore not understood and the module failed silently ("changed": false, but the archive was not extracted).

* add tests

* changelog
2021-12-14 12:31:01 -05:00
146a4bcd0d Fix docs for installing from a git repo (#76350) 2021-12-14 10:34:32 -05:00
9dac51f25a Update special_variables.rst (#76360) 2021-12-14 10:32:20 -05:00
ac2bdd6834 Fix AttributeError when providing file via --conn-password-file (#76534)
Fixes #76530
2021-12-14 10:07:36 -05:00
8a562ea14a Resolves #76449 Misplaced added version info (#76539)
`.. versionadded::` are coming right after the section tittle, and was misplaced here
2021-12-13 15:23:50 -05:00
461f30c160 yum: avoid storing unnecessary cache data (#76345)
Fixes #76336
2021-12-13 17:38:20 +01:00
4e70156d7e ansible-test - Code cleanup. (#76540)
* Add missing typing imports.
* Remove unnecessary non-capturing group.
* Whitespace.
* Add type hints.
* Ignore PyCharm false positives.
* Remove Python 2.x plugin loading logic.
* Remove Python 2.x exception handling.
* Remove Python 2.x display logic.
* Add changelog.
2021-12-10 15:49:51 -08:00
21b9389a02 ansible-test - Remove invalid type hint. 2021-12-10 12:54:12 -08:00
470c89518c ansible-test - Fix delegation from install. 2021-12-10 12:29:13 -08:00
aaa10cd506 plugins/dnf, plugins/yum: implement sslverify option (#76356) 2021-12-10 11:53:21 +01:00
2058ea5991 Clarify unroll in _finalize (#76436)
Clarifies that unrolling in _finalize is actually necessary. Also using
decorator directly.
2021-12-10 11:35:40 +01:00
ed6581e4db check finder type before passing path (#76448)
* check finder type before passing path

ci_complete

* Reduce nesting

* Test find_module does not cause a traceback with Python 3 FileFinder

* Update lib/ansible/utils/collection_loader/_collection_finder.py
2021-12-09 16:05:58 -08:00
c819c1725d Remove withought typo (#76524)
Found on https://github.com/ansible/ansible-navigator/issues/689 as
we are using codespell, maybe Ansible core could benefit from it.
2021-12-09 16:43:10 -05:00
d0de3d3dc2 change keyword return to results (#76515)
value is getting associated to python keyword return
2021-12-09 14:23:07 -05:00
894fbd6990 pkg_mgr: prohibit pkg5 usage on Altlinux (#76457)
Filter out the /usr/bin/pkg because on Altlinux it is actually the
perl-Package (not Solaris package manager).
Since the pkg5 takes precedence over apt, this workaround is
required to select the suitable package manager on Altlinux.
2021-12-09 12:47:27 -05:00
bc753c0518 Add openrc support to service_facts (#76373)
* Add openrc support to service_facts

Co-authored-by: Clément Martin <clement.martin@onespan.com>
2021-12-09 12:38:41 -05:00
0cec4d1cfc remove aws from the azure note (#76518) 2021-12-09 09:05:45 -08:00
16cdac66fe ansible-test - Use ansible-core for docs links. 2021-12-09 08:58:14 -08:00
19a58859d6 AnsibleJ2Template should be based on NativeTemplate (#76471)
Fixes #76442

ci_complete
2021-12-09 17:29:38 +01:00
37c80ea893 template lookup: jinja2_native has no effect if global is off (#76385)
This is documented behavior that was unintentionally changed in #75587.
2021-12-09 10:04:19 -06:00
e56e47faa7 ansible-test - Fix import test for collections. 2021-12-08 15:53:38 -08:00
0df60f3b61 per marketing request - add note for AAP on Azure availability (#76512) 2021-12-08 14:17:50 -08:00
82f59d4843 ansible-test - Hide ansible._vendor in import test (#76503) 2021-12-08 12:04:45 -08:00
bccfb83e00 add intersphinx mapping for Ansible 5 (#76470)
* add intersphinx mapping for Ansible 5

* add the other files
2021-12-08 06:10:05 -08:00
c45989c76f ansible-test - Remove RHEL 8.4 support. 2021-12-07 19:00:52 -08:00
97ef1d031c Revert "ansible-test - Fix import test when vendoring."
This reverts commit 33a8d06332.
2021-12-07 17:22:54 -08:00
8482ee4e9a galaxy build - ignore existing MANIFEST and FILES (#76479) 2021-12-07 16:37:28 +01:00
7830e5308e add tencentos fact distro (#76459)
Fixes #76459

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-12-07 16:20:07 +01:00
472028c869 catch the case that cowsay is broken (#76326)
* catch the case that cowsay is broken

fixes https://github.com/ansible/ansible/issues/72582

  add changelog
  raise Exception for broken cowsay
  add test for broken cowsay

Co-authored-by: Matthias Bernt <m.bernt@ufz.de>
2021-12-07 09:11:06 -05:00
60d094db73 Docsite/dev_guide: add note about ansible-test utility installation ways (#76128)
* Docsite/dev_guide: add note about ansible-test utility installation
* Add link to Testing Ansible page
2021-12-07 03:18:32 -08:00
41ee4a5b12 ansible-test - Fix traceback in validate-modules test. 2021-12-06 15:45:57 -08:00
33a8d06332 ansible-test - Fix import test when vendoring. 2021-12-06 14:31:55 -08:00
47448f1458 Add 'default' to 'env' lookup (#76327)
* Add 'default' to 'env' lookup

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2021-12-02 17:06:36 -05:00
3fe42e106c Remove finalize from globals (#76439) 2021-12-02 12:00:27 -08:00
4e7be293a5 Properly set finalize for the new environment (#76435)
* Properly set finalize for the new environment

Fixes #76379

* Fix sanity
2021-12-02 11:55:28 -08:00
eca97a19a3 Handle HTTPError being partially initialized due to the error. Fixes #76386 (#76421) 2021-12-02 11:42:29 -08:00
82ff7efa94 Fix how/what+look/like grammar in dev process doc (#76410) 2021-12-02 11:37:44 -08:00
5b2334983c Fix more 'playbook'/'play' conflation (#76387) 2021-12-02 11:26:25 -08:00
d22bdcfdc7 ansible-test - Update NIOS container to 1.4.0. 2021-12-02 11:04:48 -08:00
bf1e1d286d docs: Update porting guide for Ansible 5.0.1 (#76444) 2021-12-02 13:27:45 -05:00
b02168d644 better handling of sudo flag replacement (#76389)
* better handling of sudo flag replacement
2021-12-02 11:58:01 -05:00
480d47d071 reset defaults for json filters (#76349)
* reset defaults for json filters

  these had change on unification of json parsing/dumping
  now they behave like before, but are still controllable by user.
2021-12-02 11:02:38 -05:00
de11a1ce78 fix shell/command/script tasks skipping in check mode (#76353)
* fix shell/command/script tasks skipping in check mode

* changelog
2021-12-01 15:58:15 -05:00
b50f16db91 Update collection loader for Python 3.10 (#76225)
* Implement find_spec and exec_module to remove reliance on deprecated methods in the collection loader

ci_complete

* Move module execution to exec_module

Remove extra sys.modules handling

Use default module initialization by returning None from loader.create_module

Refactor

ci_complete

* Remove ansible-test's copy of the collection loader

ci_complete

* Fix metaclass for Python 2.x

ci_complete

* Fix Py2/Py3 syntax compatibility

* Refactor

ci_complete

* update collection_loader comments

ci_complete

* simplify find_module

ci_complete

* Fix Py2 compatibility - don't get loader from nonexistent spec

Remove unnecessary PY3 checking

* Refactor common code in load_module and exec_module

ci_complete

* tidy diff

ci_complete

* Include collection_loader in target paths for 'compile' sanity test

* add changelog

* Add "return None" instead of doing it implicitly

Remove get_filename

short-circuit exec_module if it's a redirect

ci_complete
2021-12-01 09:47:10 -08:00
1d1597ffd9 Docs: Update porting guide for Ansible 5.0.0 (#76404) 2021-11-30 10:52:58 -05:00
392b16c21c Test integration of loop and until options (#44927)
Ref #44741
Ref ansible/proposals#140

* Replace select filter with a more portable thing
* Add context
    This is needed for split controller/remote

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-11-30 10:11:27 -05:00
862a2a3599 set latest Ansible version to 5 (#76304) 2021-11-30 06:41:20 -08:00
a1205d52ce update release and maintenance for Ansible 5 (#76301) 2021-11-30 06:40:44 -08:00
b9b69c1135 Docs: Update porting guide for ansible 4.9.0 (#76363) 2021-11-29 11:16:26 -05:00
cd2d8b77fe apt - add allow_change_held_packages option (#73629)
* Add changelog fragment and integration tests
* Break up function signature into multiple lines
    It passed the 160 character width. Change it to multi-line for easier reading
    and better diffs in the future.
* Remove unused import
* Update version added for new feature
* Move changelog fragment to correct location

Co-authored-by: Thomas Stähle <thomas.staehle@check24.de>
Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-11-29 10:31:54 -05:00
0afc0b8506 Add a link to the Ansible 5.x changelog (#76352)
The 5.x changelog is available, add a link to it.
2021-11-23 09:25:51 -08:00
23414869e2 update Edit on Github hint (#76341) 2021-11-22 08:28:34 -08:00
f59d0456e1 galaxy: raise error when inaccessible path is specified multiple times (#76318)
Fixes #76316
2021-11-22 13:28:02 +01:00
0ddaf6edd6 Reduce number of iterations through PlayIterator (#74175)
* Reduce number of iterations through PlayIterator

ci_complete

* Use the new set method

ci_complete
2021-11-22 10:23:34 +01:00
d8aeffc8b7 Add macOS 12 to CI (#76328)
* Disable lookup_url test of macOS 12
2021-11-19 21:18:31 -05:00
5cbcf7c7bf Fix galaxy.collection.galaxy_api_proxy types 2021-11-19 16:36:25 -08:00
0360728b7f Fix typo in docs for "globbing" (#76324)
Constent with the rest of the documentation including fileglob.
2021-11-19 09:37:15 -08:00
1b34933414 Fix ansible-doc -l ansible.builtin / ansible.legacy (#76235) 2021-11-19 10:29:47 -05:00
c379e61b8b Update docs build requirements to most recent versions of dependencies (#76283)
* align requirements files to more recent versions

* bump up to latest antsibull

* update sphinx in rstcheck requirements

* update to dependency versions that sphinx 4.2 pulls in

* use same no-cap spelling
2021-11-19 03:17:50 -08:00
04698b0c41 Add porting guide entry for fetch_url change in behavior (#76314) 2021-11-19 05:05:32 +10:00
c8a14c6be8 ansible-test - Update base and default containers. 2021-11-17 17:03:14 -08:00
bb63c97c16 ansible-test - Update import test and sanity requirements. (#76308)
* Add script to freeze sanity requirements.
* Declare sanity test requirements and freeze
* Use pinned requirements for import.plugin test.
* Expand scope of import test for ansible-core.
* Add ignores for galaxy import errors.
* Update test-constraints sanity test.
2021-11-16 18:16:42 -08:00
21ac52435b ansible-test - Add support for RHEL 8.5 instances. (#76305)
* ansible-test - Add support for RHEL 8.5 instances.
* Clear libdnf checksum cache from unsigned package in dnf integration test.

Co-authored-by: Matt Martz <matt@sivel.net>
2021-11-16 16:35:00 -08:00
d0ec236d4a Update porting guide for Ansible 5.0.0b2 (#76303) 2021-11-16 11:56:08 -05:00
4073a22d55 uri module improvements (#50771) 2021-11-16 10:44:44 -06:00
c9d4b6bfb0 Removed local variable 'lowered_choices' because the value is never used (#76295) 2021-11-16 10:24:44 -05:00
a71ba817b0 ansible-test - Remove unused test constraint. 2021-11-15 13:50:52 -08:00
5e3d469738 ansible-test - Remove near-EOL test containers.
- fedora33
- centos8
2021-11-15 13:40:37 -08:00
0668538a3e Default callback result format (#76166)
* First pass of adding yaml result format output to default callback

* Add clog frag

* flow style always false

* Further normalization of results across distros

* no lossy, now pretty

* Fix env var in runme.sh

* Rename variable to better self document

* include NativeJinjaUnsafeText

* Linting cleanup

* Add tests specific to the prior yaml callback

* Make data munging more exact, following the checks in libyaml/pyyaml

* Remove unused import

* Extend comment

* more correct and some comments

* Fix consistency of tab vs space in this section of the file

* Add str representer

* be cooler

* faster character filtering

* Clarify None as a sentinel for default behavior

* Flip filtering logic to avoid CRLF issues with 'space break' filtering

* Py3 change and comment about the use of __call__

Co-authored-by: Matt Davis <mrd@redhat.com>
2021-11-15 13:19:11 -08:00
fd4460c1e4 docs/best_practices: all contained vault passwords required when using inventory (#75976) 2021-11-15 16:18:48 -05:00
08af0fbf95 Unbreak hostname.RedHatStrategy (#76032)
- On Python 3, decode bytes to str
- Tolerate whitespace around the line.
- Report a missing HOSTNAME line as an error.
- Don't clobber line separators when setting a new hostname.
- Add some tests for this strategy to verify correct operation.
2021-11-15 07:15:20 +01:00
abac141122 fix support containers under podman (#76292)
* `podman inspect` falls back to a same-named image if the named container is not present; since eg `http-test-container` is both the name of the image and container, it wasn't working properly under podman in many instances. Switching to `docker|podman container inspect` limits the query to containers only for both podman and docker, allowing the support container detection/creation to work properly.
2021-11-12 16:59:09 -08:00
382a353234 No longer needed to fall back to sha (#76281) 2021-11-12 08:32:31 +01:00
fb55d878db psrp - remove deprecated psrp put_file code (#76252)
* psrp - remove deprecated psrp put_file code

* Removed unused import and fix missing var
2021-11-12 10:57:28 +10:00
a734da5e82 Restore documentation on M() and R() (#76284)
* Undo most of bf9944266c, add note on where R() does not work.
Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
2021-11-11 15:26:26 -05:00
b7a5fd6be9 Fixed typo in keyword_desc.yml (#76280)
The description of 'max_fail_percentage' had a typo.
2021-11-12 05:17:08 +10:00
95e120ed02 Keep pre Python 3.10 literal_eval behavior (#76261) 2021-11-12 05:12:46 +10:00
fe77bc9e3c Validate some markup in documentation in validate-modules (#76262)
* Validate some markup in documentation.

* Add changelog fragment.

* Use urlparse instead of URL regex.

* Document new error code.

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-11-11 13:44:15 -05:00
9985b8a975 ansible-test pssa update and new rules (#76256) 2021-11-10 17:04:39 -08:00
90de24da7b Docs: Link to valid data types for role parameters (#76276) 2021-11-10 10:06:33 -05:00
b6725ec6c9 Fix pip integration test.
- Use `fallible==0.0.1a2` instead of `black==19.10b`
- Test on both Python 2 and 3.
2021-11-09 14:35:39 -08:00
be2bd2f1af Documentation for other types in collection requirements.yml (#75872) 2021-11-09 15:18:51 -05:00
55dc75b8c8 Update porting guide for Ansible 5.0.0b1 (#76263) 2021-11-09 14:05:28 -05:00
22eb4a9ce0 Remove edit on github from collection pages (#76259)
* remove main index page from Edit on Github
* remove all collection index pages from Edit on Github
2021-11-09 06:51:54 -08:00
f6ec773e6e Update porting guide Python 2.7+ wording. (#76258) 2021-11-09 09:22:16 -05:00
5c225dc0f5 Introduce public methods to access PlayIterator._host_states (#74416) 2021-11-09 08:07:51 +01:00
d7fbb209b4 ansible-test - Fix collection import test priming.
The bug was introduced in https://github.com/ansible/ansible/pull/76137
2021-11-08 17:50:02 -08:00
74dc830dd4 Use new codecov uploader (#75938)
* Use new codecov uploader
* Rewrite coverage uploader in Python
2021-11-08 14:50:54 -08:00
54f64982fb apt - remove obsolete documentation (#76243)
The lock_timeout feature was recently added to the apt module making
this section in the documentation no longer necessary
2021-11-08 16:29:21 -05:00
b16d5ff7a7 set 2.12 to latest (#76191)
* set 2.12 to latest
* add 2.10 back
2021-11-08 08:07:22 -08:00
d0c1e5a46d Update release/maint page for 2.12 release (#76205)
* make changelogs more visible and fix a broken link

* add 2.12 changelogs

* add eol column
2021-11-08 10:28:50 -05:00
f42ffe16d2 ansible-test - Add Fedora 35 test container. (#76228)
* ansible-test - Add Fedora 35 test container.
* Added Fedora 35 to CI and removed Fedora 33 from CI.
* Fix dnf integration test.
* Fix connection_paramiko_ssh test.
2021-11-04 17:20:17 -07:00
57989c2bcb Remove install of setuptools in venv for pip test.
This task was previously added in https://github.com/ansible/ansible/pull/25243 as a work-around for a setuptools bug.

The pinned version does not work with Python 3.10, and the task should no longer be needed.
2021-11-04 14:12:13 -07:00
39509ff216 Fix pip test to use setup_remote_tmp_dir. 2021-11-04 13:47:20 -07:00
a861cb5607 ansible-core 2.12 dropped support for galaxy.yaml. (#76179) 2021-11-04 15:15:22 -04:00
a1236a582c Stop using "checksumming" instead of "encrypting" in the docs (#76168)
* Hashing is not encrypting

All encryption systems have a formal inverse function to decrypt
A hash is a one way function without inverse by definition

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

Co-authored-by: Sandra McCann <samccann@redhat.com>
2021-11-04 20:06:02 +01:00
730194e2b6 ansible-test - Add RHEL 9 support. (#76217)
* Move RHEL pip package install into function.
* Add RHEL 9 support to bootstrap script.
* ansible-test - Add RHEL 9 support.
* Add install and uninstall instructions for RHEL9 to paramiko tests
* Skip incidental_inventory_docker_swarm on RHEL 9.
* Update dnf tests for rhel9
* Fix prepare_http_tests on RHEL 9.
* fix RHEL9 Python discovery tests to match distro map
* Skip subversion test on RHEL 9.0b.

Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: Matt Davis <mrd@redhat.com>
2021-11-04 10:48:34 -07:00
1b43298316 Update dev guide for vars plugins in collections (#75861) 2021-11-04 10:22:55 -04:00
17ec2d4952 check /.dockerenv and /.dockerinit to guess a dockercontainer (#74349)
* use os.path.exists for docker-check

Co-authored-by: Jacob Floyd <cognifloyd@gmail.com>
2021-11-03 15:26:36 -04:00
636b317a4f update backport instructions for 2.12 (#76209) 2021-11-03 10:10:57 -07:00
27a5116e19 Explicitly require iptables for incidental_setup_docker on RHEL8 (#76212) 2021-11-03 12:03:45 -05:00
c56d98e738 Fix broken M() refs. (#76202) 2021-11-02 15:22:16 -04:00
db2aee558b LinkUtil - ignore LIB env var (#76184) 2021-11-03 04:47:28 +10:00
2fd26ea35a docs: Update porting guide for Ansible 5.0.0a3 (#76201) 2021-11-02 14:17:10 -04:00
2de7c59930 docs: Update porting guide for Ansible 4.8.0 (#76197) 2021-11-02 14:15:03 -04:00
150faf25d3 dnf: add more specific error message for GPG check (#76194)
Fixes #76192
2021-11-02 15:01:12 +01:00
fdc3348859 Docs: Add skeleton roadmap for Ansible 6 (#76130)
* add skeleton roadmaps
* fix spacing
* correct link
* remove skeleton
2021-11-02 04:55:50 -07:00
444f5ff74e Remove redundant docs targets from Makefile. (#76059)
All of the targets, with the exception of `alldocs`, simply run the same target from `docs/docsite/Makefile`.
2021-11-01 13:07:14 -04:00
b5ed41edb3 Skip recursive suboption validation if sub_parameters is not a dict (#75635)
* Skip recursive suboption validation if sub_parameters is not a dictionary

* Ensure sub parameter elements is a sequence to prevent iterating over string characters and causing duplicate error messages for the same param
2021-11-01 12:06:49 -04:00
7bec196061 loop/fact delegation fix (#75768)
now set_fact and include_vars intermediate results are congruent with delegation
2021-11-01 11:25:10 -04:00
8bbecc7cac exhaust list of vault ids before failing (#75540)
* Try to find any valid vault id before raising an exception
* Apply the same logic during vault password file loading
* Also. Improve the warning msg and tests
2021-11-01 11:15:50 -04:00
47ee282227 Parser errors from within includes should not be rescueable (#73722)
* Parser errors from within includes should not be rescueable
* Also fixes unit tests
Fixes #73657
2021-11-01 11:05:39 -04:00
d23226a6f4 deprecate scp_if_ssh (#75218)
* deprecate scp_if_ssh

Co-authored-by: Matt Martz <matt@sivel.net>
2021-11-01 10:49:48 -04:00
dd220ddc2f Add a YAML representer for NativeJinjaUnsafeText (#76186) 2021-11-01 08:31:49 -05:00
e84d660140 Update playbooks_tests.rst (#76047) 2021-10-29 16:27:57 -04:00
2955ff57a7 Fix module name (#76058) 2021-10-29 16:26:51 -04:00
765924a3a4 Add reminder about groups default behavior in user module (#76096) 2021-10-29 16:01:21 -04:00
f92830d16e Fix zip content filtering in unarchive module (#76069)
When we introduced an include parameter to the unarchive module, we
inadvertenly flipped the exclusion logic. This flip meant that the
unarchive module started rejecting files that should be extracted.

This commit flips the bad logic and adds some tests that will make
sure things do not go bad again.
2021-10-29 15:12:24 -04:00
173550f932 use filesystem object instead of specific objects (#76054)
since the fragment is imported by different modules that support
 different set of filesystem objects

 fixes #72375
2021-10-29 11:41:12 -04:00
d17f9a523d Docs: fedora32 is no longer supported (for integration tests) (#76159) 2021-10-29 11:29:32 -04:00
e0e6464873 Docs: Fix text for contributing to collection link (#76174) 2021-10-29 11:17:12 -04:00
360a3d2431 Clarify that "requires_ansible" means Ansible Core (#76100)
Clarify that the `requires_ansible` field in meta/runtime.yml refers to the version of Ansible Core (ansible-core), not any package called "ansible" e.g. https://pypi.org/project/ansible/
2021-10-29 08:01:51 -07:00
0b0acef423 bug fix: using non-FQDN in plugin choices fails plugin name verification (#75991)
* enable both non-FQDN and FQDN plugin name
* add info about matching requirement of plugin name in config and plugin source file
2021-10-28 11:06:51 -04:00
3a9e42cfde Docs: Change API endpoint for hub to console.redhat.com in user guide (#76080)
The cloud.redhat.com has changed to console.redhat.com
2021-10-28 05:57:38 -07:00
e50ad6f118 ansible-test: Set max number of open files in containers to 10240 (#75498) 2021-10-27 14:00:14 -07:00
1ab2443e2d ansible-test - Update default containers. 2021-10-27 13:25:38 -07:00
19c8790251 2.13 schedule (#75843) 2021-10-27 15:12:30 -05:00
4abc669c24 Update module documentation about ref links (#76088)
* Update module documentation about ref links
2021-10-27 14:23:45 -04:00
cc3f1d238c Add Jinja2 version runtime check (#76141) 2021-10-27 11:41:11 -05:00
26707a3c6b Heisen jinja2_native (#75587)
* Use NativeEnvironment for all templating

ci_complete

* Keep Templar.copy_with_new_env for backwards compat

* Mention that AnsibleUndefined.__repr__ changed in the porting guide

* Templar.copy_with_new_env backwards compat

* ci_complete
2021-10-27 11:36:33 -05:00
caec2b9d29 Revert "Revert AnsibleCollectionConfig Py3 only change (#76104)"
This reverts commit 04e30d9002.
2021-10-26 16:31:28 -07:00
97f729c3d6 Fix Windows CI scripts.
The scripts now use `--list-targets -v` instead of `--explain` to evaluate changes.

This is faster and does not trigger parsing of a non-existent inventory file.
2021-10-26 15:26:34 -07:00
6b8ed23926 Update argcomplete install via apt command (#76139)
To install `argcomplete` on Ubuntu 21.10 we need to update the install line to use Python3
2021-10-26 11:29:23 -04:00
395e5e20fa PlayIterator: use enums for states (#74511) 2021-10-26 10:16:17 +02:00
cd64e0b070 ansible-test - Fix import test on old Pythons. (#76137) 2021-10-25 17:53:05 -07:00
cae7d2a671 Overhaul ansible-test integration tests. (#76111)
* Overhaul ansible-test integration tests.
* ansible-test - Fix import test pyyaml usage.
* ansible-test - Remove unused import.
* ansible-test - Fix traceback when pip is unavailable.
* ansible-test - Fix typo in port forwarding message.
* ansible-test - Fix controller logic in requirements install.
* Fix unit tests in ansible-test integration test.

Unit tests are now run for available Python versions which
provide `virtualenv` (Python 2.x) or `venv` (Python 3.x).
2021-10-25 16:32:15 -07:00
b9694ce4fb ansible-test - Remove duplicate code. 2021-10-25 15:30:06 -07:00
9b4f9e9fd3 Drop python2.6 support in module execution (#76106) 2021-10-25 08:41:51 -05:00
b4cbe1adcf ansible-test - Fix Python real prefix detection. 2021-10-21 15:28:48 -07:00
0bf7b3f4ef Fix ansible-galaxy collection verify subcommand help message. (#76108)
* Fix ansible-galaxy collection verify subcommand help message.

* changelog
2021-10-22 07:50:33 +10:00
e40a0e5c90 Don't use output_dir in target tests (#76107)
* Don't use output_dir in user tests

* Move blockinfile tests from using output_dir to depending on setup_remote_tmp_dir

* Don't use output_dir in git tests

* Don't use output_dir in uri tests
2021-10-21 10:59:48 -05:00
04e30d9002 Revert AnsibleCollectionConfig Py3 only change (#76104) 2021-10-21 08:07:23 -05:00
0f95371131 Start of moving away from six (#75863)
ci_complete
2021-10-21 10:40:04 +02:00
7621784b94 Require Jinja2 3.0.0 (#75881)
* Require Jinja2 3.0.0

ci_complete

* Fix sanity

* Remove Jinja min/max tests

* ansible-test changes

* ci_complete

* More cleanup

ci_complete

* Revert _count_newlines_from_end :( and other stuff

* Fix sanity

* It's using host_vars ...

* Unused import

* Remove overridden groupby filter

* environmentfilter -> pass_environment

* Explain preserve_trailing_newlines

* Add changelog

* ci_complete

* Deprecated ANSIBLE_JINJA2_NATIVE_WARNING

* native_helpers.py cleanup

* More cleanup in the find intgration test
2021-10-20 12:22:29 -05:00
835fe71828 Docs: fix link to 2.12 changelog (#76091) 2021-10-20 08:28:39 -07:00
66a83314b9 Modernize install (#76021)
Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Matt Davis <mrd@redhat.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2021-10-19 14:24:57 -05:00
43d09710c8 Update porting guide for Ansible 5.0.0a2 (#76083) 2021-10-19 13:30:42 -04:00
afb8a008c2 Remove incidental_deploy_helper 2021-10-19 08:46:49 -07:00
2f3fbaac3c Remove unused test/support plugins (#76078) 2021-10-19 08:45:15 -07:00
227f4398c2 Fix choices for return values. (#76070) 2021-10-19 17:22:32 +02:00
6e6f846db1 Add space to error message output (#76063) 2021-10-19 17:18:30 +02:00
3add434269 add missing space to --playbook-dir help string (#76062) 2021-10-19 17:17:49 +02:00
0c1b839c10 Remove incidental_win_copy
ci_complete
ci_coverage
2021-10-18 13:18:35 -07:00
90f670090c Remove incidental_setup_tls
ci_complete
ci_coverage
2021-10-18 11:42:09 -07:00
7e79411701 Remove incidental_cs_common 2021-10-18 11:40:19 -07:00
d099e19796 ansible-test - Move constants to remove symlink. 2021-10-18 10:25:15 -07:00
23f95300bd Intentional tests (#76051)
ci_complete
ci_coverage
2021-10-18 10:28:20 +02:00
58744acb84 Remove centos8 from CI matrix. 2021-10-15 16:06:18 -07:00
80f4b67f43 Removed unused test/support modules (#76048) 2021-10-15 09:48:14 -07:00
817e1045bb Update network_resources.rst (#76040)
* Update network_resources.rst

I am not sure a fully qualified URL should be here... but teach me great documentation gods

* Change platform index external link to internal ref

Co-authored-by: Aine Riordan <44700011+ariordan-redhat@users.noreply.github.com>
2021-10-15 08:48:30 -04:00
96372cecea Remove unused variables from Makefile. 2021-10-14 18:29:32 -07:00
2af4d30b9b Remove incidental mongodb tests.
They no longer provide unique coverage.

ci_complete
ci_coverage
2021-10-14 17:41:37 -07:00
cca9013df8 Remove incidental_win_data_deduplication test.
It no longer provides unique coverage.

ci_complete
ci_coverage
2021-10-14 15:39:04 -07:00
4cf290918f docs: clarify skip_broken option in dnf/yum (#76038) 2021-10-14 12:10:53 -07:00
9a0fe18915 allow override of PYTHON variable (#76023) 2021-10-14 12:04:52 -07:00
7cf29ded9c Intentional tests
ci_complete
ci_coverage
2021-10-14 11:52:06 -07:00
609cba5017 Remove incidental_win_dsc test.
It no longer provides any unique test coverage.

ci_complete
ci_coverage
2021-10-14 11:01:53 -07:00
fae0cf4c51 Remove unofficial packaging.
Unofficial packaging should be maintained externally since
it is not tested in CI or used in the official release process.

Maintainers of unofficial packages are better equipped with the necessary
expertise and testing resources to support alternative packaging.
2021-10-14 09:52:26 -07:00
319b50f04c Fix subversion test.
Switch to a different repo that isn't giving 503 errors since GitHub hasn't fixed the issue yet.
2021-10-14 09:48:00 -07:00
ff792d252e Docs: dash - character invalid in playbook names in collections(#75891)
* collection playbooks, note no -
fixes #75890
2021-10-14 08:25:14 -07:00
9eeaf1c5b5 Docs - add code-block:: wrapping for playbooks filter doc (#75953)
* Add code-block
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-10-14 08:11:24 -07:00
aff5e5dfc6 _run_loop: Add the task name to the warning (#76012)
Prepend the task name to the warning "The loop variable 'item' is
already in use", so that you can get some context even if stdout and
stderr go to separate places.
2021-10-14 10:31:04 -04:00
64506c7d15 Docs: Change note for rackspace cloud guide (#75898)
* Fix rackspace cloud guide docs
* Fix syntax error
2021-10-14 05:29:07 -07:00
67c12fc4eb Docs - Fix "kubernetes.core" typos in code snippets (#75930)
Replace "kuberernetes.core" with "kubernetes.core" in filter examples.
2021-10-14 05:23:14 -07:00
93a6299cd3 docs: Update porting guide for Ansible 4.7.0 (#76034) 2021-10-14 06:54:39 +01:00
3d46670622 Remove incidental_win_ping test. (#76031)
It no longer provides any unique test coverage.

ci_complete
ci_coverage
2021-10-13 12:58:30 -07:00
2437fb3718 Add more ansible-test cloud tests. 2021-10-12 17:10:18 -07:00
b1211429d5 Fix executing includes in the free strategy (#75649)
Fixes #75642
2021-10-12 18:15:37 +02:00
7a28246248 validate_modules: allow 'choices' for return values (#76009)
* Allow 'choices' for return values.
2021-10-12 11:29:27 -04:00
1ea74f4dd6 Misc typo fix (#76008)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-10-12 11:28:20 -04:00
e53982cd09 The apt module won't work with python-apt < 0.8.9 (such as on Ubuntu 10.04) (#75993)
* Check if deb file to deploy has architectures attribute, fixes ansible#47277
2021-10-12 11:24:40 -04:00
f7b7cf6753 Add vim undo files to .gitignore (#75979) 2021-10-12 11:13:59 -04:00
fa4a92f221 Docs: Add code-block:: to examples in ipaddr filters doc(#75951)
* Add code-block elements to playbooks_filters_ipaddr
* Add punctuation to lead-in sentences for code blocks
2021-10-12 05:08:52 -07:00
2a3aa66fbd docs - wrap examples in code-block:: in sample setup (#75964)
* docs: Use code-block to format code in sample setup
Fixes #75905
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-10-12 04:21:30 -07:00
4444692436 Docs: add code-block:: to playbook variables doc in user guide(#75985)
* update code-block formatting changes.
2021-10-12 03:09:11 -07:00
6bf65f6246 Docs - Added code-block:: wrappers in playbook tests doc (#75952) 2021-10-12 02:39:52 -07:00
6319a0f415 docs - Wrap examples in code-block:: in loops guide (#75916)
* docs - Use code-block to format examples in loops guide
Resolves #75900
2021-10-12 02:25:13 -07:00
afbef70bad documenting_modules_network.rst: Add missing space (#75972) 2021-10-12 11:42:10 +05:30
d6dbc1a26f docs - Change :: to code-block:: in error handling guide (#75978)
Fixes #75908
2021-10-11 15:18:07 -07:00
4d8a724071 docs - Replace :: with code-block:: in playbooks_conditionals doc (#75965)
Fixes #75906
2021-10-11 14:40:01 -07:00
d26ff4e376 Docs: changed :: to code-block:: in 9 files (#75994)
* Fixed 9 files in user guide
2021-10-11 14:28:07 -07:00
221c7373db docs - Add code-block to code examples in playbooks_strategies.rst (#75960)
Fixes ansible#75911.
2021-10-11 13:53:45 -07:00
fd346565d3 docs - wrap examples in code-blocks in playbooks_vars_facts.rst (#75961)
Fixes ansible#75912.
2021-10-11 13:28:35 -07:00
37eefb47c5 Docs: Add code-blocks to examples in Windows-WinRM guide (#75974)
Co-authored-by: Holger Dörner <h.doerner@bitexpert.de>
2021-10-11 13:15:10 -07:00
84ec976378 Docs: Add code-blocks to Playbooks-Delegation in user guide(#75973)
Co-authored-by: Holger Dörner <h.doerner@bitexpert.de>
2021-10-11 12:59:42 -07:00
d0edf69fe0 docs: code-block wrapping for playbooks_debugger.rst (#75968)
* code-block wrapping for playbooks_debugger.rst #75919
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-10-11 12:43:22 -07:00
cd540544fd Docs: add code block elements in user_guide/playbooks_async.rst (#75947)
* Fix for code block
2021-10-11 11:30:39 -07:00
fffa9412f4 Docs: add code blocks elements for user_guide/vault.rst (#75963)
* feat:(docs) add code blocks elements for user_guide/vault.rst
Addresses issue #75921
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-10-11 11:09:18 -07:00
71811407c5 Docs: code-block wrapping for playbooks_checkmode.rst #75925 (#75931)
* code-block wrapping for playbooks_checkmode.rst #75925
* Fixes typo in previously introduced code-block
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-10-11 10:42:06 -07:00
22a540e109 Docs: Code-block wrapping for playbooks_startnstep.rst #75934 (#75943)
* Code-block wrapping for playbooks_startnstep.rst #75934
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-10-11 10:07:16 -07:00
5c4bbed2de Docs: Add code-blocks to user guide doc (#75928)
* Add code-block elements to 5 examples

* Add :
2021-10-11 08:48:45 -07:00
81eec4a05a Docs: code-block wrapping for playbooks_module_defaults.rst #75936 (#75942) 2021-10-11 05:14:56 -07:00
a2ff765e06 Docs: add code-blocks to User Guide modules_intro (#75932) 2021-10-11 04:26:53 -07:00
a4a7a34893 Docs: Add code-blocks to user_guide/intro_patterns.rst (#75941) 2021-10-08 14:12:06 -07:00
4381336fbb Docs: issue 75922 add code-blocks to user_guide/playbooks_environment.rst (#75929)
Add code-blocks in the 6 outlined examples from the Issue
2021-10-08 13:27:33 -07:00
b03afeec6c Adding code-block elements in user_guide/playbooks_prompts.rst (#75935) 2021-10-08 13:01:50 -07:00
d0b88eecd8 Code block format user guide/windows setup.rst #75914 (#75956)
* set changes for code boxes.

* post changes to attempt to fix seealso links.

* attempting to fix seealso tag

* fix un-indention for sanity check.
2021-10-08 10:49:45 -07:00
89bc7ebfe6 code-block wrapping for playbooks_advanced_syntax.rst (#75981)
* code-block wrapping for playbooks_advanced_syntax.rst

* fixed spacing
2021-10-08 10:13:46 -07:00
8e77943a97 remove fest banner (#75901)
* remove fest banner

* fix nit
2021-10-08 08:30:19 -07:00
5cb1210f82 ansible-test - Update base and default containers.
- The containers are now based on Ubuntu 20.04 instead of Ubuntu 18.04.
- The default Python version used for the containers is now Python 3.10.
- The included version of PowerShell was upgraded to version 7.1.4.
- The included version of shellcheck was upgraded to version 0.7.0.

ci_complete
2021-10-07 23:04:31 -07:00
801eb73ccb ansible-test - Update Python constraints. (#75959)
* Remove obsolete constraints.
* Simplify constraints.
* Add changelog fragment.
2021-10-07 18:10:34 -07:00
7e19957afa ansible-test pslint - fix warning with nested objects (#75792)
* ansible-test pslint - fix warning with nested objects
2021-10-08 06:30:30 +10:00
8c3e576cd5 Fix docs get_url dest comment. Checksum does not prevent download if dest is dir. (#73185) 2021-10-07 15:35:43 -04:00
8510db4935 Allow ca_path to point to a bundle (#75894)
* Allow ca_path to point to a bundle. Fixes #75015
2021-10-08 05:04:48 +10:00
23b9d197eb ansible-doc: ignore plugin deprecation warnings (#75674)
Fixes #75671
2021-10-07 13:01:45 -05:00
8cef40f839 ansible-test - Fix inventory path. 2021-10-07 10:19:34 -07:00
801db758d3 code-block wrapping for playbooks_best_practices.rst #75937 (#75939) 2021-10-07 09:56:24 -07:00
bc0caad2ad Fix parsing of device serial number for RHEL8 (#75876)
* Fix parsing of device serial number for RHEL8

* Add tests and changelog

Co-authored-by: Miroslav Brabenec <miroslav.brabenec@memsource.com>
2021-10-06 17:24:09 -04:00
9a4346bae3 Docs: Moves the AWS Scenario Guide out of the main docs (#74704)
* removes AWS scenario  guide, moving to collection

* first attept to replace TOC entries

* not sure what I did, but saving it

* updates TOCs to reflect new location of aws guide

* reinstates original page as a stub

* adds links to new location for AWS guide, updates header

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-10-06 12:34:44 -07:00
2f531d73dd ansible-test - Update base and default containers.
The containers now include Python 3.10.0 instead of Python 3.10.0rc2.
2021-10-06 11:40:54 -07:00
8a295b8ada Remove incidental_cloud_init_data_facts integration tests (#75885)
* Remove incidental_cloud_init_data_facts integration tests

* Remove cloud_init_data_facts.py

* ci_coverage ci_complete
2021-10-05 16:14:37 -05:00
0c8b62b527 Update the porting guide for a new ansible version (#75893) 2021-10-05 15:17:10 -04:00
000ae00cfd Docs: Clarify adding newlines in YAML folded block scalar (#75875)
* Removed translatable words from code blocks

##### SUMMARY
Removed translatable words from codeblocks as per #59449

##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr

* Maintaining intend as well as clearity

* Preserving "save_as" as the key

* showing equivalence and keeping same context
2021-10-05 04:13:49 -07:00
19fce0527a docs - Use code-block to format code examples in Developer Guide (#75849)
Fixes #75663
2021-10-04 13:55:00 -07:00
8988f8ab5d Corrected mytask.yml file name (#75860) 2021-10-04 16:39:55 -04:00
20904c2fb6 Move ansible-5.1 to 2021-12-21 (#75865)
We moved the target date for ansible-5.0 one week back so there's now
time to do 5.1 before the holidays start.
2021-10-04 16:37:50 -04:00
4aede377d2 docs - Use code-block to format code examples in Community Guide (#75847)
Fixes #75675
2021-10-04 10:46:43 -07:00
4d398ca3a4 docs - Use code-block to format examples in Network Guide (#75850)
Fixes #75676
2021-10-04 10:29:14 -07:00
f4d4391a1f ansible-test - Update distro test containers. 2021-10-01 11:20:49 -07:00
1932f0008b ansible-core - Remove support for Python 2.6. (#75853) 2021-10-01 01:16:37 -07:00
099d80829f ansible-test - Fix inventory generation. 2021-09-30 19:03:09 -07:00
68ab92e22a ansible-test - Remove support for Python 2.6.
Deferring removal of obsolete constraints until container updates are required.
2021-09-30 14:13:50 -07:00
827981c7dd Add support for distinct collection skeleton configuration (#75845)
Signed-off-by: Jeremy Kimber <jeremy.kimber@garmin.com>

Co-authored-by: Jeremy Kimber <jeremy.kimber@garmin.com>
2021-09-30 14:13:15 -07:00
3ef8782b90 Fix sanity test ignores. 2021-09-30 13:58:27 -07:00
e9c27c99dd Fix up deprecation removal changelog headers (#75848) 2021-10-01 06:37:45 +10:00
9de4f24d7a test support ec2_ami_info: remove ec2_ami_facts name deprecation (#75841)
Fixes #75829
2021-09-30 12:50:48 -07:00
f774292439 cli - remove deprecated setting verbosity before sub command (#75840)
* cli - remove deprecated setting verbosity before sub command

Fixes #75823

* Fix tests
2021-09-30 12:50:18 -07:00
239dbcb24f copy: remove deprecated thirsty alias (#75839)
Fixes #75824
2021-09-30 12:48:48 -07:00
44095caca9 url_argument_spec: remove deprecated thirsty alias (#75838)
Fixes #75825
Fixes #75826
2021-09-30 12:48:10 -07:00
13e535c3bc Remove deprecated Templar.set_available_variables() (#75836)
Fixes #75828
2021-09-30 12:46:07 -07:00
963a272b28 uri: add documentation for return value path (#75795) 2021-09-30 12:26:33 -07:00
bb59d9afe9 bump devel to 2.13 (#75833) 2021-09-30 09:18:32 -05:00
927ffe26b7 Docs: add install link for windows (#75811) 2021-09-29 08:04:35 -07:00
5d1abdbf6b correct runas comment (#75806) 2021-09-28 18:02:01 -04:00
a9bd8b6cff No Ansible Engine (#75812) 2021-09-28 12:25:15 -05:00
79e9dae292 Don't show params when there is an issue with set_option(s) (#75805) 2021-09-28 11:25:25 -05:00
8643db5ac3 Bump antsibull version to get support for attributes and CLI options (#75787)
* Bump antsibull version to get support for attributes and CLI options.

* Include fix for attributes.

* Include fix for rst_epilog collision and for #75799.
2021-09-27 16:52:05 -04:00
a160eeedd8 2.13 changelog cleanup (#75800) 2021-09-27 10:21:22 -05:00
2934c4f710 ansible is now ansible-core in AUR too (#75145) 2021-09-27 10:46:42 -04:00
872fda8815 attribs last PR for now ... i hope (#75778)
* attribs last PR for now ... i hope

* thatsallfolks!

* fixes

* Update lib/ansible/modules/template.py

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

* Update lib/ansible/modules/validate_argument_spec.py

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

* moar fixes

* asldf

* missing import

* iswearihadaddedthese

Co-authored-by: Matt Martz <matt@sivel.net>
2021-09-24 15:55:44 -07:00
a22964609e Fix lineinfile test (#75785)
* fix remote test after controller split

* other files had it too!
2021-09-24 15:43:22 -07:00
0d5a9f2138 ansible-test - More PEP 484 type hints. 2021-09-24 15:17:21 -07:00
263fd64759 updated ansible.cfg to guide stray link devel link (#75782)
* updated ansible.cfg to guide stray link devel link
2021-09-24 16:25:41 -04:00
e66e2e25c8 ansible-test - Update default containers. 2021-09-24 13:19:10 -07:00
845935f74f Revert "Compile role with parents in the task's dependency chain (#75165)" (#75779)
This reverts commit 440cf15aeb.
2021-09-24 15:30:35 -04:00
6a5d6896fd ansible-test - Warn about stale sanity venvs. 2021-09-24 12:16:35 -07:00
b70077364a ansible-test - More PEP 484 type hints. 2021-09-24 11:57:25 -07:00
6981237130 ad-hoc: add documentation about pattern (#73303)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-09-24 14:40:13 -04:00
e2ad9f1c85 Changed to file instead path for touch choice in state parameter docs (#75282) 2021-09-24 14:36:28 -04:00
0cb7a4d260 clarify order (#75338) 2021-09-24 14:35:35 -04:00
e021a65403 using FQCN also for ansible.builtin collection (#75644) 2021-09-24 14:34:20 -04:00
e5a52c1e9d added section about parallelism to delegation (#74158) 2021-09-24 14:21:13 -04:00
d3ebbef075 correct dedupe scope (#75422) 2021-09-24 14:20:43 -04:00
f4cdea9645 docs - add some info on plugin option source precedence (#75754)
* docs - add some info on plugin option source precedence

##### SUMMARY
Add some clarity on precedence, especially from sources of the same type.


##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr

* update RST formatting

* Update docs/docsite/rst/dev_guide/developing_plugins.rst

Apply review suggestions

Co-authored-by: Aine Riordan <44700011+ariordan-redhat@users.noreply.github.com>

Co-authored-by: Aine Riordan <44700011+ariordan-redhat@users.noreply.github.com>
2021-09-24 10:50:32 -07:00
5183a2e585 Add note about loop_control.extended memory impact (#75759)
* Add note about `loop_control.extended` memory impact

* moar correct
2021-09-24 10:35:44 -07:00
65b5472ad1 Update roadmap to indicate branching happens at feature freeze (#75777) 2021-09-24 11:59:58 -05:00
a5e7ed0cc5 Update ansible porting guide for 4.6.0 release. (#75752) 2021-09-24 11:07:15 -04:00
58b03be417 ansible-test - Code cleanup. (#75774)
* ansible-test - Remove unused code.
* ansible-test - More PEP 484 type hints.
2021-09-24 00:38:56 -07:00
6c133da45e ansible-test - Fix code coverage reporting. (#75771) 2021-09-23 21:24:01 -07:00
43e1cba8c1 Fix up validate-modules sanity check for PowerShell - ci_complete 2021-09-23 20:39:05 -07:00
b51e62f6e5 ansible-test - Add minimum constraints for pytest.
Use `--strict` for `pytest` on Python 2.6 since `--strict-markers` is not available.
2021-09-23 17:18:57 -07:00
a2d4a8a9f3 PowerShell - Support optional module util imports (#75187) 2021-09-23 16:47:10 -07:00
e3fd9b0769 ansible-test - Add --prime-containers option.
Resolves https://github.com/ansible/ansible/issues/75320

The option `--prime-containers` was chosen over `--docker-pull-only` to match the recently added `--prime-venvs` option for sanity tests.
It would also fit well with a future `--prime-requirements` option for pre-installing requirements for unit and integration tests.
2021-09-23 15:52:34 -07:00
28a094c5de ansible-test - Remove unused constraints.
ci_complete
2021-09-23 12:48:44 -07:00
67ca455829 attributes: support extra value 'not applicable' for support (#75751)
* Support two extra values 'unknown' and 'not applicable' for support.

* Simplify to only one new state: 'n/a'

* Adhere to the IBM style guide.
2021-09-23 15:02:59 -04:00
c5d8dc0e11 Add attributes 2/x (#75619)
* Added attribute information to more modules

 rearranged the shared data
 platform revamped
 use 'details' and avoid overriding description

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>

* Update lib/ansible/plugins/doc_fragments/action_core.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update lib/ansible/plugins/doc_fragments/action_core.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update lib/ansible/plugins/doc_fragments/action_core.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update lib/ansible/plugins/doc_fragments/action_core.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update lib/ansible/plugins/doc_fragments/action_core.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update lib/ansible/modules/fail.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update lib/ansible/modules/debug.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update lib/ansible/modules/command.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update lib/ansible/modules/assert.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update lib/ansible/plugins/doc_fragments/action_core.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update lib/ansible/modules/gather_facts.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update lib/ansible/modules/include_vars.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update lib/ansible/modules/meta.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update lib/ansible/modules/meta.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update lib/ansible/plugins/doc_fragments/action_common_attributes.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update lib/ansible/plugins/doc_fragments/action_common_attributes.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update lib/ansible/plugins/doc_fragments/action_common_attributes.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-09-23 12:48:28 -05:00
78ff1ab546 Add constraints to prepare_http_tests target. 2021-09-23 00:14:43 -07:00
46c7b24188 ansible-test - Update distro test containers. (#75762) 2021-09-22 19:41:08 -07:00
5cb54e8c58 ansible-test - Create injector scripts at runtime. (#75761)
* ansible-test - Create injector scripts at runtime.
* Set bootstrap.sh shebang at runtime.
* Remove shebang and execute bit from importer.
* Update shebang sanity test.
* Preserve line numbers.
2021-09-22 16:01:42 -07:00
440cf15aeb Compile role with parents in the task's dependency chain (#75165)
* Use the task dependency chain to compile the role instead of the parent role's _parents list

* keep existing role inheritance, but limit it to roles in the current task dependency chain

* Test getting role parents recursively by using the current task dependency chain

* changelog
2021-09-22 17:08:00 -04:00
7a76130502 ansible-test - Update default containers.
ci_complete
2021-09-22 09:59:55 -07:00
96b221b344 Update vendored copy of distro to 1.6.0 (#75732)
* Update vendored copy of distro to 1.6.0

* copy pasta mistake

* ci_complete
2021-09-22 11:43:25 -05:00
7a4b5d14fc ansible-galaxy role install: download from API response location (#73114)
* download role from api response location

* include changelog fragment

* add unit test for role download url

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-09-22 10:39:58 -04:00
57359d0174 use passlib default if password_hash option isn't set (#75043)
* add changelog fragment
* password_hash|length == 120
* mention the new default bcrypt format in the porting guide
2021-09-21 17:35:53 -04:00
7ecc227488 ansible-galaxy: Clone git collections using shallow clones (#75722)
* ansible-galaxy: Clone git collections using shallow clones

This ensures the collection obtained via git url is a result of a
shallow git clone (git clone --depth=1). The git history of the
collection is not used by ansible, and as such, cloning the entire
history of the repo is unnecessary.

Signed-off-by: Tomas Babej <tomas@tbabej.com>

* ansible-galaxy: Only perform shallow clones on non-versioned git urls

In general, the version can be anything we can checkout (branch, tag,
but also a commit hash). In particular for commit hashes we cannot
perform a shallow clone.

Err on the safe side and only perform shallow clones for non-versioned
git urls (cloning HEAD).

* galaxy-install: Make shallow cloning compatible with older Python versions

Signed-off-by: Tomas Babej <tomas@tbabej.com>

* Pass args as a tuple

Add tests for the git command created from different repo and version combinations

* changelog

Co-authored-by: Tomas Babej <tomas@tbabej.com>
2021-09-21 15:45:28 -04:00
724800cd3f Python 3.8 Controller Minimum (#74013) 2021-09-21 13:43:31 -05:00
4ab90f3afc Re-enable old_style_cache_plugin test target (#75748)
Fix tests for cache plugins written before ConfigManager
2021-09-21 14:20:50 -04:00
4652d6ee43 ansible-test - Remove deprecated environments. 2021-09-21 08:38:12 -07:00
94410789d1 ansible-test - Add --prime-venvs option. 2021-09-21 00:03:33 -07:00
178a67fd40 ansible-test - Add support for windows/2022 (#75743)
ci_complete
2021-09-21 13:51:13 +10:00
4ea8d9a782 ansible-test - split controller/target testing (#75605) 2021-09-20 18:39:07 -07:00
989eeb243f Add an undef global Jinja function (#75435)
* add tests for fail filter

also tests that fail does not block inspectability

* add fail filter

fallback message is a bit clunky,
since you can't invoke a filter without specifying an input.
That is, "{{ fail }}" doesn't work,
so you have to do "{{ None | fail }}"

* document 'fail' filter

* add changelog fragment

* fail filter uses default message on Undefined or emptystring

makes it slightly easier to use the default message:
```diff
- "{{ None | fail }}"
+ "{{ '' | fail }}"
```

and the user sees a slightly more relevant message
if the message itself is undefined:

```diff
- The error was: {{ failmsg | fail }}: 'failmsg' is undefined
+ The error was: {{ failmsg | fail }}: Mandatory variable has not been overridden
```

* rebuild as the builtin `Undefined`

* harmonise `hint` parameter for make_undefined with jinja

* use code block for documentation item

[ref](https://github.com/ansible/ansible/pull/75435#discussion_r707661035)

* rename to `undef` to expose less Python into the Jinja

[ref](https://github.com/ansible/ansible/pull/75435#pullrequestreview-757799031)

* explicitly instantiate undefined value now that it's possible

see I knew we would break something with reflection

* preserve test coverage of undefined variable

Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
2021-09-20 15:37:36 -07:00
47b644570f facts: Add uptime fact for FreeBSD and Darwin (#75432)
This is a bit more complicated than on OpenBSD/NetBSD.

The code is inspired in part from https://github.com/Cairnarvon/uptime

Tested on the GCC compile farm: https://cfarm.tetaneutral.net/

Co-authored-by: Baptiste Jonglez <git@bitsofnetworks.org>
2021-09-20 16:57:52 +02:00
61f5c22551 Remove (only) user-facing use of ANSIBLE_ASYNC_DIR (#74249)
Change:
- Remove only user-facing use of ANSIBLE_ASYNC_DIR.
- Remove two comments saying to change things that, apparently, we
  aren't going to change...

Test Plan:
- ci_complete

Tickets:
- Fixes #74139
- Fixes #74138
- Refs #74226

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-09-17 14:58:17 -05:00
1353678f23 Enable ansible-galaxy to specify client id override with Keycloak Token (#75601)
* Enable ansible-galaxy to specify client id override with Keycloak Token

* Specify ability to provide override of client_id

* Test client_id can be configured for individual servers

* Add issue link to changelog

* Document client_id as a config option and add an example

Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
2021-09-17 12:10:10 -07:00
54a795896a Integration test and sanity index generation fixes. (#75731)
* Fix test usage of `which python`.

Also use `command -v` instead of `which` where needed.

* Fix testing_formatter.sh file checking.

The index is longer expected to exist when generating it.
The generation script is run with `set -eux`.
2021-09-17 11:05:19 -07:00
b281f84bc4 Ignore support code in update-bundled test. 2021-09-17 10:42:30 -07:00
45459346ed Document diff mode support for apt_repository and cron (#75709) 2021-09-17 11:19:47 -04:00
f0d43cfffc Document validate_certs option for Galaxy server configuration (#75728)
Added in #75710
2021-09-17 10:58:31 -04:00
2346f93961 Docs: Fix section header notation in Style Guide (#75720) 2021-09-17 10:55:05 -04:00
17122edfc5 Docs: Fix section header notation in Developer Guide (#75721) 2021-09-17 10:52:46 -04:00
8dc5516c83 getent, fix returning mulitple results for key (#75620)
* getent, fix returning multiple results for key
* added return docs

Co-authored-by: flowerysong <junk+github@flowerysong.com>
2021-09-17 10:09:40 -04:00
097bc07b66 PowerShell - Ignore LIB env var when building C# code (#75698)
* PowerShell - Ignore environment variables when building C# code

* Just unset LIB for now

* Fix sanity issue
2021-09-17 08:07:40 +10:00
a11bb8b4d3 Revert "user - consistently create user home directory on Linux (#71952)" (#75704)
This reverts commit 2f7e0b8489.
2021-09-16 12:05:32 -07:00
72ba2bdc82 ansible-galaxy - add a per-server validate_certs option (#75710)
* Add a validate_certs option to galaxy server configuration

* Add a unit test for cert validation

* changelog
2021-09-16 13:54:52 -04:00
9558f53a58 Fix git submodules path issue (#75655)
* Fix git path used for submodules

* Fix git submodules integration test
2021-09-16 09:46:50 -04:00
3d081b6ca5 Docs: Edit list of locations to search for roles (#75703)
* Docs: Add playbook base dir to roles search

* Docs: Add link to default roles path
2021-09-16 06:42:14 -07:00
c3fc8fb99a apt module: add option to allow package downgrades (#74852)
* apt module: add option to allow package downgrades

* Add new option to module so users don't have to force downgrades which
  is insecure and dangerous

* Add integration tests similar to upgrade integration tests

* Changelog

* Update changelog fragment

* Update changelogs/fragments/74852-apt-allow-downgrade.yaml

Co-authored-by: Amin Vakil <info@aminvakil.com>

* Update lib/ansible/modules/apt.py

Co-authored-by: Amin Vakil <info@aminvakil.com>

* Update lib/ansible/modules/apt.py

Co-authored-by: Amin Vakil <info@aminvakil.com>

Co-authored-by: Amin Vakil <info@aminvakil.com>
2021-09-14 17:46:56 +02:00
b1527dcf63 Small typo in vars plugin example. (#75702) 2021-09-14 10:18:04 -05:00
208014422d Fix markdown links that were errantly formatted as rst (#75697) 2021-09-14 10:15:37 -05:00
3d83c325dd Fix metadump (#75668)
* ensure dump produces json

* clog and tests

* remove library additions since they are not usable

* avoid any/all dirs

* ensure we dont use local dir as playbookdir
2021-09-14 10:05:21 -05:00
469b559ebe Try all galaxy servers when locating available versions for a collection (#75468)
* If an exception occurs when getting a collection's metadata, continue to the next in the server list.

* Warn for unknown exceptions when finding versions of a collection

* Test that an invalid server is no longer fatal if a subsequent server has the collection

* Fix server for verify tests - compare checksums against the server from which it was installed

* Add tests for verify and fix that code path to mirror install/download behavior for server errors

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2021-09-14 09:40:48 -04:00
01f0c38aa5 Docs: Update cross reference tag syntax in User Guide (#75693) 2021-09-13 10:19:48 -04:00
3e7a622204 Fix unexpected exception when a role has an empty argument_specs.yml (#75604)
* Fix role with empty argument_specs.yml

* Use try/except and add changelog fragment

* Always return a dict

* Add test for empty argument_specs key
2021-09-10 14:35:41 -04:00
55d448baa7 Run apache via async (#75682) 2021-09-10 12:02:58 -05:00
649a5bbda2 Fix cleaning up user for unarchive tests (#75681)
Become root to clean up user

Clean up users with force and remove enabled

Co-authored-by: Matt Martz <matt@sivel.net>
2021-09-10 12:44:42 -04:00
05464a0ff7 Ensure we set perms on htpasswd file to avoid permissions errors (#75679) 2021-09-10 11:06:43 -05:00
7cbb53fe9a Fix test interactions by cleaning up users with the same uid by using 'force: yes' and 'remove: yes' (#75670)
Co-authored-by: Matt Martz <matt@sivel.net>
2021-09-09 18:32:21 -04:00
63413dd483 Remove incidental_win_security_policy (#75654)
* Add an intentional test for diff.prepared

ci_complete
ci_coverage

* Remove incidental_win_security_policy

* Forgot to remove this
2021-09-09 12:17:48 -07:00
c2fa71c4e8 Fix various typos in documentation (#75662)
* docs/docsite/rst/dev_guide/developing_modules_general_aci.rst: fix typos

* docs/docsite/rst/dev_guide/testing/sanity/no-get-exception.rst: fix typos

* docs/docsite/rst/dev_guide/testing_units_modules.rst: fix typos

* docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst: fix typos

* docs/docsite/rst/porting_guides/porting_guide_2.0.rst: fix typos

* docs/docsite/rst/porting_guides/porting_guide_2.10.rst: fix typos

* docs/docsite/rst/porting_guides/porting_guide_2.4.rst: fix typos

* docs/docsite/rst/porting_guides/porting_guide_3.rst: fix typos

* docs/docsite/rst/porting_guides/porting_guide_4.rst: fix typos

* docs/docsite/rst/reference_appendices/glossary.rst: fix typos

* docs/docsite/rst/reference_appendices/release_and_maintenance.rst: fix typos

* docs/docsite/rst/scenario_guides/vmware_rest_scenarios/collect_information.rst: fix typos

* docs/docsite/rst/scenario_guides/vmware_rest_scenarios/vm_tool_information.rst: fix typos

* docs/docsite/rst/scenario_guides/vmware_scenarios/vmware_inventory_vm_attributes.rst: fix typos

* docs/docsite/rst/user_guide/playbooks_debugger.rst: fix typos

* docs/docsite/rst/user_guide/playbooks_filters.rst: fix typos

* docs/docsite/rst/user_guide/windows_performance.rst: fix typos

* docs/docsite/rst/scenario_guides/vmware_scenarios/vmware_inventory_vm_attributes.rst: fix typos
2021-09-09 08:34:46 -07:00
8d84f3c593 Fix fetch integration test. (#75661) 2021-09-08 22:11:40 -07:00
12734fa21c yaml dumper: Add YAML respresenter for AnsibleUndefined (#75078)
Fixes: #75072

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-09-07 10:21:47 +05:30
de01db08d0 pip - Use pip from the current Python interpreter. (#75634)
* pip - Use pip from the current Python interpreter.

If `executable` and `virtualenv` were not specified, and
the `pip` Python module is available for the current interpreter,
use that `pip` module instead of searching for a `pip` command.

* Add comment about needing `__main__` to run `pip`.

* Fix unit test.

* Add porting guide entry.

* Update changelog to match porting guide description.

ci_complete
2021-09-03 15:17:43 -07:00
fc8197e326 AnsiballZ - Make sure cwd is accessible. (#75636) 2021-09-03 08:31:20 -07:00
e60ee82343 docs: clarify that known_hosts path must exist (#75615)
* docs: clarify that known_hosts path must exist

Fixes #75606

* Clarify clarification.
2021-09-02 12:43:19 -07:00
ccf8a7da82 Modify getent example; closes #75624. (#75633)
* Adds "ansible_facts." in front of each getent example.
2021-09-02 15:27:17 -04:00
7ff2a55f3f psrp - fix typo (#75617)
psuedo -> pseudo
2021-09-02 15:17:26 -04:00
90518d8bb5 added vault/unvault docs (#75140) 2021-09-01 16:49:21 -04:00
5ecbc199f8 ssh connection added option priority note (#75219) 2021-09-01 16:48:06 -04:00
8af54a0355 Added info about playbooks for collection (#75535)
*
2021-09-01 16:40:03 -04:00
2c67954f9b Docs: adds warning about utf-8 in templates (#75504) 2021-09-01 16:21:18 -04:00
0ef9b9ee49 Update the porting guide for a new ansible version (#75610) 2021-09-01 15:44:07 -04:00
dcd31da01a clarify cacheable (#75085)
* clarify cacheable

* Update lib/ansible/modules/set_fact.py

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

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-09-01 15:42:24 -04:00
f38a97cece Fix build_ignore when installing a collection from source (#75547)
* Make individual dirs that should exist instead of using shutil.copytree

* Test build_ignore when installing collections in git repos

* changelog

* Fix assertion
Fix git directory

* Fix nested content while building the collection dir

Test installing a collection from a git repo and artifact have the same result

Refactor to use variables
2021-09-01 18:36:09 +02:00
d6dededab8 Use context manager for file handling in some system modules. (#65227) 2021-09-01 11:29:35 -04:00
9c2f44b884 Fix templating task action with host-specific vars (#75600)
Fixes #75568
2021-08-31 17:33:57 +02:00
bee5e02232 Rename integration test targets.
Improve consistency with naming of tests for Ansible CLI commands.
Fix naming of module_utils tests to match the files under test.
2021-08-30 17:11:07 -07:00
388760eef6 Docs: Add more Matrix documentation (#75588)
* Refs #75478 - On the communicating page, add Matrix links to first 4 chat spaces, improve introduction, update working groups with Matrix and IRC locations, add a link to the community FAQ, add localised community translations, and remove Lightbulb room, the GitHub project has been archived

Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2021-08-30 18:44:27 -05:00
2462ec74a0 validate_args_spec, use combine vars and in precedence (#75471)
* combine vars and in correct precedence
* add examples
2021-08-30 13:56:23 -04:00
e5f6c2d141 Fix rekey_on_member when key is undefined (#75131)
* Fix rekey_on_member when key is undefined and add a test case

* Add documentation about error handling in filter and test plugin sections
2021-08-30 12:03:42 -04:00
051a257092 Add attributes a-c (#75561)
* removed redundant notes
2021-08-30 11:28:00 -04:00
bbf5bbd8e4 removing out of date example ansible.cfg (#75193)
removing  out of date example ansible.cfg, show user how to generate from ansible-config

Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2021-08-30 11:25:13 -04:00
db3e8f2c1c import_role - support templating _from_files with --extra-vars (#75269)
* Support templating _from_files with --extra-vars for imported roles

* Add tests for templating the filenames for import_role, import_playbook, and import_tasks

* Add documentation

Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2021-08-30 10:34:16 -04:00
d36116ef1c dnf: ensure we use the correct locale for dnf API (#75264)
Fixes #75021
2021-08-30 14:22:00 +02:00
e35e8ed2ec makes Fest link from docs trackable (#75594)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-08-27 15:51:57 -05:00
747789787b added a caveat to say check individual module documentation for compatibility (#75582) 2021-08-27 20:33:31 +05:30
74f5367673 Ensure heuristic_log_sanitize returns correct data if no password found (#75570)
* Ensure heuristic_log_sanitize returns correct data if no password found. See #75542

* Need to allow code to flow through
2021-08-26 12:13:51 -07:00
d83acc1c4c Slip ansible 5 release [alternative] (#75529)
* Fix link to core roadmap

* Slip ansible 5 release to account for ansible-core slip.
2021-08-26 13:53:01 -04:00
3d7f2a1366 Fix an exception when passlib library is used with a wrapped algo (#75527)
* Test a passlib wrapped algo with a password lookup

* Fix error when passlib is used with a wrapped algo

The exception was:

     An unhandled exception occurred while running the lookup plugin 'password'.
     Error was a <class 'TypeError'>, original message: issubclass() arg 1 must be a class

and can be reproduced using the following command:

    ansible localhost -i localhost, -mdebug -amsg="{{ lookup('password', '/dev/null encrypt=ldap_sha512_crypt') }}"

The concerned algo are: bsd_nthash, django_argon2, django_bcrypt, ldap_bcrypt,
ldap_bsdi_crypt, ldap_des_crypt, ldap_hex_md5, ldap_hex_sha1, ldap_md5_crypt,
ldap_pbkdf2_sha1, ldap_pbkdf2_sha256, ldap_pbkdf2_sha512, ldap_sha1_crypt,
ldap_sha256_crypt, ldap_sha512_crypt, roundup_plaintext
2021-08-26 09:58:42 +10:00
baa20fba2f allow vars_files to use dwim (vars/) and vaults (#75526)
* allow vars_files to use dwim (vars/) and vaults

*  also fixed bug with temp file cleanup, some pythons dont like it when you alter loop

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
2021-08-25 14:04:27 -04:00
bb2e45873c updated 'Installing Ansible on Debian' details (#75567) 2021-08-25 13:43:48 -04:00
b37a0630da Revert "use versioned doclink for url references (#74245)" (#74782) 2021-08-24 12:35:37 -05:00
59dd5704ca Allow make docs to use PYTHON variable (#75559)
The GENERATE_CLI command does not take into account a user overriding
the PYTHON variable.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2021-08-24 11:29:28 -04:00
2ba9e35d09 yum: fix yumstate when wildcards are used in list arg (#75545)
Fixes #74557

* map is not available on centos 6's jinja...
2021-08-24 11:17:08 -04:00
3ca50a2200 Clarify get_bin_path error message (#75544) 2021-08-24 11:16:12 -04:00
ff72908b4d Fix --list-hosts when undefined var is used (#75533)
fixes #75354
2021-08-23 15:17:19 -04:00
a661e44f6e Update the porting guide for a new ansible version (#75457) 2021-08-20 11:53:23 -04:00
1dc495405f Added missing colon in note (#75465)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-08-20 11:49:28 -04:00
51f2f1ac5e yum: fix parsing of check-update with subsequent empty lines (#75452)
Rather than adding further complexity to the regex, preprocess the output to
remove any empty lines. Now the only purpose of the regex is to fix
wrapped lines.

Fixes #70949
2021-08-20 11:30:33 -04:00
9505f8c75d dnf: allow for download_only to be run without root (#75532)
Fixes #75530
2021-08-20 05:20:53 +10:00
91319c5cfc Avoid accessing delegated vars when you dont have a host (#75524)
* avoid getting delegated vars w/o inventory host

 fixes #75512

 In the case of imports, we don't have a host, so getting host vars for
 the delegated host makes no sense and should be avoided.

* also avoid error on vars_files with per host vars

* test

* testing given case

* oops
2021-08-20 05:10:00 +10:00
b554aef3e1 More options for password passing (#73117)
* add 'file options' for become and connection pass
* implemented getting passwords from file or script
* added config entry
* fixed env var name and noted executable behaviuor

Co-authored-by: Rick Elrod <rick@elrod.me>
2021-08-19 12:18:30 -04:00
214f0984a9 Dump keyword data (#75446)
* Add keywords to ansible-doc dump

  also fixed issue with async
2021-08-19 11:42:23 -04:00
1c34492413 dnf: align the return value of the list argument with yum (#75501)
* dnf: align the return value of the list argument with yum

Fixes #75483

* Add integration test
2021-08-17 11:11:07 -04:00
13e6bd9232 ssh: Update docs (#75253)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-08-16 11:03:50 -04:00
99a79e1969 ansible-test - Move code from _data to _util. (#75495)
* Update paths to match relocated files.
* Update ansible-test symlink paths.
* Update path classification.
* Update MANIFEST.in
* Update sanity test context paths.
* Update sanity ignores.
* Update shebang sanity test.
* Update configure-remoting-ps1 sanity test.
* Update BOTMETA.yml to reflect new paths.
* Update paths in collection loader comments.
* Update Makefile for ansible-test.
* Update docs.
* Add changelog fragment.
2021-08-12 15:07:06 -07:00
394860560a remove core docs build warnings (#75496) 2021-08-12 15:58:54 -05:00
bc22f70a21 Add host information to the retry print statement (#75494)
* Add host information to the retry print statement

* Add changelog fragment reflecting retry print change
2021-08-12 12:57:30 -07:00
7a9246a219 ansible-pull, restore repo options (#75491) 2021-08-12 12:52:24 -07:00
3ecf438e66 jinja2_native: short-circuit literal_eval for non-strings (#75484) 2021-08-12 12:47:33 -07:00
351f122e24 Update playbooks_tags.rst (#75472)
##### SUMMARY
When I used this example it complains with:

ERROR! The tasks/main.yml file for role 'myrole' must contain a list of tasks

The error appears to be in 'ansible/roles/myrole/tasks/main.yml': line 2, column 1, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
tasks:
^ here

Removing "tasks:" fixes it.


##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2021-08-12 12:43:20 -07:00
a88741cf14 dnf: properly capture transaction error (#75444)
Fixes #72651
2021-08-12 12:14:23 -07:00
d652b19e11 Docs: clarify dir names for local plugins (#75157)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
2021-08-12 11:47:27 -04:00
3c3e30a610 Docs: Add Matrix as a chat option (#75406) 2021-08-12 11:47:02 -04:00
03083c3139 setup module, dont truncate hpux interfaces (#75423)
* setup module, dont truncate hpux interfaces

  fixes #70533

 no hpux to test so relying on man page and users that reported successful testing
2021-08-12 10:13:36 -04:00
3d872fb5e8 Add new comment attribute to template plugin (#69253)
* Add new comment attribute to template plugin

Add comment_start_string and comment_end_string attribute to template
plugin


Co-authored-by: Hossein Zolfi <h.zolfi@inside.sahab.ir>
2021-08-12 09:46:02 -04:00
2b463ef197 ansible-test - Upgrade pylint to 2.9.3. (#75480)
* ansible-test - Upgrade `pylint` to 2.9.3.
* Update pylint ignores due to rule name change.
* Disable pylint deprecated-class for compat code.
* Add pylint ignores for test support content.
* Add ignores for arguments-renamed in lib/ansible/
* Add pylint ignores for collection_loader.
* ansible-test - Ignore deprecations in legacy collection loader.
* ansible-test - Suppress pylint consider-using-with
* ansible-test - Suppress pylint false positive.
* ansible-test - Suppress pylint consider-using-with.
* ansible-test - Suppress pylint deprecated-module
* Disable some of the new pylint suggestions.
* Remove unnecessary six usage from string_format pylint plugin.
* Remove obsolete ignore entry.
2021-08-11 21:04:42 -07:00
5af0420cab hacking - account for job names that contain separators (#75454)
Some job names contain '/' which causes the download job to fail.

Example job name: `Post-job: Checkout ansible/ansible@refs/pull/75445/merge to ansible.log`
2021-08-11 20:33:23 -07:00
7450e87615 Fix up string splitting to prepare for pylint update. (#75479)
* Use rsplit with maxsplit in BaseCacheModule.
* Use maxsplit for accessing first item.
* ansible-test - More efficient splitting.
2021-08-11 15:44:50 -07:00
ce6d8a143c Code cleanup to prepare for pylint update. (#75475)
* user - Remove unused code.
* Replace deprecated abstractproperty decorator.
* Fix __all__ to be a tuple.
* Use a generator in subelements lookup.
* Use from import in basic.py
* Add changelog fragment.
* Fix selinux unit test.
2021-08-11 17:47:23 -04:00
dc6878007b Add AnsibleFest banner (#75476)
* add AnsibleFest banner

* fix nit
2021-08-11 15:40:18 -05:00
a5b0626176 Cleanup hacking scripts to prepare for pylint update. (#75474)
* Use generator in get_recent_coverage_runs.py
* Use from import in test-module.py
2021-08-11 13:18:40 -07:00
04009a77e6 Clean up unit tests to prepare for pylint update. (#75473)
* Fix argument name in mocked function.
* Use from import in unit tests.
* Remove unused imports.
2021-08-11 13:08:31 -07:00
ca2d2c5f38 ansible-test - Cleanup to prepare for pylint update. (#75469)
* ansible-test - Fix use of abstractproperty
* ansible-test - Use dict.items() where possible.
* ansible-test - Remove unused code.
* ansible-test - Cleanup issues reported by pylint.
* ansible-test - Use dict.items() where possible.
* ansible-test - Use generator.
2021-08-11 11:47:18 -07:00
39605cdcce docs: missing colon for a note (#75453) 2021-08-11 16:58:43 +05:30
e24eb59de5 Improve ansible-galaxy error for InconsistentCandidate exception (#75235)
* Improve error for InconsistentCandidate exceptions

* Add test case for installing a collection with an inconsistent version

* Add test case for installing a collection that has a dependency with an inconsistent version

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
2021-08-10 18:00:03 -04:00
0055a328b3 Also allow .yml. (#75439) 2021-08-10 14:11:16 -05:00
cea4886c7c Update test container versions (#75447)
* Update test container versions to use the most recent which contain Python 3.10.0 RC1
2021-08-09 17:52:57 -07:00
377becd609 add diversity working group to list of working groups (#75228) 2021-08-10 00:09:09 +02:00
61b81bcd10 Docsite: improve reporting_bugs_and_features.rst (#75234)
* Docsite: improve reporting_bugs_and_features.rst

* Add clarification
2021-08-09 16:49:25 -05:00
c127843698 Fix typo in porting_guide_4.rst (#75442)
paramater -> parameter
2021-08-09 16:42:19 -05:00
fae299708f plugin attributes: make validate-modules strict again, improve version_added support (#74602)
* Add basic schema for attributes.

* Support attributes for version_added_collection adding mechanism.

* Add changelog fragment.

* Support new attribute properties from #74331.

* Require additional properties strictly.
2021-08-09 10:22:09 -05:00
e23fdee45e Fix dnf test assertion (#75426) 2021-08-06 16:56:33 -04:00
d9d98740f2 new antsibull supports breadcrumbs toggle (#75424)
* new antsibull supports breadcrumbs toggle

* let antsibull versoin float free

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-08-06 21:21:32 +02:00
f1ad6cf479 added more attributes for existing facilities (#74331) 2021-08-06 12:23:24 -05:00
75e6bdb579 ensure we convert path in warning or py2.6 breaks (#75413) 2021-08-06 05:21:23 +10:00
b541a148d5 Fix dnf package matching (#75411)
* Fix a bug with the dnf module not using all components of a package name when filtering to determine if it's installed

* changelog

* Simplify splitting on the last '.'

* Update lib/ansible/modules/dnf.py
2021-08-06 05:19:53 +10:00
b8ebf32d85 Add sanity tests which ensures that _info and _facts modules set supports_check_mode=True. (#75324) 2021-08-05 11:11:42 -04:00
5a38076568 Globals should be accessible when importing a template without the context (#75384)
Fixes #75371
2021-08-05 09:59:54 +02:00
1b95b1e7a4 Fix typo in developing_plugins_network.rst (#75382)
extention -> extension
2021-08-05 11:18:58 +05:30
2455d82c14 Make sure self doesn't end up in fake.args (#75403) 2021-08-04 13:38:48 -05:00
fa7482c63a Change interpreter discovery defaults to silently prefer Python 3 (#75049)
Push /usr/bin/python to almost the bottom of the barrel. This makes the strategy to prefer
specific versions of the "mystery meat" version.

* Change INTERPRETER_PYTHON default to 'auto'
    Change description to match change in behavior.
    Change deprecation message to a warning.

* Update docs
* Add porting guide entry
* Update unit tests
* Update integration test
* Allow INTERPRETER_PYTHON_FALLBACK to be configure using a variable
* Prefer platform-python above other Python 2 interpreters
* Add Python 3.10 to the list of interpreters
2021-08-04 14:17:32 -04:00
8d41b97329 Skip python interpreter discovery for 'forced local' module execution (#74824)
mostly for use with network_os
  use 'remote is local' property as indicator
  ensure task_vars are as expected in test
2021-08-04 11:41:58 -04:00
1d2af0b89e ansible-test - allow for the same listening port on multiple interfaces (#75387) 2021-08-03 16:45:12 -04:00
c8d413164d ignore/warn for undefined vars in unused handler names (#75244)
* Make undefined variables in handler names non-fatal if the handler is not used

* If the handler has no way to be notified (i.e. the name can't be templated and the handler has no listen topics), display a warning

* Add tests for variables in handler names

* changelog
2021-08-03 15:16:19 -04:00
d8dcfe737a ansible-test - add ssh debugging logging (#75374) 2021-08-03 10:26:18 -07:00
7d2b80371d fix quick typo (#75373)
fix a small typo introduced in #75343
2021-08-03 10:09:51 -04:00
22aa6dedc9 fix yaml version issue with config yaml dump (#75344)
now tests can run in other pythons (really yaml pkg versions)
  also cleaned up diff_failure for unimplemented flow
2021-08-02 10:33:16 -04:00
549d258c30 Update guide_aws.rst (#75375)
Update Links in AWS Guide.
2021-08-01 18:36:36 +05:30
6607051b75 docs: clarify regex_search return value (#75343) 2021-07-30 18:08:03 -05:00
58e38044fe Fix when evaluation on Native Jinja and Python 3.10 (#75202)
* Fix when evaluation on Native Jinja and Python 3.10

* Add unit test

* Add explaining comment

* Enable jinja2_native before tests

Co-Authored-By: Matt Martz <matt@sivel.net>

* Sanity

* Return native template module instead of modifying globals

Co-authored-by: Matt Martz <matt@sivel.net>
2021-07-30 17:27:49 +02:00
83039a38ad ansible-test - add RHEL 8.4 as a remote (#75362) 2021-07-30 08:19:05 -07:00
f6b27f6e35 Update test container versions (#75359)
* Update test container versions for default-test-container and ansible-core-test-container
2021-07-29 14:36:31 -07:00
7726b70d9a Improve handling of AnsibleModule arguments in validate-modules (#75332)
* Make sure AnsibleModule positional arguments are validated.

* Extract ANSIBLE_MODULE_CONSTURCTOR_ARGS with inspection.

* Remove no longer necessary return value.

* Fix PR #.

* argument_spec might not have been specified, as in community.general.xenserver_facts.

* Fix typo.
2021-07-29 12:47:54 -07:00
b22f976480 Remove duplicate any_errors_fatal test file (#75345)
test/integration/targets/any_errors_fatal/18602.yml is not run via
runme.sh and is testing the same as
test/integration/targets/any_errors_fatal/always_block.yml which is
actually run. The former file is safe to remove.
2021-07-29 12:26:41 -07:00
40ca87a963 Add packaging to requirement of ansible-test (#75356)
* Add packaging to requirement of ansible-test

Fix #75353

After requires_ansible field was added as mandatory to runtime.yml
file, ansible-test fails to check this field if it doesn't have
packaging module.

[1] https://github.com/ansible/galaxy-importer/pull/124
2021-07-29 11:50:29 -07:00
e2b0592f64 Update 2.12 roadmap for schedule change (#75350) 2021-07-29 11:29:58 -05:00
82bab063e7 service_facts, now more accurate on systemd (#75326)
* service_facts, now more accurate on systemd
2021-07-29 11:22:41 -04:00
4dca539a29 Expose unredirected_headers to uri and get_url modules (#75308) 2021-07-28 15:58:12 -05:00
767b2f07b0 Ensure Jinja2 template header overrides are used (#75306)
Fixes #75275
2021-07-26 10:38:41 -04:00
e5a2fe4c41 fix ssh cli defaults (#75245)
* fix ssh cli defaults

  fixes #75221
2021-07-23 12:12:49 -04:00
4d78b58540 Fix resolution of action/module names in module_defaults (#75284)
* Fix resolution of action/module names in module_defaults

* changelog

* Include legacy module_defaults entries for builtin plugins
2021-07-21 10:37:52 -07:00
13c28664ae Docs: talk about AWX or the Platform, not Tower (#74952)
* updates Tower page to talk about RHAAP

* updates scenario guide Tower references

* updates Tower references to use AWX and/or RHAAP

* more scenario guides fixes

* fix CI failures

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

* removes tower link

* for 2.8, still mention Tower along with AWX and RHAAP

* aws guides should be updated in the collection, where they now exist

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-07-21 13:08:46 -04:00
0e9d1ab1cc incorporate minimalism feedback on distributing collections page (#75266) 2021-07-21 13:05:14 -04:00
d016499dcd Update network user guide to point to ansible.utils.cli_parse module and add docs for validate plugin (#75104)
* Update network user guide to point to ansible.utils.cli_parse module as ansible.netcommon.cli_parse is deprecated from ansible.netcommon 2.0.0 release
2021-07-21 10:04:45 -04:00
2a759cbe20 Update the porting guide for a new ansible version (#75292) 2021-07-21 09:39:07 -04:00
8372f34b67 docs: Update description and URL for the ara repository (#75283)
The repository has moved from /openstack/ to /ansible-community/ some
time ago.
2021-07-20 12:05:31 +05:30
5dfa9bdd9f Check if a string is possibly a template in ansible.template.is_template (#75092)
* Move is_possibly_template() to function
  Call is_possibly_template() from is_template() to avoid more expensive analysis if unnecessary.
2021-07-19 10:22:38 -04:00
1fc1ab89ae Add a test for deduplicating dependencies with include_role (#75259) 2021-07-15 12:32:00 -07:00
feed68f6f0 winrm - Add explicit env vars to pass into kinit (#75256)
* winrm - Add explicit env vars to pass into kinit

* Add ini entry and don't override existing env vars
2021-07-15 12:27:29 -07:00
61900c7672 modules moved to use best_parsable_locale (#75250)
* modules moved to use best_parsable_locale

* fixed invocations

* better better

* also module_utils

* converted to function as per fb

* patch testt

* whitespace
2021-07-15 12:18:01 -07:00
d527be8a52 set host_key_checking check to False, rather than if not (which captures False and None) (#75168)
* set host_key_checking check to False, rather than if not (which captures False and None)
* add host_key_checking default to ssh.py / update documentation
2021-07-15 13:22:18 -04:00
5e271dfc60 gitignore vendored dir (#75255)
but still accept __init__.py
2021-07-14 15:33:45 -04:00
3b861abce1 add action_groups support to collections (#74039)
* Canonicalize module_defaults actions and action_groups pre-fork and cache them on the play

* Call get_action_args_with_defaults with the resolved FQCN plugin and don't pass the redirect list

* Add validation for action_group metadata and a toggle to disable the warnings

* Handle groups recursively referring to each other

* Remove special-casing for non-fqcn actions in module_defaults groups

* Error for actions and groups in module_defaults that can't be resolved

* Error for fully templated module_defaults

* Add integration tests for action_groups

* Changelog
2021-07-14 13:33:28 -04:00
9af0d91676 fix option name for parsed (#75229) 2021-07-14 18:38:26 +05:30
f8bb182589 developing_collections_testing: Fix formatting (#75233) 2021-07-12 10:57:23 -04:00
a901ff2bc0 Allow docs-build to use a local ansible-build-data checkout.
This is useful for testing the effects on docs of changing what
collections are in a version of ansible.  ansible-build-data can be
cloned locally, modified, and then build-ansible.py docs-build can be
told to use the local checkout instead of the canonical one on github.
2021-07-08 22:54:24 -07:00
dc25197c15 Allow passing extra arguments to the build-ansible.py commands
This is useful for testing and debugging.  You can use the extra
arguments to specify a local directory for the collection list, for
instance.
2021-07-08 22:54:24 -07:00
e7a3715a90 recursive_diff: handle error when parameters are not dict (#74801)
Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-07-09 10:37:50 +05:30
ac151e5ad0 become/su: Tell users not to include colon in customized list (#75084)
* Tell users not to include colon in customized list,  fixes #75076
2021-07-08 14:55:46 -05:00
8ab418f41b Disable jinja2_native warning in CI (#75214) 2021-07-08 15:15:55 -04:00
93e72c96f0 Update hacking env_setup to prefer Python 3 (#75213)
* env_setup - Prefer Python3

Prefer the 'python3' executable over 'python'.

* Add shebang for syntax detection

While the script isn't executable and we recommend sourcing it, having a shebang allows
variuos text editors to detect that it is a shell script and apply proper syntax highlighting.
2021-07-08 15:14:34 -04:00
3ba2243ba3 Replace self.module by my_module (#75196)
While implementing basic Ansible module testing I realised that the `self.module` used in some places is not actually a thing, and I changed to `my_module` to make it work as I understand it was expected.
2021-07-08 15:07:49 -04:00
1e00099753 Removed Galaxy banner (#75163) 2021-07-08 11:22:19 -05:00
67bc49e001 Restrict packaging to < 21.0 for Python < 3.6. (#75186) 2021-07-07 09:19:05 -04:00
bd03fa811b Include parent role vars as well as _role_vars (#75034) 2021-07-06 15:36:28 -05:00
21ba2967de Misc typo fixes (#75188)
Changed `Previouslly` to `Previously`.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-07-06 10:43:57 -04:00
a8de35e131 task_executor - use correct value for ssh connection retries (#75155)
Since the task and connection both have the same 'retries' keyword, the task default
would override the connection value.

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

* Set ssh_connection retries default value back to 0
  It was 0 before the move to config and was changed to 3 by accident.
2021-07-06 10:43:25 -04:00
23a84902cb Update the porting guide for a new ansible version (#75143) 2021-07-01 10:39:42 -05:00
363c1a3fba Vaultfilters (#74998)
add vault and unvault filters

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-06-30 10:24:00 -04:00
60c9f045cc Unfrack extra vars (#75127)
* Ensure we keep teh original path as per cli

  fixes #75126

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-06-30 09:39:11 -04:00
d9eb846534 Update vault script (#75074)
Update link to the `vault-keyring-client.py` file, which moved out of core.
2021-06-29 15:46:16 -05:00
d75d9443fc Bump sphinx_ansible_theme to v0.7.0+ (#75059)
This version relies on an external lib implementing lexers and styles.
That lib pulls in proper Pygments version so this patch also drops it
from direct requirements.
2021-06-29 10:23:04 -05:00
2eb9921b19 Prefer https:// links in the docs site (#75121)
This is a follow-up of previous years' 1a11cec and c8315bf. It deals
with links which at that point presumably either were not present or
did not support https://
2021-06-29 12:53:08 +05:30
f176cc1eda Remove create-repo.py script as it was changed to module (#75124) 2021-06-28 13:25:25 -04:00
16a74b798c module_common - handle cache directory creation collision (#75106)
* module_common - handle cache directory creation collision

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

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

* Use exists_ok rather than handling an exception

* Remove unused import and unused variable

* Go back to try/except but with OSError

Since we do not have split controller remote, this needs to be able to run in Python 2 in order
to be merged currently.
2021-06-25 15:36:12 -07:00
230c00e937 README optimizations (#75115)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-06-25 13:03:39 -04:00
29592aa3d4 Update YAMLSyntax.rst (#75113)
fix yaml-syntax example
2021-06-25 10:39:11 -05:00
03cb40e712 Fix baseurl handling in yum_repository test (#75096)
Since we moved yum_repository_test_repo.baseurl to file:/// format,
using urlsplit filter on it returned an empty string. Using an empty
string as a left operand of `in` was then always evaluated to True.

This was discovered with native jinja being on where urlsplit returns
None which results in a hard fail as None cannot be a left
operand of `in <string>`.
2021-06-25 05:19:24 +10:00
865bda3a11 Add a resolved_action task attribute (#74709)
* The resolved_action is the formatted version of the final plugin in the PluginLoadContext's redirect_list

* Collection plugins are represented as FQCN

* Legacy plugins are represented with only the plugin name

* Add tests

* Changelog
2021-06-24 12:51:03 -04:00
a4021977ad Fix structure of generic snippet feature (#74932)
* Fix struture of cli/doc.py snippet code.

A couple releases ago, cli/doc.py was modified to mostly conform to the
data processing pipeline steps.  format_plugin_doc() was the biggest
exception in that refactor.  When the snippet code was made generic
instead of being only for modules, the new code should have conformed to
the data processing pipeline too.

* Move the decision to output a snippet to the run() method alongside
  the decision to output a listing versus plugin_docs.
* Move the test for invalid plugin_types to the run() method as it
  affects all snippets in this run, not just a single snippet. (-t can
  only be specified once)
* Rename get_snippet_text() to format_snippet() as:
  * This is the data formatting step
  * The format_snippet() name matches with its conceptual sibling,
    format_plugin_doc().
* Use ValueError inside of format_snippet() to flag unrecoverable errors
  formatting a single snippet.
* Emit a warning when format_snippet() raises ValueError and continue to
  the next snippet.
* If the yaml(?) or toml inventory plugin is specified for snippet output,
  raise ValueError() so that the user sees a warning instead of simply
  seeing blank output.
* Do not modify arguments passed into format_snippet().  This is the
  formatting step so data should not be modified.
* Change _do_yaml_snippet() and _do_lookup_snippet() to operate side
  effect free.
* Fix raising of exceptions when formatting requred options for snippets.

* Unrelated: Use to_text() instead of to_native when calling
  display.warning(). to_native() is used for raising exceptions.  Not
  for display methods.

* Add a changelog
2021-06-24 08:34:46 -07:00
5d3d9ad8be docs: adds Ansible 5 roadmap (#75075) 2021-06-23 16:53:57 -04:00
ea0ba7bf30 update terminology based on recent IBM Style Guide word list (#75089) 2021-06-23 15:52:38 -05:00
415e08c297 Try to get best usable locale (#75033)
specially for when you have parameters in unicode but need
  to scrape responses, C is still the fallback

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-06-23 15:49:56 -04:00
f05bcf5693 update intersphinx links for Ansible 4 (#75099) 2021-06-23 14:32:03 -05:00
47c50c38bb Use antsibull-docs devel for devel docs (#74988)
* Require antsibull 0.34.0.
* Remove Makefile comment about the devel docs building only the core
(formerly base) docs; the behavior was updated in ccbfdec334
Currently 'make coredocs' builds core-only docs; 'make webdocs' builds the full docs even on the devel
branch

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2021-06-23 14:31:13 -05:00
2c0f050b4f Use antsibull sphinx extension (#73170)
* Use antsibull sphinx extension.

* Require antsibull 0.34.0.
2021-06-23 14:27:33 -05:00
58f26388be Update docs requirements list (#74956)
* removes upper bound on sphinx version
* updates versions of docs build dependencies, adds known good requirements file
* adds instructions for using known_good_reqs file
2021-06-22 13:58:54 -05:00
50b6d28ee1 Config init+ (#74914)
Can now specify plugin/plugin type for list and dump actions
 New 'init' action to create usable config sources 

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-06-22 12:21:59 -04:00
703cb79442 Implement async callbacks (#74953)
* add changelog and output from default callback
* add test
* add comments about TE task
2021-06-22 12:19:32 -04:00
ca6123e0ee Template suboptions in a role's arg spec (#75073) 2021-06-22 17:24:02 +02:00
3a8fc2d2be Syntax fixes for docs (#75086) 2021-06-22 20:48:20 +05:30
b0ae3f8a8d test: Unit tests for validation methods (#75061)
* check_required_one_of()
* check_required_by()
* check_required_if()
* check_missing_parameters()

Fixes: #55994

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-06-22 17:07:30 +02:00
6dbfd73174 YAML representer for VarsWithSources (#68525) 2021-06-22 20:03:18 +05:30
0f7f4e7b61 Add comma on role creation docs (#75064)
Adding a comma to make the sentence simpler to read.
2021-06-22 12:07:31 +05:30
aedc82da98 Clarify Vault password client naming requirements (#75060) 2021-06-22 11:58:54 +05:30
8e755707b9 Add 'hash_behaviour' option to include_vars module (#72944) 2021-06-22 09:29:53 +05:30
c404a9003f ansible-doc: improve version_added handling (#73602)
* Output version_added on top level, and improve version_added formatting

* Handle 'historical' version_added.
2021-06-21 16:27:00 -04:00
a7be495b7b Update plugin docs (#75050)
* edit existing plugin pages, headings, and links
2021-06-21 16:07:18 -04:00
ad203a7dbd Add page describing terminal plugins to docsite (#75066) 2021-06-21 09:47:42 -05:00
ec408a69f1 🔥 Drop unused core.css file
This is a forgotten leftover from #74318 that should've been removed
earlier.
2021-06-19 10:24:07 +03:00
38a11c3240 Fix typo in default_callback.py (#75051)
Changed beggining -> beginning
2021-06-18 10:01:11 +05:30
cd473dfb2f play - validate hosts entries (#74147)
* Change tests to pytest-style tests
* Add tests for invalid hosts
* Validate host inputs
  - check for empty values
  - check for None
  - check for values that are not a sequence and are not strings
  - add unit tests

* Move play name setting to get_name() and out of load()
* Add _validate_hosts() method
  By defining this method, it gets called automatically by FieldAttributeBase.validate().
2021-06-17 15:32:56 -04:00
e8ae7211da deprecate FileLock (#75032)
Co-authored-by: flowerysong <junk+github@flowerysong.com>
2021-06-17 15:14:41 -04:00
ce17498ec5 blockinfile - Remove unused code for Ansible 1.x. (#75040) 2021-06-17 10:32:42 -04:00
5e65d9834b tempfile - Remove unnecessary conditional. (#75039)
Also add integration tests for 100% code coverage.
2021-06-17 09:41:09 -04:00
afe6eb574e slurp - improve error code and test coverage (#75038)
* Improve the error handling code

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

* Add another test for non-specific failures

* Reorganize tests so failure tests are in one tasks file

* Remove os.stat() call and add changelog
2021-06-16 15:08:34 -07:00
4ab791d501 command - remove unreachable code and achieve full test coverage (#75036) 2021-06-16 15:06:18 -07:00
4e608c02fb Add changelog and porting guide for _remote_checksum() deprecation (#75035)
I forgot to add it with the PR that made the changes.
2021-06-16 16:58:02 -04:00
be0cdc0ea2 deprecate _remote_checksum() and remove use in fetch (#74848)
* Remove use of _remote_checksum from fetch module
* Add deprecation message displayed during runtime
* Increase test coverage for fetch
* Add tests covering the use of stat from the fetch module

    This required creating an unpriveleged user account and connecting as that user remotely since
    it is not possible to create a file that the root user cannot stat.

* Use fact caching to persist remote tmp dir across playbook runs
* Add variables to setup_remote_tmp test role to allow caching of the remote temp dir fact
  and preventing removal of the remote_tmp_dir
2021-06-16 13:51:07 -04:00
5a5a1882d4 Added FAQ entry for complex validation needs (#74707)
* Added FAQ entry for complex validation needs

* updated validate docs

* fix

* longline

* Apply suggestions from code review

Co-authored-by: Sandra McCann <samccann@redhat.com>
2021-06-16 13:43:01 -04:00
0467b1d477 file integration test - cleanup testing users and group 2021-06-16 10:06:12 -07:00
5b8fb4dcd3 ansible-test: exposes tiny_prefix variable
ansible-test aws provider now creates and exposes a new tiny_prefix
variable to provide a shorter prefix for the AWS tests.
2021-06-16 10:04:58 -07:00
08fc43f3ea document keywords (#74046)
* document kewyords

  also minoir tweak to local action/connection

* made corrections
2021-06-16 12:46:21 -04:00
6fd61bb19f add option def/handling to lookup (#74495) 2021-06-16 12:44:02 -04:00
2e2a5829a2 Update FreeBSD Python version in intro_bsd.rst (#74938)
* Use the python pkg instead of a specific version
The python pkg contains a symlink to the default python interpreter.
2021-06-16 11:22:26 -04:00
3fa6e6d038 example hosts should match play (#74959) 2021-06-16 11:18:44 -04:00
b0f62062d3 Async task change handling (#75020)
Async task changes should be handled in the async_status task.
2021-06-16 11:16:30 -04:00
7d38bb05e4 small note about add_hosts/limit interaction (#74978)
clarifying the scope and applicability

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
2021-06-16 11:13:11 -04:00
2387ce311f remove reference to container ML (#75014) 2021-06-16 10:47:26 -04:00
5df82415b5 collections_using.rst: add note that manual upgrade is required when installing collections from Galaxy (#75024) 2021-06-16 10:32:12 -04:00
4cb20f577b Fix env lookup docs typo (#75022)
- Fixed "impossbile" typo
2021-06-16 10:00:15 -04:00
79a0799082 fix typo in host_group_vars config (#75012)
* no need to deprecate, not used directly

  it just documents the use of the setting in loader
2021-06-15 18:03:01 -04:00
e6a7bc854c Only consider directories which do have .deps files other than ancestor.deps. (#74987) 2021-06-15 14:35:34 -05:00
7f6edd78f9 Move Docker scenario guide to community.docker. (#74736)
The scenario guide has already been added to community.docker in
ansible-collections/community.docker#140
2021-06-15 10:12:49 -05:00
58d8397771 psrp - cleanup command (#74985) 2021-06-15 07:33:56 +10:00
58450f041a Do not show empty version_added_collection values in ansible-doc text output. (#74999) 2021-06-14 17:26:40 -04:00
77e936bd50 async_status revert most changes, keep some fixes, undep module (#74931)
* revert most changes, keep some fixes, undep module

  too many corner cases, reverting major changes for controller
  side processing.
2021-06-14 16:39:59 -04:00
97acb0f470 role argspec - tag role argspec validation task with 'always' (#74994)
* update tag docs
2021-06-14 13:28:56 -04:00
d2d45900ed setup module, filter compensate for prefixes (#74924)
Allow user to abstract internal implementation from requested info
2021-06-14 09:32:28 -04:00
cf3a304ce1 psrp - Fix reset connection on failed scenarios (#74967)
* psrp - Fix reset connection on failed scenarios

* Update psrp-reset.yml

* Update changelogs/fragments/psrp-reset.yml

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

* Update changelogs/fragments/psrp-reset.yml

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

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-06-12 12:01:23 +10:00
a8cf0196f7 subversion - fix stack trace when getting repository information (#74405)
* subversion - set LC_ALL for accurate command output parsing

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

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

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

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

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

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

* Improve regexps for finding revision and URL
2021-06-11 10:23:42 -04:00
9a21e24778 get_distribution - Return distribution for all platforms (#71641)
Since moving to distro, it is possible to return this information for all platforms, not just Linux.
Also return version information for all platfrom not just Linux.
Update unit tests.
Remove some duplicate unit tests though I think there are more to remove.

* Fix docstring formatting

* Minor docstring changes

* Mock distro.id for Solaris service test

* Update comment
2021-06-11 10:22:18 -04:00
4c8c40fd3d fix unsafe preservation across newlines (#74960)
* fix unsafe preservation across newlines

  CVE-2021-3583
  ensure we always have unsafe

Co-authored-by: Rick Elrod <rick@elrod.me>
2021-06-11 09:33:40 -04:00
473df5c13f fix doc: add possible state 'inactive' (#74928) 2021-06-11 14:58:00 +10:00
576e0f6404 Update the porting guide for ansible 4.1.0 (#74965) 2021-06-10 19:45:52 -05:00
675df166c2 fix ssh_transfer_method/scp_if_ssh defaults (#74925)
* fix ssh_transfer_method/scp_if_ssh defaults

  fixes #74922

* clog
2021-06-10 15:22:41 -05:00
50e998e303 apt_key: add --recv argument as last one (#74949)
* apt_key: add --recv argument as last one

* Add unit test

* Add the required boilerplate

Co-authored-by: Marius Gedminas <marius@gedmin.as>
2021-06-11 05:47:59 +10:00
81ad125aa6 Fix name of subkey. (#74939) 2021-06-11 05:34:04 +10:00
6539c59857 ansible-pull - update help info for --directory option (#74936)
* Update -d help info for ansible-pull

* fix pep8
2021-06-11 05:31:17 +10:00
5ac1b04929 Add support for unicode in ansible-inventory CLI (#74912)
* Add support for unicode in ansible-inventory CLI

Fixes #57378

* Add tests

* First test fix

* --output tests

* fix
2021-06-11 05:07:55 +10:00
0a5cc80ce2 slurp - handle error when path is a directory (#74930) 2021-06-10 10:25:48 +05:30
36287e9810 Remove ignores that are resolved on devel 2021-06-09 11:18:12 -07:00
3f694e9f02 Ignore smart quotes in the dev guide translation.
The smart quotes are in the warning message to not use smart quotes.
2021-06-09 11:18:12 -07:00
d45c2cec55 Localization: Import first set of translated files 2021-06-09 11:18:12 -07:00
1c4ca154fa improve inv plugin selectino for snippets (#74933)
* improve inv plugin selectino for snippets
* add warning on no snippet for inventory
2021-06-09 12:13:56 -04:00
346c7a765d Use sphinx_ansible_theme Sphinx theme in docs (#74318) 2021-06-08 14:38:23 -05:00
d9001f8fd0 Fix intro docs (#74843) 2021-06-08 09:27:21 +05:30
6d2398db28 expand doc snippets to lookups and other plugins (#74403)
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2021-06-07 16:21:25 -04:00
004c33d9c5 unarchive - do not fail in init when trying to find required binary (#74892)
Test for the required binaries in the can_handle_archive() method and fail there. This
prevents failures for missing binaries unrelated to the archive type.

* Update missing zip binary message to match tar message
* Update unit tests
* Add integration tests
* Define packages based on the system rather than ignoring failures
2021-06-07 12:59:06 -04:00
acf09e56a2 Update inventory script references from c.g to ansible-community/contrib-scripts. (#74905) 2021-06-07 11:37:39 -05:00
5dd8dc8fd0 minor service_mgr facts fixes (#74894)
* minor service_mgr facts fixes

  handle case in which ps command fails or returns empty
  updated tests since it now does keep trying to detect after ps fails
2021-06-04 15:28:41 -04:00
6840b79e56 bring back async_status module for direct callers
also, deprecate it, they should use action instead
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-06-04 13:01:26 -04:00
e2658801f6 Add seed parameter to password lookup (#69775) 2021-06-04 12:20:44 -04:00
ffa548503d Wrap all results, regardless of register, except for actions with clean facts (#73161)
* Wrap all results, regardless of register, except for actions with clean facts. Fixes #21088

* ci_complete

* Add tests

* Add clog frag
2021-06-04 16:40:53 +02:00
e70fc88656 slurp - better error handling for unreadable files and directories (#68608) 2021-06-04 10:38:23 -04:00
26827f5039 ansible-doc fix displaying 'CLI' options for plugin docs
cli options will now display either use provided info, or automating from the name


Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2021-06-04 10:22:39 -04:00
6a883f1cd6 better message and timeout warning when timeout (#74885)
* better message and timeout warning when timeout
2021-06-04 10:21:12 -04:00
3d8feed2cf Update playbooks_filters.rst (#74911)
Fix typo: 'sting' -> 'string'
2021-06-04 17:50:19 +05:30
33924d7e8d gives each banner a unique div ID (#74907)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-06-03 16:51:31 -04:00
4f3ee4624e Add end_batch meta task (#74899)
* Add end_batch meta task

* Add note

* Fix sanity
2021-06-04 05:17:19 +10:00
ac77911491 Prevent conditional templating errors from masking task output. Fixes #37187 (#74891) 2021-06-04 05:11:01 +10:00
8f82e6327f ansible-cli: Remove unnessary trailing space (#74880)
Fixes: #74875

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-06-04 05:07:54 +10:00
840825b79c Allow omit to work with include_role from_args (#74879)
* Allow omit to work with include_role from_args. Fixes #66349

* Add clog frag
2021-06-04 05:07:16 +10:00
605b1a1c5c documents community 'extra docs' option in collections (#74886)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-06-03 14:22:21 -04:00
f88e81a62c updates links in comments to point to current docs (#74834)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-06-03 14:00:24 -04:00
62fc4ad8da adds banner for GalaxyNG survey (#74889) 2021-06-03 11:22:49 -04:00
b023f34f4a service_mgr: Detect using symlink if proc/1 and ps fail
* runit and other alternative service managers tend to work via symlink so this covers most of em
* Fixes #74866.
2021-06-03 09:59:31 -04:00
9c718ccc42 Async status rewrite
-  remove need for module (at least for posix side)
  - adds retry with backoff on fetching file, since
    race is bigger since we don't spend time on module
  - now gives more info on fail
  - also made actionfail/skip handle results if given
2021-06-03 09:54:40 -04:00
e201b542be Ensure end_play ends play, not batch (#74332)
* Ensure end_play ends play, not batch

Fixes #73971

ci_complete

* Preserve result

* Move AnsibleEndPlay to TQM

* Add tests

* Add changelog

* Explaining comment

* Fix changelog name

* ci_complete
2021-06-03 09:26:22 +02:00
fe20546d36 first_found: clear up the skip option usage (#74816) 2021-06-03 11:41:46 +05:30
be9f8c69d1 unarchive: Fail when zipinfo is not available (#74632)
Fixes: #39029

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-06-02 10:09:42 +05:30
805799ac8b add pkcs11 support to Ansible ssh connection module (#32829)
* rebased with upstream

* removed extra usetty as it wasnt needed, style changes, added var option setable by inventory for pkcs11

* update pkcs11_provider version_added

* Update lib/ansible/plugins/connection/ssh.py

Co-authored-by: Jordan Borean <jborean93@gmail.com>

* Update lib/ansible/plugins/connection/ssh.py

Correct logic for a password being required for pkcs11_provider

Co-authored-by: Jordan Borean <jborean93@gmail.com>

* style nit fixes for checking pkcs11_provider is set

* fixed duplication when using password_prompt with pkcs11_provider

* added changelog fragment

* added changelog fragment

Co-authored-by: David Whiteside <david.whiteside@nrel.gov>
Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
Co-authored-by: Jordan Borean <jborean93@gmail.com>
2021-06-02 12:32:43 +10:00
d9183b8df5 dnf - replace usage of private attribute with supported API (#73529)
base._update_security_filters is a private attribute of DNF used
as performance optimization. Modification or even call from outside
of DNF is against all recommendation including PEP8.

* Improve compatibility with all DNF versions

* Add changelog fragment for dnf security change
2021-06-01 15:32:38 -04:00
ba2b1a6bf6 fact gathering, ensure we get some linux hardware info even if some fails/times out (#74714)
* Add resiliency to linux hw fact gathering

 Now traps unexpected exceptions on mounts and continues
 gathiering other info.
 Also gives more info on why mount info gathering failed.
 more info if debugging
2021-06-01 14:52:22 -04:00
8d39332c3d plugins: specify plugin types for get_option (#74799) 2021-06-01 13:46:04 -04:00
adc9e4a023 Updated ansible-test azure plugin help message. 2021-06-01 10:23:04 -07:00
01ab6c6ec7 Apply display_failed_stderr on loop item results (#74865) 2021-06-01 11:31:46 -04:00
70f22c7f32 Remove commented code (#74860)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-06-01 11:26:38 -04:00
41f42d6bf6 Update intro_bsd.rst (#74768)
OpenBSD 6.9 is out and the default version of Python is 3.8, with no more 3.7.
2021-06-01 10:43:15 -04:00
81c770e44a Update intro_getting_started.rst (#74786)
Changed confusing wording.  People new to ansible, like myself, have a hard time grocking what is a playbook and what is a task.   I changed the name of the playbook to make it clearer.
2021-06-01 10:38:17 -04:00
80e7e1a17c Due to the takeover of freenode we're moving to a different irc network. (#74775)
* Due to the takeover of freenode we're moving to a different irc network.

* Our channels updated to point at the same channel name on libera.chat
* Some links went to webchat.freenode.net.  At this time, libera.chat
  doesn't point you to an official webchat client so I changed these to
  https://libera.chat. (kiwi irc does work with libera.chat so that
  could be another option).
* In general, I used the name irc.libera.net for link names and
  https://libera.chat for link targets.  This is because the irc service
  is hosted on irc.libera.chat but the project web server is hosted on
  libera.chat.  (This appears to also be true for freenode but we were
  using http://irc.freenode.net which doesn't seem to work.  Oops).
* Removed http://irc.freenode.net from the linkcheck exceptions.
  linkcheck was actually correct to flag that as invalid (should have
  been http://frenode.net instead).

* Looks like hte important people in #yaml are now in libera.chat

* Link to where contributors should get help

Add a link target and then link to where contributors should get support
for developing groups of modules.

* Update docs/docsite/rst/dev_guide/developing_modules_in_groups.rst

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: John R Barker <john@johnrbarker.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-06-01 08:48:09 +01:00
b0dcf0d164 collection: match skip message as per role install (#74861) 2021-06-01 09:44:01 +05:30
35a2345809 Fixed typo in yum package (#72964)
* yum: Fixed typo in failure message: nevra --> envra
* Added changelog fragment
2021-05-31 13:34:26 +05:30
e0558ac193 yum action plugin: 'use' as an alias of 'use_backend' (#70792)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: rukmangathan <rukmangathan.annadurai@gigamon.com>
2021-05-31 09:48:15 +05:30
5640093f1c 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
2021-05-27 19:06:45 -04:00
a5a13246ce ssh remove unused/unusable cli option ssh_args (#74846) 2021-05-27 17:16:54 -04:00
99a983c92c config: small typo fix (#74845) 2021-05-27 16:41:20 -04:00
148d4f6248 hostname: Add support for RedOS (#74844)
Fixes: #74779

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-27 21:18:48 +05:30
138b3b6851 hostname: add support for Anolis distro (#74829)
project website https://openanolis.org/

Signed-off-by: Liwei Ge <geliwei@openanolis.org>
2021-05-27 18:30:35 +05:30
774e563452 Use get_file_lines in hostname module 2021-05-27 13:15:52 +02:00
502270c804 hostname: clean up strategies
Apply #74744 and #69929 to #70828
2021-05-27 13:15:52 +02:00
2ad10ffe43 hostname: Make strategies consistent, drop py2.4
Change:
- Make strategies behave consistently and return the empty string
  instead of "UNKNOWN" (or "temporarystub") for the "before" value if
  the permanent hostname file does not exist or could not be read.
- Switch to `with open()` instead of annoying exception handling code
  (which was wrong and leaked file handles in several places). This
  drops Python 2.4 support for this module.
- Updated porting guide since users could be relying on these former,
  inconsistent values.

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-05-27 13:15:52 +02:00
8a0abed1ba [hostname] don't write in get_*() methods
Change:
- Hostname strategies' get_*() methods should never write to the
  filesystem. They are used in check_mode by default to determine if
  there is any work to be done.

Test Plan:
- New unit tests to ensure that (at least when in check_mode) the get
  methods don't ever call write.

Tickets:
- Fixes #66432

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-05-27 13:15:52 +02:00
16e1172292 Update docs for cloud maintained collections (#74373)
- AWS has moved to Zuul CI
- Kubernetes collection has been renamed
- OpenShift/OKD collection was missing
- ansible.windows is on Zuul and Azure Pipelines
- ansible.posix is on Zuul

Signed-off-by: Jill Rouleau <jill.rouleau@bespokess.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-27 15:04:16 +05:30
ae50d05182 ini: Add parameter to allow no value (#74806)
ConfigParser allows to read key with no value.

Fixes: #50594

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-27 11:12:38 +05:30
397d3763ea ansible-test - Do not downgrade cryptography. 2021-05-26 13:31:03 -07:00
e5c3f6ce99 Revert "aync_status rewrite (#74577)"
This reverts commit b6de1984db.
2021-05-26 11:37:58 -07:00
a61821b626 misc typos (#74724) 2021-05-26 19:28:52 +05:30
b63512774b Update example and description of git:single_branch (#74796) 2021-05-26 18:57:18 +05:30
ef0055a806 add anchors (#74825)
LGTM @samccann
2021-05-25 13:52:26 -04:00
88d67b00f8 Update developing_collections_distributing.rst (#74820)
It is not clear that you can publish without configuring an ansible.cfg.  The `--token` can be displayed with the `ansible-galaxy collection publish -h`
2021-05-25 13:19:05 -04:00
b6de1984db aync_status rewrite (#74577)
remove need for module (at least for posix side)
2021-05-25 12:34:38 -04:00
ce556da7a0 Remove deprecated PlayContext.make_become_cmd (#74790)
* Remove deprecated PlayContext.make_become_cmd. Fixes #74136

* Linting issues
2021-05-25 12:01:22 -04:00
98138584b7 Don't mutate os.environ in AnsibleModule.run_command, make a copy, and pass to Popen (#74791)
* Don't mutate os.environ in AnsibleModule.run_command, make a copy, and pass to Popen. Fixes #74783

* Simplify code a bit

* More simple

* Address some other potentially non threadsafe operations

* Add if around umask

* Address unit test assumptions

* Add clog frag

* yaml syntax issue
2021-05-25 12:00:47 -04:00
df5ce3e672 Remove deprecated cache support from script inventory plugin (#74813) 2021-05-25 11:35:46 -04:00
d27ce4cef3 Remove deprecated features from ansible.playbook.helpers (#74809)
* Remove deprecated features from ansible.playbook.helpers. Fixes #74135
2021-05-25 11:35:17 -04:00
27f61db86b service: Document internal working of the module (#74726)
service module acts as proxy module for all service manager modules,
just like `package` module.
This is helpful in heterogeneous environments to manage services.

Fixes: #74507

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-25 20:55:21 +05:30
9c01a7e177 Remove deprecated PlayContext.make_become_cmd (#74790)
* Remove deprecated PlayContext.make_become_cmd. Fixes #74136

* Linting issues
2021-05-25 10:05:18 -05:00
aa650562d6 Remove deprecated PlayContext.make_become_cmd (#74790) 2021-05-25 11:04:31 -04:00
4a4ffbadc5 Remove deprecated PlayContext.make_become_cmd (#74790) 2021-05-25 11:03:55 -04:00
63701b1b6b hostname: Change "strategy" to "use" (#74815)
Fixed typo: 'strategy' to 'use'
2021-05-25 14:14:18 +05:30
870f943365 docs: Update Python 2 doc links (#74633)
* docs: Update Python 2 doc links

Update links from Python 2 to Python 3

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

* use docs.python.com/3/ everywhere, except onethat should remain 2.6

* refer to python 3 in module docs and comments

* format two python docs links as list

* updates links in unwanted.py test file

* per matt clay, this should link to python 2

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-05-24 15:11:26 -04:00
52430d4228 dnf - fix whatprovides API block (#74764)
* Added additional query block
2021-05-24 13:02:28 -04:00
12f4b0db04 Fix typo in porting guide (#74812) 2021-05-24 11:53:51 -05:00
1bd7dcf339 encrypt: add new paramter 'ident' (#74595)
Add a new parameter `ident` for specifying version of BCrypt
algorithm. This parameter is only valid for `blowfish` hash type.
2021-05-24 11:46:37 -04:00
20ef733ee0 Update network_resources.rst (#74810) 2021-05-24 11:25:55 -04:00
b518aabf81 delegation fix (#74685)
*  delegation fix
2021-05-24 10:13:19 -04:00
015331518d windows: Add openssh installation link (#74765)
* Added a link to openssh installation on Windows

Fixes: #73490

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-21 11:00:39 +05:30
bc48eba896 Remove deprecated include vartags usage (#74780)
* Add clog frag
* Remove ignore
2021-05-20 15:32:52 -04:00
71e33d2578 version test - improve message when value is empty (#74754)
When an empty value is provided, no `version` attribute will exist on the `LooseVersion` or
`StrictVersion` object. We catch and handle this, but it's not immediatebly clear that an
AttributeError means an empty value was provided.

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

Add integration tests.
2021-05-20 11:55:30 -04:00
83010f666d Fix coverage paths reported in AZP. (#74759) 2021-05-19 14:54:03 -07:00
724a0c867e Fix mistaken detection of atomic_container when rpm-ostree is present (fixes #74578) (#74579)
* Lower the priority of the atomic_container detection now that we have #73445 merged

* Add changelog fragment
2021-05-19 16:15:26 -04:00
d2d1f01f9d avoid literal quoting in config lists (#74740)
* added tests
2021-05-19 16:14:52 -04:00
888fea69e5 Fix small typo in playbook_filters doc (#74762)
Move versionadded to next line to render correctly.
2021-05-19 16:23:42 +05:30
cd8e3a2208 update conf.py (#74751) 2021-05-18 15:34:43 -05:00
138dfa4549 add release note and mark 3 unmaintained (#74749) 2021-05-18 15:33:26 -05:00
c0cb353ce1 Remove PyCrypto (#74699)
* Remove PyCrypto from setup.py and packaging script
* Remove mention of pycrpto from installation docs
* Remove PyCrypto from vault
* Remove pycryto constraint and unit test requirement
* Remove PyCrypto tests from unit tests
* Add docs and fix warning message
* Remove section about cryptography library in Ansible Vault docs
2021-05-18 16:12:32 -04:00
4bf420706b Improve and extend changelog logs (#74106)
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-18 15:02:59 -04:00
fbe5f9fd7d Update the porting guide for a new ansible version (#74752) 2021-05-18 14:50:07 -04:00
5266e1e1ab Fix broken Jinja website links (for tests) (#74746)
The various links to the Jinja website were broken, this commit fixes them.
2021-05-18 11:40:38 -04:00
8d7a5d9cb3 Fix broken Jinja website links (#74745)
The URLs to the Jinja website have moved, seemingly because of the renaming from `master` to `main` (hence from `master` to `latest` in the doc). This commit fixes that.
2021-05-18 11:39:43 -04:00
957a93a583 dnf - fix typo in message (#74720)
occured -> occurred
2021-05-18 11:19:54 -04:00
bdae72ef6c Add fallback for coverage report generation.
This should allow the same script to be used for two different scenarios:

- ansible-core across multiple versions (not all of which support `--docker` for coverage reports)
- collections (which should always use the `devel` branch for coverage reports)
2021-05-17 17:42:42 -07:00
2124dde5a6 Use --docker to generate coverage XML reports.
This is needed to provide `pwsh` for generating PowerShell coverage stubs.

ci_complete
ci_coverage
2021-05-17 16:57:04 -07:00
787f722d94 Fix combined coverage file detection.
Resolves an issue introduced with https://github.com/ansible/ansible/pull/74719
2021-05-17 16:26:14 -07:00
9cfedcd9c9 Add changelog for ansible-galaxy improvements (#74738)
Changelog for #74240
2021-05-17 16:31:13 -04:00
5333e4138c note about adhoc delegate_to hosts (#74687)
* Update docs/docsite/rst/user_guide/playbooks_delegation.rst
2021-05-17 13:24:26 -05:00
ce04056797 Expand delegation options for coverage commands. 2021-05-17 10:37:42 -07:00
e875e91363 ansible-test - use pwsh to generate stubs (#74271) 2021-05-17 10:00:06 -07:00
d8e6f21d9f ini lookup - add case sensitive option (#74630)
* Add tests for case-sensitive option
* Run all test playbooks from a single file
2021-05-17 11:41:23 -04:00
2f87b8760d docs: Add a note about ansible_date_time (#74636)
* For long-running playbooks, discourage users from using
`ansible_date_time`. Use `pipe` or `now` as an alternative.

* Review comments

Fixes: #22561

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2021-05-15 10:13:05 +05:30
bf9944266c Issue 73792: Removed mentions of R() and M() (#74708)
* 73792: Removed mentions of R and M
2021-05-14 14:48:21 -05:00
8d3dce49bf Remove incidental_setup_rabbitmq integration test
All tests using this have been removed.
2021-05-14 12:31:18 -07:00
39df263f1a intro: Add a note about current user (#74638)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-14 11:41:35 -04:00
25de07946c Fix typo on roles documentation (#74696)
##### SUMMARY
Small fix on the roles directory structure documentation

##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2021-05-14 11:40:00 -04:00
91212b2008 Add JC filter plugin example (#74563)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-14 11:37:29 -04:00
fa15d35cb1 Update AWS guides with new SDK and Python requirements (#74585)
The 2.0 collection releases will introduce new Python requirements
and a new SDK support policy
2021-05-14 11:35:45 -04:00
173d0a8de7 Skip interpreter discovery for network OSs(#74012)
skip python interpreter discovery on network os being set as this indicates a 'forced local' module and should use sys.executable.
2021-05-14 10:19:55 -04:00
51b5659598 replace - better handling of file exceptions (#74686) 2021-05-13 17:00:22 -04:00
bab7acb1ad update cron test added in #74497 for /etc/crontab (#74689) 2021-05-13 16:58:46 -04:00
35281e54d9 fix config to match doc split (#74665) 2021-05-14 05:20:32 +10:00
c6ac9de67b Do not remove non-empty cron tabs (#74497)
* Only remove crontabs if they are empty

* Add integration test to ensure system cron tab doesn't get removed. Increase cron integration tests separation.
* Also detect crontab which only contains whitespace as empty.
* cron integration test: Adjust system crontab path to be distribution specific.

Co-authored-by: Fabian Klemp <fabian.klemp@elara-gmbh.de>
2021-05-13 13:38:13 -04:00
1906d75907 Adding DigitalOcean cloud support to ansible-test (#74222) 2021-05-12 16:07:21 -07:00
d6e28e6859 Update vendored copy of six to 1.16.0 (#74680)
* Update to six 1.16.0

* Address linting issues

* Remove six find_spex/exec_module warning filters

* Remove unnecessary comment about Py2.6, 2.13 will not support Py2.6, and we're bumping this for 2.12

* ci_complete

* Add changelog fragment
2021-05-12 16:26:48 -05:00
0affe4d027 ini lookup - catch and handle duplicate key and missing section errors (#74629)
* Remove unused import
* Add integration tests for errors
* Cleanup formatting on existing tests
* Add changelog
2021-05-12 16:57:02 -04:00
829c9c3d46 updates jinja filters links with new pattern for Jinja 3.x documentation 2021-05-12 10:08:00 -07:00
8c34eaa69f Jinja intersphinx should point at 3.0; other updates 2021-05-12 10:08:00 -07:00
f99d024851 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>
2021-05-11 19:59:44 -07:00
8f2c0e0574 Update the porting guide for ansible-3.4.0 (#74664) 2021-05-11 16:14:29 -05:00
1006363589 basic: Skip over module parameters (#74559)
While logging, journal.send accepts module parameters.
If module parameters similar to arguments in journal.send,
rename the parameter names before sending to journal.send

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-11 15:05:56 -04:00
2c93b22043 use self.host which will always be updated (#74574)
* use self.host which will always be updated

  pc remote_addr is not correctly updated in all cases
2021-05-11 14:49:56 -04:00
8d1cf7f266 Vendor distutils.version (#74644)
* Vendor distutils.version

* Fix import order. ci_complete

* remove distutils warning filter

* Don't remove warnings filter from importer

* ci_complete

* Add pylint config for preventing distutils.version

* Add changelog fragment
2021-05-11 12:33:51 -05:00
79e12ba98e docs: Add a note about crypt (#74640)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-11 11:39:08 -04:00
ddaa539ab1 Better handling of rstisms in ansible-doc (#74596)
* Better handling of rstisms

  replace tags more intelligently to make things more readable
  unit tests + minor adjustments
2021-05-11 11:31:20 -04:00
60a03a0f87 Add missing 'why:' to 'deprecated:'. (#74639) 2021-05-11 17:19:59 +02:00
7195367635 update docs copyright (#74643) 2021-05-11 10:16:27 -05:00
cf11c38caf Exclude unreachable hosts in ansible_play_batch between plays (#74625)
ci_complete
2021-05-11 17:12:34 +02:00
df6554c4ec fix: action _fixup_perms2 macos +a remote_paths in list() as it can be a tuple (#74613)
* fix: action _fixup_perms2 macos +a remote_paths in list() as it can be tuple

in `lib/ansible/plugin/action/__init__.py`'s `_fixup_perms2`,
`remote_paths` can be a list or tuple. however, the macos
specific attempt to use chmod +a attempts to concatenate
`remote_paths` with a list, which will fail if it is a tuple.
wrapping `remote_paths` in `list()` fixes this error.

* Update changelogs/fragments/74613-actionfixup_perms2_macos_remote_paths_ensure_list.yml

Co-authored-by: Rick Elrod <rick@elrod.me>
2021-05-11 17:08:33 +02:00
8fb54885bf Role argspec: allow new argument spec file (#74582)
* support separate role argspec file in ansible-doc

* support separate role argspec file in ansible-core

* support both .yml and .yaml extensions on argspec file in ansible-doc

* fix filename building bug and rename some argspec files to test variations

* use yaml extensions from constants

* add superfluous meta/main.yml files to tests

* Update lib/ansible/cli/doc.py

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

* update docs

* ci_complete

* add changelog and allow for main.yml variations

* add collection role testing

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-05-11 09:29:47 -05:00
f6c292d210 Remove unused CI scripts. 2021-05-10 19:47:31 -07:00
d244e47822 Update Python versions for controller-only tests. (#74652)
* Update Python versions for controller-only tests.

Both `ansible-galaxy` and `ansible-test` integration tests only run on the controller.

* Use a venv to make requirements available.
2021-05-10 18:25:53 -07:00
7b0c4845d9 Remove PyYAML warning filter in import test.
The filter is obsolete now that PyYAML imports go through our compat layer.
2021-05-10 16:57:45 -07:00
bdffb59978 Update Python versions used to run network tests. (#74647) 2021-05-10 15:06:09 -07:00
d85809d592 Update Python versions used to run Windows tests. 2021-05-10 10:30:41 -07:00
7f7d3067e3 adhoc clarify help (#74616)
also added comments to code
2021-05-10 13:28:59 -04:00
ee725846f0 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

Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2021-05-10 13:26:41 -04:00
51fd05e76b Add support for testing with Python 3.10. 2021-05-10 08:23:15 -07:00
bcb64054ed Another unit test fix for Python 3.10. (#74628)
* Another unit test fix for Python 3.10.
* Add missing __init__.py file.
2021-05-07 17:26:41 -07:00
d4413dac08 Fix unit tests on Python 3.10. 2021-05-07 16:56:30 -07:00
2f7e0b8489 user - consistently create user home directory on Linux (#71952)
Always use create_homedir when we are asked to create a home directory
in the User class. Don't use the -m and -k parameters from
useradd / luseradd as they behave differently with respect to
preexisting home directories. Instead always specify -M to ensure
that useradd / luseradd do not try to create the home directory.

This does not change potential different behaviours in child classes
of the User class.

Consider the new umask option from #73821 in create_homedir as well as
we do not let luseradd / useradd create the home directory any longer.
2021-05-07 17:00:10 -04:00
2e97240c67 Ignore more Python 3.10 warnings in import test. 2021-05-07 11:19:22 -07:00
69f3447b6b Remove 'default:' from config settings (#74607) 2021-05-07 10:31:32 -04:00
403a5d147d modules: get_url: Fix checksum binary validation (#74502)
From the sha512sum man page:

... The default mode is to print a line with checksum, a character indicating type ('*' for binary, ' ' for text), and name for each FILE.
2021-05-07 10:29:22 -04:00
4d7dc15d4e service - compare version without LooseVersion (#74508)
The distutils module is not shipped with SUNWPython on Solaris.
It's in the SUNWPython-devel package. Do not use LooseVersion.

Fixes: #74488

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-07 10:22:00 -04:00
a277644301 Add python 3.10 constraint for pyspnego (#74612) 2021-05-06 23:53:50 -07:00
e6d7aecbe4 Reorganize more ansible-test code. (#74611)
* Split out shell command.
* Relocate ansible-test integration code.
2021-05-06 17:59:07 -07:00
065fc3ca17 Remove check for legacy core and extras dirs. 2021-05-06 17:58:25 -07:00
5487e9e4fd Update runtime-metadata sanity test for Python 3.10. 2021-05-06 15:12:06 -07:00
8cccabf1eb cron: removal of deprecations and minor fix (#73591)
* removal of deprecations and minor fix

  name or cron_file is required.
  reboot was removed.
  updated docs to clarify usage.
  now using cron_file=/etc/crontab is an error

  fixes #37355
2021-05-06 18:05:06 -04:00
cbac26e500 Update import sanity test for Python 3.10. 2021-05-06 14:55:41 -07:00
2c3a3bdd9c Update pylint sanity test to work on Python 3.10. 2021-05-06 14:46:12 -07:00
c2e15f45a6 Update ansible-test compile sanity test.
The test has been rewritten to improve error handling and add support for Python 3.10.
2021-05-06 13:51:45 -07:00
35ff4ea95b warn on walking through pathing issues (#74514)
* warn show pathing issues when wallking through provided paths

  moved issues from msg to actual warnings AND a specific return field

  fixes #25314

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-05-06 16:14:33 -04:00
5463cbb841 Docs: communication.rst - add ansible-community to the IRC channel list (#74570) 2021-05-06 15:10:53 -04:00
55b401a3e7 pause - ensure control characters are always set appropriately (#74568)
* pause - ensure control characters are always set appropriately

On some systems, curses.tigetstr() returns None, which does not work as a control character.

* Add unit tests

* Sort imports

* Skip on older Python

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

* Make the tests work on Python 2 and 3
2021-05-06 15:09:26 -04:00
a6cc508822 Update the module lifecycle document to also cover plugins and collections (#74413)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-06 10:16:43 -04:00
74647a1314 systemd doc update (#74442)
Document that systemd module manages units (timers, services, ...) and not only service. (#74442)

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2021-05-06 09:49:42 +05:30
dcb807dea7 Update cli_parsing.rst (#74555)
Bad indent in an example
2021-05-06 09:34:07 +05:30
07fb6f7547 Fix imports for the previous commit.
Also add a changelog entry.
2021-05-05 18:56:29 -07:00
92c40f6365 Relocate change classification files. 2021-05-05 18:56:29 -07:00
5dfc7ee078 Remove Shippable CI provider from ansible-test. 2021-05-05 17:42:13 -07:00
8bd599d048 Change Shippable refs in docs to Azure Pipelines. 2021-05-05 17:21:48 -07:00
c48f80d062 Rename hacking/shippable to hacking/azp.
References to Shippable were changed to Azure Pipelines.

Also remove rebalance.py as it does not work with Azure Pipelines due to the required data not being present.
2021-05-05 17:21:14 -07:00
df2ae06d46 Fix ansible-test imports and paths after refactor.
Also include a changelog entry covering this commit and the previous.
2021-05-05 16:20:15 -07:00
bb3904d299 Reorganize command implementations.
This commit only renames existing files.

Changes to adapt imports will occur in a follow-up commit.
2021-05-05 16:20:15 -07:00
aea0c4dd1b Fix inventory cache prefix typos (#74523)
* Fix section for inventory cache prefix

* Redirect general config inventory cache options to inventory plugin documentation

* Update the template to fix the docs-build error

* removes 'default' entries for config settings with default: ''

* single backticks => italics, double backticks => code

* use 'Default: ~' to match other entries that have no default setting

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-05-05 13:27:40 -04:00
38dd49eb00 ansible-inventory: Handle exception in toml parsing (#74486)
Handle stacktrace raise while parsing inventory in toml format

Fixes: #74404

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-05 14:12:52 +05:30
68e9e1c999 Switch incidental OS X tests to macOS. (#74564)
* Switch incidental OS X tests to macOS.
* Rename incidental osx.sh to macos.sh.
2021-05-04 11:46:46 -07:00
728b52a6ff Use /usr/bin/python3 on rhelish 9+ (#74547)
The /usr/libexec/platform-python symbolic link is just a backwards compatibility shim there.

See ce226d00fa
2021-05-04 12:48:16 -04:00
4627c30b2e interpreter_discovery: Hide warning in auto_silent (#74509)
Hide warning "No python interpreters" in auto_silent mode.

Fixes: #74274

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-04 12:01:49 -04:00
b0389c7f11 [cli] remove superfluous trailing space from help (#74551)
Change:
- After we output the newline in help text, we also added a space. This
  caused either a space to show up before the shell prompt (in shells
  like bash), or " %" and a newline before the next prompt on shells
  like zsh that automatically force commands to end with a newline.
- This change removes the extra space, so that peace can be restored in
  the minds of many.
- This only showed up when running commands with no arguments or invalid
  arguments.

Test Plan:
- Ran `ansible`, `ansible -h`, `ansible-playbook`, `ansible-galaxy`, and
  `ansible-galaxy -h`.

Tickets:
- Introduced in #69458

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-05-04 11:42:17 -04:00
c6fda9fc1a [coverage] improve test coverage for together lookup (#74549) 2021-05-04 11:41:22 -04:00
4f0a9488bb [coverage] improve test coverage for indexed_items lookup (#74548) 2021-05-04 11:41:02 -04:00
244bf9c640 [coverage] improve test coverage for vars lookup (#74546) 2021-05-04 11:39:04 -04:00
30912b6a47 dont specify default for port, allow ssh/config (#74526)
* dont specify default for port, allow ssh/config

 also added general note on how defaults work.

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-05-04 11:09:05 -04:00
d101009688 facts - set correct OS family for Rocky Linux (#74530) 2021-05-04 10:14:13 -04:00
2d41e5f99a hostname - add Rocky Linux support (#74545) 2021-05-04 09:11:44 -04:00
728e43bc59 callback_default test - Reduce sleep time to correct CI failures
For unknown reasons, these tests started failing recently because the results
from testhost11 are being returned before testhost10, but only when coverage is
enabled.

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

ci_coverage
2021-05-03 17:55:10 -07:00
fb0d5609cb Code cleanup in ansible-test. (#74529)
* Fix get_available_python_versions calls.
* Make run_playbook vars optional.
* Use ansible_pipelining in inventory.
* Fix type hint.
* Fix order of conditional evaluation.
* Remove unused ibmi platform.
* Add changelog fragment.
2021-04-30 18:50:00 -07:00
ca507ff477 Integration test fixes. 2021-04-30 17:59:28 -07:00
daecb30ac9 The apt_key module did not properly handle GnuPG errors for certain actions (#74478)
* Not all GnuPG return codes were analyzed (rc != 0) and not all relevant GnuPG error information was returned by the 'ansible.builtin.apt_key' module (https://github.com/ansible/ansible/issues/74477)

* Update changelogs/fragments/74478-apt_key-gpg-error-check.yaml

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-04-30 16:53:41 -04:00
38fb05102c Makefile: Allow one to specify python version (#74517)
Change:
- Allow overriding python version as env var for Makefile
- Including hacking directory in git export, for docs build

Test Plan:
- Tested as part of recent downstream work

Co-authored-by: Yanis Guenane <yguenane@gmail.com>
2021-04-30 16:23:41 -04:00
9bd70045c9 Fix BaseFileCacheModule#keys to respect prefix (#72789)
* Fix BaseFileCacheModule#keys to respect prefix

Change:
- Previously BaseFileCacheModule#keys would return keys with the cache
  prefix. These keys are impossible to retrieve from the cache without
  removing the prefix or using the cache without a prefix.
  Now it removes the prefix from the key and only returns keys that
  share the same prefix as the cache.

Test Plan:
- New unit tests

* Add explicit BaseFileCacheModule#keys test

Test that files that do not match the cache prefix are ignored.
Test that the prefix is removed from the cache key.
2021-04-30 15:28:28 -04:00
d8c20a73a4 [ansible-test] Add Fedora 34, update Fedora 33 (#74506)
Change:
- Added Fedora 34 container image to docker.txt
- Dropped Fedora 32 from CI
- Added Fedora 34 to CI
- Updated Fedora 32 and 33 containers for ssh-related fixes
- Move cron fix from 698eae3f3d into
  cron_setup and make it more generic; it can affect modern distros too.

Test Plan:
- ci_complete

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-04-30 11:35:12 -05:00
6ea81b84ed apt_key - correct error message about the failure to import a 'gpg' (#74476) 2021-04-30 12:06:38 -04:00
b765d3799b update backporting instructions to reflect new latest stable branch, some edits (#74512)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-04-30 11:42:03 -04:00
d147c1ef1f apt_key test - Change the URL of the GPG key to S3 and remove it from the repo (#74483) 2021-04-30 10:44:50 -04:00
a30c55f68a Remove deprecated common.removed module_util.
Tests have been updated to reflect its removal as well.
2021-04-29 16:07:56 -07:00
1a7923e318 pip: Idempotency tests (#74473)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: David Moreau Simard <dmsimard@redhat.com>
2021-04-29 15:14:18 -04:00
f1a5c411d9 Fix sequence lookup message and add tests (#74472)
* add test for bad kv arg value
* add simple form parsing tests and make error messages the same
* add changelog
2021-04-29 15:12:23 -04:00
74b2add460 paramiko_ssh - mark connection as connected when successful (#74459)
* Remove unused import from test
2021-04-29 15:11:02 -04:00
98495ae99d Remove unused FileLock import (#74449) 2021-04-29 15:04:34 -04:00
8a2fc854f4 Add plugin config lists (#49627)
* add plugin config lists
* and dump config for plugins
*  also list configs under PLUGINS for 'all' list
2021-04-29 15:01:05 -04:00
aa12af1d34 Use our own copy of the Codecov uploader (#74460)
Due to the recent security incident, use our own copy hosted in S3
to mitigate future risk from running an arbitrary script downloaded from a
remote and untrtusted server.
2021-04-29 10:26:23 -04:00
112b175f17 Update the porting guide for a new ansible version (#74490) 2021-04-29 10:03:21 -04:00
f40ab25909 Improve a documentation of the first_found lookup plugin (#73080)
Co-authored-by: Wojciech Ściesiński <wojciech.sciesinski@huuugegames.com>
2021-04-29 10:02:21 +05:30
baa371e7b5 Add comments to keep collection loader in sync. 2021-04-28 17:45:42 -07:00
c63b867836 fixed URL for becoming an unprivileged user doc (#74448) 2021-04-28 16:14:56 -05:00
3cff54d69b Fix missing delegate display (#74370)
* dont rely on vars, task already gives us info
* ensure we always display delegation in host label
* also added parens with ansible_host to show  target host vs resolved host
* delegating to self is not delegating
* delegated vars restoration for backwards compat
* tests need mock task with delegate_to
2021-04-28 13:24:38 -04:00
26214788ee Retrofit shippable scripts to work with AZP
Co-authored-by: Matt Clay <matt@mystile.com>
2021-04-28 09:43:41 -07:00
57d661e96f Templar: remove _fail_on_{lookup,filter}_errors (#73785)
Both were added in 62d79568be and never
used, always being set to True.
2021-04-28 17:49:16 +02:00
3bc2e7783c Binary GnuPG keys downloaded via URLs by the 'ansible.builtin.apt_key' module were corrupted so 'gpg' could not import them (https://github.com/ansible/ansible/issues/74424) (#74474) 2021-04-28 10:41:14 -04:00
9e61952cdc command - add command name to warning (#74475) 2021-04-28 10:22:15 -04:00
04e57d28e3 [facts] add hpux fc info, refactor aix and solaris code (#57406)
* correctly parse device from string
* check for command presence before running them
* check for command presence and return code for solaris and aix as well
* add changelog
2021-04-28 10:17:19 -04:00
7b03ebf939 setup: Add note and example of delegated facts (#74479)
* Added a note about 'delegated_facts'
* Added an example of 'delegated_facts'

Fixes: #67067

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-04-28 08:53:36 -04:00
f194108a26 docs: Improve documentation for regex_search,replace,findall (#74368)
Improve the documentation for regex_search by adding a few more
realistic examples such as showing how to extract only parts of a
string by using regex groups.

Extend regex_findall and regex_replace by an example that includes
the multiline and ignorecase parameters.
2021-04-28 08:45:01 -04:00
68accca995 Remove needless get_next_task_for_host calls (#74174)
Called with `peek=True` and the return values are not used.

ci_complete
2021-04-28 13:19:37 +02:00
7099657dd7 Basic: don't call lstat when check_mode (#64279)
While mode is specified in check_mode, don't call lstat.
Since file may not present.

Fixes: #61185
2021-04-28 13:47:03 +05:30
b043afa025 apt: Fix fail_json API call (#74444) 2021-04-28 10:13:38 +05:30
c387b318a6 AWS: update reference to auto-retrying ResourceNotFound (#72314)
AWS Dev Guidelines: update reference to auto-retrying ResourceNotFound

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-04-28 09:59:12 +05:30
877e5b3dfe Fix ansible-test AZP build lookup. 2021-04-27 18:32:46 -07:00
be7de9844e Remove obsolete Shippable specific scripts.
Also remove some other unncessary code from CI scripts.
2021-04-27 17:11:09 -07:00
34c9ed8a28 Product-related updates. (#74454) 2021-04-27 16:19:57 -05:00
c4e76a7f80 Add collection config support to ansible-test. 2021-04-27 12:09:34 -07:00
bacede7a2b Update first_found documentation (#70502)
* import_tasks do not work with loop. We should use include_tasks instead
* update documentation
2021-04-27 13:53:21 -04:00
62cba4a6ad incidental_setup_rabbitmq test - Use official repo for rabbitmq-erlang
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.
2021-04-27 10:02:27 -07:00
8223dfccbe ansible-test - Improve __main__ checks. 2021-04-27 09:00:26 -07:00
39a49963b5 Update examples/scripts/uptime.py (#74438)
Fixes missing parameter 'verbosity'

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-04-27 17:27:55 +02:00
fcbf5c3185 [module_utils] make to_bits actually return (#74409)
Change:
- Instead of returning the `str` type, return the value that was
  calculated.

Test Plan:
- New unit tests.

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-04-27 17:15:24 +02:00
9d9b08bece fix spacing to fix header, reorg contributing page (#74421)
Co-authored-by: John R Barker <john@johnrbarker.com>
2021-04-27 10:41:10 -04:00
f97787ca74 Update argcomplete docs links on installation guide (#74410)
Link on installation docs is outdated. Switch to currently docs at: https://kislyuk.github.io/argcomplete/
2021-04-27 09:40:37 -05:00
a75bae8a62 update versions (#74432) 2021-04-27 09:36:53 -05:00
d1e6ee7b21 update changelog links and release-maint page (#74431) 2021-04-27 09:33:21 -05:00
8d499bbc83 Update Kubernetes collection name in docs (#74440) 2021-04-27 19:00:03 +05:30
63afb33d86 Use is_boto3_error_code in 'standard' example (#72313)
Use is_boto3_error_code in 'standard' example rather than e.response['Error']['Code'] (#72313)

Co-authored-by: Sloane Hertel <shertel@redhat.com>
2021-04-27 17:49:00 +05:30
cf08c23b4f Update AWS dev guides to use collections utils and fragments (#72312) 2021-04-27 17:34:49 +05:30
ddfc648d37 Update VMware library installation docs (#71219)
Depending upon OS/distro, please use pip/pip3.
2021-04-27 15:19:03 +05:30
c2985c491b Update complex_data_manipulation.rst (#72509) 2021-04-27 14:04:48 +05:30
4880fee6ca Fix typo in Makefile (#74396)
Fixed minor typo specfic -> specific
2021-04-27 11:42:57 +05:30
cb7f4f1971 Fix pypi-test-container port conflict. 2021-04-26 14:41:02 -07:00
c1879a5011 use versioned doclink for url references (#74245)
* use versioned doclink for url references

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-26 13:07:38 -04:00
85e7108d52 force version on deprecation (#74338) 2021-04-26 13:02:00 -04:00
d8fa2b50d5 Fix world readable setting (#74324)
* Fix world readable setting

   now uses shell option in all cases, the old constant still exists
    as 'documentation' but it not settable.
   also fix the docsite link in warnings/errors

* fix typose#

* fix comment#

* added deprecated to config

* missing :

* import cleanup
2021-04-26 12:49:59 -04:00
68bdfd0052 Let unarchive handle huge files
Allow extracting archives that contain files which size exceeds free system memory.

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-04-26 14:06:10 +02:00
ecc5a53288 Update default containers to 3.4.0. (#74415)
* Update default containers to 3.4.0.

The 3.4.0 containers use Python 3.6 (the system Python) for `/usr/bin/python3`.

Python 3.9 continues to be the default Python version selected by `ansible-test` for these containers.

* Fix shebang on build-ansible.py.

Using `python` instead of `python3` allows `ansible-test` python interception and requirements install to function.
2021-04-25 21:25:32 -07:00
7ca5dede97 Add weos4 network platform to documentation (#74088)
* Add weos4 network platform to documentation

* Fix small format issues
2021-04-23 23:52:14 +02:00
c90922ee36 Docs - Split Developing collections page, add info on optional module_utils (#74105)
*
2021-04-23 17:03:46 -04:00
8698855ffd Case-insensitive set theory filters (#74256)
Fixes #74255

* Fix call to 'unique(case_sensitive=False)' triggering error when falling back to Ansible's version which **is** case-sensitive
* Test multiple situations of 'unique' filter errors with fallback not handling specific parameters

Signed-off-by: Rick Elrod <rick@elrod.me>
Co-authored-by: Rick Elrod <rick@elrod.me>
2021-04-23 12:44:43 -05:00
e6a5245d60 Using "~" instead of "+" for concatination (#74364)
Changed FAQ examples to conform with the Jinja documentation:
If both values on either side of a plus/+ are numbers, they will be added whereas using "~" will convert all operands into strings and then concatenate them. Closes #73799.
2021-04-23 12:44:09 -05:00
7fd989d008 Detect Homebrew on Mac M1 (Apple Silicon) (#74378)
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-23 11:01:52 -04:00
6cfe36fa1f Set ansible-test min controller Python to 3.8. (#74395)
- Version neutral sanity tests now require Python 3.8 or later.
- Unit tests for controller-only code now require Python 3.8 or later.
2021-04-23 00:26:19 -07:00
f541c0af23 Update ansible-test default test container. (#74393)
* Update ansible-test default test container.
* Switch generic Python tests from 3.6 to 3.9.
2021-04-22 23:23:16 -07:00
ff88a2a06d Fix combinated run of unarchive and uri tests under centos 6
The unarchive integration test installs pinned packages via pip,
the uri test installs them from system packages. This explodes.
PR lets unarchive uninstall packages after test ran.
2021-04-22 17:09:10 -07:00
c295de661c Correct splitext() description, and example (#74377)
`splitext()` returns a 2-tuple of strings, and the last element of the return value includes the `.`
2021-04-22 15:40:58 -05:00
7b5dad2321 validate-modules: don't error on valid Ansible YAML in EXAMPLES 2021-04-22 12:42:47 -07:00
567361b124 Add description for COLLECTIONS_SCAN_SYS_PATH (#74351)
Fixes: #74275

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-04-22 15:08:52 -04:00
14ff5e213c Fix ansible-test docker container IP detection. 2021-04-22 11:54:54 -07:00
6119fb0a9a 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
2021-04-22 13:54:27 -05:00
bf7d4ce260 Abstract away libyaml details into yaml utils (#72607)
* Add yaml utils file and use it

* Linting fix and missing import

* Abstract a few more details

* Parser imports

* Don't use CSafeDumper in AnsibleDumper

* Move and use convert_yaml_objects_to_native when libyaml is present

* yaml_load and yaml_dump, instead of safe_*

* re-use HAS_LIBYAML from utils.yaml

* add changelog fragment

* Address recent changes

* Use representer instead of recursive type converter

* Restore needed import

* move yaml utils to module_utils

* Properly guard imports

* Update from_yaml(_all)? to handle text wrappers with CSafeLoader

* Use yaml utils for legacy_collection_loader

* Add HAS_YAML, and ignore pylint issue

* oops

* GPL->BSD
2021-04-21 16:47:03 -05:00
6418f368e3 Fix pb subs collapse (#74301)
* fix subdir parsing for plays

  fixes #74283

  Co-authored-by: Nikolaos Kakouros <nkak@kth.se>
2021-04-21 17:27:41 -04:00
a3e7cf0110 Update alpine repo to community for libuser (#74374) 2021-04-21 16:20:50 -05:00
738132da95 [ansible-test] add freebsd/13.0 remote (#74328)
Change:
- FreeBSD 13.0 was released on the 13th, add it to ansible-test.

Test Plan:
- ci_complete

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-04-21 15:13:41 -05:00
fdbef02923 Update docs on working on docs (#74201)
* Fix the Makefile's htmlsingle command.
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2021-04-21 15:15:27 -04:00
c21ad66e61 Remove unused PlayIterator.cur_dep_chain (#74366)
Introduced in fb797a9e77.
Usage removed in cae682607c.
2021-04-21 11:39:22 -04:00
7625c8f3d3 arg_spec - remove unused imports (#74354) 2021-04-21 11:38:23 -04:00
4c79dd16be Update the porting guide for a new ansible version (#74362) 2021-04-21 10:23:31 -04:00
437a08eb6d Map Debian 8 to Python 2 (#74152)
* Map Debian 8 to Python 2

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

* Add integration test for python interpreter discovery on Debian 8

* fix test issue on Debian 9, add changelog

* un"fix" not broken test :D

Co-authored-by: Fabian Klemp <fabian.klemp@elara-gmbh.de>
Co-authored-by: Matt Davis <mrd@redhat.com>
2021-04-20 15:28:24 -07:00
e6af2d6827 Fix ansible-test coverage traceback when no data.
If no coverage directory exists, ansible-test coverage would traceback.

Now it silently continues just as if the directory was present but empty.
2021-04-20 14:33:05 -07:00
2cbfd1e350 Add porting guide and documentation for changes to argument spec validation (#74268)
* Add ArgumentSpecValidator to docs
* Improve docs for ArgumentSpecValidator
* Document removal of private methods

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

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

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


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

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

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

* Improve documentation on exceptions
* Final pass
    - use args/kwargs instead of param
    - fix formatting errors that didn't display examples correctly
    - format TypeErrors so they are referenced as classes
    - specify complex types
2021-04-20 15:40:53 -04:00
6e56e72d99 vmware: Add a note about known issue (#73273)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2021-04-20 14:11:45 -04:00
c0cc574e65 Update lookup.rst (#73716)
Document that users must pass `allow_unsafe=True` as an option in the lookup to allow templating, with a note about security implications.

Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
2021-04-20 12:54:54 -05:00
ml
c9c84594d8 Docs: Fix k8s_config_resource_name YAML example (#74129)
The `name` key should be beneath `metadata`:
2021-04-20 13:37:44 -04:00
9ed0e37e53 Add a link to Jinja 2 templates (#74348)
Added a link to Jinja 2 templates in playbooks_templating documentation page.
Fixes: #74313

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-04-20 12:14:08 -05:00
49d4442378 Add umask option to user module (#73821)
* Add umask option to user module

* Fail on setting both umask and local: True

* Add integration test

* Add changelog

* Run integration tests only if HOME_MODE is not set

* Run integration tests only on Linux

Co-authored-by: Matt Clay <matt@mystile.com>
2021-04-20 12:01:56 -04:00
5f391a72ee Update playbooks_filters.rst (#74242)
##### SUMMARY
Make the `random` filter description more clear.
2021-04-20 11:59:16 -04:00
5e5bfa8116 remove deprecated ansible.module_utils._text from documentation (#73211)
According to comment in ansible.module_utils._text it is deprecated and
should not be used. This is now reflected in the documentation.
2021-04-20 11:53:27 -04:00
99a2b5f300 Provide results to examples (#73984) 2021-04-20 11:52:54 -04:00
4494ef3a9d defend against bad or missing crypt (#74304)
* defend against bad or missing crypt

  fixes #74279
2021-04-20 11:47:34 -04:00
d44eb03f49 Remove include from tests (#74330) 2021-04-20 11:19:29 -04:00
9369bd6ca1 correct how to install Docker SDK for Python (#74288)
* docs: correct guide for the latest Docker SDK for Python
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: Daeseok Youn <daeseok.youn@navercorp.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2021-04-20 11:03:30 -04:00
7b39ee361d corrected epmhasis line (#74254)
need to be careful when adding lines as you create a different offset
2021-04-20 09:38:06 -05:00
2296da95a2 fix module schema (#74295)
* fix module schema

  not out of date hardcoded list anymore, uses 'current + 4' to
  set valid deprecation targets

Co-authored-by: Matt Clay <matt@mystile.com>
2021-04-20 10:02:39 -04:00
698eae3f3d [tests] Work around vixie-cron and PAM issue, el6
Change:
- This works around an issue that causes the cron test to fail sometimes
  on el6.

Test Plan:
- ansible-test integration cron --docker centos6

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-04-19 20:41:30 -07:00
9f1513d4c0 [become] Add Solaris chmod ACL fallback
Change:
- Newer Solaris drops setfacl. Add a fallback for its chmod ACL syntax.

Test Plan:
- New units

Tickets:
- Fixes #74282

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

Test Plan:
- New unit

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-04-19 20:28:57 -05:00
7786dbbdc1 Split out module/module_utils unit test execution.
- Unit tests for `modules` and `module_utils` are now limited to importing only `ansible.module_utils` from the `ansible` module.
- Unit tests other than `modules` and `module_utils` are now run only on Python versions supported by the controller (Python 3.8+).
- Unit tests are now run in separate contexts (`controller`, `modules`, `module_utils`), each using separate invocations of `pytest`.
2021-04-19 15:44:58 -07:00
3740d7b028 Only check if play.hosts is a template when the play hasn't been finalized (#73941)
* Extend finalized logic to strategy
* Add changelog fragment
2021-04-19 13:03:40 -04:00
d8bf4206e4 netconf - handle import error when running in FIPS mode (#73992)
* Handle netconf plugin ncclient import error when running in FIPS mode

*  While running in FIPS mode importing ncclient result in
   InternalError raised by cryptography
*  Refer https://github.com/ansible/ansible/pull/65477
2021-04-19 12:41:55 -04:00
325ccf22fe Fix issue with version 3 in docs version list (#74089)
Previously would subsitute the "3" in "s3" instead of the version location in the URL
2021-04-19 18:33:35 +02:00
9ba6cf9a72 Relocate misplaced unit tests. 2021-04-16 22:23:40 -07:00
277a06f641 Clean up ansible-test cloud plugins. (#74322)
- Improve code reuse.
- Add missing type hints, fix existing ones and convert them to PEP 484 style.
- Add missing imports and clean up existing ones.
- Add missing docstrings and clean up existing ones.
2021-04-16 18:49:22 -07:00
17237c1d88 Deprecate Py2.6 support for target nodes (#74165) 2021-04-16 11:42:29 -05:00
07939b04f3 [2.12] 'attributes' (#73707)
* wip 'attributes'

* added version added tests

* syntzx

* not bile

* correztlys merges

* moved desc to frag

* simpler as dict

* unused

* clog

* Update lib/ansible/utils/plugin_docs.py

Co-authored-by: Jacob Floyd <cognifloyd@gmail.com>

* unnoted

* added action plugins

* longer list

* add sttri schema

* huh?

* itsdict

* dictit

* yolo

* gnore for now

* moar attribs

* allow extras

* positive

* added loop, documented 'imports'

* support is now none/partial/full

* import_playbook is outside host loop

Co-authored-by: Jacob Floyd <cognifloyd@gmail.com>
2021-04-16 18:17:00 +02:00
185d410316 Factor out host_label() in default stdout callback plugin (#73814)
This simplifies rendering the hostname (or hostname+delegated host) in
the default callback module, and reduces code duplication

I've chosen not move where in each handler the host label is rendered,
in case subsequent operations has side effects. However I'm happy to
change that if considered safe.

I've chosen not to change the formatting operator used (%), to avoid
changes in rendering that might result.

Signed-off-by: Alex Willmer <alex@moreati.org.uk>
2021-04-16 11:12:25 -04:00
a7c8093ce4 [2.12] Add accept_newhostkey option to git module (#73819)
* Add integration test for accept_newhostkey option

* Add changelog
2021-04-16 11:10:35 -04:00
019452dda7 uri - fix traceback on multipart-form int value (#74302) 2021-04-16 11:09:31 -04:00
fdee5ca16d Add cacheonly option to yum and dnf modules (#73820)
* Add integration test

* Add changelog

Co-authored-by: Matt Clay <matt@mystile.com>
2021-04-16 11:08:52 -04:00
0c101f3f76 Add epoch_int in date_time facts (#73822)
* Add unit test

* Add changelog
2021-04-16 11:03:07 -04:00
8d027436d4 Updated COLLECTIONS_4.rst to include ansible-inclusion repo link (#74309)
* Updated COLLECTIONS_4.rst to include ansible-inclusion repo link for new collection submission

* Update COLLECTIONS_4.rst

* Update COLLECTIONS_4.rst

* Update docs/docsite/rst/roadmap/COLLECTIONS_4.rst

Co-authored-by: Sandra McCann <samccann@redhat.com>

Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
2021-04-16 13:12:51 +01:00
7fecb7ccc3 Actually run blocks/finalized_task test (#74291) 2021-04-16 08:04:11 +02:00
7ef3dc2b8b [controller ansiballz] escape directory regex (#74270)
Change:
- We were passing a directory name directly to re.compile().
  If the directory isn't valid regex (or is) this can have odd side
  effects, such as crashing.
- Fix a few other similar cases, but less likely to be a real issue.

Test Plan:
- New test

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-04-15 17:06:58 -05:00
cf4a9fcd0f Prevent traceback when task depth exceeds python recursion depth (#73999) 2021-04-15 15:52:08 -05:00
1082e2ab79 Catch errors getting filters (#74127)
* Catch errors getting filters, and fail

* Add changelog

* Switch to warnings instead of errors, to match other plugin loader behavior

* Add tests

* Handle collections
2021-04-15 15:51:41 -05:00
28a2d9b4ae Remove __requires__ attribute for pkg_resources (#74294) 2021-04-15 15:20:20 -05:00
e3eeb88f7c removed unused imports (#74299) 2021-04-16 05:57:38 +10:00
664531d7d6 Prevent ansible_failed_task from further templating (#74290)
* Prevent ansible_failed_task from further templating

Fixes #74036

* Add changelog
2021-04-16 05:48:57 +10:00
c6945de899 Ini fixes (#74285)
* avoid 'mixed' param formats

* added tests

* clog

* fixed alignment
2021-04-16 05:36:49 +10:00
8e5dc7306e Typo fix in help output (#74277)
Should still fit in 80 chars
2021-04-16 05:18:34 +10:00
b91749d671 fix config manager list loption with choices (#74267)
fixes #74225

  Co-authored-by: Kim Nørring <github@norring.dk>
2021-04-16 05:07:43 +10:00
0a7670d1f7 deprecated include (#71262)
* deprecated include

  Update lib/ansible/modules/_include.py
  updated version numbers in schema check (real fix in separate PR)

Co-authored-by: flowerysong <junk+github@flowerysong.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2021-04-15 14:19:04 -04:00
3cbe16fa7a Fix fallback to devnull when trying to preserve stdin in worker (#74192)
ci_complete
2021-04-15 10:14:48 +02:00
ee38202fc0 Update the porting guide for ansible package 4.0.0 alpha4 (#74280) 2021-04-14 16:42:28 -04:00
126e9244c2 updates list of available versions for Ansible 3 (#74265)
* updates list of available versions for Ansible 3
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-04-13 16:59:36 -04:00
84e473a26e All lookups ported to config system (#74108)
* all lookups to support config system

 - added get_options to get full dict with all opts
 - fixed tests to match new error messages
 - kept inline string k=v parsing methods for backwards compat
 - placeholder depredation for inline string k=v parsing
 - updated tests and examples to also show new way
 - refactored and added comments to most custom k=v parsing
 - added missing docs for template_vars to template
 - normalized error messages and exception types
 - fixed constants default
 - better details value errors

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-13 15:52:42 -04:00
4819e9301b Bump azure-pipelines-test-container to version 1.9.0 2021-04-13 10:12:23 -07:00
b3b1dde648 various fixes to command (#74212)
* various fixes to command

  - Updated splitter to allow for all expected args in ad-hoc
  - Ensure we always return the returns we promissed to always return (i.e stderr/stdout)
  - Updated docs to clarify creates/removes precdence in checking
  - Removed abspath from chdir to allow reporting to handle symlinks correctly
  - Corrected tests to new output messages

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-13 12:52:29 -04:00
29aea9ff34 constructed - Add keyed_groups suboptions 'default_value' and 'trailing_separator' (#74005)
* Support omitting the trailing separator when a dictionary key's value is an empty string

* Support a default value when the value used in the group name is an empty string

* Add tests

* change log
2021-04-13 11:59:50 -04:00
270f109bb3 fix see_also formatting (#74252) 2021-04-13 11:51:39 -04:00
5e55af2f02 [test coverage] Add tests for set_stats (#74243)
* satisfy the all-knowing, ever present God of Sanity and use 'grep -c' vs. 'wc -l'
2021-04-13 11:43:53 -04:00
93fdba7013 [bugfix][coverage] find module should consider file size with file_type=any (#74241)
* add changelog
* fix cl text
* Update changelogs/fragments/74241-find-checks-size-with-any.yml

Co-authored-by: Rick Elrod <rick@elrod.me>
2021-04-13 11:41:44 -04:00
fa0bccf6a1 [module_utils.distro] Fall back to bundled (#74229)
Change:
- When a "distro" package exists in PYTHONPATH but isn't what we expect,
  fall back to our own vendored one and use it. This prevents a
  traceback if someone has some random thing that provides "distro" but
  isn't actually the "distro" library we need.

Test Plan:
- new tests

Tickets:
- Fixes #74228

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

* nuke playbook test file

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

* test fixes

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-04-13 11:27:52 -04:00
aae5bc5b9e [advanced_host_list] 100% coverage + fix a bug (#74227)
Change:
- Tests for advanced_host_list; it is now at 100% coverage.
- There was a typo (host vs hostnames) where when the host pattern
  failed to parse, instead of treating the name as a literal as
  intended, it would trigger UnboundLocalError. This didn't fatal
  as there's a global "Exception" handler below, but it did lead to
  an ugly error and incorrect behavior.

Test Plan:
- New tests
- Local experimenting

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

* changelog

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

* fix tests

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-04-13 11:26:29 -04:00
bd1acb74c8 [playbook/play.py] Increase error test coverage (#74217)
Change:
- Mostly increase error coverage for various conditions in play.py
- Also fix a string in an error, where get_name() was called before
  self.name was read in, so get_name() was always ''.

Test Plan:
- new tests

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

* Fix regex for py2 and py3

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

* py2 hates me

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-04-13 11:22:02 -04:00
19aeb4706d [conditional] Remove support for bare variables (#74208)
Change:
- Variables used in ``when`` conditionals are no longer parsed and
  attempted to be converted to booleans. All non-empty strings are
  considered true (empty strings, false).

Test Plan:
- Updated existing tests
- Added a bunch of new tests with various kinds of truthy/falsy
  values.

Tickets:
- Fixes #74134

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-04-13 11:12:10 -04:00
ce96591313 Remove deprecated cache interfaces (#74198)
* update unit test
* Remove FactCache 'update' method
2021-04-13 11:08:20 -04:00
39bd8b99ec async_wrapper more info on end (#74199)
be consistent on information returned
 normalize 'return functions'
 fix unit test
 add a bit more context on some failures
2021-04-13 10:30:13 -04:00
8502c23028 Fix links to the collections org in doc & FR forms 2021-04-13 16:23:26 +02:00
9f002d9f60 📝 Make issue forms verbose and helpful (#74185)
Co-authored-by: John R Barker <john@johnrbarker.com>
Co-authored-by: Sloane Hertel <shertel@redhat.com>
2021-04-13 15:52:03 +02:00
3a244c5533 config lookup can now handle collection plugins (#74250)
use load_name of valid plugin to find config, will handle the renamed loaded plugin that collections do:
`ansible_collection.<ns>.<collname>.plugins.<type>.<name>`
2021-04-13 00:00:43 -04:00
f38d03f6fb [ansible-test] nuke virtualenv-isolated.sh
Change:
- This isn't used in our tests, so the suggestion was to just remove
  it.

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-04-12 15:09:18 -07:00
481c036632 update intersphinx links for Ansible 3 2021-04-12 14:53:11 -07:00
d7f826c987 Change look and feel of the ansible-core docs (#74200) 2021-04-12 16:39:13 -04:00
b752d07163 Overhaul ansible-test container management.
This brings ansible-test closer to being able to support split controller/remote testing.
2021-04-12 12:40:36 -07:00
9f856a4964 config lookup can query plugin settings (#74186)
* config lookup can query plugin settings
2021-04-12 15:30:25 -04:00
bb7b17fded added apt lock_timeout (#74095)
* added apt lock_timeout

should help control issues with apt db being locked out
also cleanup imports
2021-04-12 14:10:50 -04:00
c7473828c7 Docs: Remove duplicate word (#74223)
The word "to" was erroneously used twice consecutively.

Signed-off-by: Matthew Cengia <mattcen@mattcen.com>
2021-04-11 05:50:36 -05:00
b70a42f693 fix typo in _collection_finder.py (#74218) 2021-04-10 05:13:50 -05:00
3504f4c45f [yum] report upgraded multiarch packages (#73548)
Change:
- Previously when the same package name was installed twice under
  different architectures, we only reported it once in changes.updated.
- This was the result of using a dict internally and keying on package
  name alone.
- This change still keys on package name but turns the values into lists
  which can contain multiple packages per name.

Test Plan:
- Added a lot of tests around multi-arch support
- Added some tests around virtual provides as well

Tickets:
- Fixes #73284

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-04-10 02:36:20 -05:00
8c413749fc [test/support/docker_swarm] remove deprecation (#74203)
Change:
- Remove deprecation block from support test code

Tickets:
- Fixes #74146

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-04-09 22:38:33 -05:00
9c506031fa Solaris: Correct version check in svcadm_supports_sync API (#73860)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-04-10 08:02:58 +05:30
ef554d0378 [playbook] error on empty, error on 'include' (remove two deprecations) (#74172)
Change:
- Remove two deprecated features
- We now error if a playbook is an empty list instead of just skipping
- We now error if using 'include' instead of 'import_playbook'

Test Plan:
- Added new tests for new errors

Tickets:
- Fixes #74133

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

* sanity & changelog

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-04-09 10:28:24 -04:00
becf941673 Add PyPI proxy container for tests on Python 2.6. 2021-04-08 15:47:23 -07:00
d7df8a4484 [cron] Remove deprecated features (#74197)
Change:
- Require name always
- Drop 'reboot' parameter in favor of 'special_time: reboot'

Test Plan:
- CI

Tickets:
- fixes #74132

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-04-08 15:50:27 -04:00
d5ce6e6bed Increase test coverage for command module (#74183) 2021-04-08 15:24:01 -04:00
b07a78b4ba remove deprecated connection password functions (#74155)
* they were moved from connecitons to become plugins
* fixed clog, removed sanity ignore
* fixed tests to use become functions
2021-04-08 15:11:06 -04:00
45ab6fddf3 removed task parameters (#74154)
* fixed clog
* removed ignore
* fix typose
* removed ignore
2021-04-08 15:09:45 -04:00
7443e9d659 pin docutils to 0.16 until theme problem is fixed (#74193) 2021-04-08 13:37:00 -05:00
4df9ea86c2 ansible-test - change diff mathching regexp so prefixes are optional
The `a/` and `b/` prefixes can be disabled in the `git diff` output by setting
`diff.noprefix` to `true`. The output is still a valid diff, but `ansible-test` would
raise an exception since without the prefixes, it thought the diff line was invalid.
2021-04-07 12:50:39 -07:00
7b79b69369 ansible-test - ensure trailing separator is added for connection unit test target (#74176)
For connection units tests, if the `__init__.py` file is modified, the trailing separator was
not added, making the target invalid.
2021-04-07 13:27:09 -04:00
459ea5a4a4 Update test containers in ansible-test. (#74166)
* Update distro test containers to version 2.0.2.

* Update the default test containers.
2021-04-06 15:52:56 -07:00
09c8faca9f Add 2.12 roadmap (#74000) 2021-04-06 12:43:38 -05:00
653a96dcea renamed: ansible-base.{dirs,install} -> ansible-core.{dirs,install} (#74159) 2021-04-06 11:51:52 -05:00
96f94c0fef Use a file-like obj for stdout/stderr for deadlock workaround (#74156)
Fixes #74149
2021-04-06 11:26:52 -05:00
d1842afd59 ansible-inventory - add coverage tests (#74130) 2021-04-06 12:14:54 -04:00
1cacf933b7 lineinfile - improve test coverage (#74122) 2021-04-06 12:11:10 -04:00
ecd69ed36e Use render for code blocks in issue forms 2021-04-06 18:02:41 +02:00
05662fd2ab Docs: clarify role docs - vars vs params, dependencies (#74104) 2021-04-06 11:24:28 -04:00
282dd1bbc7 Drop deprecated issue_body from issue forms
This change removes the deprecated attribute and also adds an explicit
textarea at the end of the docs report form to replace it.
2021-04-06 17:06:05 +02:00
0dd2327bca Add CoC checkboxes to the issue forms 2021-04-06 16:47:04 +02:00
3a74f7ea22 prep for 2.12 version bump (#74126)
* prep for 2.12
* Add 2.12 deprecations and sort ignore.txt list.

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

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

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

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

##### ISSUE TYPE
- Docs Pull Request

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

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


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

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

* Add doc fragment tests with fragments from other collections.

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

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


Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2021-03-23 10:27:53 -04:00
2bff120db6 Fix wrong backup directory var name in apt module (#73840)
* Fix wrong backup directory var name in apt module
2021-03-22 10:06:45 -04:00
2c40dccd85 Update Ansible release version to v2.11.0b3.post0. (#73980) 2021-03-19 23:48:17 -05:00
88a1a85ff8 New release v2.11.0b3 (#73977) 2021-03-19 22:08:27 -05:00
c6cf7986ab add porting guide info for optional module_utils (#73979) 2021-03-19 20:21:22 -05:00
abacf6a108 Use ArgumentSpecValidator in AnsibleModule (#73703)
* Begin using ArgumentSpecValidator in AnsibleModule

* Add check parameters to ArgumentSpecValidator

Add additional parameters for specifying required and mutually exclusive parameters.
Add code to the .validate() method that runs these additional checks.

* Make errors related to unsupported parameters match existing behavior

Update the punctuation in the message slightly to make it more readable.
Add a property to ArgumentSpecValidator to hold valid parameter names.

* Set default values after performining checks

* FIx sanity test failure

* Use correct parameters when checking sub options

* Use a dict when iterating over check functions

Referencing by key names makes things a bit more readable IMO.

* Fix bug in comparison for sub options evaluation

* Add options_context to check functions

This allows the parent parameter to be added the the error message if a validation
error occurs in a sub option.

* Fix bug in apply_defaults behavior of sub spec validation

* Accept options_conext in get_unsupported_parameters()

If options_context is supplied, a tuple of parent key names of unsupported parameter will be
created. This allows the full "path" to the unsupported parameter to be reported.

* Build path to the unsupported parameter for error messages.

* Remove unused import

* Update recursive finder test

* Skip if running in check mode

This was done in the _check_arguments() method. That was moved to a function that has no
way of calling fail_json(), so it must be done outside of validation.

This is a silght change in behavior, but I believe the correct one.

Previously, only unsupported parameters would cause a failure. All other checks would not be executed
if the modlue did not support check mode. This would hide validation failures in check mode.

* The great purge

Remove all methods related to argument spec validation from AnsibleModule

* Keep _name and kind in the caller and out of the validator

This seems a bit awkward since this means the caller could end up with {name} and {kind} in
the error message if they don't run the messages through the .format() method
with name and kind parameters.

* Double moustaches work

I wasn't sure if they get stripped or not. Looks like they do. Neat trick.

* Add changelog

* Update unsupported parameter test

The error message changed to include name and kind.

* Remove unused import

* Add better documentation for ArgumentSpecValidator class

* Fix example

* Few more docs fixes

* Mark required and mutually exclusive attributes as private

* Mark validate functions as private

* Reorganize functions in validation.py

* Remove unused imports in basic.py related to argument spec validation

* Create errors is module_utils

We have errors in lib/ansible/errors/ but those cannot be used by modules.

* Update recursive finder test

* Move errors to file rather than __init__.py

* Change ArgumentSpecValidator.validate() interface

Raise AnsibleValidationErrorMultiple on validation error which contains all AnsibleValidationError
exceptions for validation failures.

Return the validated parameters if validation is successful rather than True/False.

Update docs and tests.

* Get attribute in loop so that the attribute name can also be used as a parameter

* Shorten line

* Update calling code in AnsibleModule for new validator interface

* Update calling code in validate_argument_spec based in new validation interface

* Base custom exception class off of Exception

* Call the __init__ method of the base Exception class to populate args

* Ensure no_log values are always updated

* Make custom exceptions more hierarchical

This redefines AnsibleError from lib/ansible/errors with a different signature since that cannot
be used by modules. This may be a bad idea. Maybe lib/ansible/errors should be moved to
module_utils, or AnsibleError defined in this commit should use the same signature as the original.

* Just go back to basing off Exception

* Return ValidationResult object on successful validation

Create a ValidationResult class.
Return a ValidationResult from ArgumentSpecValidator.validate() when validation is successful.
Update class and method docs.
Update unit tests based on interface change.

* Make it easier to get error objects from AnsibleValidationResultMultiple

This makes the interface cleaner when getting individual error objects contained in a single
AnsibleValidationResultMultiple instance.

* Define custom exception for each type of validation failure

These errors indicate where a validation error occured. Currently they are empty but could
contain specific data for each exception type in the future.

* Update tests based on (yet another) interface change

* Mark several more functions as private

These are all doing rather "internal" things. The ArgumentSpecValidator class is the preferred
public interface.

* Move warnings and deprecations to result object

Rather than calling deprecate() and warn() directly, store them on the result object so the
caller can decide what to do with them.

* Use subclass for module arg spec validation

The subclass uses global warning and deprecations feature

* Fix up docs

* Remove legal_inputs munging from _handle_aliases()

This is done in AnsibleModule by the _set_internal_properties() method. It only makes sense
to do that for an AnsibleModule instance (it should update the parameters before performing
validation) and shouldn't be done by the validator.

Create a private function just for getting legal inputs since that is done in a couple of places.

It may make sense store that on the ValidationResult object.

* Increase test coverage

* Remove unnecessary conditional

ci_complete

* Mark warnings and deprecations as private in the ValidationResult

They can be made public once we come up with a way to make them more generally useful,
probably by creating cusom objects to store the data in more structure way.

* Mark valid_parameter_names as private and populate it during initialization

* Use a global for storing the list of additonal checks to perform

This list is used by the main validate method as well as the sub spec validation.
2021-03-19 12:09:18 -07:00
089d0a0508 find - set proper default based on use_regex (#73961)
When using "use_regex: yes" and setting an excludes: without
specifying a pattern: the existing code passes the file-glob '*' to
the regex matcher.  This results in an internal invalid-regex
exception being thrown.

This maintains the old semantics of a default match-all for pattern:
but switches the default to '.*' when use_regex is specified.

The code made sense as-is before excludes: was added (2.5).  In that
case, it made no sense to set use_regex but *not* set a pattern.
However, with excludes: it now makes sense to only want to exclude a
given regex but not specify a specific matching pattern.

Closes: #50067

* moved change to new location
added changelog

* Update lib/ansible/modules/find.py


Co-authored-by: Ian Wienand <iwienand@redhat.com>
2021-03-19 13:18:31 -04:00
48c0fbd1cb Fix a bug adding unrelated candidates to the plugin loader redirect_list (#73863)
* Fix a bug adding unrelated candidates to the plugin loader redirect_list

* Add tests for the redirect list

  * test redirect list for builtin module
  * test redirect list for redirected builtin module
  * test redirect list for collection module
  * test redirect list for redirected collection module
  * test redirect list for legacy module

* changelog
2021-03-18 17:53:57 -04:00
3e63eb8418 fix typo 2021-03-18 12:50:06 -07:00
3811fddede Amazon: Fix distribution facts for older release
Ansible can gather distribution facts for older Amazon Linux
with /etc/os-release data.

Fixes: #73946

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-03-18 12:42:04 -07:00
ad5ee1542a Remove ini and env fields for config option CONNECTION_FACTS_MODULES 2021-03-18 12:40:15 -07:00
7a55e98d29 clarifies docs for file module, addresses issue 72372 (#73938) 2021-03-18 12:34:04 -07:00
ccd9a992cf complex data example using value and default from list of dicts (#73937) 2021-03-18 12:31:33 -07:00
efe97aeb31 Update developing_inventory.rst (#73931)
* Update developing_inventory.rst

hashes/dictionaries in JSON (JavaScript Object Notation) are represented by what JSON calls "objects", so use that established terminology instead of "hash", "dictionary", or "hash/dictionary" etc.

* Update docs/docsite/rst/dev_guide/developing_inventory.rst

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2021-03-18 12:14:21 -07:00
78f34786dd Send callbacks directly from the TaskExecutor instead of TaskResults masquerading as callbacks (#73927) 2021-03-18 12:12:29 -07:00
561cdf3ace Updated COLLECTIONS_4.rst to include ansible-inclusion repo link for new collection submission (#73582)
Co-authored-by: Sandra McCann <samccann@redhat.com>

Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
2021-03-18 11:59:01 -04:00
95dc8f2361 Add some dev documentation for constructed features (#73497) 2021-03-18 09:45:13 -04:00
30c465c1a9 Promote publication (#72400)
Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
2021-03-17 16:14:32 -04:00
b57444af14 Rebased pr73824 (#73934)
Co-authored-by: Eugene <k.evgen61@gmail.com>
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-03-17 16:07:38 -04:00
4add723107 ansible-pull: Run All Playbooks When Multiple Are Supplied (#73172)
* ansible-pull: run all playbooks when multiple are supplied

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

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

  https://github.com/ansible/ansible/pull/73508

To avoid adding no_log statements to passive_interface args.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2021-03-13 08:28:57 -06:00
7c0af58449 validate-modules no_log test: extend search range, add more known false-positives (#73882)
* validate-modules no_log test: extend search range, add more known false-positives.

* Mark false-positives.
2021-03-13 08:28:33 -06:00
ed18fcac3b Ensure unit test paths for connection and inventory plugins are based on the context (#73877) 2021-03-12 12:46:40 -08:00
3a8c9242e1 Use virtual host style S3 bucket names in tests. 2021-03-12 11:34:25 -08:00
197e8f5640 Mention that minor releases end once the next ansible release is made. (#73836) 2021-03-11 16:12:55 -06:00
780f79ecbc Update the porting guide for a new ansible version (#73856) 2021-03-11 14:49:03 -06:00
b486feaaf4 document slurp returns (#73865)
* no path on return
2021-03-11 14:28:47 -06:00
bd020dd14a describe what ansible-core is (#73829) 2021-03-11 14:27:36 -06:00
37cb550185 fix su localization optoin
fixes #73837
2021-03-11 11:53:28 -08:00
8ef54759ec moved vs deprecated world readable tmp setting (#73825) 2021-03-11 11:43:27 -08:00
27eaab310b Add direct link to using multiple inventory sources (#73680)
This helps users to find the right ressources more easily and prevents them from clicking the first matching link only to be redirected to a subsection on the samepage from there

Co-authored-by: Jens Heinrich <github.com/JensHeinrich>
2021-03-11 14:36:00 -05:00
474f46ea56 Docs: Updates the release and maintenance page to reflect new cadences (#73781)
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: John R Barker <john@johnrbarker.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: John R Barker <john@johnrbarker.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
2021-03-11 14:25:18 -05:00
1ac2858b5a Update developing_modules_general.rst (#73805)
##### SUMMARY
<!--- Fixing a typo. There was a double "you" in the text. -->


##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2021-03-11 14:11:04 -05:00
31932f5fa3 Docs: Update installation page for package split (#73790) 2021-03-11 11:05:44 -08:00
b2015c98e2 validate-modules: make sure that options that potentially contain secret data have no_log set (#73508)
* Catch more potential errors (and increase false-positive rate).
* Flag some false-positives in lib/ansible/modules/ with no_log=False.

Co-authored-by: John Barker <john@johnrbarker.com>
2021-03-11 12:57:11 -05:00
3e1f6484d7 add optional module_utils import support (#73832)
* add optional module_utils import support

Treat core and collections module_utils imports nested within any Python block statement (eg, `try`, `if`) as optional. This allows Ansible modules to implement runtime fallback behavior for missing module_utils (eg from a newer version of ansible-core), where previously, the module payload builder would always fail when unable to locate a module_util (regardless of any runtime behavior the module may implement).

* sanity test fixes

ci_complete
2021-03-10 11:08:13 -08:00
15064c7a42 Update resource_prefix syntax for ansible-test. 2021-03-10 09:00:12 -08:00
1d5110db6f Unify additional info + WYSIWYG as optional input in the documentation report issue form (#73796) 2021-03-09 20:55:14 +01:00
9db557e431 Nonfatal facts (#73804)
continue with local facts vs at script error
 actually capture execution errors
 better error messages in general
 add more local facts tests

 fixes #52427
2021-03-08 16:20:37 -05:00
212837defc Documentation: Lay the ground for i18n work. (#73746)
* Documentation: Lay the ground for i18n work.

* Translating both ansible-core and ansible docs requires msgcat
  (a program from the gettext package). If msgcat is not present,
  only the ansible-core index file's strings will be extracted for translation.
  If this is a problem, a short hacking script could be written to take the
  place of msgcat (merging the various index pot files into a single pot file).

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2021-03-05 09:31:56 -08:00
fb66b4ffbc distribution: Add Amazon Linux distribution facts (#73767)
* Update Amazon Linux Distribution facts gathering logic
* Update tests

Fixes: #73742

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

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

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

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

  fixes #72739
  fixes #57220

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

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

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

  but warn that content cound not be sorted because of this

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

* Limit allowed issues to the form based ones

* Title-case the form field labels

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

* Remove CoC checkboxes from the forms

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

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

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

* add basic selinux facts tests

* fix selinux facts test when selinux missing

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

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

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

* Add tests and changelog

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

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

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

Fixes: #71977

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

* Update tests to ensure no pepxect encoding issues

* Add changelog fragment

* Add multiline note

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

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

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

Tickets:
- Fixes #73658

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

* add changelog

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

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

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

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

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

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

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

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

* Add changelog

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

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

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

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

  also avoid clobbering existing data with empty file
  fixes #45843

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

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

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

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

minimize internal HAVE_SELINUX usage

spurious junk

pep8

* pylint fixes

* add RHEL8 Python 3.8 testing

* more pylint

* import sanity

* unit tests

* changelog update

* fix a bunch of stuff

* tweak changelog

* fix setup_rpm_repo on EL8

* misc sanity/test fixes

* misc feedback tweaks

* fix import fallback in test module

* fix selinux MU test

* fix dnf tests to avoid python-dependent test packages

* add trailing LFs to aliases

* fix yum tests to avoid test package with Python deps

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

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

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

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

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

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

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

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

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

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

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

* Add changelog fragment.

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

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

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

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

* Update changelog fragment.

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

* fix misunderstood use of yaml anchors

* add changelog fragment

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

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

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

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

* Added changelog

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

* Add changelog

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

* forwarding of port 444

* forward port 8444 to port 444 on http test container

* Fix port forwarding for Windows under docker

* add changelog fragment

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

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

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

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


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

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

This module tries to identify lines like:

`HAS_FOO = True`

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

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

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

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

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

Tickets:
- Fixes #73084

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

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

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

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

* Match user-requested transitive pre-releases

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

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

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

* Support Python 3.8 on FreeBSD in ansible-test.

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

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

This change:

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

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

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

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

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

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

      - reuses helper bits previously moved out into external modules;

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

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

  * Makes `GalaxyAPI` instances sortable.

  * Adds string representation methods to `GalaxyAPI`.

  * Adds dev representation to `GalaxyAPI`.

  * Removes unnecessary integration and unit tests.

  * Aligns the tests with the new expectations.

  * Adds more tests, integration ones in particular.

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

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

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

Fixes: #68612

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

  * Also nicer naming/comments

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

* Fix missing and unused imports.

* Fix type hints.

* Suppress PyCharm false positives.

* Avoid shadowing `file` built-in.

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

This matches the recommended usage and avoids a PyCharm warning.

* Remove redundant regex escape.

* Remove redundant find_python call.

* Use tarfile.open directly.

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

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

Also adds missing test for #6653.

Fixes #72262
Fixes #72615

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

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

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

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

Test Plan:
- CI

Tickets:
- Fixes #69203

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

Test Plan:
- ci_complete

Tickets:
- Fixes #48782

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

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

ci_complete

* Postpone loading all ansible plugins

* Do we need to create an overlay?

ci_complete

* Typo

ci_complete

* Add FIXME

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

* Remove remaining occurrences of shared_loader_obj being passed to Templar

* __UNROLLED__ not needed with this change anymore

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

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

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

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

This adds the missing quotes.

##### ISSUE TYPE
- Docs Pull Request

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

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

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

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

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

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

Fixes #38696

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

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

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


##### ISSUE TYPE
- Docs Pull Request

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

##### ISSUE TYPE
- Docs Pull Request

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

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

Test Plan:
- ci_complete
- New test fixtures

Tickets:
- Fixes #73027

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

* Remove obsolete endpoint logic from ansible-test.

* Remove obsolete region selection in ansible-test.

* Remove obsolete port logic in ansible-test.

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

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

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

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

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

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

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

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

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

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

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

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

Tickets:
- Fixes #72809

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

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

Test Plan:
- ci_complete

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

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

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

* Cleanup the unused string import.

Added a changelog fragment.

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

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

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

* Add a test for --no-deps

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

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

Tickets:
- Fixes #72331

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

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

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

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

##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr

* Add changelog fragment

* Apply suggestions from code review

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

Fixes: #72217

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

Regression introduced in (#20532)

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

Fixes: #70887

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

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


##### ISSUE TYPE
- Docs Pull Request

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

* Remove unrendered markup from examples

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

* Explain Python unpacking notation

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

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

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

* Use glob setting for toctree.

* Explicitly include new file.

* Move all_plugins one level up.

* Revert "Move all_plugins one level up."

This reverts commit bd47e82ead.

* Revert "Explicitly include new file."

This reverts commit 74ae50a734.

* Adjust .gitignore

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

This reverts commit f30d99c861.

* Fix docs make clean

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

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

* Change get_wanted_type name and behavior

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

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

* Add param to check_type_str()

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

* Remove private attribute mapping types to validator

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

Update tests that were referencing the private attribute.

* Use private method for 'str' type

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

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

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

* Add changelog

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

* Change dict name to better reflect its contents

CHECK_ARGUMENT_TYPES_DISPATCHER --> DEFAULT_TYPE_VALIDATORS

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

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

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

* Remov unnecessary block

* Use vars files instead of set_fact

* Add tests for using a templated unit file

* Update changelog fragment

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

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

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

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

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

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

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

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

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

   fixes #72628

   ensure we always store paths w/o a_c

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

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

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

Fixes #61234

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

* fix up docs syntax to sanity tests are happy

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

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

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

* Fix sanity issue

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

Test downloading a collection without dependencies

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

* Ensure psrp doesn't trace

* winrm too

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

* Target localhost instead of remote host

* Don't forget inventory

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

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

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

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

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

Fixes #16130, #27081.

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

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

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

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

* Rename files for the ansible roadmap from 2.11 to 3.0

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

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

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

* Add changelog fragment.

* Improve some more 'why's.

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

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

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

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

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

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

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

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

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

Test Plan:
- ci_complete

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

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

Test Plan:
- ci_complete

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

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

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

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

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

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

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

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

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

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

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

Skip all python2 versions because next ansible-runner drops it

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

##### ISSUE TYPE
- Docs Pull Request

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

* Change tests for unfrack'd playbook_dir var

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

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

improves #57361

##### ISSUE TYPE
- Docs Pull Request

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

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

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

* Remove module type checking from ignore.txt sanity checks

* Remove mode type

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

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

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

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

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

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

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

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

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

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

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

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

* Add cache options and split up code

* Added unit tests

* Fix sanity test

* Use modified date and fix up caching for explicit servers

* Make sure credentials are not in cached server name

* Added test for getting updated cache version

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

  Fixes #27626
  based on #27859

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

Test Plan:
- CI

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

* Add comment unit test

* Fix unit test

* Fix unit test

* Add changelog

* Add paramaters which would be problematic without this fix

* Fix typo

* Fix unit test

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

Test Plan:
- ci_complete

Tickets:
- Fixes #72366

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

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

* Add spaces

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

* and more spaces

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

* s/Py/Python/

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

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

* Add collection_name to deprecated call

* more spaces

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

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

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

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

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

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

* Add explicit tests for missing_required_lib

* Add explicit tests for recursive_diff

* ci_complete ci_coverage

* Update data to cover more code/tests

* ci_complete ci_coverage

* Add argspec tests for aliases, and no_log

* Forgotten file

* ci_complete ci_coverage

* Add argspec tests for type int

* ci_complete ci_coverage

* Remove incidental_k8s

* ci_complete ci_coverage

* fix missing newline

* Remove incidental_sts_assume_role

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

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

* Also support k8s action group for community.okd.

* Also add kubernetes.core.

* Adjust PR #.

* Fix changelog fragment.

* Remove community.okd.

* Revert "Remove community.okd."

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

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

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

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

Tickets:
- Likely fixes #72316

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

* Use items instead of sub-headings.

* Update deprecation information.

* Document conditional requirements.

* Document supports_check_mode and add_file_common_args.

* Add deprecation examples.

* Re-add word.

* Improve title.

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

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

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

* Add Ansible variables. Copied from #55474.

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

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

improves #69489

* fix syntax in doc of git module

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

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

* Add explicit test for undefined repr

* ci_complete ci_coverage

* Skip old jinja2

* ci_complete ci_coverage

* Remove incidental_tower_receive

* ci_complete ci_coverage

* Remove incidental_tower_credential_type

* ci_complete ci_coverage

* Remove ignore entries

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

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

* Test missing ANSIBLE_CONFIG

* Add explicit inventory script tests

* Add explicit tests for _consume_options

* Adjust perms, remove extra file

* ci_complete ci_coverage

* remove incidental_inventory_vmware_vm_inventory

* ci_complete ci_coverage

* Remove incidental_script_inventory_vmware_inventory

* ci_complete ci_coverage

* Remove incidental_vmware_guest

* ci_complete ci_coverage

* Remove incidental_vmware_host_hyperthreading and incidental_vmware_prepare_tests

* ci_complete ci_coverage

* newline and comment about what the test is doing

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

* ci_complete ci_coverage

* Remove incidental_cs_role_permission

* ci_complete ci_coverage

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

* added test

* fix typosesz

* fix conflict

* task_timeout

* fix timeout option, added extra vars to console

* actually use right cli switch .. DUH!

* added timeout to include 'valid' but ignored keys

* fix default

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

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

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

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

* Fix port and migration issue

* Add delete step, still need to deal with pagination

* Make cleanup more efficient

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

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

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

* Update documentation

* Account for virtualization type returned on Azure Pipelines

* Do not be dependent on order of self.name_types

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


##### ISSUE TYPE
- Docs Pull Request

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

Test Plan:
- CI

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

* changelog

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

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

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

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

* review comments

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

* Attach test containers to the correct network.

* Do not assume `localhost` for accesing Docker.

* Look for containers on current network.

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

This fixes issues when using a remote Docker host.

* Support container IP lookup from networks list.

* Fix container network attachment.

* Remove redundant container detection messages.

* Limit DOCKER_HOST parsing to TCP.

* Restore docker socket existence check.

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

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

* Add test for required.

* Add test for required_one_of.

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

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

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

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

* Fix another missed occurance

* Add changelog

* Fix further reversed order of return values occurrences

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

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

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

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

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

* Added missing 'vars:' key

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

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

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

* Simplify exception wrapper

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

* Add tests and changelog

* Remove grep, do assertion in playbook. ci_complete

* Skip old jinja2 versions

* ci_complete

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

Test Plan:
- CI

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

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

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

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

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

Test Plan:
- New unit tests
- CI

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

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


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

* Test out changes with the latest test container

* Get remote hosts working

* Fix up httptester_krb5_password reader

* Fix tests for opensuse and macOS

* Hopefully last lot of testing changes

* Dont do CBT on macOS

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

* rc=1 failed

* ci_complete ci_coverage

* Test rc!=0 without failed and until

* ci_complete ci_coverage

* Remove incidental_win_psexec

* Reduce delay

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


##### ISSUE TYPE
- Docs Pull Request

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

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

* Add explicit apt_key tests for fetching key directly from url

* ci_complete ci_coverage

* Remove repo only by repo

* ci_complete ci_coverage

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

* ci_complete ci_coverage

* Add systemd tests for enabling and disabling a service

* ci_complete ci_coverage

* Remove incidental_zabbix_host

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

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

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

* Fix other example modules as well

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

* ci_complete ci_coverage

* Remove incidental_ufw

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

* ci_complete ci_coverage

* Remove incidental_vmware_guest_custom_attributes

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

* Revert callback_type -> type transform.

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

* Standardize on name and type (for callbacks).

* Fix existing author entries.

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

* These are actually parsed as integers in the code.

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

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

* ci_complete

ci_coverage

Add a wait_for test using delegate_to

* Remove incidental_ec2_instance

* Remove unused test support modules

* Requested changes

ci_complete

ci_coverage

* Oops, put everything back to test coverage again

ci_complete

ci_coverage

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

Fixes: #71704

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

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

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

Test Plan:
- Issue author

Tickets:
- Fixes #72001

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

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

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

* ci_complete ci_coverage

* Remove incidental_hcloud_server

* Remove hcloud from shippable matrix

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

* ci_complete ci_coverage

* Remove incidental_flatpak_remote

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

* Use the jinja2 filters if available

* Add unit tests

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

Test Plan:
- New unit tests

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

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

* ci_complete ci_coverage

* Remove incidental_timezone

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

* fail_on_missing_params

* ci_complete ci_coverage

* Remove incidental_aws_step_functions_state_machine

* ci_complete ci_coverage

* Remove incidental_cs_service_offering

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

Fixes: #71942

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

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

* Add clog fragment

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

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

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

##### ISSUE TYPE
- Docs Pull Request

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

* ci_complete ci_coverage

* Remove incidental_vyos_static_route

* ci_complete ci_coverage

* Add explicit coverage of suboptions required_if

* ci_complete ci_coverage

* Remove incidental_vyos_logging

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

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

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

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

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

* Non string mapping failure

* ci_complete ci_coverage

* Remove incidental_nios_txt_record and associated files

* Don't forget the ignore.txt changes

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

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

* Add changelog fragment.

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

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

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

* normalize diff

* More normalization

* diff without changed

* ci_complete ci_coverage

* nuke incidental_xml

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

Test Plan:
- CI

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

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

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

* adds yaml extension, corrects placement

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

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

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

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

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

* Make classification of CI files consistent.

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

Fixes: #51307

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

* adds ansible-output lexer, remmoves unsupported lexers

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

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

* Apply suggestions from code review

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

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

Test Plan:
- CI

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

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

Test Plan:
- New unit tests

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

Test Plan:
- Updated default callback tests

Tickets:
- Fixes #71277

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

* ci_complete ci_coverage

* Remove incidental_consul and incidental_setup_openssl

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

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

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

ci_complete
ci_coverage

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

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

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

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

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

* changes from sivel

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

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

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

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

Tickets:
- Fixes #70854

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

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

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

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

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

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

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

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

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

* linting fix

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

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

* Add test for using patterns

* s/it's/its/

* Allow bypassing parse_sources in InventoryManager

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

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

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

Test Plan:
- CI, hopefully

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

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

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

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

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

Test Plan:
- CI
- ci_complete

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

Test Plan:
- New integration tests

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

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

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

* Account for old passlib

* Add tests for salt constraints

* Add changelog fragment

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

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

* Fix ansible-test coverage traceback.

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

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

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

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

Fixes: #47906

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

* Fix sanity issues

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

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

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

Fixes: #68402

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

##### ISSUE TYPE
- Docs Pull Request

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

Add --list-tasks tests for meta tags

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

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

Test Plan:
- CI, new test

Tickets:
- Refs #71009

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

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

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

Test Plan:
- New integration tests

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

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

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

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

Fixes: #38182

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

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

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

* Add changelog and test

* Add test for issue 29047

* Fix for both tests

* blerg

* Change test messages

* fix tests

* Add multi-level block in rescue test case

* Add recursive rescue check and multi-level test

* Should probably run the new test

* ci_complete

* Merge new tests

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

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

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

* Add changelog

* adjust changelog PR link

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

* add warning about bdist_wheel

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

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

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

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

* linting fixes. ci_complete

* fix up units. ci_complete

* Try moving the sentinel put higher. ci_complete

* safeguards. ci_complete

* Move queue killing to terminate

* LINTING. ci_complete

* Subclass Queue, to add helper send_callback method

* Just use _final_q instead of adding another queue and thread

* Revert a few changes

* Add helper for inserting a TaskResult into the _final_q

* Add changelog fragment

* Address rebase issue

* ci_complete

* Add test to assert async poll callback from fork

* Don't use full path

* ci_complete

* Use _results_lock as a context manager

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

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

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

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

* selected preferred text

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

This reverts commit 5260527c4a.

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

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

* Make pattern raw string

* fmt tag should be the first non-whitespace line

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

Fixes: #67003

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

Test Plan:
- Coverage report

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

Test Plan:
- CI

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

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

* Fix up some broken tests

* Update task_executor.py

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

* Add alias for winrm and fix incorrect assumption

* Make sure aliases are used for keyword options

* Conditionally run test if sshpass is present, fix sanity

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

* More updates

* Add forgotten file

* remove debug

* Add alpine3

* equal

* group 4

* group 4

* group 5

* Try to decrease test length

* libuser only available in testing

* Remove debug

* Make loops target work on hosts without gnu date

* Enable alpine testing

* ci_complete

* Don't specify uid for creating test user

* ci_complete

* Re-sort docker completion

* use newer container image

* ci_complete

* fix indentation

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

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

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

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

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

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

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

Test Plan:
- Local
- CI

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

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

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

* Update test/units/cli/test_doc.py

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

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

  also allow expansion by additional context provided from caller

  fixes #41955

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

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

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

Test Plan:
- CI, new tests

Tickets:
- Fixes #70648

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

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

Test Plan:
- CI

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

Test Plan:
- New integration tests

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

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

Test Plan:
- New integration tests

Tickets:
- Fixes #63378

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

Test Plan:
- New integration tests

Tickets:
- Fixes #70702

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

* Document multiple Ansible versions

Clarify difference between deprecation and tombstone fields

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

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

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

Test Plan:
- New unit tests

Tickets:
- Fixes #68770

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

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

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

* Only match paths at the beginning

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

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

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

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

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

Test Plan:
- New integration tests

Tickets:
- Fixes #62136

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

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

Test Plan:
- CI

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

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

* Add stub for automatically generated 2.10 porting guide.

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

* Apply changes to base porting guides.

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

* Ansible Base -> Ansible-base

* Fix link in base porting guide.

* Add generated porting guide.

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

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

Test Plan:
- Used it for 2.10.0rc4

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

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

* incorporates feedback from felixfontein

* gundalow and samccann feedback, fix link

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

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

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

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

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

Fixes: #70905

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

* Fix downloading SCM collections

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

Check that the value being returned is actually a broadcast address

* Add tests

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

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

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

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

Add integration tests to ensure the warning works properly.

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

Test Plan:
- New integration and unit tests

Tickets:
- Fixes #69619

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

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

Test Plan:
- Re-enabled subset of git tests

Tickets:
- Fixes #64469

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

Display the subtests

* fix specificity and set ANSIBLE_BECOME_ALLOW_SAME_USER

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

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

Tickets:
- Fixes #66147

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

Test Plan:
- Local RHEL8 VM
- New integration tests

Tickets:
- Fixes #66132

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

* Fix error code.

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

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

* Add changelog.

* Fix forgotten closing braket.

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

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

Tickets:
- Fixes #22599

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

* Update changelogs/fragments/22599_svn_validate_certs.yml

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

* test verify_certs codepaths

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

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

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

* Add changelog for dnf: add nobest option

* dnf: Add nobest to yumdnf module argument_spec

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

* dnf: Add test for nobest option

* dnf: Cleanup packages in nobest test at last

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

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

* dnf: Change nobest release version to 2.11

* Change changelog number according to change in PR number

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

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

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

* Add changlelog for #70284

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

Test Plan:
- Local

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

* Also revert the delgated scenario JIC

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

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

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

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

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

ci_complete

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

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

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

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

* address review feedback

* pep8

* unit test fixes

* win fixes

* gather_facts fix module args ignores

* docs sanity

* pep8

* fix timeout test

* fix win name rewrites

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

* no need for intersphinx

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

Fixes: #58752

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

CVE-2020-1736

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

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

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

* More robust tests

* Revert 69653 change

* Allow list or dict

* fix pep8

* Sanitize lists within dict values

* words

* First pass at uri module

* Fix insane sanity tests

* fix integration tests

* Add changelog

* Remove unit test introduced in 69653

* Add ignore_keys param

* Sanitize all-the-things

* Ignore '_ansible*' keys

* cleanup

* Use module.no_log_values

* Avoid deep recursion issues by using deferred removal structure.

* Nit cleanups

* Add doc blurb

* spelling

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

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

Fixes: #70238

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

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

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

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

Test Plan:
- CI, new units/integration tests

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

* The port_ went missing.

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

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

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

* Add clearer version of OpenSSh is affected by SCP bug

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

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

* newline

* use alias

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

* period

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

* Remove commented code

* Re introduce removed changes from rebase

* Just use open

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

* adding changelog

* fixing typo in changelog entry

* adding test case

Adding test case written by bmillemayhias.

* using $HOME instead of ~

* fixing commit measage

* Update 69578-shell-remote_tmp-quoting.yaml

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

Fixes: #32386

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

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

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

* gcp module_utils is in community.general.

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

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

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

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

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

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

Builds plugin docs from collections whose source is on galaxy

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

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

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

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

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

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

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

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

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

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

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

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

Fixes: #70649

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-16 12:24:22 +05:30
4a735adc21 fix typo in changelog (#70673)
Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-15 18:45:44 -05:00
08b20c9c08 Fix spelling errors. (#70664) 2020-07-16 01:43:22 +02:00
9d27d7c8b1 ansible_runner test - Add constraints (#70667)
A recent updated to psutil, which is a dependency of ansible-runner, fails
to install on older versions of pip.

Commit with the breaking change:

  135628639b
2020-07-15 18:22:44 -04:00
8455bc6838 Some more coverage for csvfile (#70661)
* Some more coverage for csvfile

Change:
- Add a few tests

Test Plan:
- CI, new tests

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

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

Test Plan:
- CI

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

Test Plan:
- CI, new tests

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

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-14 11:43:25 -04:00
0690b68bd3 Support datetime.date object in module result (#70595)
* Support datetime.date object in module result

Fixes #70583

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

* Update ec2_group.py
2020-07-14 11:19:59 -04:00
1e02a201a6 Fix ansible-test virtualenv management. 2020-07-14 01:26:06 -07:00
09f02980a4 Update ansible-test change detection for plugins. 2020-07-13 18:28:59 -07:00
d372ce2c5d Get m_u.facts.utils coverage up to 100% (#70614)
* Get m_u.facts.utils coverage up to 100%

Change:
- Add tests to 'gathering_facts' integration target to get
  module_utils.facts.utils coverage up to 100%.
- This also clears incidental coverage from incidental_selinux.

Test Plan:
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-13 16:52:56 -07:00
918388b85f Fix building Ansible dist w/ setuptools>=48,<49.1 (#70525)
* Fix building Ansible dist w/ setuptools>=48,<49.1

This change addresses the deprecation of the use of stdlib
`distutils`. It's a short-term hotfix for the problem and we'll
need to consider dropping the use of `distutils` from our `setup.py`.

Refs:
* https://github.com/ansible/ansible/issues/70456
* https://github.com/pypa/setuptools/issues/2230
* https://github.com/pypa/setuptools/commit/bd110264

Co-Authored-By: Jason R. Coombs <jaraco@jaraco.com>

* Add a change note for PR #70525

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-07-13 17:16:26 -04:00
20209c508f docs: update module development docs (#70594)
Update module development docs for flattened modules directory.

Fixes: #70261 (at least partially)

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-13 14:41:59 -05:00
38ccfb4a3e updated requirements file for docs build (#70609) 2020-07-13 15:35:08 -04:00
c410311f55 Clarify that index_var is 0 indexed (#70548)
A little further down the page is another index, ansible_loop.index, which shares a similar description but is 1 indexed.
Its zero indexed twin has a 0 suffix.

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

To remove ambiguity around the usage of index_var, explicitly mention that this variable is 0 indexed.
2020-07-13 14:15:44 -05:00
f4ea43c4a0 Update windows_winrm.rst (#70306)
gcc also needed to be installed alongside python-devel, krb5-devel, krb5-libs, and krb5-workstation.
2020-07-13 13:43:39 -05:00
d16018fe72 Add intentional coverage for an async_wrapper case (#70593)
Change:
- Test async_wrapper when the module it runs has stderr output

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

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-13 11:58:14 -05:00
e5649ca3e8 pipe: update docs for Popen with shell=True usage (#70596)
pipe lookup plugin uses Popen with shell=True intentionally.
This is considered a security issue if user input is not validated.
Updated docs to reflect this information for the user. Also, added
Bandit B602 documentation link for further reading.

Fixes: #70159

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-13 21:40:52 +05:30
adcdee9bb0 remove 'alternatives' from COMMAND_WARNINGS config (#70577)
Change:
- This line causes the deprecation to make no grammatical sense. Nuking
  it.

Test Plan:
- My eyes

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-10 21:46:54 -05:00
d5480572c8 varnames: add tests, fix exception grammar (#70573)
Change:
- Add integration tests for various cases
- Fix wrong use of "its" in an exception thrown in varnames when it
  throws an AnsibleError, given a term of the wrong type.

Test Plan:
- new tests, CI

Tickets:
- Fixes #70546

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-10 21:04:02 -05:00
df45dcdae0 Add integration tests for test plugins. (#70576) 2020-07-10 18:48:51 -07:00
cf89ca8a03 Make filter type errors 'loop friendly' (#70417)
- ensure we preserve the typeerror part of the exception so loop defereed error handling
 can postpone those caused by undefined variables until the when check is done.
 - fix tests to comply with the 'new normal'

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

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

Co-authored-by: Sloane Hertel <shertel@redhat.com>
2020-07-10 18:49:57 -04:00
24dcaf8974 plugin loader: return collection name; ansible-doc: handle ansible.builtin correctly (#70026)
* Determine collection in plugin loader.

* Fix test.

* Use PluginPathContext objects in PluginLoader._plugin_path_cache instead of tuples.
2020-07-11 00:24:08 +02:00
1b4fd23ba6 csvfile: use parse_kv() for args, add tests (#70550)
Change:
- Use parse_kv() for parsing in the csvfile lookup plugin. This allows
  us to handle multi-word search keys and filenames. Previously, the
  plugin split on space and so none of these things worked as expected.
- Add integration tests for csvfile, testing a plethora of weird cases.

Test Plan:
- New integration tests, CI

Tickets:
- Fixes #70545

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-10 16:21:03 -05:00
f4c89eab23 ansible-doc: include collection name in text output (#70401)
* ansible-doc: include collection name in text output

* Be more careful to not accidentally pass ansible.builtin for user-supplied modules.
2020-07-10 22:52:47 +02:00
edcd1a1a70 Doc: fix examples of changelog entries. (#70551) 2020-07-10 16:17:03 -04:00
8789d7968d try to capture better winrm/put_file error (#70508)
* try to capture better winrm/put_file error

fixes #70361

* Update lib/ansible/plugins/connection/winrm.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
2020-07-10 15:37:52 -04:00
b285f4c675 Updated infini* redirects to transition to infinidat collection (#70565) 2020-07-10 20:04:21 +01:00
1ec32dd2ec Revert "Disable Hetzner Cloud tests (#70558)" (#70563)
This reverts commit bd100a8649.
2020-07-10 14:53:37 -04:00
bd100a8649 Disable Hetzner Cloud tests (#70558)
They are failing and Hetzner is working on a fix
2020-07-10 13:30:31 -04:00
9c40b1b2ff Replace filename with file in apt_key (#70492)
* Replace filename with file from apt_key check

  one is internal variable, the other is actual parameter used and required for parameter check.
2020-07-10 12:42:49 -04:00
9fbd65958d hostname: hostnamectl check -> SystemdStrategy (#70532)
Change:
- Move hostnamectl check out of GenericStrategy because it was incorrect
  for everything except the SystemdStrategy which is where it belongs.
- Add some initial tests for the hostname module, though we are limited
  by the fact that we can't do much testing with it in containers.

Test Plan:
- new hostname integration tests

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

Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-07-09 20:04:23 -05:00
b149a89e07 Migrating MySQL to community.mysql (#70523)
* Migrating MySQL to community.mysql

* Removed aliases to fix yaml linting

Co-authored-by: Ben Mildren <bmildren@digitalocean.com>
2020-07-09 15:48:43 -04:00
bbd8f15a58 Correct name of fileglob lookup integration test. 2020-07-09 12:28:06 -07:00
71c378e139 Fix decrypt argument in assemble module (#70465)
* Do not pass decrypt parameter to assemble module

* Add integration tests where decrypt=True

* Add changelog #70465
2020-07-09 15:24:12 -04:00
28fda23284 command warnings: don't send the param from action (#70531)
Change:
- Followup to #70504. We need to not pass the 'warn' parameter from the
  action plugin either, unless it's True. Otherwise, even though it
  defaults to false, we always show the deprecation.

Test Plan:
- Local

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-09 14:13:10 -04:00
f7db428375 update documentation link to python 3 (#70509)
update the docs link for strftime on the filters page to point to the python3 docs
2020-07-09 11:58:39 -05:00
64c2cb273f Document that subversion module requires subversion (#70537) 2020-07-09 11:56:44 -05:00
c4fd5bee00 Speedup modify module (#70475)
* speed up modify_module

* Remove debugging

* ci_complete

* Simplify generic_visit, alias to visit, eliminate some attr lookups

* ci_complete

* Add changelog fragment
2020-07-09 10:22:26 -05:00
b0d9deeae3 Fix ansible-test error in community.aws (#70507)
* Fix ansible-test error in community.aws

* Add changelog entry for fix

* Change check from None to string_types

* Update changelogs/fragments/70507-validate-null-author.yaml

clarify wording "or a list of strings"

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update test/lib/ansible_test/_data/sanity/validate-modules/validate_modules/schema.py

clarify wording - single string or not specified valid

Co-authored-by: Felix Fontein <felix@fontein.de>

* Do not fail but return None when given outside list

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-07-08 15:17:12 -05:00
8aca464b8b Make sure ansible_become treated as a boolean (#70484)
* Make sure ansible_become treated as a boolean
2020-07-08 14:53:38 -04:00
7525503512 fix netbox inventory plugin name to redirect (#70458)
Co-authored-by: akira <akira6592@example.com>
2020-07-08 11:15:46 +05:30
e1ba7dc52a Update AWS Integration test docmentation (#70454) 2020-07-08 08:01:37 +05:30
f3ef4ed076 Remove some constants.py deprecated items (#70466)
Change:
- Remove mk_boolean
- Remove BECOME_METHODS
- Remove get_config

Test Plan:
- CI, removed mk_boolean unit tests

Tickets:
- Fixes #69678

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-07 18:41:19 -05:00
41414ed475 Deprecate command warnings feature (#70504)
Change:
- The command warnings feature which suggests that users use modules
  instead of certain commands is now deprecated. Its `warn` paramater
  and `COMMAND_WARNINGS` configuration options are also deprecated.
  Their use will become an error in version 2.13.

Test Plan:
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-07-07 18:40:38 -05:00
707458cc8c Make netbsd virtualization facts more specific (#70467)
Change:
Our handling of NetBSD virtualization facts led to facts that were just
plain incorrect. One example is reporting Xen even when the system is
running on something completely different (like KVM).

As stated by the reporter of #69352, NetBSD has a better sysctl setting
to use for this information, machdep.hypervisor.

This PR does the following:

- Try to use machdep.hypervisor sysctl value if the other sysctl values
  we check don't end up with enough information to be useful
- Only look for /dev/xencons and assume Xen if nothing else works
  (Really this should probably return 'unknown' since the file exists on
  non-Xen systems and is not very useful).
- Add a few more patterns (Xen matches and also Hyper-V) to
  VirtualSysctlDetectionMixin#detect_virt_product.

This change is slightly breaking:
- If the first two attempts at using sysctl worked before,
  (machdep.dmi.system-product and machdep.dmi.system-vendor), they will
  continue to work.
- For cases when those values didn't work, previously the existence of
  /dev/xencons was checked, and if found, we reported 'xen' (even on
  non-Xen systems when the file existed). After this PR, we try the
  machdep.hypervisor sysctl key before still falling back to
  /dev/xencons. This means that in some cases, we might go from
  (wrongly) saying "xen" to giving a more accurate value such as "kvm"
  or "Hyper-V".

Test Plan:
- Tested with local NetBSD VM and got 'kvm' instead of 'xen' back.

Tickets:
- Fixes #69352

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-07 17:28:13 -05:00
fb7740ae3b Update hacking/shippable docs.
The `--all` option downloads more than is needed for analyzing code coverage.
2020-07-07 10:22:45 -07:00
688cd8657b Fix string/bytestring comparsion in m_u.basic (#70439)
Change:
- module_utils.basic.is_special_selinux_path() used a string ==
  bytestring comparison which returned False and made Ansible think that
  certain filesystems aren't, in fact, special-cased, when they should
  be. Ensure both sides of the == are bytestrings.

Test Plan:
- Added `copy` integration tests for this case.

Tickets:
- Fixes #70244

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-07 11:48:05 -04:00
f5037314e3 sanity: remove ansible-bad-function (#70431)
* Updated docs and ignore.txt
* Replaced with correct function calls

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-07 11:46:28 -04:00
535fde3c0f DigitalOcean content has been moved to community.digitalocean. (#70483) 2020-07-07 13:42:09 +01:00
5b03267a1f Add ansible-doc tests for documentation containing YAML anchors (#70436)
Co-authored-by: Tadej Borovšak <tadej.borovsak@xlab.si>
2020-07-07 08:33:55 -04:00
1a542e9824 migrating ProxySQL to community.proxysql (#70490)
* migrating ProxySQL to community.proxysql

* Removed remaining ProxySQL ref to community.general

Co-authored-by: Ben Mildren <bmildren@digitalocean.com>
2020-07-07 12:32:12 +01:00
bd1378405b Small documentation fixes (#70480)
* Add type for options in the sample module shown in Developing Modules, as this is required to have the tests being
green
* Remove duplicated strings: the same sentence is in "Python tips" and "Module security", keeping the
latter.
2020-07-06 12:53:10 -05:00
9164b96774 ansible-doc man formatter: fail with better error message when description isn't there (#70046)
* ansible-doc man formatter: do not crash when description isn't there.
* Change to report a better error message when description is not there.
* Add test.
2020-07-06 13:29:03 -04:00
7d7f15fc9b apt - make errors more transparent (#70099)
Include error from apt Python library in module error output

Co-authored-by: Andreas Schleifer <aschleifer@bigpoint.net>
2020-07-06 12:20:09 -04:00
73139df36c botmeta: exoscale migrated to ngine_io.exoscale (#70095)
* botmeta: exoscale migrated to ngine_io.exoscale

* botmeta: exoscale: add missing migrations

* Update lib/ansible/config/ansible_builtin_runtime.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-07-03 10:15:41 +01:00
1787a3dbf5 botmeta: vultr migrated to ngine_io.vultr (#68916) 2020-07-03 09:49:35 +01:00
8cb1272ca4 botmeta: cloudstack migrated to ngine_io.cloudstack (#68917)
* botmeta: cloudstack migrated to ngine_io.cloudstack

* also update file references

* cloudstack: botmeta: added missing migrated_to
2020-07-03 09:47:22 +01:00
8d97c8c222 Fix the internal Python API usage examples
Previous version initialized the `TaskQueueManager` after calling
`Play.load()` while advertising a way to inject a custom library
location path. This caused the tasks loader not to find any custom
modules because it was triggered before the path was actually added
to the module loader.

This patch changes the order of the operations to ensure that the
customized `context.CLIARGS` actually influences things.

Resolves https://github.com/ansible/ansible/issues/69758.
2020-07-03 10:44:54 +02:00
0198ceebe4 botmeta: cloudscale: add missing migrations (#70447) 2020-07-03 10:15:33 +05:30
82e5d03bdb Suggest ansible ad-hoc command while developing module (#70308)
If a local module has no documentation, the doc command will fail without any hints of what is wrong. Add another way to confirm the presence of a local module.
* Update docs/docsite/rst/dev_guide/developing_locally.rst

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-02 17:23:37 -05:00
4f0ec5a9a0 Suppress warning for user directory in ansible-inventory (#65344)
When user uses home directory in --playbook-dir option
of ansible-inventory command, it warns user about this.
This PR suppress the warning message for user's home directory usage
in ansible-inventory command.

Fixes: #65262

Signed-off-by: Satyajit Bulage <sbulage@redhat.com>
2020-07-02 16:22:21 -04:00
b4184aa50e ssh connection - use get_option() rather than _play_context (#70438)
The ssh_args were sometimes not correctly applied to the connection
when using _play_context. Use get_option() instead to ensure the
correct ssh_args are always applied.
2020-07-02 15:04:58 -04:00
47c809aca1 label PRs to ansible_builtin_runtime.yml (#70442) 2020-07-02 19:42:33 +01:00
4e41e37aa7 Fix flatten null perserve versionadded (#70435) 2020-07-02 13:28:39 -05:00
1be78dbfc5 Updated bundled libraries (#70418)
Change:
- Update bundled six to 1.13 (last with py2.6 support)
- Make it pass lint
- Fix check to allow skipping over compat __init__.py files we authored
- Fix check to allow files that can't be updated for some reason

Test Plan:
- ansible-test sanity --docker
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-02 12:39:00 -05:00
c600f8df58 All cloudscale.ch modules are moved to a collection (#70358) 2020-07-02 17:44:28 +01:00
aa59c23aed update platform table with links to collections (#70373) 2020-07-02 10:20:11 -05:00
9eb904ea61 Add documentation for ipaddr filters (#70343) 2020-07-02 11:17:46 -04:00
7c90a2d2a6 Update playbooks.rst (#70317) 2020-07-02 11:11:09 -04:00
46ad3c1162 Update pull.py (#70393) 2020-07-02 10:59:01 -04:00
36d7ba1408 Fixed TypeError instancemethod expecting at least 2 arguments (#69463)
* Fixed TypeError instancemethod expecting at least 2 arguments

* added changlelog for 69463
2020-07-02 00:01:31 -04:00
7a15a3a109 fix flatten handling of nulls/nones (#70141)
* fix flatten loop control issue (break -> continue)

fix issue #69012

(cherry picked from commit 2127be5ec5)

* fixed null break bug and added option to include

 fixes #69012
 fixes #69013

Co-authored-by: pseudocoder <borisovano@users.noreply.github.com>
Co-authored-by: David Shrewsbury <Shrews@users.noreply.github.com>
2020-07-01 18:52:03 -04:00
626df08d9d Fix a small typo in cache plugin description @ config/base.yml
PR #70420
2020-07-01 23:24:59 +02:00
ce570691e7 Test against galaxy_ng (#70303)
* Test against galaxy_ng

* Switch container image

* Remove redundant |default

* Re-enable

* Update image

* Update wording

* Don't use pulp as the container name
2020-07-01 16:20:03 -04:00
5d3d097de3 more correct info about role main.yml (#70326)
fixes #40496
2020-07-01 16:16:21 -04:00
c89f3cda9e incorporate minimalism feedback on filters page (#70366)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2020-07-01 16:15:32 -04:00
5709173c32 with_sequence: example using vars (#69369)
Added an example for using vars in with_sequence.

Fixes: #68836

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-01 16:12:48 -04:00
1f1d6e5aec Use the first galaxy server supporting v1 for roles (#70375)
* Use the first galaxy server supporting v1 for roles. Fixes #65440

* Add changelog fragment

* This is best effort, fall back to original behavior if something bad happens
2020-07-01 14:58:35 -05:00
91aea92c62 Add ability to fallback to chgrp remote_tmp and its files. (#68627)
* Add ability to fallback to chgrp remote_tmp and its files.

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-01 15:16:56 -04:00
b9e38e8b55 misc collection metadata fixes (#70403)
* misc collection metadata fixes

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

* ignore custom pylint rule

* this code shouldn't import a bunch of stuff from ansible, since it's run under the import sanity test
2020-07-01 14:09:21 -04:00
f7078c1f8f Throw a prettier error in m_u.basic syslog (#70312)
Change:
- In certain situations, such as when the input string contains null
  bytes (\0), syslog.syslog will throw a TypeError. Handle that and
  fail_json instead.

Test Plan:
- New test
- ansible-test --docker centos[68] (for py2 and py3 respectively)

Tickets:
- Refs #70269

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-07-01 09:28:48 -05:00
a1ac595d42 Minor grammatical fix (#70405)
'you' -> 'your'
2020-07-01 10:47:08 +05:30
40ce448657 ansible-test - do not validate blacklisted ps modules (#70376)
* ansible-test - do not validate blacklisted ps modules

* Update changelogs/fragments/validate-modules-ps-doc-blacklist.yaml

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

Co-authored-by: Matt Clay <matt@mystile.com>
2020-07-01 07:59:53 +10:00
a8ae8f4d72 setup: Handle CIFS share with backward slash (#70006)
CIFS can be mounted using backward slash as well in /etc/fstab like

\\Windows\share /data/ cifs credentials=/root/.creds 0 0

Handle this condition while gather mount information in Linux.

Fixes: #48813

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-30 16:09:35 -04:00
8324db7cb5 Add new option for YUM4/DNF repositories (#70042)
Documentation reference:
  https://dnf.readthedocs.io/en/stable/conf_ref.html

Co-authored-by: Estelle Poulin <dev@inspiredby.es>
2020-06-30 15:48:36 -04:00
eeb153287b Fix some missing migrates from network.common to mellanox.onyx (#70394)
Signed-off-by: Samer Deeb <samerd@mellanox.com>
2020-06-30 20:47:31 +01:00
5e4f708241 ansible-doc: avoid problems with YAML anchors when formatting man page (#70045)
* Avoid problems with YAML anchors when formatting man page.

* Add changelog.
2020-06-30 15:33:44 -04:00
74bedab8a9 known_hosts: update documentation (#70342)
* Update documentation as per sanity tests
* Added example about custom SSH port in example section

Fixes: #29236

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-30 12:03:31 -04:00
3c64ac2264 Clean up symlink cache during 'make clean' (#70350)
Make building across versions, renamed modules can result in no such
file errors by the install.
2020-06-30 11:44:10 -04:00
24915b2ccf Fix ansible_builtin_runtime.yml w.r.t. c.g and c.n (#70322)
* Fix module_utils for community.general.
* Fix module_utils for community.network.
* Add forgotten entry for community.general.
2020-06-30 11:22:23 -04:00
4997063b4a apt - add fail_on_autoremove option to avoid unintended package removals (#70056)
* Ensure not to remove existing packages while installing apt packages.
* Make all lines shorter than 160 characters
* Allow removing packages only when upgrading.
* Add integration tests
2020-06-30 09:53:14 -04:00
b05e00e99a Fix delegate_facts with interpreter not being set (#70293)
Fixes #70168

ci_complete

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2020-06-30 15:49:09 +02:00
30e70f4b63 Handle post_validate templating errors and fix tests (#70240)
* Handle unexpected templating errors

* Fixes #70050

Fix up tests that weren't running and add tests for graceful templating error handling
2020-06-30 09:31:58 -04:00
cc2cee6980 Fix -vvvvv unicode error in executor.module_common (#70368)
Change:
- Fix a UnicodeDecodeError in executor.module_common that could get
  triggered with -vvvvv.

Test Plan:
- `ansible-test integration --docker centos7 module_utils -vvvvv`
  This would show the error previously, and no loner does after this
  patch.

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-06-29 18:02:03 -05:00
70bb2b33ca Improve error message when ssh client is not found on the host (#70122)
* Add changlelog
2020-06-29 17:26:19 -04:00
e396715d7b git - add single_branch option (#28465)
In some usecases, we want to be able to clone a single branch
of a repository, without using --depth (which implies --single-branch).

* Use branch name when available
  -  update description of parameter
  - consolidate branch or tag checking for easy reuse

* Add changelog
* Use static task imports rather than dynamic includes
* Add integration tests for single_branch
* Account for older versions of git
* Minor tweak to warnings

Co-authored-by: Laurent Coustet <laurent.coustet@clarisys.fr>
Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-06-29 15:40:54 -04:00
5a28b2b86c Add steps for how to create changelog.rst for a collection (#70262)
* Update docs/docsite/rst/dev_guide/developing_collections.rst
* add steps to create changelogs, add sentence about not using the tool
* add note for rerunning the command

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-06-29 14:22:31 -05:00
2d59e548f6 Improve ansible-galaxy STDOUT messages for collections (#70040)
- Fix issue #70010
- Add installation successful message
- This feature targets "collection" sub-command and does not affect "role" sub-command

Signed-off-by: Hideki Saito <saito@fgrep.org>
2020-06-29 15:18:30 -04:00
e4f48c920c Docs: mention about Ansible workshops (#70353)
Lightbulb is deprecated in favor of https://ansible.github.io/workshops/
Update links accordingly.
Fixes: #70296

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-29 14:06:04 -05:00
dc6f4b6502 Fix bullet points in intro_getting_started.rst. (#70365)
The layout was jumbled due to issues with whitespace.
2020-06-29 14:05:05 -05:00
689cfd1983 Top-level deprecation of plugin did not get collection_name added when deprecating by version (#70344)
* Top-level deprecation of plugin did not get collection_name added when deprecating by version.

* Add changelog fragment.
2020-06-29 11:58:54 -07:00
83f6e4850b document FQCN for M() and :seealso: in DOCUMENTATION blocks (#70245)
* document FQCN for M() in DOCUMENTATION blocks

* add note about c
2020-06-29 11:16:59 -05:00
e39a9bf583 Add support for Parrot Linux, a Debian derivate (#69158)
Co-authored-by: black <invalid>
2020-06-29 20:22:44 +05:30
c3fc2d27d9 pause - fix curses.setupterm() error (#47851)
* [Bugfix] curses.setupterm() error

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

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

```

* Add changelog

Co-authored-by: Sam Doran <sdoran@redhat.com>
2020-06-29 10:37:40 -04:00
b491f776b9 doc: avoid mix of single and double quotes (#70115)
Avoid mix of single and double quotes in the `ternary`, this way
we can copy/past the example without any surprise.
2020-06-29 09:16:20 -05:00
ca90c138f4 Reap still running threads after timeout
This is an improvement to #49921 which reaps threads after the timeout
expires instead of letting them continue to take up resources.
2020-06-27 08:30:48 -07:00
d6fb42d1c5 Add integration tests for basic.py _set_cwd.
These tests verify that AnsibleModule can be instantiated when cwd does not exist or is unreadable.
2020-06-26 16:40:52 -07:00
3479803520 Changed from dellemc_networking to dellemc (#70299) 2020-06-26 08:48:08 +01:00
7fdd8fcfcb pip tests, use py2 compat sampleproject fork (#70313)
Change:
- sampleproject has gone py3 only. Use a py2 compatible fork.

Test Plan:
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-06-25 22:38:17 -05:00
5833af9e2a Add description of collections and become_exe keywords (#68055)
* Add description of collections keyword
* Update based on feedback.
- Add link to become plugins.
- Add note about how the collections keyword works with roles.
2020-06-25 18:49:57 -05:00
0cd07eb3fd hash filter - fail when unsupported type is passed as an argument (#70292)
Fixes #70258
2020-06-25 14:55:21 -05:00
b019029bf3 Add intentional unit tests for basic._set_cwd and common.dict_merge (#70283)
* Add unit tests for basic._set_cwd

* incidental coverage for dict_merge

* add test for async stderr inclusion
2020-06-25 14:45:13 -05:00
29169ae847 stat: Handle colon in filename (#70259)
Handle colon appearing in filename while parsing the mimetype and charset
using file command.

Fixes: #70256

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-25 14:21:50 -05:00
3c9be97e16 fix runtime.yml splunk.enterprise_security -> splunk.es (#70305)
Signed-off-by: Adam Miller <admiller@redhat.com>
2020-06-25 18:34:11 +01:00
45e0f74702 display: use stdout for column width (#70199)
stdout may differ from stdin so it should be used to determine the column
width, especially since it is the target file descriptor.
2020-06-25 12:57:24 +05:30
3fe48ecba2 Add collection path in CLI version info (#68633)
This will provide user default path of collection

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-25 01:58:56 -04:00
74494a1908 Code cleanup for ansible-test coverage support. 2020-06-24 17:39:35 -07:00
8d92df4537 Test netconf plugins in ansible-doc sanity test. 2020-06-24 15:53:32 -07:00
a3c1ea886f Revert commits related to delegated facts changes (#70272)
* Revert "Fix storing delegate_to facts (#70231)"

This reverts commit 88bb76f248.

* Revert "Fix storing local task_vars facts for the retry (#70171)"

This reverts commit eaf6086eea.
2020-06-24 15:36:51 -04:00
2531d54880 Throw AnsibleError instead of OSError, py3.9 crypt (#70246)
Change:
- On Python 3.9, `crypt.crypt` will throw instead of returning `None`
  when the algorithm isn't supported. So we catch that and handle it
  the same way we handled the algorithm not being supported on 3.8: by
  throwing AnsibleError.

Test Plan:
- CI for <=3.8.
- Local for 3.9b3:
  ansible -m debug -a "msg=\"{{ 'changeme' | password_hash('bcrypt') }}\"" localhost

  Before:
  localhost | FAILED! => {
      "msg": "Unexpected failure during module execution.",
      "stdout": ""
  }

  After:
  localhost | FAILED! => {
      "msg": "crypt.crypt does not support 'bcrypt' algorithm"
  }

Tickets:
- Fixes #69930

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-06-24 13:50:28 -05:00
ebd20ddca6 Include changelogs/changelog.yaml in distribution. (#70260) 2020-06-24 11:38:20 -05:00
262f93e22c Code cleanup in the import sanity test. 2020-06-23 23:09:00 -07:00
dd07bdf22d Fix galaxy role info bug to support multiple roles (#70148)
* Add changelog fragment
* Update changelog
2020-06-23 16:57:25 -04:00
4885ebad27 default_callback: Move 'check_mode_markers' in doc_fragments (#70228)
Callback plugin dense, yaml, and debug implement 'check_mode_markers'
so moving documentation to default callback doc_fragments.

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

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-23 16:26:09 -04:00
70c59423fc Pin ansible-test requirements for RHEL.
The `packaging` and `pyparsing` packages are now installed by `ansible-test` during provisioning of RHEL instances to match the downstream vendored versions.
2020-06-23 11:52:25 -07:00
0073ab5fa6 Nuke strategy.SharedPluginLoaderObj, depr. 2.11 (#70235)
* Nuke strategy.SharedPluginLoaderObj, depr. 2.11

Change:
- Nuke SharedPluginLoaderObj class
- Update tests (which seemingly didn't use it anyway)
- Changelog

Test Plan:
CI, grep

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

* Nuke from ignore.txt

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-06-23 13:09:26 -04:00
7ef6b174e8 Migrate onyx modules from community.network to mellanox.onyx (#70213)
Signed-off-by: Samer Deeb <samerd@mellanox.com>
2020-06-23 17:21:56 +01:00
7584e145a9 Nuke _get_item() from callback, deprecated 2.11 (#70233)
Change:
- Remove _get_item() alias as it has been deprecated
- Update tests
- Remove relevant sanity curtailment
- Add changelog

Test Plan:
CI, grep

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-06-23 12:03:27 -04:00
88bb76f248 Fix storing delegate_to facts (#70231)
* Fix storing delegate_to facts
2020-06-23 12:02:16 -04:00
c9edb35652 Nuke systemd module user option, 2.11 deprecation (#70211)
Change:
Remove all references to the 'user' param in systemd module.

Test Plan:
CI and grep.

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-06-23 11:55:01 -04:00
9cfc76a221 Nuke with_ squashing, deprecated for 2.11 (#70209)
Change:
Removes with_* loop squashing and tests for 2.11

Test Plan:
CI, and grepped for with_items in package manager integration targets.
There might be some test cases in collections which need to stop testing
this behavior.

Signed-off-by: Rick Elrod <rick@elrod.me>
2020-06-23 11:53:25 -04:00
40a42de081 async_status: Update documentation (#70196)
Fixes: #38164

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-23 11:45:54 -04:00
4b358c6641 Update config.yml (#70154)
typos & branding
* Update .github/ISSUE_TEMPLATE/config.yml

Co-authored-by: Rick Elrod <rick@elrod.me>
2020-06-23 11:17:33 -04:00
fa48678a08 Rename pylint plugin and add tests. (#70225)
* Renamed custom pylint plugin for unwanted names.
* Add integration tests for sanity test failures.
2020-06-22 20:25:35 -07:00
4816bb4f43 More boilerplate fixes. (#70224)
* Fix boilerplate in hacking dir.
* Fix boilerplate in docs dir.
* Fix boilerplate in integration tests.
* Fix boilerplate in examples.
2020-06-22 19:05:30 -07:00
234994fc07 Fix boilerplate in setup.py and lib/ansible/ dir. 2020-06-22 16:29:16 -07:00
1fedb95e4b Use libc wcwidth to calculate print width in display (#66214)
* Use libc wcwidth to calculate print width in display. Fixes #63105

* Remove errantly added blank lines

* Fixes

* Move setlocale, adjust tests to work around py2 oddity with characters following null

* Don't change cli stub

* emojis

* Remove to_text call

* Special accounting for deletions

* Add initialization function, expand tests, ensure fallback to len

* get_text_width requires text, ensure banner deals with it

* Handle setlocale errors

* Move variable decrement

* Remove unused import
2020-06-22 16:57:01 -05:00
26e8c07f32 Remove incidental_lookup_rabbitmq test.
It is no longer contributing unique code coverage.
2020-06-22 14:33:03 -07:00
98a0995fd0 Clean up unit test boilerplate. 2020-06-22 14:20:33 -07:00
4a0f42923b adds japanese translation as a version-switcher option (#70214)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2020-06-22 16:25:44 -04:00
eaf6086eea Fix storing local task_vars facts for the retry (#70171)
* Fix storing local task_vars facts for the retry

Fixes #70168
2020-06-22 10:07:47 -04:00
b2d6db7916 Rebalance CI groups to avoid macOS timeouts (#70126) 2020-06-19 16:40:51 -04:00
5885ed4455 remove gendered example (#70117)
Changed example to not assume things about names and genders
2020-06-19 14:35:03 -05:00
da868d9d60 docs: Add note about ansible-doc (#70162)
ansible-doc can only parse Python modules, added a note about
this is developer guide; Fixes: #69109
2020-06-19 14:28:02 -05:00
0ef75f65d9 Fix broken link in AWS Guide (#70153)
Point to collection rather than ansible/ansible for example.
2020-06-19 14:18:55 -05:00
647c6cd289 updates to ansible-maintained collections guidelines (#70178) 2020-06-19 14:04:19 -05:00
86606d3ca7 Disable ansible-galaxy-collection test (#70177)
It it currently failing
2020-06-19 14:20:06 -04:00
8ad46870a4 Update note about AWS collection test requirements in docs (#70176) 2020-06-19 13:40:19 -04:00
598c40beb3 Fix up the redirection of the win setup module (#70158) 2020-06-19 09:27:02 -07:00
8b24a4c5ed Fix up the redirection of the win setup module (#70158) 2020-06-19 09:24:35 -07:00
fd882e0e18 Get test data file directly in rebalance script (#70107)
Rather than looking through tests.json to find the data file, look for it explicitly
within a given target to avoid problems processing data in tests.json.
2020-06-19 09:57:50 -04:00
bc05415109 Only pass kwargs to our string checker not callable checkers (#70151)
Since only check_type_str() accepts extra param, only pass to our checker and
do not pass kwargs to custom checkers.

* Add unit tests
2020-06-19 09:52:05 -04:00
87406890cf find: Specify elements type in paths (#70139)
Fixes: #35990

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-19 06:56:02 +05:30
bccf6b85f2 Change comprehension to list() in plugin loader. 2020-06-18 12:29:52 -07:00
89afb60999 Fix transport defs in test connection plugins. 2020-06-18 11:50:51 -07:00
c67efe0bd1 Avoid unnecessary comprehensions. 2020-06-18 11:50:31 -07:00
9bbde9d085 Avoid file module false positive in newer pylint. 2020-06-18 11:36:44 -07:00
1a0d8a51cd Fix yamllint sanity test line numbers.
Parse errors from libyaml now compensate for the offset of the documentation within a module.
2020-06-18 10:03:21 -07:00
0ed5b77377 Detect failure in always block after rescue (#70094)
* Detect failure in always block after rescue

Fixes #70000

ci_complete

* Add more tests
2020-06-18 11:03:36 -05:00
33e25504ac redirecting the conjur lookup plugin to correct collection (#70106) 2020-06-18 07:38:15 +01:00
feb163e0de Improve consistency of ansible-test pylint results. (#70132)
* Disable too-many-ancestors pylint check.

This check was only enabled for ansible-test code.

In some cases this check counts 1 more ancestor in python 3.7+ than under python 3.6, making the check inconsistent and unsuitable for use in ansible-test.

* Disable additional pylint checks:

- import-error
- no-name-in-module

These checks were only enabled for ansible-test code.

These checks provide inconsistent results since they are dependent on available imports, which vary between environments.

It may be practical to enable these checks in the future if changes are made to ensure a consistent test environment for pylint.
2020-06-17 17:03:41 -07:00
e3f3b4002e Clean up ansible-test pylint configs. (#70129)
* Sort disabled pylint codes in config.
* Fix comments in pylint config.
* Add comments to pylint config.
* Prepare to sort pylint config.
* Fix pylint config indentation.
* Sort pylint good/bad names in config.
* Add changelog fragment.
2020-06-17 15:06:04 -07:00
fa1fb2d13b Test ansible-galaxy against pulp/pulp_ansible (#69605)
* Test galaxy cli against pulp

* linting fix

* Renames and small fixes

* Better handling for resetting pulp

* Clean up some things, add a comment

* I can't spell

* Bump fallaxy, use alternate pulp image

* Only reset pulp when we're are executing against pulp

* Update for updated pulp container

* Update some comments with correct URLs and typos

* Linting fix

* Pin pulp-fedora31 to a digest

* Address review comments for documentation
2020-06-17 16:06:07 -05:00
cc071cdea6 Bump devel to 2.11.0 (#70121)
Signed-off-by: Rick Elrod <rick@elrod.me>
2020-06-17 14:22:38 -05:00
4795 changed files with 118959 additions and 227590 deletions

View File

@ -0,0 +1,206 @@
trigger:
batch: true
branches:
include:
- devel
- stable-*
pr:
autoCancel: true
branches:
include:
- devel
- stable-*
variables:
- name: checkoutPath
value: ansible
- name: coverageBranches
value: devel
- name: entryPoint
value: .azure-pipelines/commands/entry-point.sh
- name: fetchDepth
value: 500
- name: defaultContainer
value: quay.io/ansible/azure-pipelines-test-container:4.0.1
pool: Standard
stages:
- stage: Sanity
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Test {0}
testFormat: sanity/{0}
targets:
- test: 1
- test: 2
- stage: Units
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Python {0}
testFormat: units/{0}
targets:
- test: 2.7
- test: 3.5
- test: 3.6
- test: 3.7
- test: 3.8
- test: 3.9
- test: '3.10'
- 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
- test: 2022
- stage: Remote
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
targets:
- name: macOS 12.0
test: macos/12.0
- name: RHEL 7.9
test: rhel/7.9
- name: RHEL 8.5 py36
test: rhel/8.5@3.6
- name: RHEL 8.5 py38
test: rhel/8.5@3.8
- name: RHEL 9.0
test: rhel/9.0
- name: FreeBSD 12.4
test: freebsd/12.4
- name: FreeBSD 13.1
test: freebsd/13.1
groups:
- 1
- 2
- 3
- 4
- 5
- template: templates/matrix.yml # context/controller (ansible-test container management)
parameters:
targets:
- name: Alpine 3.16
test: alpine/3.16
- name: Fedora 36
test: fedora/36
- name: RHEL 8.5
test: rhel/8.5
- name: RHEL 9.0
test: rhel/9.0
- name: Ubuntu 20.04
test: ubuntu/20.04
- name: Ubuntu 22.04
test: ubuntu/22.04
groups:
- 6
- stage: Docker
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: linux/{0}
targets:
- name: Alpine 3
test: alpine3
- name: CentOS 7
test: centos7
- name: Fedora 34
test: fedora34
- name: Fedora 35
test: fedora35
- name: openSUSE 15 py2
test: opensuse15py2
- name: openSUSE 15 py3
test: opensuse15
- name: Ubuntu 18.04
test: ubuntu1804
- name: Ubuntu 20.04
test: ubuntu2004
groups:
- 1
- 2
- 3
- 4
- 5
- stage: Galaxy
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Python {0}
testFormat: galaxy/{0}/1
targets:
- test: 3.8
- test: 3.9
- test: '3.10'
- stage: Generic
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Python {0}
testFormat: generic/{0}/1
targets:
- test: 3.8
- test: 3.9
- test: '3.10'
- 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
- test: 2022
- stage: Incidental
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: i/{0}/1
targets:
- name: IOS Python
test: ios/csr1000v/
- name: VyOS Python
test: vyos/1.1.8/
- name: AWS Python 2.7
test: aws/2.7
- name: AWS Python 3.6
test: aws/3.6
- name: Cloud Python
test: cloud/
- stage: Summary
condition: succeededOrFailed()
dependsOn:
- Sanity
- Units
- Windows
- Remote
- Docker
- Galaxy
- Generic
- Incidental_Windows
- Incidental
jobs:
- template: templates/coverage.yml

View File

@ -0,0 +1,62 @@
#!/usr/bin/env bash
set -o pipefail -eux
declare -a args
IFS='/:' read -ra args <<< "$1"
script="${args[0]}"
test="$1"
docker images
docker ps
for container in $(docker ps --format '{{.Image}} {{.ID}}' | grep -v -e '^quay.io/ansible/azure-pipelines-test-container:' | sed 's/^.* //'); do
docker rm -f "${container}" || true # ignore errors
done
docker ps
export PATH="${PWD}/bin:${PATH}"
export PYTHONIOENCODING='utf-8'
if [ -n "${COVERAGE:-}" ]; then
# on-demand coverage reporting triggered by setting the COVERAGE environment variable to a non-empty value
export COVERAGE="--coverage"
elif [[ "${COMMIT_MESSAGE}" =~ ci_coverage ]]; then
# on-demand coverage reporting triggered by having 'ci_coverage' in the latest commit message
export COVERAGE="--coverage"
else
# on-demand coverage reporting disabled (default behavior, always-on coverage reporting remains enabled)
export COVERAGE="--coverage-check"
fi
if [ -n "${COMPLETE:-}" ]; then
# disable change detection triggered by setting the COMPLETE environment variable to a non-empty value
export CHANGED=""
elif [[ "${COMMIT_MESSAGE}" =~ ci_complete ]]; then
# disable change detection triggered by having 'ci_complete' in the latest commit message
export CHANGED=""
else
# enable change detection (default behavior)
export CHANGED="--changed"
fi
if [ "${IS_PULL_REQUEST:-}" == "true" ]; then
# run unstable tests which are targeted by focused changes on PRs
export UNSTABLE="--allow-unstable-changed"
else
# do not run unstable tests outside PRs
export UNSTABLE=""
fi
if [[ "${COVERAGE:-}" == "--coverage" ]]; then
timeout=60
else
timeout=50
fi
ansible-test env --dump --show --timeout "${timeout}" --color -v
".azure-pipelines/commands/${script}.sh" "${test}"

View File

@ -11,4 +11,4 @@ script="${args[1]}"
IFS='/' test="${args[*]:1}"
"test/utils/shippable/incidental/${script}.sh" "${test}"
".azure-pipelines/commands/incidental/${script}.sh" "${test}"

View File

@ -16,10 +16,8 @@ provider="${P:-default}"
# python versions to test in order
# all versions run full tests
python_versions=(
2.7
3.6
)
IFS=' ' read -r -a python_versions <<< \
"$(PYTHONPATH="${PWD}/test/lib" python -c 'from ansible_test._internal import constants; print(" ".join(constants.CONTROLLER_PYTHON_VERSIONS))')"
if [ "${python_version}" ]; then
# limit tests to a single python version

View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -o pipefail -eux
declare -a args
IFS='/:' read -ra args <<< "$1"
platform="${args[0]}"
version="${args[1]}"
pyver=default
target="shippable/posix/incidental/"
# check for explicit python version like 8.3@3.8
declare -a splitversion
IFS='@' read -ra splitversion <<< "$version"
if [ "${#splitversion[@]}" -gt 1 ]; then
version="${splitversion[0]}"
pyver="${splitversion[1]}"
fi
stage="${S:-prod}"
provider="${P:-default}"
# shellcheck disable=SC2086
ansible-test integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
--python "${pyver}" --remote "${platform}/${version}" --remote-terminate always --remote-stage "${stage}" --remote-provider "${provider}" \

View File

@ -0,0 +1,52 @@
#!/usr/bin/env bash
set -o pipefail -eux
declare -a args
IFS='/:' read -ra args <<< "$1"
version="${args[1]}"
target="shippable/windows/incidental/"
stage="${S:-prod}"
provider="${P:-default}"
# python version to run full tests on while other versions run minimal tests
python_default="$(PYTHONPATH="${PWD}/test/lib" python -c 'from ansible_test._internal import constants; print(constants.CONTROLLER_MIN_PYTHON_VERSION)')"
# version to test when only testing a single version
single_version=2012-R2
# shellcheck disable=SC2086
ansible-test windows-integration --list-targets -v ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} > /tmp/explain.txt 2>&1 || { cat /tmp/explain.txt && false; }
{ grep ' windows-integration: .* (targeted)$' /tmp/explain.txt || true; } > /tmp/windows.txt
if [ -s /tmp/windows.txt ] || [ "${CHANGED:+$CHANGED}" == "" ]; then
echo "Detected changes requiring integration tests specific to Windows:"
cat /tmp/windows.txt
echo "Running Windows integration tests for multiple versions concurrently."
platforms=(
--windows "${version}"
)
else
echo "No changes requiring integration tests specific to Windows were detected."
echo "Running Windows integration tests for a single version only: ${single_version}"
if [ "${version}" != "${single_version}" ]; then
echo "Skipping this job since it is for: ${version}"
exit 0
fi
platforms=(
--windows "${version}"
)
fi
# shellcheck disable=SC2086
ansible-test windows-integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
"${platforms[@]}" \
--docker default --python "${python_default}" \
--remote-terminate always --remote-stage "${stage}" --remote-provider "${provider}"

View File

@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -o pipefail -eux
declare -a args
IFS='/:' read -ra args <<< "$1"
platform="${args[0]}"
version="${args[1]}"
pyver=default
# check for explicit python version like 8.3@3.8
declare -a splitversion
IFS='@' read -ra splitversion <<< "$version"
if [ "${#splitversion[@]}" -gt 1 ]; then
version="${splitversion[0]}"
pyver="${splitversion[1]}"
fi
if [ "${#args[@]}" -gt 2 ]; then
target="shippable/posix/group${args[2]}/"
else
target="shippable/posix/"
fi
stage="${S:-prod}"
provider="${P:-default}"
# shellcheck disable=SC2086
ansible-test integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
--python "${pyver}" --remote "${platform}/${version}" --remote-terminate always --remote-stage "${stage}" --remote-provider "${provider}" \

View File

@ -0,0 +1,41 @@
#!/usr/bin/env bash
set -o pipefail -eux
declare -a args
IFS='/:' read -ra args <<< "$1"
group="${args[1]}"
group2_include=(
ansible-doc
changelog
package-data
pep8
pylint
validate-modules
)
group1_exclude=(
"${group2_include[@]}"
)
options=()
case "${group}" in
1)
for name in "${group1_exclude[@]}"; do
options+=(--skip-test "${name}")
done
;;
2)
for name in "${group2_include[@]}"; do
options+=(--test "${name}")
done
;;
esac
# shellcheck disable=SC2086
ansible-test sanity --color -v --junit ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} \
--docker \
"${options[@]}" --allow-disabled

View File

@ -0,0 +1 @@
remote.sh

View File

@ -0,0 +1,94 @@
#!/usr/bin/env bash
set -o pipefail -eux
declare -a args
IFS='/:' read -ra args <<< "$1"
version="${args[1]}"
group="${args[2]}"
target="shippable/windows/group${group}/"
stage="${S:-prod}"
provider="${P:-default}"
# python versions to test in order
IFS=' ' read -r -a python_versions <<< \
"$(PYTHONPATH="${PWD}/test/lib" python -c 'from ansible_test._internal import constants; print(" ".join(constants.CONTROLLER_PYTHON_VERSIONS))')"
# python version to run full tests on while other versions run minimal tests
python_default="$(PYTHONPATH="${PWD}/test/lib" python -c 'from ansible_test._internal import constants; print(constants.CONTROLLER_MIN_PYTHON_VERSION)')"
# version to test when only testing a single version
single_version=2012-R2
# shellcheck disable=SC2086
ansible-test windows-integration --list-targets -v ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} > /tmp/explain.txt 2>&1 || { cat /tmp/explain.txt && false; }
{ grep ' windows-integration: .* (targeted)$' /tmp/explain.txt || true; } > /tmp/windows.txt
if [ -s /tmp/windows.txt ] || [ "${CHANGED:+$CHANGED}" == "" ]; then
echo "Detected changes requiring integration tests specific to Windows:"
cat /tmp/windows.txt
echo "Running Windows integration tests for multiple versions concurrently."
platforms=(
--windows "${version}"
)
else
echo "No changes requiring integration tests specific to Windows were detected."
echo "Running Windows integration tests for a single version only: ${single_version}"
if [ "${version}" != "${single_version}" ]; then
echo "Skipping this job since it is for: ${version}"
exit 0
fi
platforms=(
--windows "${version}"
)
fi
for version in "${python_versions[@]}"; do
changed_all_target="all"
changed_all_mode="default"
if [ "${version}" == "${python_default}" ]; then
# smoketest tests
if [ "${CHANGED}" ]; then
# with change detection enabled run tests for anything changed
# use the smoketest tests for any change that triggers all tests
ci="${target}"
changed_all_target="shippable/windows/smoketest/"
if [ "${target}" == "shippable/windows/group1/" ]; then
# only run smoketest tests for group1
changed_all_mode="include"
else
# smoketest tests already covered by group1
changed_all_mode="exclude"
fi
else
# without change detection enabled run entire test group
ci="${target}"
fi
else
# only run minimal tests for group1
if [ "${target}" != "shippable/windows/group1/" ]; then continue; fi
# minimal tests for other python versions
ci="shippable/windows/minimal/"
fi
# terminate remote instances on the final python version tested
if [ "${version}" = "${python_versions[-1]}" ]; then
terminate="always"
else
terminate="never"
fi
# shellcheck disable=SC2086
ansible-test windows-integration --color -v --retry-on-error "${ci}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
"${platforms[@]}" --changed-all-target "${changed_all_target}" --changed-all-mode "${changed_all_mode}" \
--docker default --python "${version}" \
--remote-terminate "${terminate}" --remote-stage "${stage}" --remote-provider "${provider}"
done

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 --color -v)
ansible-test coverage combine --group-by command --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,101 @@
#!/usr/bin/env python
"""
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.
"""
import argparse
import dataclasses
import pathlib
import shutil
import subprocess
import tempfile
import typing as t
import urllib.request
@dataclasses.dataclass(frozen=True)
class CoverageFile:
name: str
path: pathlib.Path
flags: t.List[str]
@dataclasses.dataclass(frozen=True)
class Args:
dry_run: bool
path: pathlib.Path
def parse_args() -> Args:
parser = argparse.ArgumentParser()
parser.add_argument('-n', '--dry-run', action='store_true')
parser.add_argument('path', type=pathlib.Path)
args = parser.parse_args()
# Store arguments in a typed dataclass
fields = dataclasses.fields(Args)
kwargs = {field.name: getattr(args, field.name) for field in fields}
return Args(**kwargs)
def process_files(directory: pathlib.Path) -> t.Tuple[CoverageFile, ...]:
processed = []
for file in directory.joinpath('reports').glob('coverage*.xml'):
name = file.stem.replace('coverage=', '')
# Get flags from name
flags = name.replace('-powershell', '').split('=') # Drop '-powershell' suffix
flags = [flag if not flag.startswith('stub') else flag.split('-')[0] for flag in flags] # Remove "-01" from stub files
processed.append(CoverageFile(name, file, flags))
return tuple(processed)
def upload_files(codecov_bin: pathlib.Path, files: t.Tuple[CoverageFile, ...], dry_run: bool = False) -> None:
for file in files:
cmd = [
str(codecov_bin),
'--name', file.name,
'--file', str(file.path),
]
for flag in file.flags:
cmd.extend(['--flags', flag])
if dry_run:
print(f'DRY-RUN: Would run command: {cmd}')
continue
subprocess.run(cmd, check=True)
def download_file(url: str, dest: pathlib.Path, flags: int, dry_run: bool = False) -> None:
if dry_run:
print(f'DRY-RUN: Would download {url} to {dest} and set mode to {flags:o}')
return
with urllib.request.urlopen(url) as resp:
with dest.open('w+b') as f:
# Read data in chunks rather than all at once
shutil.copyfileobj(resp, f, 64 * 1024)
dest.chmod(flags)
def main():
args = parse_args()
url = 'https://ci-files.testing.ansible.com/codecov/linux/codecov'
with tempfile.TemporaryDirectory(prefix='codecov-') as tmpdir:
codecov_bin = pathlib.Path(tmpdir) / 'codecov'
download_file(url, codecov_bin, 0o755, args.dry_run)
files = process_files(args.path)
upload_files(codecov_bin, files, args.dry_run)
if __name__ == '__main__':
main()

View File

@ -0,0 +1,17 @@
#!/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
# Generate stubs using docker (if supported) otherwise fall back to using a virtual environment instead.
# The use of docker is required when Powershell code is present, but Ansible 2.12 was the first version to support --docker with coverage.
ansible-test coverage xml --group-by command --stub --docker --color -v || ansible-test coverage xml --group-by command --stub --venv --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,29 @@
# 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: $[ variables.defaultContainer ]
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)
- bash: .azure-pipelines/scripts/publish-codecov.py "$(outputPath)"
displayName: Publish to codecov.io
condition: gt(variables.coverageFileCount, 0)
continueOnError: true

View File

@ -0,0 +1,55 @@
# This template uses the provided targets and optional groups to generate a matrix which is then passed to the test template.
# If this matrix template does not provide the required functionality, consider using the test template directly instead.
parameters:
# A required list of dictionaries, one per test target.
# Each item in the list must contain a "test" or "name" key.
# Both may be provided. If one is omitted, the other will be used.
- name: targets
type: object
# An optional list of values which will be used to multiply the targets list into a matrix.
# Values can be strings or numbers.
- name: groups
type: object
default: []
# An optional format string used to generate the job name.
# - {0} is the name of an item in the targets list.
- name: nameFormat
type: string
default: "{0}"
# An optional format string used to generate the test name.
# - {0} is the name of an item in the targets list.
- name: testFormat
type: string
default: "{0}"
# An optional format string used to add the group to the job name.
# {0} is the formatted name of an item in the targets list.
# {{1}} is the group -- be sure to include the double "{{" and "}}".
- name: nameGroupFormat
type: string
default: "{0} - {{1}}"
# An optional format string used to add the group to the test name.
# {0} is the formatted test of an item in the targets list.
# {{1}} is the group -- be sure to include the double "{{" and "}}".
- name: testGroupFormat
type: string
default: "{0}/{{1}}"
jobs:
- template: test.yml
parameters:
jobs:
- ${{ if eq(length(parameters.groups), 0) }}:
- ${{ each target in parameters.targets }}:
- name: ${{ format(parameters.nameFormat, coalesce(target.name, target.test)) }}
test: ${{ format(parameters.testFormat, coalesce(target.test, target.name)) }}
- ${{ if not(eq(length(parameters.groups), 0)) }}:
- ${{ each group in parameters.groups }}:
- ${{ each target in parameters.targets }}:
- name: ${{ format(format(parameters.nameGroupFormat, parameters.nameFormat), coalesce(target.name, target.test), group) }}
test: ${{ format(format(parameters.testGroupFormat, parameters.testFormat), coalesce(target.test, target.name), group) }}

View File

@ -0,0 +1,45 @@
# This template uses the provided list of jobs to create test one or more test jobs.
# It can be used directly if needed, or through the matrix template.
parameters:
# A required list of dictionaries, one per test job.
# Each item in the list must contain a "job" and "name" key.
- name: jobs
type: object
jobs:
- ${{ each job in parameters.jobs }}:
- job: test_${{ replace(replace(replace(replace(job.test, '/', '_'), '.', '_'), '-', '_'), '@', '_') }}
displayName: ${{ job.name }}
container: $[ variables.defaultContainer ]
workspace:
clean: all
steps:
- checkout: self
fetchDepth: $(fetchDepth)
path: $(checkoutPath)
- bash: .azure-pipelines/scripts/run-tests.sh "$(entryPoint)" "${{ job.test }}" "$(coverageBranches)"
displayName: Run Tests
- bash: .azure-pipelines/scripts/process-results.sh
condition: succeededOrFailed()
displayName: Process Results
- bash: .azure-pipelines/scripts/aggregate-coverage.sh "$(Agent.TempDirectory)"
condition: eq(variables.haveCoverageData, 'true')
displayName: Aggregate Coverage Data
- task: PublishTestResults@2
condition: eq(variables.haveTestResults, 'true')
inputs:
testResultsFiles: "$(outputPath)/junit/*.xml"
displayName: Publish Test Results
- task: PublishPipelineArtifact@1
condition: eq(variables.haveBotResults, 'true')
displayName: Publish Bot Results
inputs:
targetPath: "$(outputPath)/bot/"
artifactName: "Bot $(System.JobAttempt) $(System.StageDisplayName) $(System.JobDisplayName)"
- task: PublishPipelineArtifact@1
condition: eq(variables.haveCoverageData, 'true')
displayName: Publish Coverage Data
inputs:
targetPath: "$(Agent.TempDirectory)/coverage/"
artifactName: "Coverage $(System.JobAttempt) $(System.StageDisplayName) $(System.JobDisplayName)"

1
.gitattributes vendored
View File

@ -1,2 +1 @@
.github/ export-ignore
hacking/ export-ignore

30222
.github/BOTMETA.yml vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,54 +0,0 @@
---
name: 🐛 Bug report
about: Create a report to help us improve
---
<!--- Verify first that your issue is not already reported on GitHub -->
<!--- Also test if the latest release and devel branch are affected too -->
<!--- Complete *all* sections as described, this form is processed automatically -->
##### SUMMARY
<!--- Explain the problem briefly below -->
##### ISSUE TYPE
- Bug Report
##### COMPONENT NAME
<!--- Write the short name of the module, plugin, task or feature below, use your best guess if unsure -->
##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```paste below
```
##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```paste below
```
##### OS / ENVIRONMENT
<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->
##### STEPS TO REPRODUCE
<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->
<!--- Paste example playbooks or commands between quotes below -->
```yaml
```
<!--- HINT: You can paste gist.github.com links for larger files -->
##### EXPECTED RESULTS
<!--- Describe what you expected to happen when running the steps above -->
##### ACTUAL RESULTS
<!--- Describe what actually happened. If possible run with extra verbosity (-vvvv) -->
<!--- Paste verbatim command output between quotes -->
```paste below
```

263
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@ -0,0 +1,263 @@
---
name: 🐛 Bug report
description: Create a report to help us improve
body:
- type: markdown
attributes:
value: >
**Thank you for wanting to report a bug in ansible-core!**
⚠
Verify first that your issue is not [already reported on
GitHub][issue search] and keep in mind that we may have to keep
the current behavior because [every change breaks someone's
workflow][XKCD 1172].
We try to be mindful about this.
Also test if the latest release and devel branch are affected too.
**Tip:** If you are seeking community support, please consider
[starting a mailing list thread or chatting in IRC][ML||IRC].
[ML||IRC]:
https://docs.ansible.com/ansible-core/devel/community/communication.html?utm_medium=github&utm_source=issue_form--bug_report.yml#mailing-list-information
[issue search]: ../search?q=is%3Aissue&type=issues
[XKCD 1172]: https://xkcd.com/1172/
- type: textarea
attributes:
label: Summary
description: Explain the problem briefly below.
placeholder: >-
When I try to do X with ansible-core from the devel branch on GitHub, Y
breaks in a way Z under the env E. Here are all the details I know
about this problem...
validations:
required: true
- type: dropdown
attributes:
label: Issue Type
description: >
Please select the single available option in the drop-down.
<details>
<summary>
<em>Why?</em>
</summary>
We would do it by ourselves but unfortunatelly, the curent
edition of GitHub Issue Forms Alpha does not support this yet 🤷
_We will make it easier in the future, once GitHub
supports dropdown defaults. Promise!_
</details>
# FIXME: Once GitHub allows defining the default choice, update this
options:
- Bug Report
validations:
required: true
- type: input
attributes:
label: Component Name
description: >
Write the short name of the rst file, module, plugin, task or
feature below, *use your best guess if unsure*.
**Tip:** Cannot find it in this repository? Please be advised that
the source for some parts of the documentation are hosted outside
of this repository. If the page you are reporting describes
modules/plugins/etc that are not officially supported by the
Ansible Core Engineering team, there is a good chance that it is
coming from one of the [Ansible Collections maintained by the
community][collections org]. If this is the case, please make sure
to file an issue under the appropriate project there instead.
[collections org]: /ansible-collections
placeholder: dnf, apt, yum, pip, user etc.
validations:
required: true
- type: textarea
attributes:
label: Ansible Version
description: >-
Paste verbatim output from `ansible --version` below, under
the prompt line. Please don't wrap it with tripple backticks — your
whole input will be turned into a code snippet automatically.
render: console
value: |
$ ansible --version
placeholder: |
$ ansible --version
ansible [core 2.11.0b4.post0] (detached HEAD ref: refs/) last updated 2021/04/02 00:33:35 (GMT +200)
config file = None
configured module search path = ['~/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = ~/src/github/ansible/ansible/lib/ansible
ansible collection location = ~/.ansible/collections:/usr/share/ansible/collections
executable location = bin/ansible
python version = 3.9.0 (default, Oct 26 2020, 13:08:59) [GCC 10.2.0]
jinja version = 2.11.3
libyaml = True
validations:
required: true
- type: textarea
attributes:
label: Configuration
description: >-
Paste verbatim output from `ansible-config dump --only-changed`
below, under the prompt line.
Please don't wrap it with tripple backticks — your
whole input will be turned into a code snippet automatically.
render: console
value: |
$ ansible-config dump --only-changed
placeholder: |
$ ansible-config dump --only-changed
DEFAULT_GATHERING(~/src/github/ansible/ansible/ansible.cfg) = smart
DEFAULT_HOST_LIST(~/src/github/ansible/ansible/ansible.cfg) = ['~/src/github/ansible/ansible/hosts']
DEFAULT_VAULT_PASSWORD_FILE(~/src/github/ansible/ansible/ansible.cfg) = ~/src/github/ansible/ansible/vault/print-password.sh
validations:
required: true
- type: textarea
attributes:
label: OS / Environment
description: >-
Provide all relevant information below, e.g. target OS versions,
network device firmware, etc.
placeholder: RHEL 8, CentOS Stream etc.
validations:
required: true
- type: textarea
attributes:
label: Steps to Reproduce
description: |
Describe exactly how to reproduce the problem, using a minimal test-case. It would *really* help us understand your problem if you could also pased any playbooks, configs and commands you used.
**HINT:** You can paste https://gist.github.com links for larger files.
value: |
<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
```
placeholder: |
1. Implement the following playbook:
```yaml
---
# ping.yml
- hosts: all
gather_facts: false
tasks:
- ping:
...
```
2. Then run `ANSIBLE_DEBUG=1 ansible-playbook ping.yml -vvvvv`
3. An error occurs.
validations:
required: true
- type: textarea
attributes:
label: Expected Results
description: >-
Describe what you expected to happen when running the steps above.
placeholder: >-
I expected X to happen because I assumed Y and was shocked
that it did not.
validations:
required: true
- type: textarea
attributes:
label: Actual Results
description: |
Describe what actually happened. If possible run with extra verbosity (`-vvvv`).
Paste verbatim command output and don't wrap it with tripple backticks — your
whole input will be turned into a code snippet automatically.
render: console
placeholder: >-
Certificate did not match expected hostname: files.pythonhosted.org. Certificate: {'notAfter': 'Apr 28 19:20:25 2021 GMT', 'subjectAltName': ((u'DNS', 'r.ssl.fastly.net'), (u'DNS', '*.catchpoint.com'), (u'DNS', '*.cnn.io'), (u'DNS', '*.dollarshaveclub.com'), (u'DNS', '*.eater.com'), (u'DNS', '*.fastly.picmonkey.com'), (u'DNS', '*.files.saymedia-content.com'), (u'DNS', '*.ft.com'), (u'DNS', '*.meetupstatic.com'), (u'DNS', '*.nfl.com'), (u'DNS', '*.pagar.me'), (u'DNS', '*.picmonkey.com'), (u'DNS', '*.realself.com'), (u'DNS', '*.sbnation.com'), (u'DNS', '*.shakr.com'), (u'DNS', '*.streamable.com'), (u'DNS', '*.surfly.com'), (u'DNS', '*.theverge.com'), (u'DNS', '*.thrillist.com'), (u'DNS', '*.vox-cdn.com'), (u'DNS', '*.vox.com'), (u'DNS', '*.voxmedia.com'), (u'DNS', 'eater.com'), (u'DNS', 'ft.com'), (u'DNS', 'i.gse.io'), (u'DNS', 'picmonkey.com'), (u'DNS', 'realself.com'), (u'DNS', 'static.wixstatic.com'), (u'DNS', 'streamable.com'), (u'DNS', 'surfly.com'), (u'DNS', 'theverge.com'), (u'DNS', 'vox-cdn.com'), (u'DNS', 'vox.com'), (u'DNS', 'www.joyent.com')), 'subject': ((('countryName', u'US'),), (('stateOrProvinceName', u'California'),), (('localityName', u'San Francisco'),), (('organizationName', u'Fastly, Inc'),), (('commonName', u'r.ssl.fastly.net'),))}
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.6/dist-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "/usr/local/lib/python2.6/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/local/lib/python2.6/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python2.6/dist-packages/pip/req/req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "/usr/local/lib/python2.6/dist-packages/pip/download.py", line 821, in unpack_url
hashes=hashes
File "/usr/local/lib/python2.6/dist-packages/pip/download.py", line 659, in unpack_http_url
hashes)
File "/usr/local/lib/python2.6/dist-packages/pip/download.py", line 853, in _download_http_url
stream=True,
File "/usr/local/lib/python2.6/dist-packages/pip/_vendor/requests/sessions.py", line 521, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/pip/_vendor/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.6/dist-packages/pip/_vendor/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/pip/_vendor/cachecontrol/adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/local/lib/python2.6/dist-packages/pip/_vendor/requests/adapters.py", line 506, in send
raise SSLError(e, request=request)
SSLError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/ef/ab/aa12712415809bf698e719b307419f953e25344e8f42d557533d7a02b276/netapp_lib-2020.7.16-py2-none-any.whl (Caused by SSLError(CertificateError("hostname 'files.pythonhosted.org' doesn't match either of 'r.ssl.fastly.net', '*.catchpoint.com', '*.cnn.io', '*.dollarshaveclub.com', '*.eater.com', '*.fastly.picmonkey.com', '*.files.saymedia-content.com', '*.ft.com', '*.meetupstatic.com', '*.nfl.com', '*.pagar.me', '*.picmonkey.com', '*.realself.com', '*.sbnation.com', '*.shakr.com', '*.streamable.com', '*.surfly.com', '*.theverge.com', '*.thrillist.com', '*.vox-cdn.com', '*.vox.com', '*.voxmedia.com', 'eater.com', 'ft.com', 'i.gse.io', 'picmonkey.com', 'realself.com', 'static.wixstatic.com', 'streamable.com', 'surfly.com', 'theverge.com', 'vox-cdn.com', 'vox.com', 'www.joyent.com'",),))
ERROR: Command "/usr/bin/python2.6 /root/ansible/test/lib/ansible_test/_data/quiet_pip.py install --disable-pip-version-check -r /root/ansible/test/lib/ansible_test/_data/requirements/units.txt -r tests/unit/requirements.txt -c /root/ansible/test/lib/ansible_test/_data/requirements/constraints.txt" returned exit status 2.
ERROR: Command "docker exec d47eb360db4ce779c1f690db964655b76e68895c4360ff252c46fe7fe6f5c75a /usr/bin/env ANSIBLE_TEST_CONTENT_ROOT=/root/ansible_collections/netapp/ontap LC_ALL=en_US.UTF-8 /usr/bin/python3.6 /root/ansible/bin/ansible-test units --metadata tests/output/.tmp/metadata-9i2qfrcl.json --truncate 200 --redact --color yes --requirements --python default --requirements-mode only" returned exit status 1.
validations:
required: true
- type: markdown
attributes:
value: >
*One last thing...*
*Please, complete **all** sections as described, this form
is [processed automatically by a robot][ansibot help].*
Thank you for your collaboration!
[ansibot help]:
/ansible/ansibullbot/blob/master/ISSUE_HELP.md#for-issue-submitters
- type: checkboxes
attributes:
label: Code of Conduct
description: |
Read the [Ansible Code of Conduct][CoC] first.
[CoC]: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--bug_report.yml
options:
- label: I agree to follow the Ansible Code of Conduct
required: true
...

View File

@ -1,5 +1,5 @@
# Ref: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
blank_issues_enabled: true # default
blank_issues_enabled: false # default: true
contact_links:
- name: 🔐 Security bug report 🔥
url: https://docs.ansible.com/ansible/latest/community/reporting_bugs_and_features.html?utm_medium=github&utm_source=issue_template_chooser
@ -20,7 +20,7 @@ contact_links:
about: Please ask and answer usage questions here
- name: ⚡ Working groups
url: https://github.com/ansible/community/wiki
about: Interedted in improving a specific area? Become a part of a working group!
about: Interested in improving a specific area? Become a part of a working group!
- name: 💼 For Enterprise
url: https://www.ansible.com/products/engine?utm_medium=github&utm_source=issue_template_chooser
about: Red Hat offers supported builds of Ansible Engine
about: Red Hat offers support for the Ansible Automation Platform

View File

@ -1,38 +0,0 @@
---
name: 📝 Documentation Report
about: Ask us about docs
---
<!--- Verify first that your improvement is not already reported on GitHub -->
<!--- Also test if the latest release and devel branch are affected too -->
<!--- Complete *all* sections as described, this form is processed automatically -->
##### SUMMARY
<!--- Explain the problem briefly below, add suggestions to wording or structure -->
<!--- HINT: Did you know the documentation has an "Edit on GitHub" link on every page ? -->
##### ISSUE TYPE
- Documentation Report
##### COMPONENT NAME
<!--- Write the short name of the rst file, module, plugin, task or feature below, use your best guess if unsure -->
##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```paste below
```
##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```paste below
```
##### OS / ENVIRONMENT
<!--- Provide all relevant information below, e.g. OS version, browser, etc. -->
##### ADDITIONAL INFORMATION
<!--- Describe how this improves the documentation, e.g. before/after situation or screenshots -->
<!--- HINT: You can paste gist.github.com links for larger files -->

View File

@ -0,0 +1,199 @@
---
name: 📝 Documentation Report
description: Ask us about docs
body:
- type: markdown
attributes:
value: >
**Thank you for wanting to report a problem with ansible-core
documentation!**
Please fill out your suggestions below. If the problem seems
straightforward, feel free to go ahead and
[submit a pull request] instead!
⚠
Verify first that your issue is not [already reported on
GitHub][issue search].
Also test if the latest release and devel branch are affected too.
**Tip:** If you are seeking community support, please consider
[starting a mailing list thread or chatting in IRC][ML||IRC].
[ML||IRC]:
https://docs.ansible.com/ansible-core/devel/community/communication.html?utm_medium=github&utm_source=issue_form--documentation_report.yml#mailing-list-information
[issue search]: ../search?q=is%3Aissue&type=issues
[submit a pull request]:
https://docs.ansible.com/ansible-core/devel/community/documentation_contributions.html
- type: textarea
attributes:
label: Summary
description: >
Explain the problem briefly below, add suggestions to wording
or structure.
**HINT:** Did you know the documentation has a `View on GitHub`
link on some pages? Feel free to use it to start a pull request
right from the GitHub UI!
placeholder: >-
I was reading the ansible-core documentation of version X and I'm having
problems understanding Y. It would be very helpful if that got
rephrased as Z.
validations:
required: true
- type: dropdown
attributes:
label: Issue Type
description: >
Please select the single available option in the drop-down.
<details>
<summary>
<em>Why?</em>
</summary>
We would do it by ourselves but unfortunatelly, the curent
edition of GitHub Issue Forms Alpha does not support this yet 🤷
_We will make it easier in the future, once GitHub
supports dropdown defaults. Promise!_
</details>
# FIXME: Once GitHub allows defining the default choice, update this
options:
- Documentation Report
validations:
required: true
- type: input
attributes:
label: Component Name
description: >
Write the short name of the rst file, module, plugin, task or
feature below, *use your best guess if unsure*.
**Tip:** Be advised that the source for some parts of the
documentation are hosted outside of this repository. If the page
you are reporting describes modules/plugins/etc that are not
officially supported by the Ansible Core Engineering team, there
is a good chance that it is coming from one of the [Ansible
Collections maintained by the community][collections org]. If this
is the case, please make sure to file an issue under the
appropriate project there instead.
[collections org]: /ansible-collections
placeholder: docs/docsite/rst/dev_guide/debugging.rst
validations:
required: true
- type: textarea
attributes:
label: Ansible Version
description: >-
Paste verbatim output from `ansible --version` below, under
the prompt line. Please don't wrap it with tripple backticks — your
whole input will be turned into a code snippet automatically.
render: console
value: |
$ ansible --version
placeholder: |
$ ansible --version
ansible [core 2.11.0b4.post0] (detached HEAD ref: refs/) last updated 2021/04/02 00:33:35 (GMT +200)
config file = None
configured module search path = ['~/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = ~/src/github/ansible/ansible/lib/ansible
ansible collection location = ~/.ansible/collections:/usr/share/ansible/collections
executable location = bin/ansible
python version = 3.9.0 (default, Oct 26 2020, 13:08:59) [GCC 10.2.0]
jinja version = 2.11.3
libyaml = True
validations:
required: true
- type: textarea
attributes:
label: Configuration
description: >-
Paste verbatim output from `ansible-config dump --only-changed`
below, under the prompt line.
Please don't wrap it with tripple backticks — your
whole input will be turned into a code snippet automatically.
render: console
value: |
$ ansible-config dump --only-changed
placeholder: |
$ ansible-config dump --only-changed
DEFAULT_GATHERING(~/src/github/ansible/ansible/ansible.cfg) = smart
DEFAULT_HOST_LIST(~/src/github/ansible/ansible/ansible.cfg) = ['~/src/github/ansible/ansible/hosts']
DEFAULT_VAULT_PASSWORD_FILE(~/src/github/ansible/ansible/ansible.cfg) = ~/src/github/ansible/ansible/vault/print-password.sh
validations:
required: true
- type: textarea
attributes:
label: OS / Environment
description: >-
Provide all relevant information below, e.g. OS version,
browser, etc.
placeholder: Fedora 33, Firefox etc.
validations:
required: true
- type: textarea
attributes:
label: Additional Information
description: |
Describe how this improves the documentation, e.g. before/after situation or screenshots.
**HINT:** You can paste https://gist.github.com links for larger files.
placeholder: >-
When the improvement is applied, it makes it more straightforward
to understand X.
validations:
required: true
- type: markdown
attributes:
value: >
*One last thing...*
*Please, complete **all** sections as described, this form
is [processed automatically by a robot][ansibot help].*
Thank you for your collaboration!
[ansibot help]:
/ansible/ansibullbot/blob/master/ISSUE_HELP.md#for-issue-submitters
- type: checkboxes
attributes:
label: Code of Conduct
description: |
Read the [Ansible Code of Conduct][CoC] first.
[CoC]: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--documentation_report.yml
options:
- label: I agree to follow the Ansible Code of Conduct
required: true
...

View File

@ -1,25 +0,0 @@
---
name: ✨ Feature request
about: Suggest an idea for this project
---
<!--- Verify first that your feature was not already discussed on GitHub -->
<!--- Complete *all* sections as described, this form is processed automatically -->
##### SUMMARY
<!--- Describe the new feature/improvement briefly below -->
##### ISSUE TYPE
- Feature Idea
##### COMPONENT NAME
<!--- Write the short name of the module, plugin, task or feature below, use your best guess if unsure -->
##### ADDITIONAL INFORMATION
<!--- Describe how the feature would be used, why it is needed and what it would solve -->
<!--- Paste example playbooks or commands between quotes below -->
```yaml
```
<!--- HINT: You can also paste gist.github.com links for larger files -->

View File

@ -0,0 +1,192 @@
---
name: ✨ Feature request
description: Suggest an idea for this project
body:
- type: markdown
attributes:
value: >
**Thank you for wanting to suggest a feature for ansible-core!**
💡
Before you go ahead with your request, please first consider if it
would be useful for majority of the ansible-core users. As a
general rule of thumb, any feature that is only of interest to a
small sub group should be [implemented in a third-party Ansible
Collection][contribute to collections] or maybe even just your
project alone. Be mindful of the fact that the essential
ansible-core features have a broad impact.
If unsure, consider filing a [new proposal] instead outlining your
use-cases, the research and implementation considerations. Then,
start a discussion on one of the public [IRC meetings] we have just
for this.
<details>
<summary>
❗ Every change breaks someone's workflow.
</summary>
[![❗ Every change breaks someone's workflow.
](https://imgs.xkcd.com/comics/workflow.png)
](https://xkcd.com/1172/)
</details>
⚠
Verify first that your idea is not [already requested on
GitHub][issue search].
Also test if the devel branch does not already implement this.
**Tip:** If you are seeking community support, please consider
[starting a mailing list thread or chatting in IRC][ML||IRC].
[contribute to collections]:
https://docs.ansible.com/ansible-core/devel/community/contributing_maintained_collections.html?utm_medium=github&utm_source=issue_form--feature_request.yml
[IRC meetings]:
https://docs.ansible.com/ansible-core/devel/community/communication.html?utm_medium=github&utm_source=issue_form--feature_request.yml#irc-meetings
[issue search]: ../search?q=is%3Aissue&type=issues
[ML||IRC]:
https://docs.ansible.com/ansible-core/devel/community/communication.html?utm_medium=github&utm_source=issue_form--feature_request.yml#mailing-list-information
[new proposal]: ../../proposals/issues/new
- type: textarea
attributes:
label: Summary
description: >
Describe the new feature/improvement you would like briefly below.
What's the problem this feature will solve?
What are you trying to do, that you are unable to achieve
with ansible-core as it currently stands?
* Provide examples of real-world use cases that this would enable
and how it solves the problem you described.
* How do you solve this now?
* Have you tried to work around the problem using other tools?
* Could there be a different approach to solving this issue?
*Know **exactly** what you want?* Consider filing a [new proposal]
instead outlining your research and implementation considerations.
[new proposal]: ../../proposals/issues/new
placeholder: >-
I am trying to do X with ansible-core from the devel branch on GitHub and
I think that implementing a feature Y would be very helpful for me and
every other user of ansible-core because of Z.
validations:
required: true
- type: dropdown
attributes:
label: Issue Type
description: >
Please select the single available option in the drop-down.
<details>
<summary>
<em>Why?</em>
</summary>
We would do it by ourselves but unfortunatelly, the curent
edition of GitHub Issue Forms Alpha does not support this yet 🤷
_We will make it easier in the future, once GitHub
supports dropdown defaults. Promise!_
</details>
# FIXME: Once GitHub allows defining the default choice, update this
options:
- Feature Idea
validations:
required: true
- type: input
attributes:
label: Component Name
description: >
Write the short name of the module, plugin, task or feature below,
*use your best guess if unsure*.
Be aware that a lot of content that used to reside in this repository
previously, is now hosted under [individual collection
projects][collections org].
If this is the case, please make sure to file an issue under the
appropriate project there instead.
[collections org]: /ansible-collections
placeholder: dnf, apt, yum, pip, user etc.
validations:
required: true
- type: textarea
attributes:
label: Additional Information
description: |
Describe how the feature would be used, why it is needed and what it would solve.
**HINT:** You can paste https://gist.github.com links for larger files.
value: |
<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
```
placeholder: >-
I asked on https://stackoverflow.com/.... and the community
advised me to do X, Y and Z.
validations:
required: true
- type: markdown
attributes:
value: >
*One last thing...*
*Please, complete **all** sections as described, this form
is [processed automatically by a robot][ansibot help].*
Thank you for your collaboration!
[ansibot help]:
/ansible/ansibullbot/blob/master/ISSUE_HELP.md#for-issue-submitters
- type: checkboxes
attributes:
label: Code of Conduct
description: |
Read the [Ansible Code of Conduct][CoC] first.
[CoC]: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--feature_request.yml
options:
- label: I agree to follow the Ansible Code of Conduct
required: true
...

View File

@ -8,7 +8,7 @@
- Bugfix Pull Request
- Docs Pull Request
- Feature Pull Request
- New Module Pull Request
- Test Pull Request
##### COMPONENT NAME
<!--- Write the short name of the module, plugin, task or feature below -->

View File

@ -1,4 +1,7 @@
---
- 2.13.0 Nobody's Fault but Mine
- 2.12.0 Dazed and Confused
- 2.11.0 Hey Hey, What Can I Do
- 2.10.0 When the Levee Breaks
- 2.9.0 Immigrant Song
- 2.8.0 How Many More Times

17
.gitignore vendored
View File

@ -32,11 +32,17 @@ 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/dev_guide/index.rst
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
@ -47,12 +53,10 @@ docs/docsite/searchindex.js
docs/docsite/_static/*.gif
docs/docsite/_static/*.png
docs/docsite/_static/websupport.js
# deb building stuff...
/debian/
deb-build
# Vim swap files
*.swp
*.swo
[._]*.un~
credentials.yml
# test output
*.retry
@ -77,7 +81,12 @@ Vagrantfile
/lib/ansible.egg-info/
# First used in the `devel` branch during Ansible 2.10 development.
/lib/ansible_base.egg-info/
/shippable/
# First used in the `devel` branch during Ansible 2.11 development.
/lib/ansible_core.egg-info/
# vendored lib dir
lib/ansible/_vendor/*
!lib/ansible/_vendor/__init__.py
# test stuff
/test/integration/cloud-config-*.*
!/test/integration/cloud-config-*.*.template
.python-version

View File

@ -1,36 +1,12 @@
include README.rst
include COPYING
include SYMLINK_CACHE.json
include bin/*
include changelogs/CHANGELOG*.rst
include changelogs/changelog.yaml
include licenses/*.txt
include requirements.txt
include shippable.yml
recursive-include docs *
exclude docs/docsite/rst_warnings
recursive-exclude docs/docsite/_build *
recursive-exclude docs/docsite/_extensions *.pyc *.pyo
include examples/hosts
include examples/ansible.cfg
include examples/scripts/ConfigureRemotingForAnsible.ps1
include examples/scripts/upgrade_to_ps3.ps1
recursive-include lib/ansible/executor/powershell *.ps1
recursive-include lib/ansible/module_utils/csharp *.cs
recursive-include lib/ansible/module_utils/powershell *.psm1
recursive-include lib/ansible/modules/windows *.ps1
recursive-include lib/ansible/galaxy/data *.yml *.j2 README.md ansible.cfg inventory .git_keep
recursive-include lib/ansible/config *.yml
recursive-include licenses *.txt
recursive-include packaging *
recursive-include packaging *.py *.j2
recursive-include test/ansible_test *.py Makefile
recursive-include test/integration *
recursive-include test/lib/ansible_test/config *.template
recursive-include test/lib/ansible_test/_data *.cfg *.ini *.json *.ps1 *.psd1 *.py *.sh *.txt *.yml coveragerc inventory
recursive-include test/lib/ansible_test/_data/injector ansible ansible-config ansible-connection ansible-console ansible-doc ansible-galaxy ansible-playbook ansible-pull ansible-test ansible-vault pytest
recursive-include test/lib/ansible_test/_data/sanity/validate-modules validate-modules
recursive-include test/sanity *.json *.py *.txt
recursive-include test/support *.py *.ps1 *.psm1 *.cs
exclude test/sanity/code-smell/botmeta.*
recursive-include test/sanity *.in *.json *.py *.txt
recursive-include test/support *.py *.ps1 *.psm1 *.cs *.md
recursive-include test/units *
include Makefile
include MANIFEST.in
include changelogs/CHANGELOG*.rst
recursive-include hacking/build_library *.py
include hacking/build-ansible.py

288
Makefile
View File

@ -1,288 +0,0 @@
# WARN: gmake syntax
########################################################
# Makefile for Ansible
#
# useful targets:
# make clean ---------------- clean up
# make webdocs -------------- produce ansible doc at docs/docsite/_build/html
# make sdist ---------------- produce a tarball
# make deb-src -------------- produce a DEB source
# make deb ------------------ produce a DEB
# make docs ----------------- rebuild the manpages (results are checked in)
# make tests ---------------- run the tests (see https://docs.ansible.com/ansible/devel/dev_guide/testing_units.html for requirements)
########################################################
# variable section
NAME = ansible-base
OS = $(shell uname -s)
PREFIX ?= '/usr/local'
SDIST_DIR ?= 'dist'
# This doesn't evaluate until it's called. The -D argument is the
# directory of the target file ($@), kinda like `dirname`.
MANPAGES ?= $(patsubst %.rst.in,%,$(wildcard ./docs/man/man1/ansible*.1.rst.in))
ifneq ($(shell which rst2man 2>/dev/null),)
ASCII2MAN = rst2man $< $@
else ifneq ($(shell which rst2man.py 2>/dev/null),)
ASCII2MAN = rst2man.py $< $@
else
ASCII2MAN = @echo "ERROR: rst2man from docutils command is not installed but is required to build $(MANPAGES)" && exit 1
endif
PYTHON=python
GENERATE_CLI = hacking/build-ansible.py generate-man
# fetch version from project release.py as single source-of-truth
VERSION := $(shell $(PYTHON) packaging/release/versionhelper/version_helper.py --raw || echo error)
ifeq ($(findstring error,$(VERSION)), error)
$(error "version_helper failed")
endif
# Get the branch information from git
ifneq ($(shell which git),)
GIT_DATE := $(shell git log -n 1 --format="%ci")
GIT_HASH := $(shell git log -n 1 --format="%h")
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD | sed 's/[-_.\/]//g')
GITINFO = .$(GIT_HASH).$(GIT_BRANCH)
else
GITINFO = ""
endif
ifeq ($(shell echo $(OS) | egrep -c 'Darwin|FreeBSD|OpenBSD|DragonFly'),1)
DATE := $(shell date -j -r $(shell git log -n 1 --format="%ct") +%Y%m%d%H%M)
CPUS ?= $(shell sysctl hw.ncpu|awk '{print $$2}')
else
DATE := $(shell date --utc --date="$(GIT_DATE)" +%Y%m%d%H%M)
CPUS ?= $(shell nproc)
endif
# DEB build parameters
DEBUILD_BIN ?= debuild
DEBUILD_OPTS = --source-option="-I"
DPUT_BIN ?= dput
DPUT_OPTS ?=
DEB_DATE := $(shell LC_TIME=C date +"%a, %d %b %Y %T %z")
DEB_VERSION ?= $(shell $(PYTHON) packaging/release/versionhelper/version_helper.py --debversion)
ifeq ($(OFFICIAL),yes)
DEB_RELEASE ?= $(shell $(PYTHON) packaging/release/versionhelper/version_helper.py --debrelease)ppa
# Sign OFFICIAL builds using 'DEBSIGN_KEYID'
# DEBSIGN_KEYID is required when signing
ifneq ($(DEBSIGN_KEYID),)
DEBUILD_OPTS += -k$(DEBSIGN_KEYID)
endif
else
DEB_RELEASE ?= 100.git$(DATE)$(GITINFO)
# Do not sign unofficial builds
DEBUILD_OPTS += -uc -us
DPUT_OPTS += -u
endif
DEBUILD = $(DEBUILD_BIN) $(DEBUILD_OPTS)
DEB_PPA ?= ppa
# Choose the desired Ubuntu release: lucid precise saucy trusty
DEB_DIST ?= unstable
# pbuilder parameters
PBUILDER_ARCH ?= amd64
PBUILDER_CACHE_DIR = /var/cache/pbuilder
PBUILDER_BIN ?= pbuilder
PBUILDER_OPTS ?= --debootstrapopts --variant=buildd --architecture $(PBUILDER_ARCH) --debbuildopts -b
# ansible-test parameters
ANSIBLE_TEST ?= bin/ansible-test
TEST_FLAGS ?=
# ansible-test units parameters (make test / make test-py3)
PYTHON_VERSION ?= $(shell python2 -c 'import sys; print("%s.%s" % sys.version_info[:2])')
PYTHON3_VERSION ?= $(shell python3 -c 'import sys; print("%s.%s" % sys.version_info[:2])')
# ansible-test integration parameters (make integration)
IMAGE ?= centos7
TARGET ?=
########################################################
.PHONY: all
all: clean python
.PHONY: tests
tests:
$(ANSIBLE_TEST) units -v --python $(PYTHON_VERSION) $(TEST_FLAGS)
.PHONY: tests-py3
tests-py3:
$(ANSIBLE_TEST) units -v --python $(PYTHON3_VERSION) $(TEST_FLAGS)
.PHONY: integration
integration:
$(ANSIBLE_TEST) integration -v --docker $(IMAGE) $(TARGET) $(TEST_FLAGS)
# Regenerate %.1.rst if %.1.rst.in has been modified more
# recently than %.1.rst.
%.1.rst: %.1.rst.in
sed "s/%VERSION%/$(VERSION)/" $< > $@
rm $<
# Regenerate %.1 if %.1.rst or release.py has been modified more
# recently than %.1. (Implicitly runs the %.1.rst recipe)
%.1: %.1.rst lib/ansible/release.py
$(ASCII2MAN)
.PHONY: clean
clean:
@echo "Cleaning up distutils stuff"
rm -rf build
rm -rf dist
rm -rf lib/ansible*.egg-info/
@echo "Cleaning up byte compiled python stuff"
find . -type f -regex ".*\.py[co]$$" -delete
find . -type d -name "__pycache__" -delete
@echo "Cleaning up editor backup files"
find . -type f -not -path ./test/units/inventory_test_data/group_vars/noparse/all.yml~ \( -name "*~" -or -name "#*" \) -delete
find . -type f \( -name "*.swp" \) -delete
@echo "Cleaning up manpage stuff"
find ./docs/man -type f -name "*.xml" -delete
find ./docs/man -type f -name "*.rst" -delete
find ./docs/man/man3 -type f -name "*.3" -delete
rm -f ./docs/man/man1/*
@echo "Cleaning up output from test runs"
rm -rf test/test_data
rm -rf shippable/
rm -rf logs/
rm -rf .cache/
rm -f test/units/.coverage*
rm -rf test/results/*/*
find test/ -type f -name '*.retry' -delete
@echo "Cleaning up Debian building stuff"
rm -rf debian
rm -rf deb-build
rm -rf docs/json
rm -rf docs/js
@echo "Cleaning up docsite"
$(MAKE) -C docs/docsite clean
.PHONY: python
python:
$(PYTHON) setup.py build
.PHONY: install
install:
$(PYTHON) setup.py install
install_manpages:
gzip -9 $(wildcard ./docs/man/man1/ansible*.1)
cp $(wildcard ./docs/man/man1/ansible*.1.gz) $(PREFIX)/man/man1/
.PHONY: sdist_check
sdist_check:
$(PYTHON) -c 'import setuptools, sys; sys.exit(int(not (tuple(map(int, setuptools.__version__.split("."))) > (39, 2, 0))))'
$(PYTHON) packaging/sdist/check-link-behavior.py
.PHONY: sdist
sdist: sdist_check clean docs
_ANSIBLE_SDIST_FROM_MAKEFILE=1 $(PYTHON) setup.py sdist --dist-dir=$(SDIST_DIR)
# Official releases generate the changelog as the last commit before the release.
# Snapshots shouldn't result in new checkins so the changelog is generated as
# part of creating the tarball.
.PHONY: snapshot
snapshot: sdist_check clean docs changelog
_ANSIBLE_SDIST_FROM_MAKEFILE=1 $(PYTHON) setup.py sdist --dist-dir=$(SDIST_DIR)
.PHONY: sdist_upload
sdist_upload: clean docs
$(PYTHON) setup.py sdist upload 2>&1 |tee upload.log
.PHONY: changelog
changelog:
PYTHONPATH=./lib antsibull-changelog release -vv --use-ansible-doc && PYTHONPATH=./lib antsibull-changelog generate -vv --use-ansible-doc
.PHONY: debian
debian: sdist
@for DIST in $(DEB_DIST) ; do \
mkdir -p deb-build/$${DIST} ; \
tar -C deb-build/$${DIST} -xvf dist/$(NAME)-$(VERSION).tar.gz ; \
cp -a packaging/debian deb-build/$${DIST}/$(NAME)-$(VERSION)/ ; \
sed -ie "s|%VERSION%|$(DEB_VERSION)|g;s|%RELEASE%|$(DEB_RELEASE)|;s|%DIST%|$${DIST}|g;s|%DATE%|$(DEB_DATE)|g" deb-build/$${DIST}/$(NAME)-$(VERSION)/debian/changelog ; \
done
.PHONY: deb
deb: deb-src
@for DIST in $(DEB_DIST) ; do \
PBUILDER_OPTS="$(PBUILDER_OPTS) --distribution $${DIST} --basetgz $(PBUILDER_CACHE_DIR)/$${DIST}-$(PBUILDER_ARCH)-base.tgz --buildresult $(CURDIR)/deb-build/$${DIST}" ; \
$(PBUILDER_BIN) create $${PBUILDER_OPTS} --othermirror "deb http://archive.ubuntu.com/ubuntu $${DIST} universe" ; \
$(PBUILDER_BIN) update $${PBUILDER_OPTS} ; \
$(PBUILDER_BIN) build $${PBUILDER_OPTS} deb-build/$${DIST}/$(NAME)_$(DEB_VERSION)-$(DEB_RELEASE)~$${DIST}.dsc ; \
done
@echo "#############################################"
@echo "Ansible DEB artifacts:"
@for DIST in $(DEB_DIST) ; do \
echo deb-build/$${DIST}/$(NAME)_$(DEB_VERSION)-$(DEB_RELEASE)~$${DIST}_amd64.changes ; \
done
@echo "#############################################"
# Build package outside of pbuilder, with locally installed dependencies.
# Install BuildRequires as noted in packaging/debian/control.
.PHONY: local_deb
local_deb: debian
@for DIST in $(DEB_DIST) ; do \
(cd deb-build/$${DIST}/$(NAME)-$(VERSION)/ && $(DEBUILD) -b) ; \
done
@echo "#############################################"
@echo "Ansible DEB artifacts:"
@for DIST in $(DEB_DIST) ; do \
echo deb-build/$${DIST}/$(NAME)_$(DEB_VERSION)-$(DEB_RELEASE)~$${DIST}_amd64.changes ; \
done
@echo "#############################################"
.PHONY: deb-src
deb-src: debian
@for DIST in $(DEB_DIST) ; do \
(cd deb-build/$${DIST}/$(NAME)-$(VERSION)/ && $(DEBUILD) -S) ; \
done
@echo "#############################################"
@echo "Ansible DEB artifacts:"
@for DIST in $(DEB_DIST) ; do \
echo deb-build/$${DIST}/$(NAME)_$(DEB_VERSION)-$(DEB_RELEASE)~$${DIST}_source.changes ; \
done
@echo "#############################################"
.PHONY: deb-upload
deb-upload: deb
@for DIST in $(DEB_DIST) ; do \
$(DPUT_BIN) $(DPUT_OPTS) $(DEB_PPA) deb-build/$${DIST}/$(NAME)_$(DEB_VERSION)-$(DEB_RELEASE)~$${DIST}_amd64.changes ; \
done
.PHONY: deb-src-upload
deb-src-upload: deb-src
@for DIST in $(DEB_DIST) ; do \
$(DPUT_BIN) $(DPUT_OPTS) $(DEB_PPA) deb-build/$${DIST}/$(NAME)_$(DEB_VERSION)-$(DEB_RELEASE)~$${DIST}_source.changes ; \
done
.PHONY: epub
epub:
(cd docs/docsite/; CPUS=$(CPUS) $(MAKE) epub)
# for arch or gentoo, read instructions in the appropriate 'packaging' subdirectory directory
.PHONY: webdocs
webdocs:
(cd docs/docsite/; CPUS=$(CPUS) $(MAKE) docs)
.PHONY: linkcheckdocs
linkcheckdocs:
(cd docs/docsite/; CPUS=$(CPUS) $(MAKE) 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
docs: generate_rst
$(MAKE) $(MANPAGES)
.PHONY: alldocs
alldocs: docs webdocs
version:
@echo $(VERSION)

89
README.md Normal file
View File

@ -0,0 +1,89 @@
[![PyPI version](https://img.shields.io/pypi/v/ansible-core.svg)](https://pypi.org/project/ansible-core)
[![Docs badge](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://docs.ansible.com/ansible/latest/)
[![Chat badge](https://img.shields.io/badge/chat-IRC-brightgreen.svg)](https://docs.ansible.com/ansible/latest/community/communication.html)
[![Build Status](https://dev.azure.com/ansible/ansible/_apis/build/status/CI?branchName=devel)](https://dev.azure.com/ansible/ansible/_build/latest?definitionId=20&branchName=devel)
[![Ansible Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-Ansible-silver.svg)](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)
[![Ansible mailing lists](https://img.shields.io/badge/mailing%20lists-Ansible-orange.svg)](https://docs.ansible.com/ansible/latest/community/communication.html#mailing-list-information)
[![Repository License](https://img.shields.io/badge/license-GPL%20v3.0-brightgreen.svg)](COPYING)
[![Ansible CII Best Practices certification](https://bestpractices.coreinfrastructure.org/projects/2372/badge)](https://bestpractices.coreinfrastructure.org/projects/2372)
# Ansible
Ansible is a radically simple IT automation system. It handles
configuration management, application deployment, cloud provisioning,
ad-hoc task execution, network automation, and multi-node orchestration. Ansible makes complex
changes like zero-downtime rolling updates with load balancers easy. More information on the Ansible [website](https://ansible.com/).
## Design Principles
* Have an extremely simple setup process with a minimal learning curve.
* Manage machines quickly and in parallel.
* Avoid custom-agents and additional open ports, be agentless by
leveraging the existing SSH daemon.
* Describe infrastructure in a language that is both machine and human
friendly.
* Focus on security and easy auditability/review/rewriting of content.
* Manage new remote machines instantly, without bootstrapping any
software.
* Allow module development in any dynamic language, not just Python.
* Be usable as non-root.
* Be the easiest IT automation system to use, ever.
## Use Ansible
You can install a released version of Ansible with `pip` or a package manager. See our
[installation guide](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) for details on installing Ansible
on a variety of platforms.
Power users and developers can run the `devel` branch, which has the latest
features and fixes, directly. Although it is reasonably stable, you are more likely to encounter
breaking changes when running the `devel` branch. We recommend getting involved
in the Ansible community if you want to run the `devel` branch.
## Get Involved
* Read [Community Information](https://docs.ansible.com/ansible/latest/community) for all
kinds of ways to contribute to and interact with the project,
including mailing list information and how to submit bug reports and
code to Ansible.
* Join a [Working Group](https://github.com/ansible/community/wiki),
an organized community devoted to a specific technology domain or platform.
* Submit a proposed code update through a pull request to the `devel` branch.
* Talk to us before making larger changes
to avoid duplicate efforts. This not only helps everyone
know what is going on, but it also helps save time and effort if we decide
some changes are needed.
* For a list of email lists, IRC channels and Working Groups, see the
[Communication page](https://docs.ansible.com/ansible/latest/community/communication.html)
## Coding Guidelines
We document our Coding Guidelines in the [Developer Guide](https://docs.ansible.com/ansible/devel/dev_guide/). We particularly suggest you review:
* [Contributing your module to Ansible](https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_checklist.html)
* [Conventions, tips, and pitfalls](https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_best_practices.html)
## Branch Info
* The `devel` branch corresponds to the release actively under development.
* The `stable-2.X` branches correspond to stable releases.
* Create a branch based on `devel` and set up a [dev environment](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html#common-environment-setup) if you want to open a PR.
* See the [Ansible release and maintenance](https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html) page for information about active branches.
## Roadmap
Based on team and community feedback, an initial roadmap will be published for a major or minor version (ex: 2.7, 2.8).
The [Ansible Roadmap page](https://docs.ansible.com/ansible/devel/roadmap/) details what is planned and how to influence the roadmap.
## Authors
Ansible was created by [Michael DeHaan](https://github.com/mpdehaan)
and has contributions from over 5000 users (and growing). Thanks everyone!
[Ansible](https://www.ansible.com) is sponsored by [Red Hat, Inc.](https://www.redhat.com)
## License
GNU General Public License v3.0 or later
See [COPYING](COPYING) to see the full text.

View File

@ -1,115 +0,0 @@
|PyPI version| |Docs badge| |Chat badge| |Build Status| |Code Of Conduct| |Mailing Lists| |License|
*******
Ansible
*******
Ansible is a radically simple IT automation system. It handles
configuration management, application deployment, cloud provisioning,
ad-hoc task execution, network automation, and multi-node orchestration. Ansible makes complex
changes like zero-downtime rolling updates with load balancers easy. More information on `the Ansible website <https://ansible.com/>`_.
Design Principles
=================
* Have a dead simple setup process and a minimal learning curve.
* Manage machines very quickly and in parallel.
* Avoid custom-agents and additional open ports, be agentless by
leveraging the existing SSH daemon.
* Describe infrastructure in a language that is both machine and human
friendly.
* Focus on security and easy auditability/review/rewriting of content.
* Manage new remote machines instantly, without bootstrapping any
software.
* Allow module development in any dynamic language, not just Python.
* Be usable as non-root.
* Be the easiest IT automation system to use, ever.
Use Ansible
===========
You can install a released version of Ansible via ``pip``, a package manager, or
our `release repository <https://releases.ansible.com/ansible/>`_. See our
`installation guide <https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html>`_ for details on installing Ansible
on a variety of platforms.
Red Hat offers supported builds of `Ansible Engine <https://www.ansible.com/ansible-engine>`_.
Power users and developers can run the ``devel`` branch, which has the latest
features and fixes, directly. Although it is reasonably stable, you are more likely to encounter
breaking changes when running the ``devel`` branch. We recommend getting involved
in the Ansible community if you want to run the ``devel`` branch.
Get Involved
============
* Read `Community
Information <https://docs.ansible.com/ansible/latest/community>`_ for all
kinds of ways to contribute to and interact with the project,
including mailing list information and how to submit bug reports and
code to Ansible.
* Join a `Working Group
<https://github.com/ansible/community/wiki>`_, an organized community devoted to a specific technology domain or platform.
* Submit a proposed code update through a pull request to the ``devel`` branch.
* Talk to us before making larger changes
to avoid duplicate efforts. This not only helps everyone
know what is going on, it also helps save time and effort if we decide
some changes are needed.
* For a list of email lists, IRC channels and Working Groups, see the
`Communication page <https://docs.ansible.com/ansible/latest/community/communication.html>`_
Coding Guidelines
=================
We document our Coding Guidelines in the `Developer Guide <https://docs.ansible.com/ansible/devel/dev_guide/>`_. We particularly suggest you review:
* `Contributing your module to Ansible <https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_checklist.html>`_
* `Conventions, tips and pitfalls <https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_best_practices.html>`_
Branch Info
===========
* The ``devel`` branch corresponds to the release actively under development.
* The ``stable-2.X`` branches correspond to stable releases.
* Create a branch based on ``devel`` and set up a `dev environment <https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html#common-environment-setup>`_ if you want to open a PR.
* See the `Ansible release and maintenance <https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html>`_ page for information about active branches.
Roadmap
=======
Based on team and community feedback, an initial roadmap will be published for a major or minor version (ex: 2.7, 2.8).
The `Ansible Roadmap page <https://docs.ansible.com/ansible/devel/roadmap/>`_ details what is planned and how to influence the roadmap.
Authors
=======
Ansible was created by `Michael DeHaan <https://github.com/mpdehaan>`_
and has contributions from over 4700 users (and growing). Thanks everyone!
`Ansible <https://www.ansible.com>`_ is sponsored by `Red Hat, Inc.
<https://www.redhat.com>`_
License
=======
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
.. |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
.. |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
:target: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html
:alt: Ansible Code of Conduct
.. |Mailing Lists| image:: https://img.shields.io/badge/mailing%20lists-Ansible-orange.svg
:target: https://docs.ansible.com/ansible/latest/community/communication.html#mailing-list-information
:alt: Ansible mailing lists
.. |License| image:: https://img.shields.io/badge/license-GPL%20v3.0-brightgreen.svg
:target: COPYING
:alt: Repository License

View File

@ -1 +1 @@
../lib/ansible/cli/scripts/ansible_cli_stub.py
../lib/ansible/cli/adhoc.py

View File

@ -1 +1 @@
ansible
../lib/ansible/cli/config.py

View File

@ -1 +1 @@
ansible
../lib/ansible/cli/console.py

View File

@ -1 +1 @@
ansible
../lib/ansible/cli/doc.py

View File

@ -1 +1 @@
ansible
../lib/ansible/cli/galaxy.py

View File

@ -1 +1 @@
ansible
../lib/ansible/cli/inventory.py

View File

@ -1 +1 @@
ansible
../lib/ansible/cli/playbook.py

View File

@ -1 +1 @@
ansible
../lib/ansible/cli/pull.py

View File

@ -1 +1 @@
../test/lib/ansible_test/_data/cli/ansible_test_cli_stub.py
../test/lib/ansible_test/_util/target/cli/ansible_test_cli_stub.py

View File

@ -1 +1 @@
ansible
../lib/ansible/cli/vault.py

View File

@ -0,0 +1,813 @@
=========================================================
ansible-core 2.13 "Nobody's Fault but Mine" Release Notes
=========================================================
.. contents:: Topics
v2.13.13
========
Release Summary
---------------
| Release Date: 2023-10-09
| `Porting Guide <https://docs.ansible.com/ansible-core/2.13/porting_guides/porting_guide_core_2.13.html>`__
Security Fixes
--------------
- ansible-galaxy - Prevent roles from using symlinks to overwrite files outside of the installation directory (CVE-2023-5115)
Bugfixes
--------
- ansible-galaxy info - fix reporting no role found when lookup_role_by_name returns None.
v2.13.12
========
Release Summary
---------------
| Release Date: 2023-09-11
| `Porting Guide <https://docs.ansible.com/ansible-core/2.13/porting_guides/porting_guide_core_2.13.html>`__
Minor Changes
-------------
- Removed ``exclude`` and ``recursive-exclude`` commands for generated files from the ``MANIFEST.in`` file. These excludes were unnecessary since releases are expected to be built with a clean worktree.
- Removed ``exclude`` commands for sanity test files from the ``MANIFEST.in`` file. These tests were previously excluded because they did not pass when run from an sdist. However, sanity tests are not expected to pass from an sdist, so excluding some (but not all) of the failing tests makes little sense.
- Removed redundant ``include`` commands from the ``MANIFEST.in`` file. These includes either duplicated default behavior or another command.
- The ``ansible-core`` sdist no longer contains pre-generated man pages. Instead, a ``packaging/cli-doc/build.py`` script is included in the sdist. This script can generate man pages and standalone RST documentation for ``ansible-core`` CLI programs.
- The ``docs`` and ``examples`` directories are no longer included in the ``ansible-core`` sdist. These directories have been moved to the https://github.com/ansible/ansible-documentation repository.
- The minimum required ``setuptools`` version is now 45.2.0, as it is the oldest version to support Python 3.10.
- Use ``include`` where ``recursive-include`` is unnecessary in the ``MANIFEST.in`` file.
- Use ``package_data`` instead of ``include_package_data`` for ``setup.cfg`` to avoid ``setuptools`` warnings.
- ansible-test - Update the logic used to detect when ``ansible-test`` is running from source.
- ansible-test — Replaced `freebsd/12.3` remote with `freebsd/12.4`. The former is no longer functional.
- ansible-test — Replaced `freebsd/13.0` remote with `freebsd/13.1`. The former is no longer functional.
Bugfixes
--------
- Exclude internal options from man pages and docs.
- Fix ``ansible-config init`` man page option indentation.
- The ``ansible-config init`` command now has a documentation description.
- The ``ansible-galaxy collection download`` command now has a documentation description.
- The ``ansible-galaxy collection install`` command documentation is now visible (previously hidden by a decorator).
- The ``ansible-galaxy collection verify`` command now has a documentation description.
- The ``ansible-galaxy role install`` command documentation is now visible (previously hidden by a decorator).
- The ``ansible-inventory`` command command now has a documentation description (previously used as the epilog).
- Update module_utils.urls unit test to work with cryptography >= 41.0.0.
- When generating man pages, use ``func`` to find the command function instead of looking it up by the command name.
- ansible-galaxy - Enabled the ``data`` tarfile filter during role installation for Python versions that support it. A probing mechanism is used to avoid Python versions with a broken implementation.
- ansible-test - Always use ansible-test managed entry points for ansible-core CLI tools when not running from source. This fixes issues where CLI entry points created during install are not compatible with ansible-test.
- ansible-test - Pre-build a PyYAML wheel before installing requirements to avoid a potential Cython build failure.
- man page build - Sub commands of ``ansible-galaxy role`` and ``ansible-galaxy collection`` are now documented.
- tarfile - handle data filter deprecation warning message for extract and extractall (https://github.com/ansible/ansible/issues/80832).
v2.13.11
========
Release Summary
---------------
| Release Date: 2023-07-18
| `Porting Guide <https://docs.ansible.com/ansible-core/2.13/porting_guides/porting_guide_core_2.13.html>`__
Minor Changes
-------------
- Removed ``straight.plugin`` from the build and packaging requirements.
Bugfixes
--------
- ansible-test - Fix a traceback that occurs when attempting to test Ansible source using a different ansible-test. A clear error message is now given when this scenario occurs.
- ansible-test local change detection - use ``git merge-base <branch> HEAD`` instead of ``git merge-base --fork-point <branch>`` (https://github.com/ansible/ansible/pull/79734).
- man page build - Remove the dependency on the ``docs`` directory for building man pages.
v2.13.10
========
Release Summary
---------------
| Release Date: 2023-05-22
| `Porting Guide <https://docs.ansible.com/ansible-core/2.13/porting_guides/porting_guide_core_2.13.html>`__
Minor Changes
-------------
- ansible-test - Allow float values for the ``--timeout`` option to the ``env`` command. This simplifies testing.
- ansible-test - Refactored ``env`` command logic and timeout handling.
- ansible-test - Use ``datetime.datetime.now`` with ``tz`` specified instead of ``datetime.datetime.utcnow``.
Bugfixes
--------
- ansible-galaxy - fix installing signed collections (https://github.com/ansible/ansible/issues/80648).
- ansible-galaxy collection verify - fix verifying signed collections when the keyring is not configured.
- ansible-test - Fix handling of timeouts exceeding one day.
- ansible-test - Fix various cases where the test timeout could expire without terminating the tests.
- ansible-test - When bootstrapping remote FreeBSD instances, use the OS packaged ``setuptools`` instead of installing the latest version from PyPI.
- pep517 build backend - Copy symlinks when copying the source tree. This avoids tracebacks in various scenarios, such as when a venv is present in the source tree.
v2.13.9
=======
Release Summary
---------------
| Release Date: 2023-04-24
| `Porting Guide <https://docs.ansible.com/ansible-core/2.13/porting_guides/porting_guide_core_2.13.html>`__
Minor Changes
-------------
- ansible-test - Moved git handling out of the validate-modules sanity test and into ansible-test.
- ansible-test - Removed the ``--keep-git`` sanity test option, which was limited to testing ansible-core itself.
- ansible-test - Updated the Azure Pipelines CI plugin to work with newer versions of git.
Breaking Changes / Porting Guide
--------------------------------
- ansible-test - Integration tests which depend on specific file permissions when running in an ansible-test managed host environment may require changes. Tests that require permissions other than ``755`` or ``644`` may need to be updated to set the necessary permissions as part of the test run.
Bugfixes
--------
- Fix ``MANIFEST.in`` to exclude unwanted files in the ``packaging/`` directory.
- Fix ``MANIFEST.in`` to include ``*.md`` files in the ``test/support/`` directory.
- Windows - Display a warning if the module failed to cleanup any temporary files rather than failing the task. The warning contains a brief description of what failed to be deleted.
- Windows - Ensure the module temp directory contains more unique values to avoid conflicts with concurrent runs - https://github.com/ansible/ansible/issues/80294
- Windows - Improve temporary file cleanup used by modules. Will use a more reliable delete operation on Windows Server 2016 and newer to delete files that might still be open by other software like Anti Virus scanners. There are still scenarios where a file or directory cannot be deleted but the new method should work in more scenarios.
- ansible-doc - stop generating wrong module URLs for module see-alsos. The URLs for modules in ansible.builtin do now work, and URLs for modules outside ansible.builtin are no longer added (https://github.com/ansible/ansible/pull/80280).
- ansible-galaxy - Improve retries for collection installs, to properly retry, and extend retry logic to common URL related connection errors (https://github.com/ansible/ansible/issues/80170 https://github.com/ansible/ansible/issues/80174)
- ansible-galaxy - reduce API calls to servers by fetching signatures only for final candidates.
- ansible-test - Add support for ``argcomplete`` version 3.
- ansible-test - Always indicate the Python version being used before installing requirements. Resolves issue https://github.com/ansible/ansible/issues/72855
- ansible-test - Exclude ansible-core vendored Python packages from ansible-test payloads.
- ansible-test - Integration test target prefixes defined in a ``tests/integration/target-prefixes.{group}`` file can now contain an underscore (``_``) character. Resolves issue https://github.com/ansible/ansible/issues/79225
- ansible-test - Removed pointless comparison in diff evaluation logic.
- ansible-test - Set ``PYLINTHOME`` for the ``pylint`` sanity test to prevent failures due to ``pylint`` checking for the existence of an obsolete home directory.
- ansible-test - Support loading of vendored Python packages from ansible-core.
- ansible-test - Use consistent file permissions when delegating tests to a container or remote host. Files with any execute bit set will use permissions ``755``. All other files will use permissions ``644``. (Resolves issue https://github.com/ansible/ansible/issues/75079)
- password lookup now correctly reads stored ident fields.
- pep517 build backend - Use the documented ``import_module`` import from ``importlib``.
v2.13.8
=======
Release Summary
---------------
| Release Date: 2023-02-27
| `Porting Guide <https://docs.ansible.com/ansible/devel/porting_guides.html>`__
Major Changes
-------------
- ansible-test - Docker Desktop on WSL2 is now supported (additional configuration required).
- ansible-test - Docker and Podman are now supported on hosts with cgroup v2 unified. Previously only cgroup v1 and cgroup v2 hybrid were supported.
- ansible-test - Podman now works on container hosts without systemd. Previously only some containers worked, while others required rootfull or rootless Podman, but would not work with both. Some containers did not work at all.
- ansible-test - Podman on WSL2 is now supported.
- ansible-test - When additional cgroup setup is required on the container host, this will be automatically detected. Instructions on how to configure the host will be provided in the error message shown.
Minor Changes
-------------
- ansible-test - A new ``audit`` option is available when running custom containers. This option can be used to indicate whether a container requires the AUDIT_WRITE capability. The default is ``required``, which most containers will need when using Podman. If necessary, the ``none`` option can be used to opt-out of the capability. This has no effect on Docker, which always provides the capability.
- ansible-test - A new ``cgroup`` option is available when running custom containers. This option can be used to indicate a container requires cgroup v1 or that it does not use cgroup. The default behavior assumes the container works with cgroup v2 (as well as v1).
- ansible-test - Add support for provisioning Alpine 3.16 remote instances.
- ansible-test - Add support for provisioning Fedora 36 remote instances.
- ansible-test - Add support for provisioning Ubuntu 20.04 remote instances.
- ansible-test - Add support for provisioning remotes which require ``doas`` for become.
- ansible-test - Additional log details are shown when containers fail to start or SSH connections to containers fail.
- ansible-test - Alpine remotes now use ``sudo`` for tests, using ``doas`` only for bootstrapping.
- ansible-test - Become support for remote instance provisioning is no longer tied to a fixed list of platforms.
- ansible-test - Connection failures to remote provisioned hosts now show failure details as a warning.
- ansible-test - Containers included with ansible-test no longer disable seccomp by default.
- ansible-test - Failure to connect to a container over SSH now results in a clear error. Previously tests would be attempted even after initial connection attempts failed.
- ansible-test - FreeBSD remotes now use ``sudo`` for tests, using ``su`` only for bootstrapping.
- ansible-test - Integration tests can be excluded from retries triggered by the ``--retry-on-error`` option by adding the ``retry/never`` alias. This is useful for tests that cannot pass on a retry or are too slow to make retries useful.
- ansible-test - More details are provided about an instance when provisioning fails.
- ansible-test - Reduce the polling limit for SSHD startup in containers from 60 retries to 10. The one second delay between retries remains in place.
- ansible-test - Remote Alpine instances now have the ``acl`` package installed.
- ansible-test - Remote Fedora instances now have the ``acl`` package installed.
- ansible-test - Remote FreeBSD instances now have ACLs enabled on the root filesystem.
- ansible-test - Remote Ubuntu instances now have the ``acl`` package installed.
- ansible-test - SSH connections from OpenSSH 8.8+ to CentOS 6 containers now work without additional configuration. However, clients older than OpenSSH 7.0 can no longer connect to CentOS 6 containers as a result. The container must have ``centos6`` in the image name for this work-around to be applied.
- ansible-test - SSH shell connections from OpenSSH 8.8+ to ansible-test provisioned network instances now work without additional configuration. However, clients older than OpenSSH 7.0 can no longer open shell sessions for ansible-test provisioned network instances as a result.
- ansible-test - Specify the configuration file location required by test plugins when the config file is not found. This resolves issue: https://github.com/ansible/ansible/issues/79411
- ansible-test - The ``ansible-test env`` command now detects and reports the container ID if running in a container.
- ansible-test - Unit tests now support network disconnect by default when running under Podman. Previously this feature only worked by default under Docker.
- ansible-test - Use ``stop --time 0`` followed by ``rm`` to remove ephemeral containers instead of ``rm -f``. This speeds up teardown of ephemeral containers.
- ansible-test - Warnings are now shown when using containers that were built with VOLUME instructions.
- ansible-test - When setting the max open files for containers, the container host's limit will be checked. If the host limit is lower than the preferred value, it will be used and a warning will be shown.
- ansible-test - When using Podman, ansible-test will detect if the loginuid used in containers is incorrect. When this occurs a warning is displayed and the container is run with the AUDIT_CONTROL capability. Previously containers would fail under this situation, with no useful warnings or errors given.
- ansible-test acme test container - update version to update used Pebble version, underlying Python and Go base containers, and Python requirements (https://github.com/ansible/ansible/pull/79783).
Bugfixes
--------
- Ansible.Basic.cs - Ignore compiler warning (reported as an error) when running under PowerShell 7.3.x.
- TaskExecutor - don't ignore templated _raw_params that k=v parser failed to parse (https://github.com/ansible/ansible/issues/79862)
- ansible-test - Always remove containers after failing to create/run them. This avoids leaving behind created containers when using podman.
- ansible-test - Avoid using ``exec`` after container startup when possible. This improves container startup performance and avoids intermittent startup issues with some old containers.
- ansible-test - Connection attempts to managed remote instances no longer abort on ``Permission denied`` errors.
- ansible-test - Detection for running in a Podman or Docker container has been fixed to detect more scenarios. The new detection relies on ``/proc/self/mountinfo`` instead of ``/proc/self/cpuset``. Detection now works with custom cgroups and private cgroup namespaces.
- ansible-test - Fix bootstrapping of Python 3.9 on Ubuntu 20.04 remotes.
- ansible-test - Fix validate-modules error when retrieving PowerShell argspec when retrieved inside a Cmdlet
- ansible-test - Handle server errors when executing the ``docker info`` command.
- ansible-test - Multiple containers now work under Podman without specifying the ``--docker-network`` option.
- ansible-test - Pass the ``XDG_RUNTIME_DIR`` environment variable through to container commands.
- ansible-test - Perform PyPI proxy configuration after instances are ready and bootstrapping has been completed. Only target instances are affected, as controller instances were already handled this way. This avoids proxy configuration errors when target instances are not yet ready for use.
- ansible-test - Prevent concurrent / repeat inspections of the same container image.
- ansible-test - Prevent concurrent / repeat pulls of the same container image.
- ansible-test - Prevent concurrent execution of cached methods.
- ansible-test - Show the exception type when reporting errors during instance provisioning.
- ansible-test - Support Podman 4.4.0+ by adding the ``SYS_CHROOT`` capability when running containers.
- ansible-test - Temporary executables are now verified as executable after creation. Without this check, path injected scripts may not be found, typically on systems with ``/tmp`` mounted using the "noexec" option. This can manifest as a missing Python interpreter, or use of the wrong Python interpreter, as well as other error conditions.
- ansible-test - Test containers are now run with the ``--tmpfs`` option for ``/tmp``, ``/run`` and ``/run/lock``. This allows use of containers built without the ``VOLUME`` instruction. Additionally, containers with those volumes defined no longer create anonymous volumes for them. This avoids leaving behind volumes on the container host after the container is stopped and deleted.
- ansible-test - fix warning message about failing to run an image to include the image name
- file - touch action in check mode was always returning ok. Fix now evaluates the different conditions and returns the appropriate changed status. (https://github.com/ansible/ansible/issues/79360)
Known Issues
------------
- ansible-test - Additional configuration may be required for certain container host and container combinations. Further details are available in the testing documentation.
- ansible-test - Custom containers with ``VOLUME`` instructions may be unable to start, when previously the containers started correctly. Remove the ``VOLUME`` instructions to resolve the issue. Containers with this condition will cause ``ansible-test`` to emit a warning.
- ansible-test - Systems with Podman networking issues may be unable to run containers, when previously the issue went unreported. Correct the networking issues to continue using ``ansible-test`` with Podman.
- ansible-test - Using Docker on systems with SELinux may require setting SELinux to permissive mode. Podman should work with SELinux in enforcing mode.
v2.13.7
=======
Release Summary
---------------
| Release Date: 2022-12-05
| `Porting Guide <https://docs.ansible.com/ansible/devel/porting_guides.html>`__
Minor Changes
-------------
- ansible-test - Improve consistency of executed ``pylint`` commands by making the plugins ordered.
Bugfixes
--------
- file lookup now plays nice with generic lookup ``errors`` option.
v2.13.6
=======
Release Summary
---------------
| Release Date: 2022-11-07
| `Porting Guide <https://docs.ansible.com/ansible/devel/porting_guides.html>`__
Minor Changes
-------------
- ansible-test - Improve consistency of version specific documentation links.
Bugfixes
--------
- BSD network facts - Do not assume column indexes, look for ``netmask`` and ``broadcast`` for determining the correct columns when parsing ``inet`` line (https://github.com/ansible/ansible/issues/79117)
- ansible-galaxy - make initial call to Galaxy server on-demand only when installing, getting info about, and listing roles.
- ansible-test - Add ``wheel < 0.38.0`` constraint for Python 3.6 and earlier.
- ansible-test - Fix broken documentation link for ``aws`` test plugin error messages.
- copy module will no longer move 'non files' set as src when remote_src=true.
- file lookup now handles missing files more gracefully.
- service_facts - Use python re to parse service output instead of grep (https://github.com/ansible/ansible/issues/78541)
- updated error messages to include 'acl' and not just mode changes when failing to set required permissions on remote.
v2.13.5
=======
Release Summary
---------------
| Release Date: 2022-10-10
| `Porting Guide <https://docs.ansible.com/ansible/devel/porting_guides.html>`__
Bugfixes
--------
- ``ansible-galaxy`` - remove extra server api call during dependency resolution for requirements and dependencies that are already satisfied (https://github.com/ansible/ansible/issues/77443).
- ansible-test - Allow disabled, unsupported, unstable and destructive integration test targets to be selected using their respective prefixes.
- ansible-test - Allow unstable tests to run when targeted changes are made and the ``--allow-unstable-changed`` option is specified (resolves https://github.com/ansible/ansible/issues/74213).
- apt - Fix module failure when a package is not installed and only_upgrade=True. Skip that package and check the remaining requested packages for upgrades. (https://github.com/ansible/ansible/issues/78762)
- apt module should not traceback on invalid type given as package. issue 78663.
- known_hosts - do not return changed status when a non-existing key is removed (https://github.com/ansible/ansible/issues/78598)
- paramiko - Add back support for ``ssh_args``, ``ssh_common_args``, and ``ssh_extra_args`` for parsing the ``ProxyCommand`` (https://github.com/ansible/ansible/issues/78750)
- plugin loader, fix detection for existing configuration before initializing for a plugin
v2.13.4
=======
Release Summary
---------------
| Release Date: 2022-09-12
| `Porting Guide <https://docs.ansible.com/ansible/devel/porting_guides.html>`__
Bugfixes
--------
- Fix for network_cli not getting all relevant connection options
- ansible-galaxy - Fix detection of ``--role-file`` in arguments for implicit role invocation (https://github.com/ansible/ansible/issues/78204)
- ansible-galaxy - Fix exit codes for role search and delete (https://github.com/ansible/ansible/issues/78516)
- ansible-test - Fix change detection for ansible-test's own integration tests.
- ansible-test - ansible-doc sanity test - Correctly determine the fully-qualified collection name for plugins in subdirectories, resolving https://github.com/ansible/ansible/issues/78490.
- apt - don't actually update the cache in check mode with update_cache=true.
- apt - don't mark existing packages as manually installed in check mode (https://github.com/ansible/ansible/issues/66413).
- apt - fix package selection to include /etc/apt/preferences(.d) (https://github.com/ansible/ansible/issues/77969)
- urls - Guard imports of ``urllib3`` by catching ``Exception`` instead of ``ImportError`` to prevent exceptions in the import process of optional dependencies from preventing use of ``urls.py`` (https://github.com/ansible/ansible/issues/78648)
- wait_for - Read file and perform comparisons using bytes to avoid decode errors (https://github.com/ansible/ansible/issues/78214)
v2.13.3
=======
Release Summary
---------------
| Release Date: 2022-08-15
| `Porting Guide <https://docs.ansible.com/ansible/devel/porting_guides.html>`__
Bugfixes
--------
- Avoid 'unreachable' error when chmod on AIX has 255 as return code.
- Fix PluginLoader to mimic Python import machinery by adding module to sys.modules before exec
- Fix dnf module documentation to indicate that comparison operators for package version require spaces around them (https://github.com/ansible/ansible/issues/78295)
- ansible-connection - decrypt vaulted parameters before sending over the socket, as vault secrets are not available on the other side.
- ansible-galaxy - Fix reinitializing the whole collection directory with ``ansible-galaxy collection init ns.coll --force``. Now directories and files that are not included in the collection skeleton will be removed.
- ansible-galaxy - do not require mandatory keys in the ``galaxy.yml`` of source collections when listing them (https://github.com/ansible/ansible/issues/70180).
- ansible-galaxy - fix listing collections that contains metadata but the namespace or name are not strings.
- ansible-galaxy - fix setting the cache for paginated responses from Galaxy NG/AH (https://github.com/ansible/ansible/issues/77911).
- ansible-test - Delegation for commands which generate output for programmatic consumption no longer redirect all output to stdout. The affected commands and options are ``shell``, ``sanity --lint``, ``sanity --list-tests``, ``integration --list-targets``, ``coverage analyze``
- ansible-test - Delegation now properly handles arguments given after ``--`` on the command line.
- ansible-test - Test configuration for collections is now parsed only once, prior to delegation. Fixes issue: https://github.com/ansible/ansible/issues/78334
- ansible-test - The ``shell`` command no longer redirects all output to stdout when running a provided command. Any command output written to stderr will be mixed with the stderr output from ansible-test.
- ansible-test - The ``shell`` command no longer requests a TTY when using delegation unless an interactive shell is being used. An interactive shell is the default behavior when no command is given to pass to the shell.
- dnf - fix output parsing on systems with ``LANGUAGE`` set to a language other than English (https://github.com/ansible/ansible/issues/78193)
- if a config setting prevents running ansible it should at least show it's "origin".
- prevent type annotation shim failures from causing runtime failures (https://github.com/ansible/ansible/pull/77860)
- template module/lookup - fix ``convert_data`` option that was effectively always set to True for Jinja macros (https://github.com/ansible/ansible/issues/78141)
- uri - properly use uri parameter use_proxy (https://github.com/ansible/ansible/issues/58632)
- yum - fix traceback when ``releasever`` is specified with ``latest`` (https://github.com/ansible/ansible/issues/78058)
v2.13.2
=======
Release Summary
---------------
| Release Date: 2022-07-18
| `Porting Guide <https://docs.ansible.com/ansible/devel/porting_guides.html>`__
Minor Changes
-------------
- ansible-test - An improved error message is shown when the download of a pip bootstrap script fails. The download now uses ``urllib2`` instead of ``urllib`` on Python 2.
Bugfixes
--------
- Move undefined check from concat to finalize (https://github.com/ansible/ansible/issues/78156)
- ansible-doc - no longer list module and plugin aliases that are created with symlinks (https://github.com/ansible/ansible/pull/78137).
- ansible-doc - when listing modules in collections, proceed recursively. This fixes module listing for community.general 5.x.y and community.network 4.x.y (https://github.com/ansible/ansible/pull/78137).
- ansible-doc will not add 'website for' in ":ref:" substitutions as it made them confusing.
- file backed cache plugins now handle concurrent access by making atomic updates to the files.
- password lookup does not ignore k=v arguments anymore.
- user - Fix error "Permission denied" in user module while generating SSH keys (https://github.com/ansible/ansible/issues/78017).
v2.13.1
=======
Release Summary
---------------
| Release Date: 2022-06-20
| `Porting Guide <https://docs.ansible.com/ansible/devel/porting_guides.html>`__
Minor Changes
-------------
- Add an 'action_plugin' field for modules in runtime.yml plugin_routing.
This fixes module_defaults by supporting modules-as-redirected-actions
without redirecting module_defaults entries to the common action.
.. code: yaml
plugin_routing:
action:
facts:
redirect: ns.coll.eos
command:
redirect: ns.coll.eos
modules:
facts:
redirect: ns.coll.eos_facts
command:
redirect: ns.coll.eos_command
With the runtime.yml above for ns.coll, a task such as
.. code: yaml
- hosts: all
module_defaults:
ns.coll.eos_facts: {'valid_for_eos_facts': 'value'}
ns.coll.eos_command: {'not_valid_for_eos_facts': 'value'}
tasks:
- ns.coll.facts:
will end up with defaults for eos_facts and eos_command
since both modules redirect to the same action.
To select an action plugin for a module without merging
module_defaults, define an action_plugin field for the resolved
module in the runtime.yml.
.. code: yaml
plugin_routing:
modules:
facts:
redirect: ns.coll.eos_facts
action_plugin: ns.coll.eos
command:
redirect: ns.coll.eos_command
action_plugin: ns.coll.eos
The action_plugin field can be a redirected action plugin, as
it is resolved normally.
Using the modified runtime.yml, the example task will only use
the ns.coll.eos_facts defaults.
- ansible-galaxy - Support resolvelib versions 0.6.x, 0.7.x, and 0.8.x. The full range of supported versions is now >= 0.5.3, < 0.9.0.
- ansible-test - Add RHEL 9.0 remote support.
- ansible-test - Add support for Ubuntu VMs using the ``--remote`` option.
- ansible-test - Add support for exporting inventory with ``ansible-test shell --export {path}``.
- ansible-test - Add support for multi-arch remotes.
- ansible-test - Add support for running non-interactive commands with ``ansible-test shell``.
- ansible-test - Avoid using the ``mock_use_standalone_module`` setting for unit tests running on Python 3.8 or later.
- ansible-test - Blocking mode is now enforced for stdin, stdout and stderr. If any of these are non-blocking then ansible-test will exit during startup with an error.
- ansible-test - Improve consistency of output messages by using stdout or stderr for most output, but not both.
- ansible-test - The ``shell`` command can be used outside a collection if no controller delegation is required.
Bugfixes
--------
- Add PyYAML >= 5.1 as a dependency of ansible-core to be compatible with Python 3.8+.
- ansible-config dump - Only display plugin type headers when plugin options are changed if --only-changed is specified.
- ansible-galaxy - handle unsupported versions of resolvelib gracefully.
- ansible-test - Fix internal validation of remote completion configuration.
- ansible-test - Prevent ``--target-`` prefixed options for the ``shell`` command from being combined with legacy environment options.
- ansible-test - Sanity test output with the ``--lint`` option is no longer mixed in with bootstrapping output.
- ansible-test - Subprocesses are now isolated from the stdin, stdout and stderr of ansible-test. This avoids issues with subprocesses tampering with the file descriptors, such as SSH making them non-blocking. As a result of this change, subprocess output from unit and integration tests on stderr now go to stdout.
- ansible-test - Subprocesses no longer have access to the TTY ansible-test is connected to, if any. This maintains consistent behavior between local testing and CI systems, which typically do not provide a TTY. Tests which require a TTY should use pexpect or another mechanism to create a PTY.
- apt module now correctly handles virtual packages.
- lookup plugin - catch KeyError when lookup returns dictionary (https://github.com/ansible/ansible/pull/77789).
- pip - fix cases where resolution of pip Python module fails when importlib.util has not already been imported
- plugin loader - Sort results when fuzzy matching plugin names (https://github.com/ansible/ansible/issues/77966).
- plugin loader will now load config data for plugin by name instead of by file to avoid issues with the same file being loaded under different names (fqcn + short name).
- psrp connection now handles default to inventory_hostname correctly.
- winrm connection now handles default to inventory_hostname correctly.
v2.13.0
=======
Release Summary
---------------
| Release Date: 2022-05-16
| `Porting Guide <https://docs.ansible.com/ansible/devel/porting_guides.html>`__
Major Changes
-------------
- Jinja2 Controller Requirement - Jinja2 3.0.0 or newer is required for the control node (the machine that runs Ansible) (https://github.com/ansible/ansible/pull/75881)
- Templating - remove ``safe_eval`` in favor of using ``NativeEnvironment`` but utilizing ``literal_eval`` only in cases when ``safe_eval`` was used (https://github.com/ansible/ansible/pull/75587)
Minor Changes
-------------
- Action Plugins - Add helper method for argument spec validation, and extend to pause and async_wrapper
- Added AIX root CA certs folders - enhance the TLS support in ``uri`` task on AIX
- Added ``module_utils.compat.typing`` to facilitate type-hinting on all supported Python versions.
- Ansible.Basic - small changes to allow use in PowerShell modules running on non-Windows platforms (https://github.com/ansible/ansible/pull/76924).
- AnsibleModule.run_command() now has a toggle to allow caller to decide to handle exceptions from executing the command itself
- Attach concat function to an environment class (https://github.com/ansible/ansible/pull/76282)
- Clarify in a comment that unrolling an iterator in ``Templar._finalize`` is actually necessary. Also switch to using the ``_unroll_iterator`` decorator directly to deduplicate code in ``Templar._finalize``. (https://github.com/ansible/ansible/pull/76436)
- Installation - modernize our python installation, to reduce dynamic code in setup.py, and migrate what is feasible to setup.cfg. This will enable shipping wheels in the future.
- PlayIterator - introduce public methods to access ``PlayIterator._host_states`` (https://github.com/ansible/ansible/pull/74416)
- PlayIterator - use enums for Iterating and Failed states (https://github.com/ansible/ansible/pull/74511)
- Reduce number of iterations through PlayIterator (https://github.com/ansible/ansible/pull/74175)
- Remove more Python 2.x compatibility code from controller (https://github.com/ansible/ansible/pull/77320).
- Start of moving away from using Six, Python 2 and 3 compatibility library (https://github.com/ansible/ansible/pull/75863)
- The collection loader now reports a Python warning if an attempt is made to install the Ansible collection loader a second time. Previously this condition was reported using an Ansible warning.
- ``ansible-galaxy collection [install|verify]`` - allow user-provided signature sources in addition to those from the Galaxy server. Each collection entry in a requirements file can specify a ``signatures`` key followed by a list of sources. Collection name(s) provided on the CLI can specify additional signature sources by using the ``--signatures`` CLI option. Signature sources should be URIs that can be opened with ``urllib.request.urlopen()``, such as "https://example.com/path/to/detached_signature.asc" or "file:///path/to/detached_signature.asc". The ``--keyring`` option must be specified if signature sources are provided.
- ``ansible-galaxy collection [install|verify]`` - use gpg to verify the authenticity of the signed ``MANIFEST.json`` with ASCII armored detached signatures provided by the Galaxy server. The keyring (which is not managed by ``ansible-galaxy``) must be provided with the ``--keyring`` option to use signature verification. If no ``--keyring`` is specified and the collection to ``install|verify`` has associated detached signatures on the Galaxy server, a warning is provided.
- ``ansible-galaxy collection install`` - Add a global configuration to modify the required number of signatures that must verify the authenticity of the collection. By default, the number of required successful signatures is 1. Set this option to ``all`` to require all signatures verify the collection. To ensure signature verification fails if there are no valid signatures, prepend the value with '+', such as ``+all`` or ``+1``.
- ``ansible-galaxy collection install`` - Add a global ignore list for gpg signature errors. This can be used to ignore certain signatures when the number of required successful signatures is all. When the required number of successful signatures is a positive integer, the only effect this has is to display fewer errors to the user on failure (success is determined by having the minimum number of successful signatures, in which case all errors are disregarded).
- ``ansible-galaxy collection install`` - Add a global toggle to turn off GPG signature verification.
- ``ansible-galaxy collection install`` - Store Galaxy server metadata alongside installed collections for provenance. Signatures obtained from the Galaxy server can be used for offline verification with ``ansible-galaxy collection verify --offline``.
- ansible-console - Provide a way to customize the stdout callback
- ansible-core modules - Remove unused Python shebangs from built-in modules.
- ansible-doc metadata dump - add option ``--no-fail-on-errors`` which allows to not fail the ansible-doc invocation when errors happen during docs parsing or processing. Instead they are reported in the JSON result in an ``error`` key for the affected plugins (https://github.com/ansible/ansible/pull/77035).
- ansible-galaxy - the option to skip certificate verification now also applies when cloning via SCM (git/hg) (https://github.com/ansible/ansible/issues/41077)
- ansible-test - Accept new-style Python modules without a shebang.
- ansible-test - Add ``--version`` support to show the ansible-core version.
- ansible-test - Add support for ``rhel/8.5`` remote instances.
- ansible-test - Add support for remote testing of FreeBSD 12.3.
- ansible-test - Add support for running container tests with ``podman remote`` (https://github.com/ansible/ansible/pull/75753)
- ansible-test - Added the ``fedora35`` test container.
- ansible-test - Change the maximum number of open files in a test container from the default to ``10240``.
- ansible-test - Declare public dependencies of ansible-core and use to limit unguarded imports in plugins.
- ansible-test - Importing ``distutils`` now results in an error.
- ansible-test - Installation of ``cryptography`` is no longer version constrained when ``openssl`` 1.1.0 or later is installed.
- ansible-test - Miscellaneous code cleanup and type hint fixes.
- ansible-test - PowerShell in the ``base`` and ``default`` containers has been upgraded to version 7.1.4.
- ansible-test - Remove RHEL 8.4 remote (``rhel/8.4``) support.
- ansible-test - Remove ``idna`` constraint.
- ansible-test - Remove obsolete ``MAXFD`` display.
- ansible-test - Remove obsolete constraints for Python 2.6.
- ansible-test - Remove support for FreeBSD 12.2 remote provisioning.
- ansible-test - Remove support for macOS 11.1 remote provisioning.
- ansible-test - Remove support for provisioning remote AIX instances.
- ansible-test - Remove the ``centos8`` test container since CentOS 8 will reach end-of-life soon.
- ansible-test - Remove the ``fedora33`` test container since Fedora 33 will reach end-of-life soon.
- ansible-test - Remove unused Python 2.x compatibility code.
- ansible-test - Removed support for Sherlock from the Azure provisioning plugin.
- ansible-test - Removed used ``MarkupSafe`` constraint for Python 3.5 and earlier.
- ansible-test - Requirements for the plugin import test are now frozen.
- ansible-test - Shellcheck in the ``base`` and ``default`` containers has been upgraded to version 0.7.0.
- ansible-test - Stop early with an error if the current working directory contains an invalid collection namespace or name.
- ansible-test - The ``--help`` option is now available when an unsupported cwd is in use.
- ansible-test - The ``--help`` output now shows the same instructions about cwd as would be shown in error messages if the cwd is unsupported.
- ansible-test - The ``pip`` and ``wheel`` packages are removed from all sanity test virtual environments after installation completes to reduce their size. Previously they were only removed from the environments used for the ``import`` sanity test.
- ansible-test - The explanation about cwd usage has been improved to explain more clearly what is required.
- ansible-test - The hash for all managed sanity test virtual environments has changed. Containers that include ``ansible-test sanity --prime-venvs`` will need to be rebuilt to continue using primed virtual environments.
- ansible-test - Update ``base`` container to version 2.1.0.
- ansible-test - Update ``base`` container to version 2.2.0.
- ansible-test - Update ``default`` containers to version 5.2.0.
- ansible-test - Update ``default`` containers to version 5.4.0.
- ansible-test - Update ``default`` containers to version 5.5.0.
- ansible-test - Update ``default`` containers to version 5.6.2.
- ansible-test - Update ``default`` containers to version 5.7.0.
- ansible-test - Update ``default`` containers to version 5.8.0.
- ansible-test - Update ``default`` containers to version 5.9.0.
- ansible-test - Update ``pip`` used to bootstrap remote FreeBSD instances from version 20.3.4 to 21.3.1.
- ansible-test - Update sanity test requirements.
- ansible-test - Update the NIOS test plugin container to version 1.4.0.
- ansible-test - Update the ``alpine`` container to version 3.3.0. This updates the base image from 3.14.2 to 3.15.0, which includes support for installing binary wheels using pip.
- ansible-test - Update the ``base`` and ``default`` containers from Python 3.10.0rc2 to 3.10.0.
- ansible-test - Update the ``base`` and ``default`` containers from a Ubuntu 18.04 to Ubuntu 20.04 base image.
- ansible-test - Update the ``default`` containers to version 5.1.0.
- ansible-test - Update the ``galaxy`` test plugin to get its container from a copy on quay.io.
- ansible-test - Update the ``openshift`` test plugin to get its container from a copy on quay.io.
- ansible-test - Use Python 3.10 as the default Python version for the ``base`` and ``default`` containers.
- ansible-test - add macOS 12.0 as a remote target (https://github.com/ansible/ansible/pull/76328)
- ansible-test - handle JSON decode error gracefully in podman environment.
- ansible-test pslint - Added the `AvoidLongLines <https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/AvoidLongLines.md>`_ rule set to a length of 160.
- ansible-test pslint - Added the `PlaceCloseBrace <https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/PlaceCloseBrace.md>`_ rule set to enforce close braces on a newline.
- ansible-test pslint - Added the `PlaceOpenBrace <https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/PlaceOpenBrace.md>`_ rule set to enforce open braces on the same line and a subsequent newline.
- ansible-test pslint - Added the `UseConsistentIndentation <https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/UseConsistentIndentation.md>`_ rule to enforce indentation is done with 4 spaces.
- ansible-test pslint - Added the `UseConsistentWhitespace <https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/UseConsistentWhitespace.md>`_ rule to enforce whitespace consistency in PowerShell.
- ansible-test pslint - Updated ``PowerShellScriptAnalyzer`` to 1.20.0
- ansible-test sanity validate-modules - the validate-modules sanity test now also checks the documentation of documentable plugin types (https://github.com/ansible/ansible/pull/71734).
- ansible-test validate-modules sanity test - add more schema checks to improve quality of plugin documentation (https://github.com/ansible/ansible/pull/77268).
- ansible-test validate_modules - allow ``choices`` for return values (https://github.com/ansible/ansible/pull/76009).
- apt - Add support for using ">=" in package version number matching.
- apt - Adds APT option ``--allow-change-held-packages`` as module parameter ``allow_change_held_packages`` to allow APT up- or downgrading a package which is on APTs hold list (https://github.com/ansible/ansible/issues/65325)
- auto inventory plugin will now give plugin loading information on verbose output
- callbacks - Add result serialization format options to ``_dump_results`` allowing plugins such as the ``default`` callback to emit ``YAML`` serialized task results in addition to ``JSON``
- dnf - add more specific error message for GPG validation (https://github.com/ansible/ansible/issues/76192)
- env lookup, add default option
- facts - report prefix length for IPv4 addresses in Linux network facts.
- get_parsable_locale now logs result when in debug mode.
- git - display the destination directory path in error msg when local_mods detects local modifications conflict so that users see the exact location
- iptables - add the ``chain_management`` parameter that controls iptables chain creation and deletion
- jinja2_native - keep same behavior on Python 3.10.
- junit callback - Add support for replacing the directory portion of out-of-tree relative task paths with a placeholder.
- k8s - scenario guides for kubernetes migrated to ``kubernetes.core`` collection.
- module_utils.distro - Add missing ``typing`` import from original code.
- package_facts - add pkg_info support for OpenBSD and NetBSD (https://github.com/ansible/ansible/pull/76580)
- services_facts - Add support for openrc (https://github.com/ansible/ansible/pull/76373).
- setting DEFAULT_FACT_PATH is being deprecated in favor of the generic module_defaults keyword
- uri - Avoid reading the response body when not needed
- uri - Eliminate multiple requests to determine the final URL for file naming with ``dest``
- validate-modules - do some basic validation on the ``M(...)``, ``U(...)``, ``L(..., ...)`` and ``R(..., ...)`` documentation markups (https://github.com/ansible/ansible/pull/76262).
- vmware - migrated vmware scenario guides to `community.vmware` repo.
- yum, dnf - add sslverify option to temporarily disable certificate validation for a repository
Breaking Changes / Porting Guide
--------------------------------
- Module Python Dependency - Drop support for Python 2.6 in module execution.
- Templating - it is no longer allowed to perform arithmetic and concatenation operations outside of the jinja template (https://github.com/ansible/ansible/pull/75587)
- The ``finalize`` method is no longer exposed in the globals for use in templating.
Deprecated Features
-------------------
- ansible-core - Remove support for Python 2.6.
- ansible-test - Remove support for Python 2.6.
- ssh connection plugin option scp_if_ssh in favor of ssh_transfer_method.
Removed Features (previously deprecated)
----------------------------------------
- Remove deprecated ``Templar.set_available_variables()`` method (https://github.com/ansible/ansible/issues/75828)
- cli - remove deprecated ability to set verbosity before the sub-command (https://github.com/ansible/ansible/issues/75823)
- copy - remove deprecated ``thirsty`` alias (https://github.com/ansible/ansible/issues/75824)
- psrp - Removed fallback on ``put_file`` with older ``pypsrp`` versions. Users must have at least ``pypsrp>=0.4.0``.
- url_argument_spec - remove deprecated ``thirsty`` alias for ``get_url`` and ``uri`` modules (https://github.com/ansible/ansible/issues/75825, https://github.com/ansible/ansible/issues/75826)
Security Fixes
--------------
- Do not include params in exception when a call to ``set_options`` fails. Additionally, block the exception that is returned from being displayed to stdout. (CVE-2021-3620)
Bugfixes
--------
- Add a YAML representer for ``NativeJinjaText``
- Add a YAML representer for ``NativeJinjaUnsafeText``
- AnsiballZ - Ensure we use the full python package in the module cache filename to avoid a case where ``collections:`` is used to execute a module via short name, where the short name duplicates another module from ``ansible.builtin`` or another collection that was executed previously.
- Ansible.ModuleUtils.LinkUtil - Ignore the ``LIB`` environment variable when loading the ``LinkUtil`` code
- Ansible.ModuleUtils.SID - Use user principal name as is for lookup in the ``Convert-ToSID`` function - https://github.com/ansible/ansible/issues/77316
- Detect package manager for Amazon Linux 2022 (AL2022) as dnf
- Ensure the correct ``environment_class`` is set on ``AnsibleJ2Template``
- Fix ``AttributeError`` when providing password file via ``--connection-password-file`` (https://github.com/ansible/ansible/issues/76530)
- Fix ``end_play`` to end the current play only (https://github.com/ansible/ansible/issues/76672)
- Fix collection filter/test plugin redirects (https://github.com/ansible/ansible/issues/77192).
- Fix executing includes in the always section in the free strategy (https://github.com/ansible/ansible/issues/75642)
- Fix for when templating empty template file resulted in file with string 'None' (https://github.com/ansible/ansible/issues/76610)
- Fix help message for the 'ansible-galaxy collection verify' positional argument. The positional argument must be a collection name (https://github.com/ansible/ansible/issues/76087).
- Fix module logging issue when using custom module on WSL2 (https://github.com/ansible/ansible/issues/76320)
- Fix task debugger to work with ``run_once`` using ``linear`` strategy (https://github.com/ansible/ansible/issues/76049)
- Fix traceback when installing a collection from a git repository and git is not installed (https://github.com/ansible/ansible/issues/77479).
- Interpreter Discovery - Fallback to OS family if the distro is not found in ``INTERPRETER_PYTHON_DISTRO_MAP`` (https://github.com/ansible/ansible/issues/75560)
- Interpreter discovery - Add ``RHEL`` to ``OS_FAMILY_MAP`` for correct family fallback for interpreter discovery (https://github.com/ansible/ansible/issues/77368)
- Make include_role/include_tasks work with any_errors_fatal (https://github.com/ansible/ansible/issues/50897)
- Parser errors from within includes should not be rescueable (https://github.com/ansible/ansible/issues/73657)
- Prevent losing unsafe on results returned from lookups (https://github.com/ansible/ansible/issues/77535)
- Templating - Ensure we catch exceptions when getting ``.filters`` and ``.tests`` attributes on their respective plugins and properly error, instead of aborting which results in no filters being added to the jinja2 environment
- Trigger an undefined error when an undefined variable is detected within a dictionary and/or list (https://github.com/ansible/ansible/pull/75587)
- _run_loop - Add the task name to the warning (https://github.com/ansible/ansible/issues/76011)
- ``Templar.copy_with_new_env`` - set the ``finalize`` method of the new ``Templar`` object for the new environment (https://github.com/ansible/ansible/issues/76379)
- add_host/group_by: fix using changed_when in a loop (https://github.com/ansible/ansible/issues/71627)
- ansible - Exclude Python 2.6 from Python interpreter discovery.
- ansible-config avoid showing _terms and _input when --only-changed.
- ansible-doc - Fix ansible-doc -l ansible.builtin / ansible.legacy not returning anything
- ansible-doc - ignore plugin deprecation warnings (https://github.com/ansible/ansible/issues/75671)
- ansible-galaxy - Add galaxy_collection_skeleton/galaxy_collection_skeleton_ignore configuration options
- ansible-galaxy - Fix using the '--ignore-certs' option when there is no server-specific configuration for the Galaxy server.
- ansible-galaxy - installing/downloading collections with invalid versions in git repositories and directories now gives a formatted error message (https://github.com/ansible/ansible/issues/76425, https://github.com/ansible/ansible/issues/75404).
- ansible-galaxy - when installing a role properly raise an error when inaccessible path is specified multiple times in roles_path (e.g. via environment variable and command line option) (https://github.com/ansible/ansible/issues/76316)
- ansible-galaxy collection build - Ignore any existing ``MANIFEST.json`` and ``FILES.json`` in the root directory when building a collection.
- ansible-galaxy collection verify - display files/directories not included in the FILES.json as modified content.
- ansible-galaxy publish - Fix warning and error detection in import messages to properly display them in Ansible
- ansible-pull handle case where hostname and nodename are empty
- ansible-test - Add default entry for Windows remotes to be used with unknown versions.
- ansible-test - All virtual environments managed by ansible-test are marked as usable after being bootstrapped, to avoid errors caused by use of incomplete environments. Previously this was only done for sanity tests. Existing environments from previous versions of ansible-test will be recreated on demand due to lacking the new marker.
- ansible-test - Automatic target requirements installation is now based on the target environment instead of the controller environment.
- ansible-test - Correctly detect when running as the ``root`` user (UID 0) on the origin host. The result of the detection was incorrectly being inverted.
- ansible-test - Don't fail if network cannot be disconnected (https://github.com/ansible/ansible/pull/77472)
- ansible-test - Fix Python real prefix detection when running in a ``venv`` virtual environment.
- ansible-test - Fix ``windows-integration`` and ``network-integration`` when used with the ``--docker`` option and user-provided inventory.
- ansible-test - Fix installation and usage of ``pyyaml`` requirement for the ``import`` sanity test for collections.
- ansible-test - Fix path to inventory file for ``windows-integration`` and ``network-integration`` commands for collections.
- ansible-test - Fix plugin loading.
- ansible-test - Fix skipping of tests marked ``needs/python`` on the origin host.
- ansible-test - Fix skipping of tests marked ``needs/root`` on the origin host.
- ansible-test - Fix the ``import`` sanity test to work properly when Ansible's built-in vendoring support is in use.
- ansible-test - Fix the ``validate-modules`` sanity test to avoid double-loading the collection loader and possibly failing on import of the ``packaging`` module.
- ansible-test - Fix traceback in ``import`` sanity test on Python 2.7 when ``pip`` is not available.
- ansible-test - Fix traceback in the ``validate-modules`` sanity test when testing an Ansible module without any callables.
- ansible-test - Fix traceback when running from an install and delegating execution to a different Python interpreter.
- ansible-test - Fix traceback when using the ``--all`` option with PowerShell code coverage.
- ansible-test - Fix type hints.
- ansible-test - Import ``yaml.cyaml.CParser`` instead of ``_yaml.CParser`` in the ``yamllint`` sanity test.
- ansible-test - Limit ``paramiko`` installation to versions before 2.9.0. This is required to maintain support for systems which do not support RSA SHA-2 algorithms.
- ansible-test - Pylint Deprecated Plugin - Use correct message symbols when date or version is not a float or str (https://github.com/ansible/ansible/issues/77085)
- ansible-test - Relocate constants to eliminate symlink.
- ansible-test - Replace the directory portion of out-of-tree paths in JUnit files from integration tests with the ``out-of-tree:`` prefix.
- ansible-test - Sanity tests run with the ``--requirements` option for Python 2.x now install ``virtualenv`` when it is missing or too old. Previously it was only installed if missing. Version 16.7.12 is now installed instead of the latest version.
- ansible-test - Set the ``pytest`` option ``--rootdir`` instead of letting it be auto-detected.
- ansible-test - Show an error message instead of a traceback when running outside of a supported directory.
- ansible-test - Target integration test requirements are now correctly installed for target environments running on the controller.
- ansible-test - The ``import`` sanity test no longer reports errors about ``packaging`` being missing when testing collections.
- ansible-test - Update distribution test containers to version 3.1.0.
- ansible-test - Update help links to reference ``ansible-core`` instead of ``ansible``.
- ansible-test - Update unit tests to use the ``--forked`` option instead of the deprecated ``--boxed`` option.
- ansible-test - Use https://ci-files.testing.ansible.com/ for instance bootstrapping instead of an S3 endpoint.
- ansible-test - Use relative paths in JUnit files generated during integration test runs.
- ansible-test - Use the correct variable to reference the client's SSH key when generating inventory.
- ansible-test - Use the legacy collection loader for ``import`` sanity tests on target-only Python versions.
- ansible-test - Virtual environments managed by ansible-test now use consistent versions of ``pip``, ``setuptools`` and ``wheel``. This avoids issues with virtual environments containing outdated or dysfunctional versions of these tools. The initial bootstrapping of ``pip`` is done by ansible-test from an HTTPS endpoint instead of creating the virtual environment with it already present.
- ansible-test - fix a typo in validate-modules.
- ansible-test - fixed support container failures (eg http-test-container) under podman
- ansible-test compile sanity test - do not crash if a column could not be determined for an error (https://github.com/ansible/ansible/pull/77465).
- ansible-test pslint - Fix error when encountering validation results that are highly nested - https://github.com/ansible/ansible/issues/74151
- ansible-vault encrypt_string - fix ``--output`` option to correctly write encrypted string into given file (https://github.com/ansible/ansible/issues/75101)
- ansible.builtin.file modification_time supports check_mode
- ansible_facts.devices - Fix parsing of device serial number detected via sg_inq for rhel8 (https://github.com/ansible/ansible/issues/75420)
- apt - fails to deploy deb file to old debian systems using python-apt < 0.8.9 (https://github.com/ansible/ansible/issues/47277)
- arg_spec - Fix incorrect ``no_log`` warning when a parameter alias is used (https://github.com/ansible/ansible/pull/77576)
- async - Improve performance of sending async callback events by never sending the full task through the queue (https://github.com/ansible/ansible/issues/76729)
- catch the case that cowsay is broken which would lead to missing output
- cleaning facts will now only warn about the variable name and not post the content, which can be undesireable to disclose
- collection_loader - Implement 'find_spec' and 'exec_module' to override deprecated importlib methods 'find_module' and 'load_module' when applicable (https://github.com/ansible/ansible/issues/74660).
- correctly inherit vars from parent in block (https://github.com/ansible/ansible/issues/75286).
- default callback - Ensure we compare FQCN also in lockstep logic, to ensure using the FQCN of a strategy plugin triggers the correct behavior in the default callback plugin. (https://github.com/ansible/ansible/issues/76782)
- distribution - add EuroLinux to fact gathering (https://github.com/ansible/ansible/pull/76624).
- distribution - detect tencentos and gather correct facts on the distro.
- dnf - ensure releasever is passed into libdnf as string (https://github.com/ansible/ansible/issues/77010)
- extend timeout for ansible-galaxy when communicating with the galaxy server api, and apply it to all interactions with the api
- facts - add support for deepin distro information detection (https://github.com/ansible/ansible/issues/77286).
- first_found - fix to allow for spaces in file names (https://github.com/ansible/ansible/issues/77136)
- gather_facts - Fact gathering now continues even if it fails to read a file
- gather_facts action now handles the move of base connection plugin types into collections to add/prevent subset argument correctly
- gather_facts/setup will not fail anymore if capsh is present but not executable
- git module fix docs and proper use of ssh wrapper script and GIT_SSH_COMMAND depending on version.
- git module is more consistent and clearer about which ssh options are added to git calls.
- git module no longer uses wrapper script for ssh options.
- hacking - fix incorrect usage of deprecated fish-shell redirection operators that failed to honor ``--quiet`` flag when sourced (https://github.com/ansible/ansible/pull/77180).
- hostname - Do not require SystemdStrategy subclasses for every distro (https://github.com/ansible/ansible/issues/76792)
- hostname - Fix Debian strategy KeyError, use `SystemdStrategy` (https://github.com/ansible/ansible/issues/76124)
- hostname - Update the systemd strategy in the ``hostname`` module to not interfere with NetworkManager (https://github.com/ansible/ansible/issues/76958)
- hostname - add hostname support for openEuler distro (https://github.com/ansible/ansible/pull/76619).
- hostname - use ``file_get_content()`` to read the file containing the host name in the ``FileStrategy.get_permanent_hostname()`` method. This prevents a ``TypeError`` from being raised when the strategy is used (https://github.com/ansible/ansible/issues/77025).
- include_vars, properly initialize variable as there is corner case in which it can end up referenced and not defined
- inventory - parameterize ``disable_lookups`` in ``Constructable`` (https://github.com/ansible/ansible/issues/76769).
- inventory manager now respects --flush-cache
- junit callback - Fix traceback during automatic fact gathering when using relative paths.
- junit callback - Fix unicode error when handling non-ASCII task paths.
- module_utils.common.yaml - The ``SafeLoader``, ``SafeDumper`` and ``Parser`` classes now fallback to ``object`` when ``yaml`` is not available. This fixes tracebacks when inheriting from these classes without requiring a ``HAS_YAML`` guard around class definitions.
- parameters - handle blank values when argument is a list (https://github.com/ansible/ansible/issues/77108).
- play_context now compensates for when a conneciton sets the default to inventory_hostname but skips adding it to the vars.
- playbook/strategy have more informative 'attribute' based errors for playbook objects and handlers.
- python modules (new type) will now again prefer the specific python stated in the module's shebang instead of hardcoding to /usr/bin/python.
- replace - Always return ``rc`` to ensure return values are consistent - https://github.com/ansible/ansible/pull/71963
- script - skip in check mode if the plugin cannot determine if a change will occur (i.e. neither `creates` or `removes` are provided).
- service - Fixed handling of sleep arguments during service restarts on AIX. (https://github.com/ansible/ansible/issues/76877)
- service - Fixed service restarts with arguments on AIX. (https://github.com/ansible/ansible/issues/76840)
- service_facts module will now give more meaningful warnings when it fails to gather data.
- set_fact/include_vars correctly handle delegation assignments within loops
- setup - detect docker container with check for ./dockerenv or ./dockinit (https://github.com/ansible/ansible/pull/74349).
- shell/command - only return changed as True if the task has not been skipped.
- shell/command - only skip in check mode if the options `creates` and `removes` are both None.
- ssh connection - properly quote controlpersist path given by user to avoid issues with spaces and other characters
- ssh connection avoid parsing ssh cli debug lines as they can match expected output at high verbosities.
- ssh connection now uses more correct host source as play_context can ignore loop/delegation variations.
- sudo become plugin, fix handling of non interactive flags, previous substitution was too naive
- systemd - check if service is alias so it gets enabled (https://github.com/ansible/ansible/issues/75538).
- systemd - check if service is indirect so it gets enabled (https://github.com/ansible/ansible/issues/76453).
- task_executor reverts the change to push facts into delegated vars on loop finalization as result managing code already handles this and was duplicating effort to wrong result.
- template lookup - restore inadvertently deleted default for ``convert_data`` (https://github.com/ansible/ansible/issues/77004)
- to_json/to_nice_json filters defaults back to unvaulting/no unsafe packing.
- unarchive - Fix zip archive file listing that caused issues with content postprocessing (https://github.com/ansible/ansible/issues/76067).
- unarchive - Make extraction work when the LANGUAGE environment variable is set to a non-English locale.
- unarchive - apply ``owner`` and ``group`` permissions to top folder (https://github.com/ansible/ansible/issues/35426)
- unarchive - include the original error when a handler cannot manage the archive (https://github.com/ansible/ansible/issues/28977).
- unarchive - the ``io_buffer_size`` option added in 2.12 was not accepted by the module (https://github.com/ansible/ansible/pull/77271).
- urls - Allow ``ca_path`` to point to a bundle containing multiple PEM certs (https://github.com/ansible/ansible/issues/75015)
- urls/uri - Address case where ``HTTPError`` isn't fully initialized due to the error, and is missing certain methods and attributes (https://github.com/ansible/ansible/issues/76386)
- user - allow ``password_expiry_min`` and ``password_expiry_min`` to be set to ``0`` (https://github.com/ansible/ansible/issues/75017)
- user - allow password min and max to be set at the same time (https://github.com/ansible/ansible/issues/75017)
- user - update logic to check if user exists or not in MacOS.
- validate_argument_spec - Skip suboption validation if the top level option is an invalid type (https://github.com/ansible/ansible/issues/75612).
- variablemanager, more efficient read of vars files
- vault - Warn instead of fail for missing vault IDs if at least one valid vault secret is found.
- winrm - Ensure ``kinit`` is run with the same ``PATH`` env var as the Ansible process
- yum - prevent storing unnecessary cache data by running `yum makecache fast` (https://github.com/ansible/ansible/issues/76336)
Known Issues
------------
- get_url - document ``check_mode`` correctly with unreliable changed status (https://github.com/ansible/ansible/issues/65687).

View File

@ -1,6 +0,0 @@
Placeholder changelog
=====================
This file is a placeholder; a version-specific ``CHANGELOG-vX.Y.rst`` will be generated during releases from fragments
under changelogs/fragments. On release branches once a release has been created, consult the branch's version-specific
file for changes that have occurred in that branch.

8
changelogs/README.md Normal file
View File

@ -0,0 +1,8 @@
Changelogs
==========
As part of the release process a version-specific `CHANGELOG-vX.Y.rst` will be generated from fragments in
the `fragments` directory.
On release branches once a release has been created, consult the branch's version-specific file for changes that have
occurred in that branch. The `devel` branch does not have a generated changelog, only changelog fragments.

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,12 @@
---
title: Ansible Base
title: ansible-core
release_tag_re: '(v(?:[\d.ab\-]|rc)+)'
pre_release_tag_re: '(?P<pre_release>(?:[ab]|rc)+\d*)$'
changes_file: changelog.yaml
changes_format: combined
keep_fragments: true
always_refresh: true
ignore_other_fragment_extensions: true
mention_ancestor: false
notesdir: fragments
prelude_section_name: release_summary

View File

@ -0,0 +1,2 @@
bugfixes:
- ansible_facts.devices - Fix parsing of device serial number detected via sg_inq for rhel8 (https://github.com/ansible/ansible/issues/75420)

View File

@ -0,0 +1,3 @@
release_summary: |
| Release Date: 2023-05-22
| `Porting Guide <https://docs.ansible.com/ansible-core/2.13/porting_guides/porting_guide_core_2.13.html>`__

View File

@ -0,0 +1,3 @@
release_summary: |
| Release Date: 2023-05-15
| `Porting Guide <https://docs.ansible.com/ansible-core/2.13/porting_guides/porting_guide_core_2.13.html>`__

View File

@ -0,0 +1,3 @@
release_summary: |
| Release Date: 2023-07-18
| `Porting Guide <https://docs.ansible.com/ansible-core/2.13/porting_guides/porting_guide_core_2.13.html>`__

View File

@ -0,0 +1,3 @@
release_summary: |
| Release Date: 2023-07-10
| `Porting Guide <https://docs.ansible.com/ansible-core/2.13/porting_guides/porting_guide_core_2.13.html>`__

View File

@ -0,0 +1,3 @@
release_summary: |
| Release Date: 2023-09-11
| `Porting Guide <https://docs.ansible.com/ansible-core/2.13/porting_guides/porting_guide_core_2.13.html>`__

View File

@ -0,0 +1,3 @@
release_summary: |
| Release Date: 2023-09-05
| `Porting Guide <https://docs.ansible.com/ansible-core/2.13/porting_guides/porting_guide_core_2.13.html>`__

View File

@ -0,0 +1,3 @@
release_summary: |
| Release Date: 2023-10-09
| `Porting Guide <https://docs.ansible.com/ansible-core/2.13/porting_guides/porting_guide_core_2.13.html>`__

View File

@ -0,0 +1,3 @@
release_summary: |
| Release Date: 2023-10-03
| `Porting Guide <https://docs.ansible.com/ansible-core/2.13/porting_guides/porting_guide_core_2.13.html>`__

View File

@ -0,0 +1,3 @@
release_summary: |
| Release Date: 2023-04-24
| `Porting Guide <https://docs.ansible.com/ansible-core/2.13/porting_guides/porting_guide_core_2.13.html>`__

View File

@ -0,0 +1,3 @@
release_summary: |
| Release Date: 2023-04-17
| `Porting Guide <https://docs.ansible.com/ansible-core/2.13/porting_guides/porting_guide_core_2.13.html>`__

View File

@ -1,3 +0,0 @@
bugfixes:
- uri - Don't return the body even if it failed
(https://github.com/ansible/ansible/issues/21003)

View File

@ -1,2 +0,0 @@
minor_changes:
- ssh - connection plugin now supports a new variable ``sshpass_prompt`` which gets passed to ``sshpass`` allowing the user to set a custom substring to search for a password prompt (requires sshpass 1.06+)

View File

@ -1,3 +0,0 @@
---
bugfixes:
- copy - Fixed copy module not working in case that remote_src is enabled and dest ends in a / (https://github.com/ansible/ansible/pull/47238)

View File

@ -0,0 +1,2 @@
bugfixes:
- apt - fails to deploy deb file to old debian systems using python-apt < 0.8.9 (https://github.com/ansible/ansible/issues/47277)

View File

@ -0,0 +1,3 @@
minor_changes:
- uri - Eliminate multiple requests to determine the final URL for file naming with ``dest``
- uri - Avoid reading the response body when not needed

View File

@ -0,0 +1,2 @@
bugfixes:
- Make include_role/include_tasks work with any_errors_fatal (https://github.com/ansible/ansible/issues/50897)

View File

@ -1,4 +0,0 @@
---
bugfixes:
- apt - Fixed the issue the cache being updated while auto-installing its
dependencies even when ``update_cache`` is set to false.

View File

@ -1,2 +0,0 @@
minor_changes:
- Raise error when no task file is provided to import_tasks (https://github.com/ansible/ansible/issues/54095).

View File

@ -1,6 +0,0 @@
bugfixes:
- synchronize - fix password authentication on Python 2 (https://github.com/ansible/ansible/issues/56629)
- >
AnsibleModule.run_command() - set ``close_fds`` to ``False`` on Python 2 if ``pass_fds`` are passed to
``run_command()``. Since ``subprocess.Popen()`` on Python 2 does not have the ``pass_fds`` option,
there is no way to exclude a specific list of file descriptors from being closed.

View File

@ -1,2 +0,0 @@
bugfixes:
- Remove the unnecessary warning about aptitude not being installed (https://github.com/ansible/ansible/issues/56832).

View File

@ -1,2 +0,0 @@
minor_changes:
- apt_repository - Implemented an exponential backoff behaviour when retrying to update the apt cache with new params ``update_cache_retry_max_delay`` and ``update_cache_retries`` to control the behavior.

View File

@ -1,3 +0,0 @@
---
bugfixes:
- Add missing gcp modules to gcp module defaults group

View File

@ -1,4 +0,0 @@
bugfixes:
- combine filter - ``[dict1, [dict2]] | combine`` now raise an error; previously ``combine`` had an undocumented behaviour where it was flattening the list before combining it (https://github.com/ansible/ansible/pull/57894#discussion_r339517518).
minor_changes:
- combine filter - now accept a ``list_merge`` argument which modifies its behaviour when the hashes to merge contain arrays/lists.

View File

@ -1,2 +0,0 @@
bugfixes:
- copy - recursive copy with ``remote_src=yes`` now recurses beyond first level. (Fixes https://github.com/ansible/ansible/issues/58284)

View File

@ -0,0 +1,2 @@
bugfixes:
- uri - properly use uri parameter use_proxy (https://github.com/ansible/ansible/issues/58632)

View File

@ -1,5 +0,0 @@
bugfixes:
- "ansible-test - during module validation, improve alias handling."
- "ansible-test - during module validation, handle add_file_common_args only for top-level arguments."
minor_changes:
- "ansible-test - extend alias validation."

View File

@ -1,2 +0,0 @@
bugfixes:
- Use hostnamectl command to get current hostname for host while using systemd strategy (https://github.com/ansible/ansible/issues/59438).

View File

@ -1,2 +0,0 @@
bugfixes:
- CLI - the `ANSIBLE_PLAYBOOK_DIR` envvar or `playbook_dir` config can now substitute for the --playbook-dir arg on CLIs that support it (https://github.com/ansible/ansible/issues/59464)

View File

@ -1,2 +0,0 @@
bugfixes:
- cron and cronvar - use get_bin_path utility to locate the default crontab executable instead of the hardcoded /usr/bin/crontab. (https://github.com/ansible/ansible/pull/59765)

View File

@ -1,5 +0,0 @@
bugfixes:
- >
group - The group module was not correctly detecting whether a local
group is existing or not with local set to yes if the same group
exists in a non local group repository e.g. LDAP. (https://github.com/ansible/ansible/issues/58619)

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