Compare commits

...

4737 Commits

Author SHA1 Message Date
4e861fa9c8 New release v2.19.0b2 (#85040)
* New release v2.19.0b2

* Revert setuptools version bump
2025-04-24 01:58:00 +00:00
f898f9fec6 Implement TaskResult backward compatibility for callbacks (#85039)
* Implement TaskResult backward compatibility for callbacks
* general API cleanup
* misc deprecations

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

* fix v2_on_any deprecation exclusion for base

---------

Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit 03181ac87b)
2025-04-23 18:08:29 -07:00
4714194672 restore parsing/utils/jsonify.py (#85032)
(cherry picked from commit 2033993d89)
2025-04-23 18:08:29 -07:00
ffbf121182 comment: raise an exception when an invalid option is provided (#84984)
Co-authored-by: Matt Clay <matt@mystile.com>
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
(cherry picked from commit 1daa8412d5)
2025-04-21 10:11:08 -05:00
89a4900b61 normalize error handler choices (#84998)
use existing to avoid deprecation cycle
normalize test too

(cherry picked from commit 2cbb721f6f)
2025-04-21 10:11:08 -05:00
17d4fdd883 Increase galaxy test publish timeout (#85016)
(cherry picked from commit e6dc17cda4)
2025-04-21 10:11:08 -05:00
7fc916361e Fix test_range_templating on 32-bit architectures (#85007)
* Fix test_range_templating on 32-bit architectures

32-bit archtectures like i386, armel, armhf will fail with the error

ansible._internal._templating._errors.AnsibleTemplatePluginRuntimeError: The
filter plugin 'ansible.builtin.random' failed: Python int too large to convert
to C ssize_t

So just pick sys.maxsize (2**31 - 1) so it works on 32 bit machines.

---------

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit 5f6aef95ac)
2025-04-21 10:11:08 -05:00
82ea3addce Miscellaneous fixes (#85012)
* Add help_text to play_hosts deprecation

* clean up TaskResult type handling

(cherry picked from commit 1b6b910439)
2025-04-21 10:11:08 -05:00
98009c811b Disable retries on ansible-galaxy-collection (#85013)
(cherry picked from commit f7d03474a5)
2025-04-21 10:11:08 -05:00
de7c454684 Remove unused local function _get_plugin_vars from vars manager (#85008)
(cherry picked from commit 93e6f012cb)
2025-04-21 10:11:07 -05:00
80d5f05642 Miscellaneous DT fixes (#84991)
* Use `_UNSET` instead of allowing `ellipsis`

* Fix deprecation warning pre-check

* Deprecation warnings from modules can now be disabled.
* Deprecation warnings from modules get the "can be disabled" notice.

* Include help text in pre-display fatal errors

* Simplify lookup warning/debug messaging

* Fix return type of `timedout` test plugin

* Use `object` for `_UNSET`

* Remove obsolete `convert_data` tests

* Remove unnecessary template from test

* Improve legacy YAML objects backward compat

* Fix templar backward compat for None overrides

(cherry picked from commit 6cc97447aa)
2025-04-16 10:55:21 -05:00
ec0d8f3278 Disable parallel publish in galaxy test (#85000)
(cherry picked from commit e094d48b1b)
2025-04-16 10:55:21 -05:00
c21a817c47 filter_core integration test - remove Python 2.6 related dead code (#84985)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
(cherry picked from commit 500a4aba08)
2025-04-16 10:55:21 -05:00
85cb2baf1f get_bin_path('ssh-agent'): required is deprecated (#84995)
(cherry picked from commit 4868effc71)
2025-04-16 10:55:21 -05:00
2fcfad54b0 ansible-doc: fix indent and line wrapping for first line of (sub-)option and (sub-)return value descriptions (#84690)
* Fix initial indent for descriptions of suboptions.
* Fix line width for initial line of option descriptions.

(cherry picked from commit 352d8ec33a)
2025-04-16 10:55:21 -05:00
6f95a618af Convert DT issue template to pre-release template (#84982)
(cherry picked from commit 9ddfe9db39)
2025-04-16 10:55:20 -05:00
19d9253ec9 Update Ansible release version to v2.19.0b1.post0. (#84988) 2025-04-14 18:47:34 +00:00
8d775ddced New release v2.19.0b1 (#84979) 2025-04-14 12:21:05 -05:00
35750ed321 Templating overhaul, implement Data Tagging (#84621)
Co-authored-by: Matt Davis <mrd@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2025-04-14 08:54:36 -07:00
6fc592df9b Fix uninstall tests (#84973)
match file name to package_manager detection of dnf5
2025-04-11 18:55:08 -04:00
3d30e05bb4 ansible-test - Improve runme.sh error handling (#84972) 2025-04-11 20:56:34 +00:00
c54ff7de41 Filter: add support for URL-safe encoding/decoding in b64* (#84949)
* Added support for URL-safe decoding into b64decode
* Added support for URL-safe encoding into b64encode

Fixes: #84147

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-04-11 09:08:02 -07:00
244c2f06ed Add ssh-agent launching, and ssh-agent python client (#84754)
* Add ssh-agent launching, and ssh-agent python client

* Move things around, is this better??

* docs

* postpone creating dir after bin lookup

* fix method name

* changelog ssh agent

* address reviews

* fix typing

* do not redefine public_key

* typing

* more typing

* Catch OSError when starting ssh agent

* likely copy pasted old code

* var type fix

* why is this needed?

ci_complete

* ignoring the change for now

* write out pub key file atomically

* defensive timeout for the socket

* _populate_agent docstring

* do not allow setting these in config

* check expected length before slicing blobs

* test all key types

* remove lock/unlock functionality

* docstring

* private _ssh_agent

* .

* launch agent in cli and ansible_ssh_*

* additional info for ssh-agent comment

* Add tests for remove and remove_all

* comment on os.rename

* hopefully mitigate agent startup/delays problems

* exceptions

* unused import

* fix sanity

* perf

---------

Co-authored-by: Matt Martz <matt@sivel.net>
2025-04-10 15:30:34 -07:00
fcdf0b80b3 git: Document security risk involved in embedding user creds (#84963)
* Provide warning to user about the potential risk involved in
  embedding username and password in git URL while checking out the source.

Fixes: #84557

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-04-10 15:15:42 -04:00
82e4b469f6 respawn: Update ENV dict copy with PYTHONPATH value (#84962)
* Use shallow copy of os.environ to update PYTHONPATH value
  instead of using '|' operator

Fixes: #84954

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-04-10 15:14:24 -04:00
4bc4030988 ansible-pull fix adhoc output inconsistencies on changed (#84869)
Two fixes for single bug:
  - ignore callback changes for adhoc
  - allow 'yaml' change matching
---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-04-10 14:56:52 -04:00
fd76cc2821 Revert "basic: remember the user sensitive information to use later (#84699)" (#84959)
This reverts commit 19e9f3dae2.
2025-04-10 11:19:11 -05:00
16db3fe6c9 fix typo (#84955) 2025-04-10 15:54:40 +00:00
5347d4d4fc distro: detect debian for OS_FAMILY for LMDE 6 (#84941)
Fixes: #84934

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-04-09 16:22:20 -04:00
8b0c4825ae Pin wheel to resolve build issues (#84943) 2025-04-08 22:31:23 -07:00
72909599f6 pipelining fxies (#78111)
Moved check to connection as it should be the final decider
Added property to become plugins to indicate support
Also removed hardcoded su exception
Added tty detection logic for ssh (pipelining won't work if tty is needed or forced)

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2025-04-08 15:53:38 -04:00
a01e58cae3 Support prompt matching with ssh_askpass (#84927) 2025-04-08 10:18:18 -05:00
19e9f3dae2 basic: remember the user sensitive information to use later (#84699)
* Git allows embedding username and password in repo URL for
  https authentication. This may lead to exposing the user sensitive
  information to logs and unautheticated users.
  Adding no_log will partially solve this.
* Added documentation warning user about URL embedded with username
  and password.
* Added logic to remember user sensitive information for later sanitization

Fixes: #84557

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-04-08 09:53:36 -05:00
6a274d8456 Handle forwarded exceptions from dnf5-5.2.13 (#84933) 2025-04-08 09:35:32 -05:00
462affa7c4 Clean up interpreter discovery (#84394)
* Clean up interpreter discovery

- Deprecated `auto_legacy` and `auto_legacy_silent`
- Removed obsolete platform fallback config and logic
- Replaced unit tests with integration tests
- Increased test coverage
2025-04-03 18:07:36 +00:00
b7d76a93b2 Fix up coverage with async on Windows (#84917)
Fixes the coverage collection for Windows and async tasks. This ensures
the async task still has access to the PSHost so that it can access the
runspace debugger tasks on the host.
2025-04-03 12:56:51 +10:00
390e112822 Support download_url without a scheme:host (#84767)
* Support download_url without a scheme:host. Fixes #84213

* Support properly rebuilding pagination links. #84765

* Don't permit non absolute pagination links

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2025-04-02 20:21:41 +00:00
183c695be1 Fix errant warning about client_secret and access_token (#84916) 2025-04-02 10:34:09 -05:00
399d2841c8 Add fallible 2025.4.1 to issue template (#84915) 2025-04-01 23:25:59 +00:00
2a4b1c8248 ansible-config: Dump galaxy server config in proper JSON format (#84912)
Fixes: #84840

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-04-01 11:36:15 -04:00
7d0886457a Windows Exec Runner Update (#84868)
Updates the Windows exec runner in preparation for the WDAC changes.
This new process is designed to improve the way modules are run by
Windows and expose common functionality to run PowerShell code in a
common environment. It also includes futher changes to improve the error
handling to make it easier to see where an error occurred in the running
code.
2025-04-01 11:24:35 +10:00
b3d21e3ad2 Fix apt and dpkg_selections tests (#84900)
* Fix apt and dpkg_selections tests

The tests now support aarch64.
They also have reduced dependencies on URLs hosted on third-party servers.

* Skip tests on unsupported platforms

* Use same package version for both tests

* Fix multi-arch support for Ubuntu 22.04
2025-03-27 09:05:25 -07:00
87422526f5 Expand tests for apt_repository (#84904) 2025-03-27 04:52:24 +00:00
b9e35d66c4 Fix markup for config variable reference. (#84901) 2025-03-26 16:28:31 -04:00
3607f01521 Improve vault filter documentation with clearer examples (#84896)
Fixes: #83583

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-03-26 02:14:48 +00:00
e66aaa66a5 Improve performance of including tasks into the play (#84445)
* Improve performance of including tasks into the play

PlayIterator.add_tasks is used to insert tasks from an include into the
play for particular host. It makes a copy of the current block including
the tasks within the block and inserts the new tasks from the include
into the copied block. But there is no need to make copies of tasks
within the block, what we want is a "shallow" copy of the block. This
PR changes that to copy the block excluding the tasks within.

On a contrived playbook with 50 include_role tasks, each role has 1 task,
running on 10 hosts the running time is reduced from ~55s to ~44s in my
environment.

ci_complete

* Add changelog
2025-03-24 09:39:17 -05:00
5280850130 find: skip ENOENT while enumerating files (#84877)
* skip 'no such file or directory' error code while files and
  directories and report them.

Fixes: #84873

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-03-24 07:37:01 -07:00
1e5aac7b4f Set IPv4 and IPv6 simultaneously (#84829) 2025-03-21 16:19:58 -04:00
e53c12fe2b ansible-test - Update base/default containers (#84874) 2025-03-20 13:25:55 -07:00
3690819ee8 Fix wait_for examples (#84870)
connection: local is wrong as configured remote python does not always match controller
missing the timeout to wait 300s before error
2025-03-20 16:03:26 -04:00
f4aafe1a94 ansible-test - Update pylint requirement (#84872) 2025-03-20 17:18:03 +00:00
35665db4ed Miscellaneous integration test fixes (#84871) 2025-03-20 16:48:02 +00:00
091994a477 ansible-test - Update sanity test requirements (#84866) 2025-03-20 01:21:56 +00:00
b7a5411d8b ansible-test - Improve pep8 compat with black (#84867) 2025-03-20 01:17:01 +00:00
7e7946b60d Require Jinja2 3.1.0 or later (#84864) 2025-03-20 00:21:26 +00:00
ad5cf37625 Add typing_extensions for core unit tests on <3.11 (#84865) 2025-03-20 00:00:07 +00:00
0d4f00f5c8 needed intesect, not difference (#84839)
fixes #84750

Added tests to verify output when using smart + others
2025-03-19 10:41:30 -04:00
61a6222e0e uri: form location correctly from relative redirect (#84541)
* uri: form location correctly from relative redirect

Previously, the original URL would be combined with the relative location incorrectly, especially for URL of any complexity.

Add simple tests demonstrating the problem that fail without the fix

* fix pylint error, import the method similar to other uri methods

* add changelog fragment

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-03-18 15:54:48 -04:00
101e2eb19a windows async - refactor async wrapper code (#84712)
Refactor the async wrapper and watchdog scripts for Windows. This
attempts to avoid WMI on connection plugins that allow breaking away
from a job like winrm and ssh as an optimisation and changes how WMI is
used so that we can get the error details on a failed process more
easily.

These changes are being made also in preparation for the WDAC
implementation that requires this new execution model where input needs
to be provided through stdin.
2025-03-19 04:47:32 +10:00
611d8bdde3 doc-build: fix doc builds (#84852)
Fixes: #84849

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-03-18 16:20:50 +01:00
ac43e40904 darwin: simplify the fact code (#84848)
* Follow up for code review on #84779

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-03-18 14:21:30 +00:00
8127abbc29 Don't inherit stdio (#82770) 2025-03-17 10:08:11 -05:00
3684b4824d Remove reliance on sshpass and utilize SSH_ASKPASS (#83936)
* Add SSH_ASKPASS as an alternative means to provide ssh with passwords
2025-03-17 10:07:44 -05:00
2e7e5b65e7 🧪 Drop venv when making coverage XML @ CI
This deletes the fallback that would use `--venv` when `--docker` is
unavailable in `ansible-test`. But this option is present in all
supported versions of Ansible as it was added in v2.12 which is EOL
already.

PR #84819
2025-03-13 12:24:37 +01:00
9821a4de2f pipe/lines: simplify explanation for need for quotes (#84816)
* do not mention subprocess.Popen, it is an implementation detail
* use "shell injection vulnerability" to describe the problem that is
  well-known, or easily searched for on $search_engine and do not link
  to a 3rd-party site that is also specific to a tool for Python
2025-03-12 17:04:31 +01:00
4efb01c2f3 ansible-test - Replace FreeBSD 13.4 with 13.5 (#84812) 2025-03-11 15:21:38 -07:00
f11dfa7cce dnf5: use new pkg_gpgcheck option, fallback to deprecated one (#84791) 2025-03-11 18:11:57 +01:00
44966cb8e2 Update Fallible issue template (#84808) 2025-03-11 16:32:17 +00:00
df08ed3ef3 🔥 Remove Python 2 datetime compat fallbacks
This patch marks the `ansible.module_utils.compat.datetime` module as deprecated, including `UTC`, `utcfromtimestamp()`  and `utcnow` shims that it provides, scheduling its removal for v2.21.

It also replaces any uses of the compatibility helpers with non-deprecated calls to CPython stdlib.

PR #81874

Co-authored-by: Matt Clay <matt@mystile.com>
2025-03-11 17:19:40 +01:00
50b4e0d279 facts: use pagesize for darwin (#84779)
Fixes: #84773

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-03-11 15:40:46 +00:00
fc71a5befd Added Popen warning to lines.py documentation (#84806) 2025-03-11 16:38:13 +01:00
7fbaf6cfcf dnf5: fix is_installed check for provided packages (#84802)
Fixes #84578
2025-03-11 16:27:13 +01:00
7e0d8398ff Implement an informative reporter for resolvelib
Prior to this change, when the dependency resolver started looping over multiple versions of the same collection due to backtracking, it might take a lot of time to consider and disregard tens or hundreds of versions. But to the end-user, it looks like “nothing is happening, the program is *stuck*”. Even worse if such a time-consuming backtracking hits multiple collections and it “hangs” for longer cumulative period of time.

This patch improves the perceived responsiveness by printing out informational messages with the current status whenever the backtracking for a collection happens for the first, the eighth and the thirteenth times. The last message also reminds them that they can interrupt the process and attempt to adjust the constraints.

In debug mode, it also shows what caused conflicts leading up to candidate rejections. But this is only available with `resolvelib >= 0.9.0`.

The improvement is heavily inspired by https://github.com/pypa/pip/commit/9731131.

PR #81709

Co-Authored-By: Jordan Borean <jborean93@gmail.com>
2025-03-10 12:57:09 +01:00
09391f38f0 dnf tests: unique environment/group name (#84785)
Prevents `Group state for \"customenvgroup\" not found` error which may
or may not be a regression in dnf5. Just name groups/envs uniquely to
workaround the issue.
2025-03-06 11:28:19 +01:00
c02ad3516f Adjust fallible issue template (#84776)
This should provide missing details the bot is looking for.
2025-03-04 23:16:45 -08:00
532e3ea3ec test: error handling in include_role (#84737)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-03-04 15:17:01 +00:00
9bed0413ec Deprecate the paramiko connection plugin. Fixes #83757 (#84727) 2025-03-04 09:05:28 -06:00
00067f1d2e Limit respawn to supported python versions (#83662)
* Limit respawn to supported python versions
2025-03-04 08:43:39 -06:00
96a8c04207 Add issue template for Fallible Data Tagging (#84766) 2025-03-03 11:47:58 -08:00
9ef623a517 Integration test cleanup (#84763)
This brings in integration test fixes from the data tagging PR which are unrelated to DT changes.
2025-03-01 03:11:46 +00:00
650ee5abf8 core: update b64encode and b64decode doc (#84757) 2025-02-28 17:37:38 +01:00
4a710587dd 🧪 Add macOS 15.3 to CI and ansible-test (#84665) 2025-02-25 18:55:03 +01:00
5ff8d093f0 ansible-test - Code style cleanup (#84749)
* ansible-test - Minor style cleanup (add blank lines)

* ansible-test - Use `"""` instead of `'''`
2025-02-25 04:47:45 +00:00
e9e6001263 winrm - Remove pexpect kinit code (#84735)
Removes the use of pexpect in the winrm connection plugin and rely on
just subprocess. In the past pexpect was used for macOS compatibility so
that it could handle the TTY prompt but after testing it seems like
subprocess with `start_new_session=True` is enough to get it reading
from stdin on all platforms. This simplifies the code as there's no
longer an optional library changing how things are called and will work
out of the box.
2025-02-25 04:59:04 +10:00
bddb9a7490 ansible-test - Support target testing with black (#84744) 2025-02-24 17:09:38 +00:00
989e583356 ansible-test - Initial support for black in core (#84741) 2025-02-24 08:39:59 +00:00
2a3c93f593 Deprecate strategy plugins (#84728)
* Deprecate strategy plugins. Fixes #84725
2025-02-19 14:28:55 -06:00
e5ec1ee76c Windows - Support WDAC Audit Mode (#84730)
Fix up bug when attempting to run any module on a Windows host that has
been configured with WDAC and Dynamic Code Security in audit mode. This
does not enable WDAC support with signed scripts so Ansible will still
not pass the audit events but it no longer fails to run.
2025-02-20 05:13:29 +10:00
a742e20fca ansible-test validate-modules - fix ps util checks (#84610)
* ansible-test validate-modules - fix ps util checks

Fix the module util import checks done by `ansible-test sanity --test
validate-modules` to support the newer `#AnsibleRequires` import
statement and `-Optional` flag.

* Fix sanity issues
2025-02-19 07:42:22 +10:00
d21788a9b4 Fix integration tests on debian (#84379)
* Simplify conditional for service_facts integration test

This test requires systemd, so just test for that. Also fixes running this on
Debian testing/unstable releases, where ansible_distribution_version is "n/a".

* Clean up after service_facts integration test

* Simplify set_fact in interpreter_discovery_python test

Those vars are always set, either to something discovered, or "n/a". There are
no evaluations against the value "unknown".

* interpreter_discovery_python: Fix Debian test

Debian doesn't set VERSION_ID in /etc/os-release on pre-releases, see
https://bugs.debian.org/1008735

ansible 2.17 onwards does not support python 2.7 anyway.

* fix deb822_repository integration test failure on Debian

* Fix integration test hostname for Debian

* Fix integration test mount_facts

Some VMs might only have a single mount point, so they only have a single UUID.

* Add package deps for integration test subversion

/usr/bin/htpasswd is shipped in apache2-utils and needed by the main playbook.

* Fix integration test "service" on Debian sid

Debian sid does not set ansible_distribution_version, as such any tests assuming
it's a numeric value will fail. Since this is ancient test code that predates
ansible_service_mgr, remove the error-prone heuristic and rely on that var
instead.

* Fix service integration tests not running on *BSD

---------

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
2025-02-18 13:33:24 -08:00
7a091bf486 Ensure implicit flush_handlers have a parent block (#84709)
* Ensure implicit flush_handlers have a parent block

To avoid getting tracebacks when calling methods like ``get_play()`` on
them.

* task needs to be copied

* copy only when necessary
2025-02-18 08:42:36 -06:00
55e9e21ded better error message for malformed documentation (#84705)
No the file name that caused the error will be apparent
---------

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-02-17 16:12:14 -05:00
cc30f25c42 Make timeout on become an unreachable error (#84589)
* Make timeout on become an unreachable error

Fixes #84468
2025-02-17 08:49:50 -06:00
478806e668 Minor typo fixes (#84714)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-02-14 16:47:18 -05:00
5d7b8288f8 Fix local connection and become issues (#84700)
* Fixed various become-related issues in `local` connection plugin.
* Fixed various issues in `sudo` and `su` become plugins.
* Added unit and integration test coverage.

Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Matt Davis <nitzmahone@redhat.com>
2025-02-13 09:17:57 -08:00
a4d4315d37 non-confrontational by default (#84707) 2025-02-12 09:40:36 -06:00
ea2fe793aa Extend description for meta refresh_inventory (#84691)
* Link to amazon.aws.aws_ec2 inventory plugin.

* Mention that refresh_inventory does not update the selected hosts for a play.

* Address comments by bcoca.

* Apply suggestions from code review

---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-02-11 12:00:42 -08:00
fd30ba8ce0 clarify check_mode (#84703)
fixes #84701
2025-02-11 16:54:06 +00:00
b27b8068f9 re: maxsplit is now keyword argument (#84702)
* Passing maxsplit and flags as positional arguments is deprecated in
  3.13.

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-02-11 10:45:02 -05:00
21492e27fa Add openSUSE MicroOS to SUSE family list (#84685)
* Add openSUSE MicroOS to SUSE family list

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-02-11 10:27:10 -05:00
411b7985a5 test: Enable group tests for Alpine (#84652)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-02-11 10:10:08 -05:00
d0110ff691 test: enable user test for alpine (#84644)
* test: enable user test for alpine

* Disable user home update tests

* Disable some more tests which are not applicable for Alpine

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-02-11 10:09:29 -05:00
d049e7b1b3 fix broken ansible-galaxy-collection resolvelib test (#84626) 2025-02-11 10:03:58 -05:00
a086c34a91 linear - don't treat end_role as a run_once task (#84673) 2025-02-11 08:54:39 -06:00
8d65900974 template: update links to docs (#84689)
Changed the URL to Jinja project
2025-02-10 07:43:49 -08:00
cdb1ce000a Fix is_pinned property of Requirement (#81812)
Previously, requirement version specs starting with `!=` were
incorrectly considered as pinned release requests because the
comparison was being made against a one-char string while the
operator is two-char. This patch changes the check to test against `!`
which is enough to detect this case.
2025-02-08 00:01:23 +01:00
333ee8d010 Test include_vars reserved variable matching (#84678)
* Add test case for include_vars

* Revise test to catch erroneous warnings
2025-02-07 16:15:59 -05:00
ee49adfaf4 🧪🔥 Delete the egg-info integration test (#84686)
Previously, the integration test depended on luck. `setuptools` used
to be bundled in Python stdlib's `ensurepip`. Python 3.12 and newer no
longer include it. This test imports `pkg_resources` that is a part of
`setuptools`, meaning that it'll run out of luck at some point, under
newer Python runtimes.

This test does not seem to be useful to us so instead of fixing it, we
remove it from the repo [[1]].

Supersedes #84681.

[1]: https://github.com/ansible/ansible/pull/84681#discussion_r1945525317
2025-02-07 19:43:29 +01:00
6724e076dd Fix 1GB example in human_to_bytes.yml
Fixed an incorrect example, where the expected output given had evidently been copied from an earlier example accidentally.

PR #84684
2025-02-07 18:30:23 +01:00
f3ccd78cce ansible-test - Update base/default containers (#84670) 2025-02-05 02:09:06 +00:00
cd881bf71e ansible-test - Add pytest-mock to mypy sanity test (#84669) 2025-02-05 00:58:48 +00:00
7594243fc0 ansible-test - Update sanity test requirements (#84667) 2025-02-04 15:03:34 -08:00
21bc1d915d ansible-test - Fix warning message grammar (#84666) 2025-02-04 19:58:21 +00:00
4b38456e4f ansible-test - Correct CLI arg type and annotation (#84664) 2025-02-04 17:53:14 +00:00
4cc47307ef Use separate venvs for each release command (#84641)
This avoids requirements conflicts between different commands invoked by the release tool.
2025-01-30 08:31:36 -08:00
a6b5861c53 add lightweight core issue template for bot-ignored issues (#84638) 2025-01-29 18:18:48 -08:00
48d71ba3aa [fix] warn_if_reserved expects a list (#84624)
Fixes #84623
2025-01-28 18:46:10 +00:00
8290912eb1 service_facts: skip unwanted lines in openrc output (#84622)
* rc-status commands returns unwanted lines with service names
  and their status. Skip such lines while parsing service names

Fixes: #84512

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-28 16:19:46 +01:00
6db6d1967e connection: raise exception return by SSH (#84592)
Fixes: #58133

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-28 16:05:37 +01:00
ce392dd86e Revert "generator: add support for extra vars usage (#84544)" (#84619)
This reverts commit 186c716af1.
2025-01-27 17:59:29 -08:00
e6adddcaf8 debug: hide loop variables while using var (#84597)
Fixes: #65856

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-23 15:00:32 -08:00
03d6209862 apt_key: fix module names in docs (#84588)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-22 08:46:04 -06:00
c9097f73a2 uri: Handle HTTP exception raised (#84015)
* Handle HTTP exceptions raised when reading the content
  such as IncompleteRead

Fixes: #83794

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-21 21:39:28 +00:00
186c716af1 generator: add support for extra vars usage (#84544)
* generator: add support for extra vars usage

Fixes: #83270

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

* CI green

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

* Review requests

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

* Review requests II

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

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-21 15:20:51 -05:00
4953fc7b26 Apt key bye (#84555)
* apt-key module updates due to debian removal

Still kept for now for backwards compat, but removing from testing when not present
And adding more explicit mesasges to errors to point to new module

* added docs and error msg

* clog

* aslkdfj

* no docs to document doc changes

* also add warning to apt_repository

* clog on apt_repo too

* fix string concat

* Apply suggestions from code review

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

---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-21 14:45:38 -05:00
689c047e3a Update win_dirname and win_basename docs (#84587)
* Updated docs and examples for win_dirname and win_basename for UNC path

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-21 09:57:14 -08:00
b51ec9412e cache: deprecated API first_order_merge (#84568)
* deprecated legacy method first_order_merge

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-21 09:33:22 -08:00
df7e1befb4 stdout callback first comment (#84533)
so we know its a rule, not just implementation accident
2025-01-21 11:02:03 -05:00
3b6d086f5e targets/handlers: fix incorrect test cmd (#84567) 2025-01-21 10:38:03 -05:00
8c5e33cd3a Ansible.Basic - Fix required_if check (#84562)
Fixes the Ansible.Basic `required_if` check when the option to check is
either unset or explicitly set to null.
2025-01-21 05:00:03 +10:00
f86c58e2d2 ssh - Improve CLIXML stderr parsing (#84569)
Improves the logic for parsing CLIXML values in the stderr returned by
SSH. This fixes encoding problems by having a fallback in case the
output is not valid UTF-8. It also can now extract embedded CLIXML
sequences in all of stderr rather than just at the start.
2025-01-21 04:42:12 +10:00
3398c102b5 reserved vars, avoid gather_subset (#84575) 2025-01-17 21:33:25 -05:00
675d7201d8 fix template (#84563)
also fix gather_subset warning and add some comments/notes
---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-16 16:33:43 -05:00
35a712588e filters/flatten: fix input documentation (#84477)
Flatten input is a list, not a dictionary.
2025-01-15 14:26:29 -05:00
ad93b96750 host_group_vars - remove unnecessary os.path.join cache (#84549) 2025-01-14 14:55:33 -05:00
3030c79331 user: Fix homedir permissions when UMASK is unset in /etc/login.defs
When a user doesn't exist and user module is used to create the user and the
homedir, adduser is called which parses HOME_MODE from /etc/login.defs, and when
not set calculates the mode from UMASK from the same file.

When a user already exists without homedir, and the user module is used to add a
home dir, it incorrectly ignores HOME_MODE, resulting in a world-readable home
dir when UMASK is not set. This is for example the case in Debian trixie and
later, and likely Ubuntu 25.04 and later.


Signed-off-by: Lee Garrett <lgarrett@rocketjump.eu>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-14 11:44:16 -08:00
5623a386c1 Fix unit and integration tests (#84554)
This is a follow-up to https://github.com/ansible/ansible/pull/84473
2025-01-14 09:27:39 -08:00
7677bf1c9b ansible-test - Use urllib intead of curl (#84551)
Also added automatic retries on HTTP request exceptions, since all currently implemented methods (GET/PUT/DELETE) are idempotent.
2025-01-14 08:59:42 -08:00
a046ef5a95 fix incongruent ansible-vault cli options (#84494)
prompt now only errors if stdin is specifically triggered and not due to lack of other args

fixes #84489
---------

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2025-01-14 10:46:52 -05:00
73180c0630 ansible-vault integration test fix (fixes: #83837) (#84486)
Correct the test that expects an error when using ansible-vault to write against
a non-writeable dir. Skip the test as root, as root can always write.

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
2025-01-14 15:46:31 +00:00
5b0d170496 get_url: add support for BSD-style digest (#84485)
* Added support for BSD-style digest file to test
  checksum of downloaded file.

Fixes: #84476

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-14 15:44:29 +00:00
f727d74fc2 Allows iptables chain creation with wait parameter (#84491)
* Allows iptables chain creation with wait parameter

Fixes #84490

* Add the changelog fragment for 84490
2025-01-14 10:43:08 -05:00
8588401387 User: Update prompt for SSH key passphrase prompt (#84521)
* update prompt for SSH key passphrase prompt
* introduce timeout in SSH key passphrase interaction

Fixes: #84484

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-14 10:35:31 -05:00
d79b706c06 fix[doc.py]: path will be undefined (#84464)
* fix[doc.py]: path will be undefined and a direct reference will throw an UnboundLocalError.

If none of the files in files exists, path will be undefined and a direct reference will throw an UnboundLocalError.
Repair function file parameter type annotation is inaccurate

* Update changelogs/fragments/fix-cli-doc-path_undefined.yaml

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

---------

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2025-01-14 15:33:43 +00:00
e151cd765d with_dict type error include value in error message (#84473)
* with_dict better error message

* include type in error message

* changelog fragment

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

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

* specific wording

---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-14 10:21:56 -05:00
4c30e8b6cf .github: simplify PR templates (#84536)
It is rare that we need to provide information like "before and after
the change". In majority of cases we just ignore "Additional
information" when submitting PRs. We can just put the needed information
into the summary if needed and remove the section from the template,
simplifying it.
2025-01-14 15:04:43 +01:00
ae55f874a0 Enforce FQCNs in seealso plugin/module entries. (#84325) 2025-01-13 17:24:09 -05:00
508c4dc93e Update ticketing stubs (#84535)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-13 12:04:50 -08:00
60e2135c2b Bump acme test container to 2.3.0 (#84547) 2025-01-13 11:24:56 -08:00
40d364985d host_group_vars - fix Python API traceback caused by undefined 'key' variable (#84488)
Fixes:

Traceback (most recent call last):
  File "/home/shertel/ansible/lib/ansible/plugins/vars/host_group_vars.py", line 139, in get_vars
    FOUND[key] = found_files = loader.find_vars_files(opath, entity_name)
          ^^^
UnboundLocalError: cannot access local variable 'key' where it is not associated with a value

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/shertel/ansible/lib/ansible/plugins/vars/host_group_vars.py", line 151, in get_vars
    raise AnsibleParserError(to_native(e))
ansible.errors.AnsibleParserError: cannot access local variable 'key' where it is not associated with a value
2025-01-13 11:51:49 -05:00
eb475e23f7 ansible-test - Update utility containers (#84545) 2025-01-11 01:09:48 +00:00
20baf29a2a fix warnings about reserved variable names to cover all sources (#84432)
Also remove redundant check from tqm
Now covers module output (set_fact/include_vars)
Includes play objects at any stage (tasks that error were not covered)
Added tests, moved them to role structure
2025-01-10 18:03:18 +00:00
96f7090acc Use ECR Public for container test (#84537) 2025-01-09 21:16:01 -08:00
477433c5ba constructed, let users know some limitations (#84510)
* constructed, let users know some limitations

reasons https://forum.ansible.com/t/debugging-constructed-inventory-constructing-group-from-values-of-host-variables/39443

* fix indent

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

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

* updated as per fb

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-01-09 16:18:23 -05:00
64cbb71e6e FIX get_options function for CallbackBase (#84496) 2025-01-08 11:26:42 -05:00
ed250ecd0a 📝 Update the outdated WGs+community links in GH issues (#84523)
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2025-01-08 13:07:04 +00:00
ecadbc6354 📝 Drop drop-down default note from issue forms (#84524)
Co-authored-by: flowerysong <junk+github@flowerysong.com>
2025-01-08 14:00:26 +01:00
3b77277428 ansible-test - Fix FreeBSD instance CA certs (#84529)
Some versions and architectures come with `ca_root_nss` pre-installed.
However, at least FreeBSD 13.4 on aarch64 does not.
This change ensures the certificates will always be installed.
2025-01-07 19:17:35 -08:00
1b3face065 ansible-test - Replace FreeBSD 14.1 with 14.2 (#84527)
* ansible-test - Replace FreeBSD 14.1 with 14.2

* Remove cron faketime testing from FreeBSD
2025-01-07 17:15:27 -08:00
f552fe2c15 ansible-test - Replace RHEL 9.4 with 9.5 (#84526) 2025-01-07 15:11:33 -08:00
35c4b58c11 ansible-test - Replace Alpine 3.20 with 3.21 (#84525) 2025-01-07 14:37:35 -08:00
648dcd3a6a ansible-test - Replace Fedora 40 with 41 (#84281)
* ansible-test - Replace Fedora 40 with 41

Also update other distro containers to remove unnecessary packages:

* apache2
* subversion
* ruby

* Fix subversion test on Ubuntu

Also remove obsolete vars files from subversion test.

* Skip dnf test on Fedora 41+

The dnf5 test is all that is needed.

* Support dnf5 for the package test

* Extend unix-chkpwd work-around for Fedora
2025-01-07 13:46:48 -08:00
3a33d8a4c1 Add Keycloak service account auth capability to ansible-galaxy (#83145) 2025-01-07 12:02:22 -06:00
91f4b71d40 Fix uri integration test on Python 3.13 (#84518) 2025-01-06 17:50:34 -08:00
eb6d581286 ansible-test - Update nios-test-container to 7.0.0 (#84517) 2025-01-06 15:59:58 -08:00
5ec236b564 Fix result_pickle_error integration test (#84506)
The test has been updated to use a custom type which does not support pickling,
instead of relying on Jinja's `Undefined` type. As of Jinja 3.1.5 that type now
supports pickle, which breaks the original implementation of the test.
2025-01-02 19:59:16 -08:00
f72aa1dc0c test: Update regex for required and default in FieldAttributes (#84209)
Fixes: #61460

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2025-01-03 02:14:56 +00:00
db44fc58ec Added docstrings to V2 methods in the CallbackBase Class (4 & 5 of 27) (#83507)
* Added docstrings to V2 methods in the CallbackBase Class (4 & 5 of 27)

* Made corrections as requested by webknjaz.

* Cleaned up whitespace issues.

* Corrections to customization note for review by webknjaz.

* Added rtype to return in docstrings.

* Simplified docstrings.


Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
2024-12-30 21:58:10 +01:00
cae4f90b21 Add documentation for non-numeric cron scheduling values (#84396)
- Document vixie cron compatible non-numeric values
- State which parameters cannot be used together with special_time
2024-12-17 12:48:58 -05:00
c64c389007 gather_facts, fix 'smart' handling with network os and 'setup' (#84425)
gather_facts, fix network_os and smart logic and defaults

setup will be default for smart only if network_os is not set, now you get warnings and errors when missing a valid facts module for a network os

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-17 10:19:43 -05:00
01ca9b1d0e uri: move follow_redirects to module_utils (#84442)
* url lookup and uri module shares follow_redirects parameter,
  moving it module_utils code.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-10 08:08:24 -08:00
106909db8b adding option for form-multipart data to switch multipart encoding (#80566)
* adding option for form-multipart data to switch multipart encoding from default base64 to 7or8bit encoding

Co-authored-by: davlas <david.lassig@bwi.de>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2024-12-10 07:54:23 -08:00
3fffddc183 Added None/empty notes to regex_search (#84437) 2024-12-10 07:51:49 -08:00
73d8f4ad46 Make sure we are always using Lock from our multiprocessing context (#84453)
* Make sure we are always using Lock from our multiprocessing context

* add clog frag
2024-12-10 10:38:57 -05:00
563906687b Fix a debug message error (#84426) 2024-12-10 10:13:22 -05:00
3c91eab0d8 copy, prevent internal options in task (#84422)
* copy, prevent internal options in task

fixes #84367
2024-12-10 10:07:12 -05:00
f0f5d7f88b simplify copy module (#84313)
* simplify redundancy with AnsibleModule set_*_if_different methods

* simplify copying a source directory to a dest directory without modifying behavior
2024-12-10 09:09:15 -05:00
363c57b311 csvfile - let the config system do the typecasting (#82263)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-06 16:15:17 +00:00
ac110eb012 lookup_template: added trim_blocks option (#84254)
* Allow user to control the trimming of blocks while templating
* Added tests
* Updated documentation and example

Fixes: #75962

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-06 15:44:08 +00:00
0f466bb75f test: Remove dead code (#84436)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-05 14:52:12 -08:00
d500354798 unarchive: Clamp zip timestamps on 32-bit time_t (#84409)
Clamp zip timestamps to representible values when unpacking zip files on
platforms that use 32-bit time_t (e.g.  Debian i386). This is a
non-issue in practice (in 2024), but should allow the test suite to pass
on Debian i386.

We use a round value of 2038-01-01 00:00:00 for simplicity, and to avoid
running into timezone offsets closer to the actual limit.

MR #81520 introduced sanity-checking tests that used dates not
representable with a 32-bit time_t.
2024-12-05 17:26:58 -05:00
af2bb2c182 wait_for_connection - test connection=local does not emit warning (#84438)
Add test for PR 84421
2024-12-05 17:24:48 -05:00
59d9737788 fix reset_connection with templated connection variables (#84240)
* ssh: Test reset_connection with templated ansible_ssh_executable

Add failing test to confirm subsequent fixes are necessary & sufficient.

* ssh: Fix reset_connection with templated ansible_ssh_executable

Signed-off-by: Alex Willmer <alex@moreati.org.uk>
2024-12-05 15:54:46 -05:00
Fil
eed6d48046 Fix failed_when string in the second ansible.builtin.uri example (#84382)
Open the double quotes at the beginning of the entire `failed_when` value.

Individual conditions work well, yet fail each time they are combined with a logic `or` (as per the example).

Double quoting the entire string solved the problem.
2024-12-05 20:20:27 +00:00
e2b454f4e3 wait_for_connection: fix errant warning for local connection(s) (#84421)
This prevents "[WARNING]: Reset is not implemented for this connection" when
using wait_for_connection with localhost or other local hosts.

It's arguable (from a consistency/correctness perspective) that
`ansible.plugins.connection.local.Connection.reset()` should call
`Connection.close()`. I went for a no-op on the basis of "if it aint broke
don't fix it", and erred on the side of keeping existing semantics. However
either option would be fine with me.
2024-12-05 14:56:14 -05:00
5208cffd91 document decrypt also works on strings (#84412) 2024-12-05 14:54:23 -05:00
b154e38e54 config lookup, fixes and tests (#84398)
* Integration tests for lookup_config

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-05 11:19:34 -08:00
6d21e28c73 Fix non-root integration tests failure (#84378)
* Fix callback_default integration test for non-root users

This test compares the test output to previously collected output. However, this
previously assumed that the tests are run as root, even though needs/root in
aliases is not set.

So instead parameterize the output, and use sed to replace the value that
diverge when running it as different users.

* integration tests: Ensure temp file removal doesn't fail as non-root user

* Don't fail when ansible-galaxy integration test runs as non-root

* Update integration test callback list

---------

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
2024-12-05 14:17:29 -05:00
1ad0c404ef Coverage for virtual/sunos.py (#84357)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-03 09:11:49 -08:00
2ca086c993 Coverage for virtual/hpux.py (#84362)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-03 10:41:56 -05:00
5b231bbbdb test coverage for virtual/sysctl.py (#84356)
* test coverage for virtual/sysctl.py

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-03 10:33:30 -05:00
df0fe81383 Changed human_to_bytes input to a string (#84336)
For it to be a human readable description it can't be an int.
2024-12-03 10:18:37 -05:00
27aa60b8b4 Added examples for password_hash (#84322)
Fixes: #84318

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-03 15:14:48 +00:00
5100aa3977 fix documentation about avoiding apt_key (#84326) 2024-12-03 10:14:37 -05:00
803cf7df41 Add ansible_uptime_seconds support for AIX (#84321)
Added ansible_uptime_seconds fact for AIX

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-03 10:12:39 -05:00
92cf41aa46 Additional tests for lookup_sequence (#84315)
* Additional tests for lookup_sequence

* Follow up for https://github.com/ansible/ansible/pull/83758,
  to add tests for stride parameter.
---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-03 10:06:29 -05:00
9588215601 Removed deprecated include_delegate_to param (#84306)
* Removed deprecated include_delegate_to param

* Remove deprecated include_delegate_to param from
  get_vars API in manager.py

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

* Make ignore.txt

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-12-03 10:04:32 -05:00
cf4276f560 package_facts: extend note about python3-rpm to cover Fedora 41+ (#84373)
Fedora 41 no longer has python3-rpm installed by default either,
so package_facts blows up on Fedora 41 hosts unless you make sure
python3-rpm is installed first. Not sure we can do a lot about
this besides extending this note.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-11-29 11:19:07 -05:00
f9b58fa13f ansible-test - fix coverage for test modules (#84366)
Fixes the coverage path translation for modules located in integration
test paths. Instead of trying to match by the unique temporary path name
that the module is executed as, the reporting tool will translate it to
the static path that the module is actually located under.
2024-11-27 13:43:06 +10:00
f2a77b071e Test aliases fix (#84377)
* integrity tests: Tag (destructive) root tests as such

- apt_key needs root to touch the apt key database
- debconf needs root to change debconf values of system packages
- gathering writes to /etc/ansible/*, writeable only to root
- group creates system groups
- noexec mounts/umounts a ramdisk
- systemd requires root to start/stop services

Mark all except noexec as "destructive" as they change the state of the system.

* integration test cron requires root, as it calls setup_cron

* integration test dpkg_selection runs dpkg as root

* integration test facts_linux_network requires root

It adds/removes IP addresses from network interfaces, requiring root for that.

* integration test package requires root

installs/removes system packages

* Integration test service requires root

Creates/starts/stops/removes systemd services

* integration test user requires root to create users

* integration tests using setup_test_user require root

---------

Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
2024-11-25 16:43:40 -08:00
2a53b851fe dnf5,apt: add auto_install_module_deps option (#84292)
* dnf5,apt: add auto_install_module_deps option

Fixes #84206
2024-11-21 10:06:18 -06:00
95e3af3e0f ansible-test - Improve container network detection (#84323)
When detection of the current container network fails, a warning is now issued and execution continues.
This simplifies usage in cases where the current container cannot be inspected, such as when running in GitHub Codespaces.
2024-11-19 10:49:24 -08:00
c99493eb3f dnf5 - consolidate package resolving settings (#84335)
Fixes #84334
2024-11-19 18:00:35 +01:00
a27a7a27d1 dnf5: fix is_installed check (#84275)
Fixes #84259
2024-11-19 09:32:04 +01:00
3e82ed307b include_vars - fix including new hash variables when hash_behaviour is set to merge (#84303) 2024-11-14 13:50:14 -05:00
e14f9fe725 Sequence query fix (#83758)
Co-authored-by: flowerysong <junk+github@flowerysong.com>
2024-11-13 19:46:57 -08:00
c734ac2125 vars/varnames more examles more varied (#84300)
also ref each other in seealso as they will commonly be used toghether
2024-11-12 16:05:37 -05:00
32eacecca9 Deprecated libvirt_lxc_noseclabel config (#84287)
* Deprecated libvirt_lxc_noseclabel config

* deprecate moved libvirt_lxc_noseclabel config

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

* Make CI green I

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

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-11-12 16:13:45 +01:00
ca0810da85 Add tests for deprecations (#84284)
* Check for module deprecation
* Check for module option deprecation
* Check for plugin deprecation

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-11-12 16:09:39 +01:00
e404bc17f7 package_facts fix empty packages on foreign mgr (#83855)
* package_facts fix empty packages on foreign mgr

return the first package manager that provides output

add tests with fake rpm on apt machines
2024-11-12 08:36:26 -05:00
3befdd3d15 Fix runas become SYSTEM logic (#84280)
Fixes the logic when attempting to become the SYSTEM user using the
runas plugin. It was incorrectly assumed that calling LogonUser with the
SYSTEM username would produce a new token with all the privileges but
instead it creates a copy of the existing token. This reverts the logic
back to the original process and adds in new logic to avoid any tokens
that are restricted from creating new processes.
2024-11-12 09:16:22 +10:00
52ecd3664a ansible-test - align 2025 connection defaults to CI matrix (#84291) 2024-11-11 09:07:35 +10:00
9d249432c4 Increase scope of mypy sanity test (#84288)
* Increase scope of mypy sanity test

* Fix issues reported by mypy
2024-11-09 02:58:29 +00:00
7501bbec20 Add support for Windows Server 2025 (#84285)
Adds Windows Server 2025 to the testing matrix.
2024-11-08 12:28:20 +10:00
bf48b538f8 command module, fix docs to reflect reality (#84191)
though the previous docs were the 'intended' outcome,
the current behaviour has been active for a long time and should
not be removed due to backward compatibility issues.

One thing we can do going forward is deprecate substitution enabled by default.
2024-11-07 16:22:40 -05:00
a98801903d ansible-test - Replace FreeBSD 13.3 with 13.4 (#84236)
* ansible-test - Replace FreeBSD 13.3 with 13.4
* ansible-test - Fix typos in bootstrap.sh
* Skip libfaketime on FreeBSD except FreeBSD 14
2024-11-07 13:19:26 -08:00
1d61f2a4fd remove ignore clauses for module uri (#83642)
Co-authored-by: flowerysong <junk+github@flowerysong.com>
2024-11-07 14:56:51 +00:00
31cde0ebd1 user: create Buildroot subclass as alias to Busybox (#83666)
Fixes: #83665
2024-11-07 14:45:32 +00:00
157ef04b1e Add --flush-cache option to ansible-pull (#84211) 2024-11-06 11:40:15 -05:00
771f7ad29c update ansible-galaxy resolvelib requirement to >= 0.5.3, < 2.0.0 (#84218)
* Update resolvelib upperbound to 2.0.0

Minor SemVer releases should not contain breaking changes

* Test the latest minor release and reduce number of resolvelib versions tested for efficiency
2024-11-06 10:20:26 -05:00
68bfa37838 ansible-test - Fix interactive cmd traceback (#84264) 2024-11-05 23:50:34 +00:00
9cdd6e58b3 Fixed ipv6 pattern in parse_address (#84237) 2024-11-05 08:05:21 -08:00
a99d66e6c7 Removed deprecated STRING_CONVERSION_ACTION (#84245)
Fixes: #84220

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-11-05 16:27:12 +01:00
49b22d4d6b Python binary should not be python at first try for env-setup.fish (#84212) 2024-11-05 16:13:52 +01:00
abf6036bb2 Link to role argspec docs. Fixes #84164 (#84192) 2024-11-04 17:06:58 -06:00
f92e99fd8f test: fix check_required_by (#84153)
* Update the documentation for check_required_by
* Fix return value for check_required_by (now returns empty list on success)

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-11-02 10:36:45 -07:00
c49e94017a Improvements for the create-bulk-issues.py script (#84235)
* Improve error handling for create-bulk-issues.py

* Add support for setting assignee

* Add example YAML to feature --help output.

* Add additional help message for token issues.
2024-11-01 15:15:59 -07:00
32ae3ce117 Remove encrypt unit tests for undocumented algorithms, which are disallowed in 2.19. (#84219) 2024-11-01 13:21:24 -04:00
8784469b4c encrypt: raise error on passing unsupported passlib hashtype (#84186)
* Raise an AnsibleFilterError when unsupported passlib hashtype is
  provided in do_encrypt.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-31 15:27:37 +00:00
2c6b78f516 Add --flush-cache option for ansible and ansible-console (#84149)
* Allow CLIs that accept inventory options to flush the inventory cache(s) and fact cache

Fixes #83749
2024-10-30 14:59:01 -04:00
03acb22f99 Fix returning unreachable for looped tasks (#84049)
* Fix returning unreachable for looped tasks

Add tests for ignore_unreachable and loop
2024-10-30 10:35:23 -04:00
a3b58fb67c Add a test using ignore_errors as a variable (#84175)
* Add a regression test for https://github.com/ansible/ansible/issues/32384
2024-10-29 16:32:17 +01:00
3a40ba3b2c Remove deprecated pycompat24 and importlib (#84161)
* Removed deprecated pycompat24 and importlib

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

* Make CI green

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

* Ignore basic.py

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

* Make CI green III

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

* Make CI green IV

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

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-29 16:14:01 +01:00
1b46b5923e Change changelog type from bugfixes to removed_features (#84158)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-29 16:09:20 +01:00
f29b46e438 Remove deprecated plural form of collection path (#84156)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-29 16:07:20 +01:00
d662a8d088 Enable file module to disable diff_mode (#83700)
Several tasks within the modification_time.yml and state_link.yml task
lists have explicitly enabled diff_mode because these tests previously
assumed a diff attribute would always be returned from the file module.
2024-10-25 18:32:11 +00:00
ab1a8cb3b3 docs: print deprecation collection name (#84126)
While showing the deprecation message, mention the collection name
from which the module is removed.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-25 11:20:11 -07:00
c9ac477e53 Preserve _ansible_no_log from action result; fix include_vars to set properly (#84143)
* fixes for CVE-2024-8775

* propagate truthy `_ansible_no_log` in action result (previously superseded by task-calculated value)
* always mask entire `include_vars` action result if any file loaded had a false `show_content` flag (previously used only the flag value from the last file loaded)

* update no_log tests for CVE-2024-8775
* include validation of _ansible_no_log preservation when set by actions
* replace static values with dynamic for increased robustness to logging/display/callback changes (but still using grep counts :( )

* changelog

* use ternary, coerce to bool explicitly
2024-10-24 22:56:54 +00:00
11e4a6a722 user module avoid conflicts ssh pub key (#84165)
Remove pub key if we are going to generate private
fix tests for os X
2024-10-24 14:39:51 -04:00
b1816880cb Remove deprecated compat.selector (#84155)
* Removed files related to selector compat

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-23 14:54:40 +00:00
1e6ffc1d02 Fixed broken tests (#84088)
* Add `match=` in pytest.raises
* Remove redundant assert statements

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2024-10-18 14:11:33 -07:00
1727bbecce test: Remove unreachable tests (#83696)
variable_manager unit tests are unreachable. These tests
are already covered in integration tests.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-18 12:23:40 -07:00
53ceb74e84 Use open with context manager (#83337)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-18 10:53:11 -07:00
f7766cf843 Trim selinux_policytype @ integration tests (#84136)
The shell command sometimes prints a trailing whitespace which breaks
the tests on old RHELs. This patch is supposed to fix that.
2024-10-18 09:25:40 -07:00
c6e166319a test: use password to generate random string instead of range (#84129)
* Use password lookup instead of range
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-17 19:17:42 +00:00
42e2f09b97 Faster host removal from a handler (#84091)
In ``Handler.notify_host`` we ensure that ``Handler.notified_hosts`` can contain
particular host at most once. Therefore for removing a host it should be
faster to use ``list.remove`` which removes the first item in the list,
as opposed to using list comprehension removing all such items.
2024-10-17 08:33:39 +02:00
4f6276d72d Remove configuration options that were moved to inventory plugins now that ansible-config supports plugin types. (#84130) 2024-10-16 15:39:15 -04:00
663f7f3b56 test for gathering FIPS facts (#83266)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-16 12:35:12 -07:00
279de623d0 Use dict comprehension instead (#83680)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-16 12:33:07 -07:00
671c797aa1 Remove unnecessary code (#84085)
* os.setsid does not return anything, so remove code which relying
  on return value

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-15 07:59:01 -07:00
58cb8ca4fa feat: checksum_algo param for find module (#83014)
Co-authored-by: shirann <shirannx@gmail.com>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <webknjaz@redhat.com>
2024-10-11 11:02:39 -07:00
48be6f8b6f ansible-test - Improve container probe error handling (#84109) 2024-10-10 22:58:38 +00:00
6aaac6cab3 service_facts: add FreeBSD support (#82556)
new freebsd scanner using 'their version' of service cli tool
also avoid loading the linuxy service scanner when freebsd
2024-10-10 14:22:21 -04:00
b3950bc864 Add NoReturn annotations in module_utils (#84106) 2024-10-10 16:58:27 +00:00
56bab1d097 Enable bad-docstring-quotes pylint rule for core (#84100)
* Enable bad-docstring-quotes pylint rule for core

* Ignore previously bulk update in git blame
2024-10-09 21:57:05 +00:00
a0495fc314 Update triple single quotes to triple double quotes (#84099)
* Update triple single quotes to triple double quotes

This change was fully automated.

The updated Python files have been verified to tokenize the same as the originals, except for the expected change in quoting of strings, which were verified through literal_eval.

* Manual conversion of docstring quotes
2024-10-09 21:22:35 +00:00
62ce21b6e4 ansible-test - Work around pylint issue on 3.11 (#84094) 2024-10-09 17:19:55 +00:00
83671ecb39 ansible-test - Enable pylint docstyle for tests (#84092)
This cleans up the implementation of the pylint sanity test and enables the docstyle extension rule `bad-docstring-quotes` for tests.

The rule will be enabled for the rest of ansible-core once automated cleanup has been performed on existing docstrings.
2024-10-09 15:38:32 +00:00
0b661438a0 ansible-test - Update base/default containers (#84089) 2024-10-08 18:33:04 -07:00
7e57c0fb3d Fix copyright format for gather_facts and mount_facts as documented (#84087) 2024-10-08 17:11:06 -07:00
955e310b4c Cover unit tests with mypy (#84084)
* Added support for testing unit tests with mypy.
* Added support for ignoring individual mypy error codes.
* Added missing assert on unit tests and marked xfail.
* Added type hints for some unit tests.
* Added ignores for unit tests not passing mypy.
* Fixed incorrect autouse argument in unit test fixtures.
* Fixed minor issues causing problems with mypy in unit tests.
2024-10-08 13:29:37 -07:00
18c6b40e19 Update unique filter docs (#84078)
* Correct case_sensitive example
* Add attribute docs

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-08 12:09:07 -07:00
0959472bc6 user module, avoid chmoding symlink'd home file (#83956)
also added tests

---------
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2024-10-08 13:15:34 -04:00
f3b956a7ef docs: unique add missing settings (#84076)
add the `case_sensitive` setting
2024-10-08 17:35:35 +02:00
f1f0d9bd53 PlayIterator: skip tasks from already ran roles (#83793)
... so strategies do not have to filter them.
2024-10-08 07:28:02 +02:00
d0df3a174a ansible-galaxy - fix ignoring certs when installing from git repos (#83332)
* Fix installing collections|roles from git repos with GALAXY_IGNORE_CERTS

* Fix installing collections from git repos with --ignore-certs

* Update unit test

* Add test case
2024-10-07 18:42:49 -04:00
50604e8461 ansible-test - Update astroid for pylint sanity test (#84054) 2024-10-04 13:18:07 -07:00
3cf308f672 ansible-test - Disable pylint deprecated-* rules (#84050) 2024-10-04 08:31:46 -07:00
0f4f05ebe4 Implicit flush_handlers inherit play tags (#83968) 2024-10-04 09:47:28 +02:00
ee9e6130a7 Fix error message given by ansible.module_utils.facts.timeout.timeout (#83945)
* Update unit test

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2024-10-03 21:54:54 +00:00
9406ed3109 ansible-test - Update sanity tests and default Python (#83998)
* ansible-test - Update sanity test requirements
* ansible-test - Default to Python 3.13 in base/default containers
* ansible-test - Fix incorrect AnyStr type hints
2024-10-03 09:59:56 -07:00
d6d2251929 Reduce number of implicit meta tasks (#84007)
This greatly reduces run time on large inventories since meta tasks are
executed in the main process sequentially and just executing them is expensive.

This change avoids running the following implicit meta tasks:
  * ``flush_handlers`` on hosts where no handlers are notified
  * ``noop`` for the linear strategy's lockstep, instead hosts that are
    not executing the current task are just not part of the current host loop

A playbook consiting of two simple plays both running on ~6000 hosts
runs in:
devel: 37s
this PR: 1.3s

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2024-10-03 16:02:02 +02:00
02e00aba3f file: simplify the code (#84043)
* Remove unnecessary code
* Make code simple to read

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-03 06:53:09 -07:00
f593eb42a3 get_url: properly parse filename in content-disposition (#83748)
Since we don't really care about the type we don't have to
query for it and just retrieve the filename value.
Unfortunately we cannot use module_utils.urls.get_response_filename
as we don't have the response object, so just utilize
email.message.Message to parse the filename
instead of manually doing the work ourselves.

Fixes: #83690
2024-10-03 15:36:42 +02:00
b3c4154e86 Use sentinel everywhere (#84041)
* Use sentinel everywhere

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-02 15:49:35 -07:00
9abc651cd6 ansible-test - Update nios-test-container to 6.0.0 (#84042) 2024-10-02 16:37:37 +00:00
bebc192c3e remove one ignore clause for module copy (#83643)
---------
Co-authored-by: flowerysong <junk+github@flowerysong.com>
2024-10-02 13:53:58 +00:00
4c8fb12fc2 cron: return stdout and rc for cron command (#83290)
Co-authored-by: Jack Farzan <jfarzan@adobe.com>
2024-10-01 14:45:27 -07:00
79e8c4c26c debconf: set empty password value (#83217)
Fixes: #83214

---------
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-10-01 11:48:57 -04:00
fb7fd51b93 Prevent condor from being installed and fulfilling libfmt dependency (#84023) 2024-09-30 11:11:22 -05:00
f97adb4c5d Add additional logging for SSH runtime output timeouts and escalation messages (#84008)
Signed-off-by: Yuri Savinkin <stkwar@gmail.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-09-30 11:26:21 -04:00
3d40db1ac0 INVENTORY_IGNORE_EXTS stop ignoring ini (#84001)
* INVENTORY_IGNORE_EXTS stop ignoring ini

Originally added to avoid configuration files for inventory scripts
now clashes with the much more common ini inventory files.

* add a note to script plugin

* Update lib/ansible/plugins/inventory/script.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-09-26 12:15:34 -07:00
34f8f55d9e facts: Skip path if the distribution path is directory (#84012)
* facts: Skip path if the distribution path is directory

Skip path if the distribution path is directory instead of file.
Handle exception raised while handling distribution path.

Fixes: #84006

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

* Review requests

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-09-26 15:05:57 -04:00
21fee95af7 package/dnf action plugins: better facts failure msg (#83995) 2024-09-26 09:19:00 +02:00
facf9186b4 Test entry points with editable install (#84002)
This allows collection of code coverage for the entry points.
2024-09-24 11:23:20 -07:00
0c8efa29b2 Ansible Errors, Don't hide stacked messages when yaml (#83933)
Also remove redundant msg now that we fixed yaml case
So no more need to %s % e.

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-09-24 13:58:41 -04:00
8caa32a558 split: Fix incorrect example result of the split builtin filter (#83982)
The following Python output proves that the second member of the resulting list should be " a", not "a":

```txt
$ python3 
Python 3.12.3 (main, Sep 11 2024, 14:17:37) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> string = "jojo is, a"
>>> string.split(',')
['jojo is', ' a']
```
2024-09-24 17:33:25 +02:00
f4e2e206b3 Add basic validation for action_groups (#83965)
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2024-09-24 17:15:43 +02:00
0a100c7f06 dnf5: fix tb when plugins API is not available (#83969)
Follow up on https://github.com/ansible/ansible/pull/83105
2024-09-24 10:52:20 +02:00
c0fb71a642 Move ansible-deprecated ignores for tests inline (#83989) 2024-09-23 17:33:01 -07:00
491a87215a zap changelogs (#83988) 2024-09-23 16:20:13 -07:00
1b8bfd40ab bump devel to 2.19 (#83985) 2024-09-23 15:29:06 -07:00
b5263c2c10 isidentifier: Remove Python 2 specific code (#83688)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-09-23 20:41:08 +00:00
7693c892fa ansible-test - Use Python version in pylint contexts (#83984) 2024-09-23 13:40:10 -07:00
bf8da52aac ansible-galaxy - fix the usage for role/collection install (#83979) 2024-09-23 10:04:45 -04:00
aa24e97435 dnf5: re-introduce `state: installed` alias (#83961)
Fixes #83960
2024-09-23 09:33:38 +02:00
6efb30b43e Do not convert floats to ints when there is truncation (#83864)
Adjusted error messages
fixed tests
removed py2 compat tests, since no more py2

Co-authored-by: Matt Clay <matt@mystile.com>
2024-09-20 10:06:15 -04:00
40ade1f84b Add mount_facts module (#83508)
* Add a mount_facts module capable of gathering mounts skipped by default
fact gathering

* By default, collect mount facts from standard locations including
/etc/mtab, /proc/mounts, /etc/fstab, /etc/mnttab, /etc/vfstab, and on AIX,
/etc/filesystems.

When no file-based source for the current mounts can be found
(like /proc/mounts), the module falls back to using mount as a source.
This allows BSD and AIX to collect the existing mounts by default, without
causing Linux hosts to use both /proc/mounts and mount output.

* Non-standard locations and "mount" can be configured as a sources.

* Support returning an aggregate list of mount points in addition to first
found.

When there are multiple mounts for the same mount point in an
individual source, a warning is given if the include_aggregate_mounts
option is not configured.

* Add options to filter on fstypes and devices (supporting UNIX shell
wildcards).

* Support configuring a timeout and timeout behavior to make it easier
to use the module as a default facts module without risking a hang.

* Include the source and line(s) corresponding to a mount for easier
debugging.

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2024-09-19 15:05:05 -04:00
9ab63986ad ansible-test no longer needs special casing in __main__.py (#83962) 2024-09-19 09:56:46 -05:00
85d9a40aac Clarify galaxy CLI --help about install locations (#83919)
* add descriptions for `ansible-galaxy install` and `ansible-galaxy role|collection install`

* fix the usage for installing roles and collections together and include collections in the description for -r

Closes #81159

Co-authored-by: Alan Rominger <arominge@redhat.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
2024-09-18 15:07:21 -04:00
bcee35385b timedout extended (#83953)
* timedout extended

* add timedout test
2024-09-18 09:58:30 -05:00
f00e3d7762 Update communication links for the forum (#83862)
* update communication details in README

* update comms details in contributing

* update comms details in issue templates

* add link to contributors guide

* point to devel for comms
2024-09-16 12:43:29 +01:00
b5ae8a382b runas - create new SYTEM token for become (#83827)
Instead of re-using the token used in impersonation, this change will
create a new token for the SYSTEM account as returned by LogonUser. The
benefits of this is that the token will contain the full privileges for
the SYSTEM account rather than potentially one that has restricted
privileges we used during impersonation. It should also help avoid
problems on Windows that fails on status 0x0000016F when the
impersonated token during become was from a process that is restricted
from creating sub processes.
2024-09-13 14:25:58 +10:00
33d4ba8fa2 file module: Clarify the docs that the force parameter works for hardlinks too (#83913) 2024-09-11 11:05:16 +02:00
47e64dc371 service_facts, fix systemd/ubuntu failed reporting (#83424)
Avoid check description, better comments
2024-09-10 13:32:52 -04:00
d58988d8ff fact gathering, mounts, fixes for single proc code and tests (#83866)
* Fact gathering fix 'no shm' branhc

* Use concurrent.futures instead of multiprocessing

This entirely avoids the need for fallback logic since the concurrent.futures thread pool does not depend on `/dev/shm`.

Co-authored-by: Matt Clay <matt@mystile.com>
2024-09-10 12:15:29 -04:00
31d73b0645 Replace binary_modules Makefile with Python script (#83925)
Also update the platform list:

* Remove linux ppc64le
* Add darwin arm64
2024-09-09 15:06:36 -07:00
a84fa50096 ansible-test - Update base/default containers (#83930) 2024-09-09 20:54:02 +00:00
cf2a4a85da ansible-test - Update sanity test requirements (#83921) 2024-09-09 11:22:28 -07:00
cd342f76b4 release.py - Use changelog requirements (#83920)
Use the changelog sanity test requirements instead of the package-data sanity test requirements.

This enables removal of most package-data sanity test requirements, as they are no longer used by the test itself.
The additional requirements were being maintained only to provide pinned requirements for building the changelog during a release.
2024-09-09 10:49:04 -07:00
11e56d9c27 iptables, use existing validation (#83907)
also remove redundant  and wrong test
2024-09-06 16:57:05 -04:00
59b3e49d70 Stop suggesting easy_install in hacking (#83909)
It's been discouraged for the past decade. And CPython actually ships
with pip nowadays, that is bundled within the built-in `ensurepip`
stdlib module.
2024-09-06 17:13:06 +02:00
9c49fdd86d delay keyword changed from int to float (#83901)
* delay keyword changed from int to float

* draft test

* fixed test

* expanded test, fixed 'name' tests also

* cleanup

* fix
2024-09-06 14:50:35 +10:00
0f6b58b5f2 Update subset.yml (#83908)
Typo error in examples
2024-09-06 05:52:38 +10:00
4fa512406b loop_control "early exit" feature (#62151)
* add a loop_control break_when directive to break out of a loop after any item

* remove loop var as normal exit would

* example usage:

- name: generate a random password up to 10 times, until it matches the policy
  set_fact:
    password: "{{ lookup('password', '/dev/null', chars=character_set, length=length) }}"
  loop: "{{ range(0, 10) }}"
  loop_control:
    break_when:
      - password is match(password_policy)

Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
2024-09-05 10:16:23 -04:00
e3ccdaaa2e release.py - Include pyproject.toml in git add (#83892) 2024-09-03 21:27:50 -07:00
b544ac13ec release.py - Add missing setuptools arg to prepare (#83887)
* release.py - Add missing setuptools arg to prepare

This allows the prepare command to accept the `--no-setuptools` argument.

It also fixes a traceback when using the `prepare` command.

* Use a more accurate type hint
2024-09-03 15:05:26 -05:00
24e5b0d4fc Add DaemonThreadPoolExecutor impl (#83880)
* Add DaemonThreadPoolExecutor impl
* Provide a simple parallel execution method with the ability to abandon timed-out operations that won't block threadpool/process shutdown, and without a dependency on /dev/shm (as multiprocessing Thread/Process pools have).
* Create module_utils/_internal to ensure that this is clearly not supported for public consumption.
2024-09-03 11:23:38 -07:00
1a4644ff15 psrp - Remove extras lookups (#83760)
* psrp - Remove extras lookups

Removed the extras variable lookups for the psrp connection plugin. All
valid options are already documented and the extras functionality is
slated to be deprecated at a future point in time. This should have
affect on existing user's playbooks.

* Fix up sanity tests and add explicit boolean conversion test
2024-09-02 11:58:46 +10:00
1503805b70 Add location on include_tasks fail inside include (#83876)
Adds the datastore details to the parser error when attempting to
include tasks that contain include_tasks without a filename set. This
change will now display the exact location of the include_tasks that
failed like any normal syntax error.
2024-09-02 06:21:30 +10:00
4346430003 ansible-test - Reduce scope of empty-init test (#83878) 2024-08-30 16:46:45 -07:00
49490d92c3 Update boilerplate sanity test (#83879)
The `annotations` future can now be imported as `_annotations`.
2024-08-30 16:36:20 -07:00
8b8a249d26 Remove references to IRC or Google Groups (#83875) 2024-08-30 05:25:17 +10:00
9d42b34ed3 Fix Windows entries in test matrix (#83873)
The display names need to be set so code coverage reporting works.
2024-08-29 11:07:01 -07:00
9a5a9e48fc Improve testing for Windows SSH and other connection plugins (#83834)
Expands the test matrix used for testing on Windows to cover the three
connection plugins we support for all the tasks. This change also
changes how raw commands are run over SSH to avoid starting a
`powershell.exe` process that was uneeded in the majority of cases used
in Ansible. This simplifies our code a bit more by removing extra
Windows specific actions in the ssh plugin and improves the efficiency
when running tasks.
2024-08-29 06:27:16 +10:00
db04499f58 ansible-test - Update nios-test-container to 5.0.0 2024-08-28 10:58:40 -07:00
1f987423fd Print the name of the option being deprecated (#83761)
Fixes #83759
2024-08-27 11:59:10 +02:00
c6a391c8d8 fix delegate_to integration test (#83865)
* the test was previously passing erroneously due to the `timeout` elapsing in CI, and that the `failed` test does not encompass `unreachable`
2024-08-26 17:54:08 -07:00
2a676ff897 copy, fix permissions and atime on diff partitions (#83824)
we just set time also, when on diff partitions
2024-08-26 14:22:15 -04:00
faf446a895 runtime-metadata sanity test: do not fail deprecation version checks if galaxy.yml has empty version (#83831)
* Do not create invalid SemanticVersion objects.
* Fix SemanticVersion.parse().
* Add basic runtime-metadata tests.
2024-08-26 13:59:34 -04:00
bed9a9597a galaxy-cli tasking polling interval from environment variable (#83803)
Added configuration options, including environment variables to control the polling 
No-Issue

---------
Signed-off-by: James Tanner <tanner.jc@gmail.com>
Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Jordan Borean <jborean93@gmail.com>
2024-08-26 10:14:50 -04:00
b5e0293645 powershell - Improve CLIXML parsing (#83847)
Improves the logic used when parsing CLIXML to support all escaped
character sequences and not just newlines.
2024-08-23 11:10:12 +10:00
9b0d2decb2 Handle authentication errors and token expiration (#83695)
Fixes #70019
2024-08-22 13:57:02 -05:00
5ab5f23487 dnf: stop filtering exceptions by matching on text (#83297)
* Rely on dnf.base.remove, no special handling isn't needed,
  let the dnf internals figure out what is needed to be done.
  This is more in line with what dnf cli does.

* "already installed" in Exception (if it is even a thing) should be
  caught by special exceptions like MarkingError or CompsError. This
  appears to be a historic check that is no longer needed.

Supersedes: #83295
2024-08-21 15:45:28 +02:00
69fb629355 Fix up raw_params for ansible.windows modules (#83830)
* Fix up raw_params for ansible.windows modules

Fixes up the logic for detecting if using ansible.windows.win_command or
ansible.windows.win_shell with _raw_params. These two modules are
special in that they can be referenced in 4 different ways but the
ansible.windows collection specific prefix needs to be manually added to
the list.

* Fix up sanity issue
2024-08-20 08:59:07 +10:00
718ce13673 connection plugins: extras fix (#83353)
Currently we match the load name, which can be an fqcn, but most users expect the 'naked' name
Now plugins can declare that name by setting _extras_prefix property or fallback to 'non fqcn' if no extras prefix
2024-08-19 11:20:34 -04:00
90de03be50 Gather mount facts, fallback for when multiproc is not feasable (#83750)
* fallback to 'single threaded gathering' for when multiproc fails

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2024-08-19 10:25:29 -04:00
520fa688ba ssh and psrp - Support more complex characters in fetch_file (#83753)
* ssh and psrp - Support more complex chars in fetch_file

Fixes the psrp and ssh (with piped) fetch function to work with paths
that contains glob like characters in the path. For Windows this was
needed when using paths that contain `[]` in the path. For ssh this was
a problem with FreeBSD when using the piped transfer method with similar
characters.

Also tidies up the psrp logic to not inject the paths and buffer size
in the script but pass it as an object through an argument/parameter.

* Fix sanity check
2024-08-19 04:21:24 +10:00
dec49e6288 Add explicit winrm/psrp tests for HTTP and HTTPS (#83769) 2024-08-16 08:30:33 +10:00
430aaa1960 Fix tests when running against SSH target 2024-08-15 13:40:42 -07:00
81e025b414 ansible-test - Add Windows remote connection option 2024-08-15 13:40:42 -07:00
a3ee846a64 Use a venv in more integration tests (#83799)
* Use venv for pause test
* Use venv for debugger test
* Use venv for builtin_vars_prompt test
2024-08-14 17:10:05 -07:00
6eb16faed2 ansible-test - Update base/default containers (#83796) 2024-08-14 20:40:10 +00:00
da02611c48 ansible-test - Update sanity test requirements (#83795)
* Remove PyYAML pin for yamllint sanity test
* Freeze sanity test requirements
2024-08-14 19:00:59 +00:00
ab624ad031 ansible-test - Remove generation of egg-info (#83786)
Also remove egg-info generation from hacking/env-setup scripts.
2024-08-14 09:03:51 -07:00
26375e7f12 fix copy module update atime/mtime (#83235)
Ensure we force mtime/atime update when using copystat

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2024-08-14 14:43:12 +00:00
89137cb5a0 Add end_role meta task (#83263)
ci_complete
2024-08-13 16:48:59 -05:00
fe7e68bfcb Fix ansible-vault integration test for missing vault ids (#83777)
* Fix broken, circumvented test for missing vault ids

* verify the command returns a non-zero exit code

Co-authored-by: Matt Clay <matt@mystile.com>
2024-08-13 17:20:39 -04:00
9a54ba5a39 Ensure skipped loop iteration register var is available (#83756)
Fixes #83619
2024-08-13 12:48:49 -05:00
5c84220dbb Fix meta tasks breaking host/fork affinity with host_pinned (#83438)
Fixes #83294
2024-08-13 10:39:00 -05:00
a0f9bbf3f3 ini lookup: add new interpolation option (#83773)
Fixes #83755
2024-08-13 11:04:42 -04:00
b25afbb4e9 Suppress cryptography warnings for paramiko (#83772) 2024-08-12 17:28:27 -07:00
68515abf97 Drop use of setup.py and setup.cfg (#81443) 2024-08-12 13:54:29 -05:00
2b91c57c85 atomic_move - fix creating file in directory with setgid bit (#83718)
* fix creating file in directory with setgid bit

* add a test using the copy module's content option to create a file in a directory with setgid bit

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2024-08-12 10:34:20 -04:00
0d6b034103 Enable validation of subkeys in rpm key module (#83716)
* Enable validation of subkeys in rpm key module

A gpg subkey may change while the primary key remains the same. Due to
this behavior, there are situations where validation of the primary gpg
key fingerprint is not sufficient because the desired target is actually
the gpg subkey. This change allows the user to validate against either
the fingerprint of the primary gpg key or its subkey.

Signed-off-by: Kellin <kellin@retromud.org>

* Improve tests, add multi-fingerprint

- Improve tests to cover all cases
- add multi fingerprint validation

Signed-off-by: Kellin <kellin@retromud.org>
2024-08-12 10:13:39 -04:00
7b74de069c fix: COLOR_INCLUDED to colorize included output (#83711)
adds color included configuration and applies to include message

Co-authored-by: Achille Myette <amyette@drw.com>
2024-08-09 10:26:21 -04:00
e4d7286298 use diff intermediate var to preserve functionality (#83738)
add tests
2024-08-08 15:18:00 -04:00
797e6bb220 Add vaulted_file test (#83717)
* Add vaulted_file test
* fix is_encrypted_file while we are here
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2024-08-08 15:14:05 -04:00
97a60c1e86 Fix csvfile test - quote file argument (#83751)
file was intended to be a string, not an undefined variable
2024-08-08 13:06:53 -04:00
d9f1866249 Deprecate remaining safe evals (#83293) 2024-08-08 08:41:52 +02:00
59ca05b709 ansible-test - Update default and distro containers (#83736) 2024-08-06 19:47:43 -07:00
a301ae876e try disabling negative values win_reboot test (#83735)
* hoping to improve CI stability
2024-08-06 18:34:57 -07:00
70be017f02 ansible-test - Update mypy and package-data tests (#83734)
* package-data - Test min/max setuptools version

* Fix multi-version abstraction

* Convert mypy test to script based test

* Fix f-string in pymarkdown test

* Sanity test fixes
2024-08-06 17:48:02 -07:00
717f1092e3 ansible-test - Update venv management and sanity requirements (#83729)
* ansible-test - Update venv management
* Upgrade from pip 24.0 to 24.2
* Omit `wheel` and `setuptools` from ansible-test managed virtual environments
* Drop pre-release hacks
* Update mypy requirements
* Freeze sanity test requirements
* Update sanity test configuration
* Update sanity ignores
2024-08-06 14:53:40 -07:00
0be66ed6dc Fix task-adjacent search path in roles (#83621)
* Restore search path in the current task file’s directory for roles
2024-08-06 17:53:23 -04:00
26c8a28d05 csvfile lookup - fix giving an error when no search term is provided (#83710)
Fixes #83689
2024-08-06 17:50:51 -04:00
885e3766a8 core: raw params better error msg (#83726)
* less confusing error msg
* also remove 'removed' include
2024-08-06 16:18:41 -04:00
c5210ad3eb Fix display to log severity mapping (#83712)
add caplevel to display to pass through
also reverse dict order as 'last update wins'
added tests ... and also log severity to log

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2024-08-06 16:18:03 -04:00
ac5ed40a21 Fix type hints and misc mypy/pylint issues (#83724) 2024-08-05 19:30:37 -07:00
6019f3f425 ansible-test - Update coverage to 7.6.1 (#83723) 2024-08-05 15:27:49 -07:00
4e69d83fac release.py - Auto-update setuptools upper bound (#83713)
When releases are prepared, the upper bound on setuptools in pyproject.toml will be automatically updated
to the latest version available on PyPI. This version will then be tested by the package-data sanity test
during the release process and will be used to build the release.

This change ensures that a released version of ansible-core can be built in the future if a new setuptools
release includes breaking changes that would prevent building a functional package. If a downstream package
maintainer requires a newer setuptools version than the upper bound permits, they can patch pyproject.toml
as needed. Since ansible-core releases support specific Python versions, lack of support for new setuptools
releases will have no effect on support for future Python versions.
2024-08-05 16:59:26 -05:00
207a5fbebb test: Handle Singleton Display class (#83673)
Fixes: #83538

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-08-01 23:21:08 -07:00
91f680a749 Remove extraneous get_bin_path call (#83675)
ip_path is already calculated before calling get_interfaces_info

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2024-08-02 00:12:57 +00:00
5ae8b5b3a6 Remove EXTERNALLY-MANAGED marker in apt test (#83706)
The marker is removed in ansible-test managed environments, but the apt test restores it
by installing/upgrading packages. To avoid breaking later tests, the marker needs to be
removed again.

ci_complete
2024-08-01 13:31:47 -07:00
245885177c systemd facts: Handle AttributeError (#83684)
* Handle AttributeError raised while running systemd facts on
  non-systemd hosts

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-08-01 12:09:02 -07:00
31ad786de1 ansible-doc: handle on_fail (#83676)
Handle errors raised when role doc has errors

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-08-01 12:08:11 -07:00
20465ba11a Add UID and GID min/max keys (#81770)
Fixes: #72183
2024-08-01 09:04:59 -07:00
6bf6844a1c add error handling when parsing values in ini files (#82718)
Fixes: #82717

Co-authored-by: Karl A. Grindley <kgrindley@ll.mit.edu>
2024-08-01 02:34:42 +00:00
c6d5be5cac test: update tests (#83686)
* Remove commented code
* Enable disabled tests
* Formatting

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-31 17:32:11 -07:00
3daf01e270 tests: use keyserver with keyid while using apt_key (#83694)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-31 15:52:12 -07:00
bbf96c250f winrm - quota retry handling (#83656)
* winrm - quota retry handling

Add a retry attempt when receiving ERROR_WSMAN_QUOTA_MAX_OPERATIONS when
starting a command. This can occur when running a loop with multiple
iterations or an action plugin that runs multiple commands.

* Update pywinrm constraint for test

* Add verbose hint and mark test as destructive
2024-08-01 04:12:31 +10:00
ff5deaf62f fix module_defaults group incorrectly giving deprecation warnings (#83510)
don't display deprecation warnings for actions/modules as a result of using an action_group containing a deprecated plugin
2024-07-30 13:45:25 +00:00
d23a2de5f2 Remove selinux import (#83674)
Remove selinux import which was kept for backward compatibility

Fixes: #83657

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-29 16:58:54 +00:00
07a1d6a3fd dnf/setup_rpm_repo: simplify dummy testing repos (#83624)
This change simplifies construction and footprint of testing rpm
repository created by rpmfluff:
* all packages default to noarch
* only when necessary build package for a specific architecture(s)
* do not build several repositories each for specific arch
* remove duplicate "incompatible arch" test
* skip_broken_and_nobest: move testing packages from an external repo
  into our dummy repo for transparency
* remove compatibility code from create_repo.py for versions no longer
  needed
* remove support for old OS versions from setup_rpm_repo
* simplify representation of an rpm in create_repo.py to allow easier
  changes

Notes
* there is one more external testing repo used at
https://ci-files.testing.ansible.com/test/integration/targets/setup_rpm_repo/repo-with-updateinfo
2024-07-29 10:41:23 +02:00
3d4bd79574 validate-modules: detect names set mismatch between argument spec and documentation (#83599) 2024-07-28 15:39:01 +00:00
7e3916b767 Typo fixes and other bits and bobs (#83672)
Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
2024-07-27 09:16:34 -07:00
8e74cdc7b2 Set LANGUAGE env variable is set to a non-English locale (#83671)
Fixes: #83608

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-26 15:50:23 -07:00
a3a92bcc13 Remove explicit shell environment docs (#83649)
Removes the docs for the environment keyword in the shell base plugins
as they are a no-op in the plugins themselves. The environment value is
provided by the action base which gets it from the action base on the
task.environment value. This should avoid confusion around how its being
set and removes some code that is not used at all.
2024-07-26 15:21:33 +10:00
fe1183f8ac Replace random with secrets (#83668)
Use secrets library instead of random.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-25 14:31:41 -07:00
504f5b1230 apt: Report change when package is removed (#83547)
While upgrade process removes a package, module should
report changed=True instead of changed=False

Fixes: #46314

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-25 15:01:46 +00:00
33565f3774 increase timeout downloading galaxy role URLs (#83562)
* Update the timeout to download role archive to 60 seconds to match collections
TODO: in future make a configurable 'artifact download timeout'
2024-07-23 21:56:15 +00:00
cd105d479a display: warn user about empty log path value (#83381)
Fixes: #79959

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-23 21:21:23 +00:00
6371a883d4 Added info about MacOS targets for cron module (#83620)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-23 18:37:57 +00:00
79f819dc54 ansible-test - Remove VyOS tests and support files (#83650)
The VyOS remote image required for running the tests is no longer functional.
2024-07-22 13:42:06 -07:00
d36dc70afc remove ignore clauses for module find (#83575)
add testcase for expanding home dir names
2024-07-22 10:10:49 -04:00
a60fb178b1 docs adjustments (batch 1) (#83341) 2024-07-21 08:31:19 -07:00
46ff7594a4 env: update examples for setting default values to variable (#83370) 2024-07-21 08:12:55 -07:00
f261a6142f Use build instead of pep517 for integration test 2024-07-19 10:03:29 -07:00
b90c3a8de5 Revert "🧪 Use setuptools [core] @ collections_runtime_pythonpath (#83627)"
This reverts commit 0d5460df16.
2024-07-19 10:03:29 -07:00
0d5460df16 🧪 Use setuptools [core] @ collections_runtime_pythonpath (#83627) 2024-07-19 16:22:33 +02:00
eeb9b50669 remove ignore clauses for module lineinfile (#83595) 2024-07-18 15:51:08 -04:00
c904bffc7d debconf: handle boolean value representation consistently (#83601)
* lift code that normalizes value type for boolean vtype to cover both
  branches of conditional.
* remove obsolete and incomplete conversion of type in set_selection.

Fixes: #83594
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2024-07-18 12:50:31 -07:00
4408b2c3e1 replace - fix documentation and remove ignore clauses (#83574) 2024-07-18 15:14:23 -04:00
906c969b55 ansible-test - Improve unknown env error message (#83610) 2024-07-15 16:37:40 +00:00
506d12de69 Update any.yml (#83588)
* fixed typo in description
* fixed comment in examples
2024-07-15 08:05:28 -07:00
0eeb933238 module compression is now again settable via var (#83573)
Previous change overlooked 'uncommenting' the variable entry as a way to update this  to keep the functionality.


Co-authored-by: Glandos <bugs-github@antipoul.fr>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-12 11:38:50 -04:00
08de64076a remove ignore clauses for module blockinfile (#83577) 2024-07-11 08:56:05 -07:00
7cf7dff3a6 Ensure that we are handling DownloadError properly in the dnf module (#83543)
Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>
2024-07-10 10:02:51 -06:00
28cef00576 dnf: follow-up on is_newer_installed arches fix (#83556)
* dnf: follow-up on is_newer_installed arches fix

* fix for the non package object case

* prevent early bailout in dnf _is_newer_version_installed
* non-installed available arches would fail out of the check early

---------

Co-authored-by: Matt Davis <nitzmahone@redhat.com>
2024-07-09 20:26:29 +00:00
293bba7533 fix misc. documentation typos and formatting for modules starting with u-y (#83422) 2024-07-09 15:29:15 -04:00
313f9d9f69 fix misc. documentation typos and formatting for modules starting with s (#83420) 2024-07-09 15:26:54 -04:00
9cdfcd9aed ansible-test - Update nios-test-container to 4.0.0 (#83539) 2024-07-09 10:37:11 -07:00
10997ab3aa ansible-test - Update base/default containers (#83553) 2024-07-09 17:25:20 +00:00
20a815b03f Quality-of-life improvements for release tool (#83551)
* Quality-of-life improvements for release tool

- Default devel releases to b1
- Default non-devel releases to rc1
- Default to release announcement to console
- Avoid auto-links in GH release annoucements for file sizes
2024-07-09 10:17:28 -07:00
4a1775acd3 review modules docs - batch(fragments) (#83431)
Co-authored-by: flowerysong <junk+github@flowerysong.com>
2024-07-09 17:13:10 +00:00
9472005dee update distro version to 1.9.0 (#83540) 2024-07-09 16:48:43 +00:00
4f6a4534a7 known_hosts: don't modify AnsibleModule.params (#83517)
Using this dictionary to store the return values results in
the return values showing up in the returned
`invocation['module_args']`, which is confusing. It also causes all
module arguments to be returned, which is preserved by this change but
should ideally be removed in the future.
2024-07-09 09:07:45 -06:00
83a0975611 Add dinit as a service_mgr (#83489) 2024-07-08 22:30:10 +00:00
43346f1fdc Add SL-Micro to Suse family list (#83541) 2024-07-07 21:37:32 -07:00
edce798713 Fix Creating user directory using tilde always reports "changed" (#83113)
Fixes: #82490
2024-07-07 19:26:14 +00:00
e5309ba29f validate-modules: reject option/alias names equal up to casing belonging to different options (#83530)
* Reject option/alias names equal up to casing belonging to different options.

* Update test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2024-07-05 19:35:54 -04:00
63538f7779 package_facts: fix warning logic (#83520)
* package_facts: fix warning logic

* Refactor so that warnings can work
2024-07-05 13:27:45 -04:00
775bc1110e linear: fix included handlers executing in lockstep (#83209)
Fixes #83019
2024-07-04 09:33:37 +02:00
571e2a9551 Fix incorrect rc when executing end_host in rescue (#83522)
Fixes #83447
2024-07-04 09:19:56 +02:00
6c0f4c8a2d hostvars templating fix, override serialization (#83509)
fixes #82872
nicer implementation courtesy of nitzmahone
2024-07-02 14:27:17 -04:00
7d678cbd96 Fix require_only_one. (#83511) 2024-07-02 09:36:23 -04:00
00ddc27d69 actually show plugin config warnings/deprecations (#82593)
previouslly we recorded but did not show to avoid spam
since we could not dedup from forks, that was already
fixed in another PR so now we can show/display them.

Also:
  * funcitonalize deprecation msg construct from docs
  * reuse formatting func in cli
  * normalize alternatives: most of the code used intended plural
    but some and most data/tests used the singular
  * update schemas and tests

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2024-07-01 19:56:19 -04:00
101f017ef5 Replace references to archived ansible/ansible-examples repository (#83500)
* Replace references to archived ansible/ansible-examples repository

* Update examples to reference ansible repository

* Include HTTPS among SSH references in examples
2024-07-01 12:06:53 +00:00
a8e4106c47 Fix tb for when env var contains % (#83499)
Fixes #83498

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2024-06-28 16:50:45 +02:00
665d2e15d7 dnf: remove legacy code (#83298) 2024-06-28 15:49:42 +02:00
41ba6536cf facts/hardware: Fix support_discard block device fact (#83480)
Previously, `support_discard` simply returned the value of
`/sys/block/{device}/queue/discard_granularity`. When its value is `0`, then
the block device doesn't support discards; _however_, it being greater than
zero doesn't necessarily mean that the block device _does_ support discards.

But another indication that a block device doesn't support discards is
`/sys/block/{device}/queue/discard_max_hw_bytes` being equal to `0` (with the
same caveat as above). So if either of those are `0`, set `support_discard` to
zero, otherwise set it to the value of `discard_granularity` for backwards
compatibility.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
2024-06-28 09:40:14 -04:00
2930a4664c dnf - arches must be the same in the is_newer_installed check (#83417)
Fixes #83406
2024-06-28 11:45:40 +02:00
7a3f9384cf Fix simmilar branches (#83497)
Identical branches in conditional node: 'elif name != permanent_hostname' and 'else'. First bruch is not nessesary

Co-authored-by: mar.s <marchenkov.s.d@gmail.com>
2024-06-27 12:30:13 -07:00
0ee6e39615 dnf, dnf5: fix installing via wildcard (#83481)
Fixes #83373
2024-06-26 16:36:12 +02:00
8f1fddb161 Enable Ubuntu 24.04 group 6 in CI (#83466)
* Enable Ubuntu 24.04 group 6 in CI

* Disable rootfull Podman on Ubuntu

* Disable unix-chkpwd AppArmor profile on Ubuntu for Fedora 40 tests

* Document AppArmor and rootfull issues
2024-06-25 08:42:51 -07:00
0d28705ce5 linear strategy, show templated task name on start (#83473)
we only templated in some cases but when queueing we could get an untemplated name for the 'on start' event.
2024-06-25 09:24:24 -04:00
339452c105 Ensure the correct connection name is shown in results (#83354) 2024-06-24 09:52:06 -04:00
f7dee8aaf8 add support for inactive option (#83355)
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2024-06-21 14:31:31 -04:00
a121a169e3 ansible-test - Replace FreeBSD 14.0 with 14.1 (#83477) 2024-06-20 15:20:10 -07:00
c93af4e148 unarchive: handle content and size differences (#83454)
Consider content differs and size differs while unarchiving
the same tar.gz file

Fixes: #29610

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-20 10:50:27 -07:00
c2c6005842 get_url: Verify checksum using tmpsrc, not dest (#64092)
Previously, if the checksum of the downloaded file did not match the
specified checksum, the *destination* file was removed. This possibly
leaves the system that is being provisioned in an invalid state.

Instead, the checksum should be calculated on the temporary file only.
If there's a mismatch, delete the *temporary* file, not the destination
file.

This requires checking the checksum before moving the file.
2024-06-20 10:55:59 -04:00
96c04e9d1d ansible-test - Update PyPI and utility container (#83475) 2024-06-19 01:31:33 +00:00
1b42af5004 ansible-test: update http-test-container to 3.2.0 (#83469) 2024-06-18 13:46:52 -07:00
d62496fe41 human_to_bytes: strictly parse strings (#83403)
Fixes: #82075
2024-06-18 09:21:04 -07:00
df29852f3a Update the dnf5 copr repo (#83459)
The dnf-nightly is the official nightly repo now.
2024-06-18 11:08:19 -04:00
224853b684 replace: update after/before example (#83453)
Fixes: #83390

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-18 11:03:49 -04:00
dc31b6cf55 service_facts on OpenBSD: Don't crash on '=' in rcctl flags. (#83458)
Splitting on all '=' characters produced too many values.
2024-06-18 10:00:09 -04:00
dad6f07731 ansible-test - Update tested platforms (#83446)
* ansible-test - Update tested platforms

* Add work-around for Alpine tests

* Fix prepare_http_tests on Fedora

* Fix deb-src setup for Ubuntu 24.04+

* Set multiarch_test_pkg for Ubuntu 24.04

* Update AZP test matrix
2024-06-17 23:17:04 +00:00
c1a082c697 Added docstrings to V2 methods in the CallbackBase Class (2 & 3 of 27) (#83342) 2024-06-17 18:33:46 -04:00
44f22162cb Remove timezone support module and tests (#83465)
The timezone support module was used only for changing the timezone in the user module integration tests.

Changing the timezone for the tests is unecessarily complex for the purpose of asserting proper parsing of user expiration times.
2024-06-17 15:06:39 -07:00
f4751766db selinux compat - add ignore, proper ex chaining (#83460) 2024-06-17 13:26:41 -07:00
b2a289dcbb Remove Python 3.10 support for the controller (#83221)
Fixes #83094
2024-06-17 09:03:41 +02:00
6382ea168a vault: Handle directory value to vault password file (#83384)
When vault password file env variable is set to blank,
this value is converted to CWD and passed for further
processing.
Check if ANSIBLE_VAULT_PASSWORD_FILE is not a directory.

Fixes: #42960

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-14 18:40:30 -07:00
1ed29416db dnf: update use_backend documentation (#83429)
* add note about backwards compatibility
2024-06-14 18:12:36 -07:00
e64c6c1ca5 unarchive: Better handling of files with an invalid timestamp in zip file (#81520)
Fixes: #81092

Signed-off-by: gilsongpfe <gilson.gpf@gmail.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-13 14:30:37 -07:00
a0aad17912 Adds limit parameter to ansible.builtin.find (#83153)
* Explicitly guarantee topdown search.
* Makes max matches unlimited == None.
2024-06-13 16:12:51 -04:00
1c156e2b70 review modules docs - batch(klmpr) (#83418) 2024-06-13 12:03:46 -07:00
5af5b4b6c8 ansible-test - Update PyPI test container to 3.1.0 (#83432) 2024-06-13 08:52:43 -07:00
738180d240 ansible-test - Fix unit test coverage collection (#83433) 2024-06-12 15:47:58 -07:00
72a5957720 Fix Linux Sector count Fact (#81246)
* Use sectorsize fact in disk size calc rather than hardcoded 512

* Added conversion for sysfs sectorcount to real sector count
2024-06-12 18:35:03 -04:00
a9b902f579 ansible-test action-plugin-docs sidecar (#83325)
Fix to have ansible-test sanity --test action-plugin-docs to check for
action plugin documentation inside a sidecar file rather than a Python
module.
2024-06-13 06:16:15 +10:00
6e8a7ed327 Revert warning message in setup/gather_facts (#83427)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-11 12:01:29 -07:00
cf265eb14d Add Python 3.13 support (#83416)
* Add Python 3.13 support

* Add temporary work-around for yamllint test
2024-06-11 11:36:10 -07:00
126ffc7947 Specify -O in windows ssh tests as needed for scp to work with openssh 9+ (#83426) 2024-06-11 10:59:17 -07:00
5022415887 Clarify documentation for INJECT_FACTS_AS_VARS (#83404) 2024-06-11 08:12:31 -07:00
c6ba5a3560 docs adjustments - batch(ghi) (#83399)
* review modules docs - batch(ghi)

* fix option markup in gather_facts
2024-06-11 08:02:50 -07:00
14df8c2cf2 ansible-test - Prepare for Python 3.13 (#83414)
Includes an update to `coverage` and pinned Python requirements.
2024-06-10 19:33:33 -07:00
d16ad25e4b Remove extraneous pylint ignore (#83257)
* Pylint issue 511 is closed, remove ignore related to that.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-10 19:23:49 -07:00
4f73d2ff7a docs adjustments (#83369) 2024-06-11 02:16:59 +00:00
531bc9891f Fix issues reported by mypy (#83413) 2024-06-10 18:18:33 -07:00
6ab26707de Fix quoting in fork_safe_stdio test (#83412) 2024-06-10 17:13:15 -07:00
cbbf06893e Validate and process Handler.listen only once (#83400)
Fixes #83392
2024-06-10 10:46:12 -05:00
2e60bef855 Update azure-pipelines-test-container (#83302) 2024-06-06 17:19:57 -07:00
bdc1cdfa54 Revert "bool filter, add booleanization strategy option (#83362)" (#83391)
This reverts commit 655a8ff38f.
2024-06-06 14:30:15 -07:00
93b8b86067 Properly quote all needed components of shell commands (#83365)
* Properly quote all needed components of shell commands

* Use self.quote, add new self.join
2024-06-06 15:14:18 -05:00
68638f4710 fix any_errors_fatal tests (#83389)
* fix any_errors_fatal test to exit on non-zero rc

Use a typo in the debug msg to avoid matching play recap

* remove duplicate 'set -ux'
2024-06-06 12:25:49 -07:00
70c2b35210 docs adjustments (batch 2) (#83368)
* docs adjustments

* Update lib/ansible/modules/assemble.py

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

---------

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-06 12:04:48 -07:00
655a8ff38f bool filter, add booleanization strategy option (#83362)
also make the YAML booleanization the same as spec/JSON/module function
 previous 'aproximation' was missing several options.

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-05 17:26:01 -07:00
16ebeb7d21 facts: add facts about x86_64 flags to detect microarchitecture (#83356)
Fixes: #83331

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-06-04 13:35:07 -07:00
0a311f6669 additional timeout info (#83364) 2024-06-04 14:11:54 -04:00
c77ed376c4 timeout give extra info (#83206)
the new field shows the python code in execution when it timed out, 99% of the time it will be on a selector waiting for output from ssh to remote.
2024-06-04 11:42:15 -04:00
e07b4edc54 Fix Test failure with cowsay installed/present (#83347) 2024-06-03 06:51:32 -07:00
b8f1add983 powershell - Improve Add-Type tempdir handler (#83080)
Improves the Add-Type temporary directory handler to include a retry
mechanism and not fail on an error. Deleting a temporary file used in
compilation is not a critical error and should improve the reliability
of Ansible on Windows hosts.
2024-06-03 13:17:36 +10:00
347a822a42 Documented v2_runner_on_failed method in Callback class (#83267)
* Documented v2_runner_on_failed method in Callback class

* Added changes requested by @bcoca.
2024-05-31 17:22:34 -04:00
454dd9e91d The extension returned by the splitext contains the dot (#82803)
Fixed examples for splitext filter plugin
2024-05-31 08:29:33 -07:00
153c979662 test: Cleanup facts/network/* tests (#83256)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-30 09:23:18 -07:00
f2435375a8 Fix task.resolved_action callbacks (#82003)
* Fix task.resolved_action for callbacks when playbooks use action or local_action

* Fix using module_defaults with 'action' and 'local_action' task FA and add a test case

Fixes #81905
2024-05-30 10:20:54 -04:00
46168c8cc2 file module, follow symlink when doing hardlink (#34228)
Fixes: #33911
2024-05-29 22:22:19 -07:00
000bac9a3e gather_facts, mention ansible_facts_parallel var (#83278) 2024-05-29 18:11:43 -04:00
949c503f2e config, integrate dynamic galaxy servers (#83129)
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2024-05-29 15:42:21 -04:00
375d3889de ansible-doc: make color configurable (#83311)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-29 09:44:54 -07:00
3253189b33 get_url: update docs for checksum (#83305)
If user provides checksum URL which requires basic auth,
then module parameter username and password is used to
download the checksum file.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-28 11:23:52 -04:00
3af9d0f189 apt_*: add more info message while updating apt cache (#83230)
Fixes: #77941

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-23 16:15:02 -07:00
c1d41ee44e filter: update the documentation for win_splitdrive (#83301)
Fixes: #83299

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-23 12:12:29 -07:00
10f9b8e655 Correct code comment in PBE to reflect current behavior (#83269)
Correct a code comment in the PlaybookExecutor class that explains
the host failure condition under which the PBE breaks out of the
run. This comment previously stated that the maximum failure
percentage was checked, but that logic has been refactored into
the linear strategy plugin.
2024-05-21 11:14:29 -04:00
560d3af097 ansible-test - Update http-test-container (#83272)
* Disable cipher suite integration tests

When the client and server both support TLS 1.3, cipher suite selection is effectively a no-op.

Python provides no way to disable TLS 1.3 cipher suites, and no way to prefer user-selected cipher suites.
Since TLS 1.3 includes a mandatory cipher suite, this makes it impossible to induce a cipher suite related error when using TLS 1.3.

* Update multipart form-data integration test

* Fix netrc integration tests

* Update HTTP test host substring

* ansible-test - Update http-test-container
2024-05-19 12:36:00 -07:00
b8483adb33 ansible-test - Update pypi-test-container (#83273) 2024-05-19 12:35:44 -07:00
930f18ea65 ansible-test - Update ansible-test-utility-container (#83274) 2024-05-19 12:35:32 -07:00
a7e666829e MUNI tech writers: timeout documentation. (#83152)
* Documentation on the timeout keyword

* wording changes

* keyword description wording edit

* removed whitespace at the end of lines.

* Changed to more accurate wording

---------

Co-authored-by: Niko Mlynarčik <536617@mail.muni.cz>
2024-05-17 09:38:03 -04:00
c5114e1819 Remove deprecated VariableManager._get_delegated_vars (#83259)
Fixes #82950
2024-05-17 09:32:38 +02:00
b70248eb22 Warn if the binary is unavailable using get_bin_path (#83258)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-16 02:32:22 +00:00
7e0a476ba2 setup module, make missing sysctl minor issue (#81297)
Signed-off-by: Brian Coca <brian.coca+git@gmail.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-15 15:19:14 -07:00
ac6200b597 Refactor dmidecode fact gathering code (#83211)
* Code now bails out early if dmidecode command is unavailable

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-14 17:18:59 +02:00
65638b4d01 remove old install info when installing collections (#83194)
* Fix cleaning up galaxy server info from previous installations

* changelog
2024-05-14 17:09:55 +02:00
f7d7890df9 Use inclusive word: logical (#83232)
Use word 'logical' instead of non-inclusive word

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-10 15:49:53 +00:00
8ad68f12ee Refactor yum_repository, deprecate yum only options (#83116) 2024-05-09 11:27:27 +02:00
3c280e6c1b dnf5: implement enable_plugin and disable_plugin options (#83105)
80cfea9c25
2024-05-09 10:54:40 +02:00
036d14f1e6 Darwin: add unit tests for hardware fact gathering (#83212)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-07 15:33:13 -07:00
523745e02e dnf: integration tests cleanup (#83203)
* remove no longer needed tasks
* remove workarounds
* consolidate conditionals
* remove distros/versions from conditionals that are no longer present
  in CI
2024-05-07 08:42:55 +02:00
45a30ab093 package_facts: apk fix when cache is empty (#83132) 2024-05-06 22:43:28 +00:00
504bdae894 added examples for systemd service usage (#83192)
mostly how to filter/manipulate the results
---------

Co-authored-by: flowerysong <junk+github@flowerysong.com>
2024-05-06 17:53:19 -04:00
57a8eca3af pymarkdown: update docs (#83150)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-06 21:52:50 +00:00
417db213c0 facts: Update RAID devices regex for FreeBSD (#82081)
Added support FreeBSD RAID devices and regex to match partitions as well as slices. 
RAID device list is taken from here: https://github.com/freebsd/freebsd-src/blob/main/usr.sbin/bsdconfig/share/device.subr
2024-05-06 13:41:37 -07:00
aed8c080f6 ansible-galaxy, clarify licensing for 'init' templates and results (#83175) 2024-05-06 16:22:52 -04:00
f5b945bf6a ansible-doc: fix typo in output (#83205) 2024-05-06 20:04:21 +00:00
eb3ea3ce5c Fix order of CLI arguments on FreeBSD (#81377)
When passing arguments on FreeBSD to service command the order is
important, otherwise the service command will ignore the arguments.
2024-05-06 19:32:36 +00:00
6aa8192131 Multi-arch support for container test (#83196) 2024-05-03 18:15:37 -07:00
3461f1d757 Build test modules for aarch64 (#83195) 2024-05-03 17:42:59 -07:00
f4bbd75a3c git: Check if version is populated or not (#82173)
Before usage check if the git version is populated or not.

Fixes: #72321

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-03 22:17:36 +00:00
2816922cd6 display: fix log verbosity (#83179)
* display, ensure we have a logger before we log
2024-05-03 10:38:41 -04:00
889012e29e clean up ansible-connection (#82992)
* clean up ansible-connection stuff

* eliminate unnecessary usage of pty/termios
* always use default pickle protocol
* remove unnecessary wire hashing

Co-authored-by: Kate Case <this.is@katherineca.se>
2024-05-02 21:37:19 +00:00
ad777cba5a package_facts add alias support (#83149)
* package_facts add alias support

fixes #83143

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-02 14:33:12 -04:00
dc6b77beca Don't hardcode the dnf module, dynamically select one (#83183) 2024-05-02 12:22:56 -05:00
2b65166a29 uri: deprecate 'yes' or 'no' value in follow_redirects param (#83169)
* uri (module and lookup): deprecate 'yes' or 'no' value in follow_redirects param

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-05-02 02:43:22 +00:00
cd9c4eb5a6 Gather sysinfo facts on s390 (#83157) 2024-05-01 11:10:58 -07:00
585ef6c55e Show examples in role entrypoint argument specs. (#82671) 2024-05-01 11:27:50 -04:00
e3d4c20f6e Correctly treat separate paragraphs in top-level descriptions as separate paragraphs. (#83155) 2024-04-30 17:15:35 +02:00
2ed6c30929 Add version ceiling for pypsrp (#83122)
* Add version ceiling for pypsrp

Add a version ceiling for the pypsrp requirements. This ensures that the
future v1.0.0 release won't impact existing users who install the
library using the version range specified.

* Use constraints file

* Add changelog for this change
2024-04-30 10:09:35 +10:00
dfc559866a minor fix for misspelling (#83156)
This change fixes a minor spelling error, indivudually ==> individually.
2024-04-29 15:45:21 +00:00
802e95f580 distro: remove pep8 ignore
* Remove unnecessary pep8 from ignore.txt

Fixes: #80840

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-25 12:23:01 -07:00
628ce5a62e assemble: update argument_spec with 'decrypt' option
* decrypt option is used by assemble action plugin.
  Add this parameter to remove failure raised by
  validate-modules:nonexistent-parameter-documented

Fixes: #80840

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-25 12:22:19 -07:00
d5edb77db4 Add description of ansible.utils.path.unfrackpath() basedir argument 2024-04-25 12:11:38 -07:00
c18e755b82 removed extra ansible_managed 2024-04-25 12:11:09 -07:00
e84240db84 Fix installing roles containing symlinks (#82911)
* Fix installing roles containing symlinks

Fix sanitizing tarfile symlinks relative to the link directory instead of the archive

For example:

role
├── handlers
│   └── utils.yml -> ../tasks/utils/suite.yml

The link ../tasks/utils/suite.yml will resolve to a path outside of the link's directory, but within the role

role/handlers/../tasks/utils/suite.yml

the resolved path relative to the role is tasks/utils/suite.yml, but if the symlink is set to that value, tarfile would extract it from role/handlers/tasks/utils/suite.yml

* Replace overly forgiving test case with tests for a symlink in a subdirectory of the archive and a symlink in the archive dir when these are not equivalent.

* Build test case from role files to make it easier to add test cases

Fixes #82702
Fixes #81965
Fixes #82051
2024-04-24 11:07:29 -04:00
124d03145c inspect components, ansible_managed templatable (#83053)
* inspect components, ansible_managed templatable

fixes #82322
2024-04-23 12:43:47 -04:00
718edde465 Update distro version in __init__.py (#83114)
Update the bundled package distro from 1.6.0 to 1.9.0 in __init__.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-23 08:26:42 -07:00
33d1224e83 password_hash: update docs about bcrypt (#81675)
Signed-off-by: Sven Kieske <kieske@osism.tech>
2024-04-23 01:20:04 +00:00
87bead3dcf setup_rpm_repo/create_repo: "Arch dependent binaries in noarch package" (#83108)
This fixes "Arch dependent binaries in noarch package" error cause by
including files created by make_elf function in noarch packages. While the
error only manifests itself on EL 7 and 8 it is better to use files
suitable for noarch packages to prevent the error potentially
re-occuring in the future.
2024-04-22 09:10:42 +02:00
7f93f6171d add systemd version and features fact (#83083)
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2024-04-18 21:22:56 -04:00
5dac5d365a systemd_service: handle failure when mask operation fails (#83079)
* Handle the mask operation failure instead of just
  marking state changed.

Fixes: #81649

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-18 16:28:30 +00:00
ae2234f185 add countme option to yum_repository (#82831)
* add countme option to yum_repository

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* Update lib/ansible/modules/yum_repository.py

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

* add changelog fragment

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* add version_added

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* Update lib/ansible/modules/yum_repository.py

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

* Update lib/ansible/modules/yum_repository.py

* Update lib/ansible/modules/yum_repository.py

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>

* Update lib/ansible/modules/yum_repository.py

---------

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2024-04-18 13:51:22 +02:00
6b3bab6476 plugin: fixed examples of csv lookup plugin (#83068)
Fixes: #83031

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-17 15:08:22 -07:00
8c3c694472 test: remove ansible-examples.git repo (#81600)
* test: remove ansible-examples.git repo

* To speed up git tests remove reference to ansible-examples.git

Fixes: #81327

* Make CI green

Signed-off-by: Ansible Test Runner <noreply@example.com>
Co-authored-by: Ansible Test Runner <noreply@example.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2024-04-17 17:15:42 -04:00
0c51a30d93 ansible-config: add 'validate' option (#83007)
We can now validate both ansible.cfg and 'ANSIBLE_' env vars
match either core (-t base), installed plugin(s) (-t <plugin_type>) or both (-t all)
2024-04-17 16:26:05 -04:00
8bc0d809a6 Update sdist path in release tool
The latest setuptools package uses a normalized package name for the sdist.
2024-04-16 10:13:40 -07:00
a3cdd831b3 handlers: fix executing in lockstep using linear (#83030)
Fixes #82307
2024-04-16 17:45:18 +02:00
82d91f0952 Make inventory --list help text wording consistent (#83035) 2024-04-15 10:21:28 -04:00
57750e2cf7 Fallbacks for brand new APIs that don't exist in released dnf5 (#83022) 2024-04-12 10:15:49 +02:00
3a6f825a8e dnf - honor installroot and substitutes in paths (#83011)
In #80094 support for var substitution for cachedir was added but there
are more options that should be supported. Using an API for
prepend_installroot which should be done anyway provide that feature
so use that. In addition, perform the operation once all substitutes
are in place (releasever as well).
2024-04-12 09:34:46 +02:00
4e57249d59 dnf5: replace removed API calls (#83020)
* dnf5: replace removed API calls

bfb6f32e15
96c9188f9c

* call set_group_with_name instead of setting group_with_name

c7b88428f3

---------

Co-authored-by: Matt Martz <matt@sivel.net>
2024-04-11 14:57:44 -05:00
cb81801124 facts: Add a generic detection for VMware product name (#83012)
* Use startswith instead of hardcoded values in VMWare product
  detction

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-11 15:07:36 -04:00
3076478892 Extend systemctl is-enabled check to handle "enabled-runtime" too. (#77754)
In general the existence of a runtime-enabled unit should not prevent
a persistent enable being set.

Specifically this handles the case where there is an entry in fstab
for a mount point (which is retained to allow manual mount/umount to
take place) and yet a systemd mount unit needs to be deployed to
handle other unit options. There will be a generator-created unit file
which shows the unit as enabled-runtime and the persistent enable of
the mount unit will fail.

Additionally improve the comments and modify the code to use rsplit()
and the "in" notation since "systemctl is-enabled" is documented to
return specific values in the cases of interest.

---------

Signed-off-by: David Greaves <david@dgreaves.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-10 10:09:04 -04:00
d304fd86c2 modules/dnf: Substitute variables in DNF cache path (#80094)
The cache directory can be specified with variables that are expanded by DNF, for example,

```
cachedir=/var/cache/yum/$basearch/$releasever
```

But the `dnf` module would use that path literally, instead of replacing
`$basearch` and `$releasever` with their values.

This commit ensures that variables in `cachedir` are properly substituted.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
2024-04-09 13:11:43 -07:00
46137127a2 ansible-config: ensure we get templated default (#82974)
AKA all defaults rendered
2024-04-09 14:57:26 -04:00
bb138b1f6e play_context: remove deprecated PlayContext.verbosity (#82993)
Fixes: #82945

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-09 11:08:52 -04:00
cd365057d3 Remove more Python 2.x compat code 2024-04-08 12:55:52 -07:00
5187061939 ansible-test - Update base/default containers 2024-04-08 10:09:58 -07:00
61e18572bb Play - remove deprecated ROLE_CACHE in favor of role_cache (#82979) 2024-04-04 23:07:25 +00:00
92feda2e13 paramiko_ssh: remove deprecated ssh_*_args parameters (#82988)
* removed ssh_args parameter
* removed ssh_extra_args parameter
* removed ssh_common_args parameter

Fixes: #82939
Fixes: #82940
Fixes: #82941

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-04 12:51:22 -07:00
14a2f6e2ab Remove Python 2 traces from dnf/dnf5 modules (#82985) 2024-04-04 12:39:11 -07:00
971c49b711 Remove deprecated vars keyword syntax as a list of dictionaries, it is now required to be a single dictionary (#82980)
Update unit test
2024-04-04 12:34:54 -07:00
e03fcda6da Remove deprecated configs for DEFAULT_FACT_PATH, DEFAULT_GATHER_SUBSET, and DEFAULT_GATHER_TIMEOUT (#82978)
Instead, set module_defaults at the play level, which will apply to the
gather_facts keyword as well as any
ansible.builtin.setup/ansible.builtin.gather_facts tasks.

- hosts: all
  gather_facts: yes
  module_defaults:
    ansible.builtin.setup:
      fact_path: /path/to/facts.d/
      gather_subset: '!all,!min,local'
      gather_timeout: 20
  tasks:
    # also applies to:
    - ansible.builtin.setup:
    - ansible.builtin.gather_facts:

If you wish to only apply these to the gather_facts keyword, set as play keywords.
2024-04-04 12:32:25 -07:00
52529f0b8e plugins: remove deprecated features (#82976)
* Remove deprecated REQUIRE_WHITELIST
* Remove deprecated module_blacklist

Fixes: #82947

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-04 12:29:50 -07:00
5f36fc9a46 to_nice_json: document the indent option (#82973)
Specifying indent as an option to `to_nice_json` has been possible in
contrary to what documentation states.

Follow-up to https://github.com/ansible/ansible/pull/82912
2024-04-04 12:27:50 -07:00
179bc1dabd fetch - add error check on calculated dest (#82970)
Add explicit error when the calculated dest path for fetch becomes a
local directory. The existing behaviour will not be checked unlike when
the path did not end with a trailing slash.
2024-04-04 12:26:21 -07:00
ea55dddc6a Remove deprecated 'loader' argument (#82968)
* remove deprecated 'loader' argument from listify_lookup_plugin_terms API

Fixes: #82949

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-04 12:23:18 -07:00
208168ee4c apt: add a note about extraneous quotes in package name (#82960)
* add a note for user to not to include extraneous single or double
  quotes while specifying package name with a specific version.

Fixes: #82763

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-04 12:12:53 -07:00
1c17fe2d53 Drop Python 3.7 support (#82982) 2024-04-04 09:41:14 -07:00
c12d42577e Remove missed changelog fragments (#82975) 2024-04-03 09:25:49 -05:00
76fe4e8a71 Bump devel to 2.18.0.dev0 (#82934)
* Bump devel to 2.18.0.dev0

* Add ignores for 2.18 deprecations
2024-04-02 21:18:18 +00:00
85d8673860 Follow up to #82933 - remove platforms from templates (#82961) 2024-04-02 17:06:39 -04:00
4bc6ffb2aa Eaiser package mgr overrides (#82629)
Added variable to override auto detection



Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Matt Martz <matt@sivel.net>
2024-04-02 16:38:05 -04:00
4bddbe69d5 Fix traceback inheriting from NetworkConnectionBase and add integration tests (#82954)
Co-authored-by: Jeroen van Bemmel <jvb127@gmail.com>
2024-04-02 11:19:07 -04:00
478e139195 remove nonexistent url from role templates (#82933)
* Remove obsolete v1 link for role platforms from the role templates
* Delete platforms block entirely
2024-04-02 11:15:12 -04:00
bcaae4c435 systemd_service: Update docs regarding required_* (#82917)
* Update the documentation regarding required_one_of and required_by
  in systemd_service

Fixes: #82914

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-02 11:06:40 -04:00
21a987b8b6 connection: update test coverage for SSH connection plugin (#82916)
* connection: update test coverage for SSH connection plugin

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-04-02 11:05:41 -04:00
9e08f78bd3 ansible-test - Update base/default containers (#82952) 2024-04-01 20:13:11 +00:00
31901d23e7 ansible-test - Remove FreeBSD 13.2 (#82951) 2024-04-01 18:14:32 +00:00
8280fbc776 ansible-test - Remove Alpine 3.18 (#82116)
Co-authored-by: Matt Clay <matt@mystile.com>
2024-04-01 17:54:51 +00:00
b3d8cdde5d fix handling allow_duplicates with the role cache (#82691)
allow_duplicates is not part of the role uniqueness, so the value on the cached role may not match the current role.

* remove the allow_duplicates check from Role.has_run() which operates on the deduplicated role
* check the current role's allow_duplicates value in the strategy

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2024-03-28 15:33:09 -04:00
8704b9fc29 centralize and complete the internal static vars (#82872)
* centralize and complete the internal static vars

These vars are internal and should not be overridden nor templated
from inventory nor hostvars.
2024-03-28 15:06:35 -04:00
e3f4fe4fb9 ansible-test - Remove macos/13.2 remote from ansible-test
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
2024-03-27 22:45:54 +00:00
5c804cbf6f ssh docs fixes (#82902) 2024-03-26 17:07:32 -04:00
fde206499d async support check mode (#82901)
Allow async tasks to run in check mode
Add check_mode support to async_status
Add tests, also for 'hidden' async mode in gather_facts/parallel
2024-03-26 17:06:29 -04:00
b639bd1fd4 Allow "role_name : " prefix for notifying handler listen topics (#82854)
* Allow role name prefix for handler task listen topics

For example,

- name: handler name
  debug:
  listen: topic1

can be notified using `topic1`, `role : topic1` if the handler is in a
standalone or collection role, and `ns.col.role: topic1` if the role is
in a collection, the same way handler names work.

changelog

* fix changelog and tests
2024-03-26 13:29:45 -05:00
8fec1575e6 apt: handle options while installing python3-apt (#82913)
* apt: handle options while installing python3-apt

* While installing python3-apt library, honor parameter
  such as install_recommends and dpkg_options

Fixes: #40608

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

* Review changes

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

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-26 16:16:27 +01:00
Jon
a1b6e3a258 Document sort_keys option in to_nice_json() filter (#82912)
Added by https://github.com/ansible/ansible/pull/52341.
2024-03-26 16:15:28 +01:00
5f4e332e37 Fix condition for unquoting configuration strings from ini files (#82388)
* Add prefix to `origin` when configuration variables come from ini files

Fixes ansible#82387

This change was suggested by @bcoca in
https://github.com/ansible/ansible/pull/82388#discussion_r1424235728 and
https://github.com/ansible/ansible/pull/82388#discussion_r1424249732

When configuration variables come from an ini file, their `origin` is
now set to `ini: <file>`. Similarly, once supported, YAML configuration
files will have their `origin` as `yaml: <file>`.

Consequently, since unquoting configuration strings should happen if and
only if they come from an ini file, this condition boils down to testing
whether their `origin` starts with `ini:`.

* Do not add prefix to `origin` but explicitly pass `origin_ftype`

So as not to rely on a specific format of the `origin` string,
as suggested by @sivel in
https://github.com/ansible/ansible/pull/82388#issuecomment-1881714871
2024-03-26 09:12:17 -05:00
a870e7d0c6 Bump bundled distro version to 1.8.0 (#81765)
* Bump bundled distro version to 1.8.0

* Bump bundled distro version from to 1.8.0 from 1.6.0

Fixes: #81713

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

* Remove sanity entries

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

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-25 10:23:03 -05:00
d86ad77d6f Remove deprecated scp_if_ssh from SSH connection plugin (#82072)
* removed deprecated scp_if_ssh feature from SSH connection
  plugin

Fixes: #81715

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-25 14:50:37 +00:00
b8b12c4be3 Update sanity requirements (#82296)
* Update sanity requirements
* Drop Python 3.7 for mypy

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-22 17:17:52 -07:00
ca168eb367 ansible-test - Fix Alpine libexpat bootstrapping 2024-03-22 12:27:35 -07:00
ad0ec47fe9 first_found lookup; minor fixes (#82836)
Always process options no matter the combination
return a full normalized path (symlinks still not followed, should be specific option in future)
2024-03-22 13:00:46 -04:00
b4d67adfda ansible-test - Update distro containers to 7.1.0 2024-03-21 21:40:01 -07:00
a1ad7100df ansible-test - Handle externally managed Python (#82883)
Remove EXTERNALLY-MANAGED marker in ansible-test managed environments

Additional changes:

- Test the Alpine 3.19 container
- Stop testing Alpine 3.18 container and remote
- Add missing changelog entry the Alpine 3.19 container
2024-03-21 21:06:25 -07:00
73701004b0 ansible-test - Add alpine 3.19 (#82115) 2024-03-22 01:02:29 +00:00
c0821346fc Do not mangle plugin names in collections that start with an underscore. (#82574) 2024-03-21 19:40:46 -04:00
11d69e065f ansible-doc: restore role attributes (#82678)
* Restore role attributes.

* Add a deprecation warning for role argument specs containing attributes

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2024-03-21 17:06:15 -04:00
31bbc8334e Update container test cgroup handling
When the host uses cgroup v2 and does not use systemd,
skip container scenarios which are unsupported.
2024-03-21 13:19:38 -07:00
a192193c55 Limit Alpine 3.18 test hacks to that version 2024-03-21 12:05:05 -07:00
ddae41759c Add FreeBSD 13.3 and 14.0 to ansible-test (#82530)
Co-authored-by: Matt Clay <matt@mystile.com>
2024-03-21 17:50:51 +00:00
8eabeefa63 mypy: update code required to bump sanity requirements
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-21 09:54:24 -07:00
aecffcb896 pylint: update for use-yield-from
* With Pylint 3.1.0, use-yield-from check is enabled

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-21 09:37:18 -07:00
481d8bdc1e Unarchive get zipinfo on more OS/distros (#82873)
Not all implementations use -l as default for -Z on unzip
2024-03-21 08:43:08 -07:00
2b1a5dd7a0 Remove outdated constraint for paramiko setup 2024-03-20 19:09:05 -07:00
e659c23bf2 blockinfile: do not crash when filename has no path (#81638)
* Do not crash when filename has no path.

* Clean up file after test.
2024-03-20 18:39:19 -05:00
0c9f1989a7 Do not treat leading underscore in plugin names as attempted deprecation. 2024-03-20 14:01:50 -07:00
8aecd1f9b2 winrm - Handle task timeout (#82784)
When using winrm over HTTP with message encryption enabled and a task
has timed out the connection plugin will fail to cleanup the WinRM
command. This will change that exception into a warning as a timeout is
already an exception event and a failure to clean the operation should
not override the timeout error shown.
2024-03-21 05:19:52 +10:00
c9086061ca Allow check mode async task disabling check_mode (#82827)
* Allow check mode async task disabling check_mode

Allows running an async task with check_mode: False when the playbook is
being run in check mode.

* Add check_mode attribute to internal cleanup task
2024-03-20 11:34:57 -04:00
56fa630e47 apt: Install recommended packages while installing deb files (#82805)
* install recommended packages while installing deb files and
  install_recommends is set to true.

Fixes: #29726

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-19 08:52:50 -07:00
c5557ad872 fix wording in error msg (#82848) 2024-03-19 11:27:40 -04:00
25c0dc50a2 Fix up to_datetime timedelta seconds docs (#82826) 2024-03-19 11:04:11 -04:00
732df49e46 Update zip.yml (#82840)
Fix typo of mydcit instead of mydict.
2024-03-19 07:59:47 -07:00
2bb09bfd12 atomic_move - fix preserving extended acls (#82818)
* use copystat to copy as many attributes as possible before os.rename

update unit test mocks for updated method of attribute preservation

add integration test for lineinfile case

remove erroneous `- meta: end_play` from lineinfile test suite

* add keep_dest_attrs parameter to control whether src attributes are
copied initially, and for existing destinations, whether the src is
updated using the dest before being renamed

consolidate with copy unsetting extended attrs

ci_complete
2024-03-18 10:58:00 -04:00
7adc146e2f Fix traceback and allow installing roles with version None (#81849)
* Allow installing roles with version `None` from Galaxy

Co-authored-by: Matt Martz <matt@sivel.net>
2024-03-16 00:17:37 +00:00
4000656849 git: Rename option gpg_whitelist to gpg_allowlist (#82377)
Signed-off-by: Sebastian Endres <sebastian.endres@dlr.de>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-15 22:49:28 +00:00
3b823d908e Enable file cache for vaulted host_vars_files vars plugin (#81995)
Enable file cache for vaulted host_vars_files vars plugin

* fixes #81994
* Changed cache arg from bool to str to allow 'vaulted' only file cache
* removed unused used var
---------
Co-authored-by: Steffen Oschatz <so@ypsilon.net>
2024-03-15 14:50:38 -04:00
92df664806 [DOCS] README: update working groups link (#82254) 2024-03-15 16:49:33 +00:00
6439627ce4 test_apt: migrate from unittest to pytest (#82666)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-14 19:19:36 -07:00
2806758793 filter: Misc fixes in docs (#82823)
* misc fixes for the filter documentation

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-15 05:11:33 +10:00
1181436d54 docs: describe capture references (#82819)
* update docs and example for capture references

Fixes: #82797

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-15 05:03:50 +10:00
9a0a5d834e Fixes permission for cache json file from 600 to 644 (#82761)
Until ansible-core 2.12 the facts cache file created by this module, have permission set as 644 which allows the other users to read the cache, since ansible-core 2.13, we create the temporary file, but we do not set the permission after renaming the temporary file.  Adding the line to set the permission to allow other users/groups to read this file.
2024-03-14 10:24:09 -07:00
86f48a526a Install crun from Alpine 3.19 for known musl compatibility (#82812) 2024-03-13 13:31:59 -05:00
d9e798b48f debconf: allow a list for value when vtype is multiselect (#82757)
* allow user to specify a list for value when vtype is multiselect

Fixes: #81345

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-12 16:06:35 +00:00
f02081b391 Fix discrepancy in behaviour between apt-get clean and its equivalent ansible.builtin.apt: clean=True (#82800)
* added integration test for issue 82611 regarding discrepency between apt-get clean and ansible.builtin.apt: clean

* fixed new line issue

* Implementation of bug fix for 82611

Fixed discrepancy in behaviour between apt-get clean and its equivalent ansible.builtin.apt: clean=True

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>

---------

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2024-03-12 11:10:50 -04:00
936e757478 Document no until support for meta (#82795) 2024-03-12 11:02:38 -04:00
8b0f2ad9c5 remove repetitive words (#82799)
Signed-off-by: carrychair <linghuchong404@gmail.com>
2024-03-12 07:40:27 -07:00
f1ded0f417 dnf: utilize the API for the installed checks (#82725)
Fixes #71808
Fixes #76463
Fixes #81018
2024-03-08 09:43:42 +01:00
a28709f92d dnf: fix installing a package based the file it provides (#82744)
Fixes #82461
2024-03-08 08:25:44 +01:00
e0c91af45f Remove os.environ compat for py2 and deprecate ansible.utils.py3compat (#82794) 2024-03-07 17:08:22 -06:00
5d15af3a95 Split the unified PR template into few (#82734)
Ref: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository
2024-03-07 22:22:05 +00:00
6db7a3bd64 Fix handling of ansible_loop_var and ansible_index_var inside ansible.builtin.include_tasks (#82789)
* added integration test for issue 82655 regarding ansible_loop_var and ansible_index_var inside included yml

* ensure correct handling of ansible_loop_var and ansible_index_var inside ansible builtin include_tasks Co-authored-by: Matt <matt@sivel.net>

* added changelog

* fixed new line issue
2024-03-08 05:08:29 +10:00
2cf52daa03 Handle error raised when argument validation (#82783)
* Handle error raised when argument validation with elements=int
  and value is not within choices

Fixes: #82776

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-08 05:04:58 +10:00
bb030db546 Re-enable psrp tests that were disabled (#82785) 2024-03-07 12:47:43 +10:00
942424e10b Avoid winrm hang on stdin write failure (#82766)
If the connection plugin fails to write the data to run to stdin we will
only attempt to get the output with one operation attempt. If this times
out we will consider the command to have failed and raise an exception
instead of forever attempting to get the output.
2024-03-07 08:47:04 +10:00
dd44449b6e Use of constant for 644 permission variable (#82762)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-05 16:09:58 +01:00
cdd303101e Follow fix for test_iptables (#82768)
* rename 'test_policy_table' to 'test_policy_table_flush' to remove duplicate
  test case name.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-05 12:42:08 +01:00
38006103dc Fixed typo 'must by' to 'must be' (#82769) 2024-03-04 15:31:20 -08:00
8750a1f9ac test: migrate iptables tests from unittests to pytest (#82647)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-01 09:01:33 -08:00
ca2de9e2a4 Improve documentation for replace module (#82756) 2024-02-29 11:01:26 -08:00
03246dc0ae galaxy: Skip verification for unwanted files (#82162)
Fixes: #81628

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-02-27 23:05:29 +00:00
4edd6ba04f Add MIRACLE LINUX as RedHat OS Family (#82722)
Co-authored-by: Taiki Fujiwara <taiki.fujiwara@miraclelinux>
2024-02-27 09:42:16 -08:00
77ab7afc3d dnf: obey the keepcache setting (#82735)
Fixes #81954
2024-02-27 15:22:56 +01:00
9a8be1e8c8 Disable ansible-test podman container tests on Ubuntu 22.04 (#82748) 2024-02-26 13:45:08 -06:00
79ea21a39f Fix error when templating an unsafe string leading to a type error in Python (#82675)
Fixes #82600
2024-02-26 15:39:07 +01:00
1b209d742e Galaxy trailing slash (#82732)
* fix: ensure path argument doesn't have a backslash

* feat: add changelog

* Update lib/ansible/cli/__init__.py

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

* Simplify logic and add tests

---------

Co-authored-by: dorkamotorka <teo.podobnik1234@gmail.com>
Co-authored-by: Teodor Janez Podobnik <48418580+dorkamotorka@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2024-02-22 04:09:24 +00:00
a1edb61ce7 ansible-test - Add work-around for pytest>=8 errors (#82723)
* ansible-test - Add work-around for pytest>=8 errors
* Update changelogs/fragments/ansible-test-pytest-8.yml

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2024-02-21 10:08:54 -08:00
386edc666e Add macOS 14.3 to CI and ansible-test
Additionally, this patch takes care of installing GPG within the
`ansible-galaxy-collection` test when running under macOS 14 and higher.

PR #82697

ci_complete
2024-02-16 21:26:16 +01:00
437457e6d9 Proxy more display methods (#81900) 2024-02-14 17:53:52 -06:00
5566a655ae Updates to interpreter discovery for 2.17 (#82420) 2024-02-14 13:16:54 -06:00
4bcc27ca99 add --extra-vars for ansible-galaxy role|collection init (#82605)
allow extra vars when templating j2 files in the skeleton, for example:

ansible-galaxy init --role-skeleton /path/to/skeleton --extra-vars @/path/to/vars_file.yml newrole

ansible-galaxy init --extra-vars "min_ansible_version=2.17.0" newrole
2024-02-14 13:50:36 -05:00
b88d43a029 uri: update use_netrc.yml (#82672)
Changed successfull to successful
2024-02-14 03:38:56 +00:00
6c21c545e1 Deprecate support for the v2 galaxy API (#82543)
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2024-02-13 09:31:33 -06:00
d15b77b94e fix find integration test
* original test assertion was not quoted properly and was thus silently "truthy" instead of actually functioning
2024-02-12 13:57:13 -08:00
a23ea2aef2 Reword warning if the reserved keyword _ansible_ is used (#82657)
Extend the wordings in warning if the reserved keyword _ansible_
is used as a module parameter.

Fixes: #82514

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Jordan Borean <jborean93@gmail.com>
2024-02-09 04:43:46 +00:00
c8d6f7b95e ansible-test - Fix validate-modules Python handling
The ``validate-modules`` sanity test no longer attempts to process files with unrecognized extensions as Python.

Integration tests have been added to verify Python-specific checks do not apply to these files.

The `invalid-extension` and `missing-gplv3-license` checks still apply to these files. This may change in the future.
2024-02-08 08:43:08 -08:00
e78be30baa apt_repository: Update PPA URL to point to HTTPS (#82599)
Fixes: #82463

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-02-07 11:07:35 -08:00
b6a89bff6c Add missing char 's' in exists documentation (#82651) 2024-02-07 10:45:43 -08:00
11efa5c48b Reduce complexity of Request.open (#81988) 2024-02-06 10:50:19 -06:00
eb44c77968 Remove tests for ansible-runner (#82571) 2024-02-06 09:50:54 -06:00
a452c53375 import_role - allow subdirectories with _from options (#82642)
* Allow subdirectories with import_role _from options

Add tests that tasks_from is restricted to the role

Note that a task like:

- import_role:
    name: role
    tasks_from: tasks/entrypoint.yml

will now load tasks from "{{ role_path }}/tasks/tasks/entrypoint.yml"
instead of "{{ role_path }}/tasks/entrypoint.yml". This change in
behavior matches include_role.

* better test case (filename doesn't match one in tasks/)

Fixes #82584
2024-02-06 16:13:47 +01:00
da26e2a5eb iptables: added choices in match_set_flags option (#82641)
* 'src,src', 'dst,dst' added as new option choices in
  match_set_flags option

Fixes: #81281

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-02-06 16:12:54 +01:00
a10d255e0b dnf,dnf5 - add the best option and fix nobest (#82627)
best/nobest options are one of the options whose default values are set
by an OS distribution. For example in our CI, both Fedora and RHEL set
the best option to different default values. As such we should defer to
the distributions for the default value and not change it by default but
if users wish to change it they can do so explicitly.

Currently the dnf module sets the nobest option inconsistenly and not for
all cases. This patch fixes that to reflect the behavior described
above. In addition adding the best option for both dnf and dnf5 modules
since the best option is prefer to nobest in dnf while in dnf5 nobest is
completely removed in favor of best.

Fixes #82616
2024-02-01 14:05:57 -05:00
e458cbac61 Allow for arbitrary key 'context' in argument spec (#82183)
* Allow for arbitrary key 'context' in argument spec
2024-01-30 08:59:57 -06:00
7a0c321054 Remove redundant undefined error message (#81867)
Fixes: #78703

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-01-29 17:00:53 -08:00
bec27fb4c0 prettyfy ansible-doc (#75116)
* prettify ansibile-doc output

delimiters when no color
avoid triggering color mode for existing tests
all use _format to observe nocolor
more v more info
imporoved conditional display
updated version on -v
normalize role errors
expand role data, dedupe code, fix formatting on warning
fix bug with galaxy info
role list improvements:
 lists all roles (even w/o meta/argspec)
 specs now indented under role
 role only listed once
Updated tests to reflect format changes

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-01-29 10:16:53 -05:00
6d34eb88d9 Do not ignore SyntaxError from jinja2.Environment.from_string (#82607)
Jinja may generate an invalid Python source code from a template. Trying
to compile such source code into a Python code object results in
SyntaxError being thrown. An example of such a template is providing the
same keyword argument into a lookup twice, resulting in:
`SyntaxError: keyword argument repeated`.

Since `jinja2.exceptions.TemplateSyntaxError` does not cover such a
case, as it is not a Jinja parsing error, we need to catch SyntaxError
explicitly ourselves.

Fixes #82606
2024-01-29 10:33:33 +01:00
13e6d8487a fix loading vars_plugins in roles (#82273)
* Fix loading legacy vars plugins when the plugin loader cache is reset

* Remove extra cache layer by ensuring vars plugin names are cached (stateless or not) so that the plugin loader cache can double as the load order
2024-01-26 09:01:14 -05:00
8641144375 Adding note about implicit groups (#82580)
clarifying usage in conjunction with use_group_vars
2024-01-23 16:00:44 -05:00
8b2dd5fdd3 updated looups to use set_option in custom parse (#82425)
limit password params
  updated test error message catching
  make sure we reset params for each term
  ensure we only update options if we have em
2024-01-23 14:48:32 -05:00
f73d72e830 find: do not fail on PermissionError (#82282)
* Log and skip permission errors on files and directories

Fixes: #82027

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-01-23 10:55:13 -08:00
f024cf35d7 Remove the yum module, redirect it to dnf (#81895)
Fixes #81728
2024-01-23 10:23:43 -06:00
c7334ea92c Fix url encoded credentials in netloc (#82552)
Prior to this commit, it was impossible to use a module like dnf with a
URL that contains a username with an @ such as an email address
username, because:

  dnf:
    name: https://foo@example.com:bar@example.com/some.rpm

Would cause netloc parsing to fail. However, the following:

  dnf:
    name: https://foo%40example.com:bar@example.com/some.rpm

Would also fail because ansible would *not* URL-decode the credentials,
causing the following to be base64 encoded in the Authorization header:

  Zm9vJTQwZXhhbXBsZS5jb206YmFyCg==

Which decodes to:

  foo%40example.com:foo

Which is *not* the authorized username, and as such, *won't* pass basic
auth.

With this commit, Ansible's url lib behaves like curl, chromium, wget,
etc, and encodes the above to:

  Zm9vQGV4YW1wbGUuY29tOmJhcgo=

Which decodes to:

  foo@example.com:bar

Which will actually pass the HTTP Basic Auth, and is the same behaviour
that you will find ie. with:

  curl -vvI https://foo%40bar:test@example.com 2>&1 |grep Auth | awk '{ print $4 }'
2024-01-23 09:37:36 -06:00
06cd285901 Play recap stats and callbacks for include_role, consolidate with include_tasks (#79260)
This moves handling of callbacks and play recap stats from
_load_included_file to individual strategies so include_role tasks are
accounted for, not just include_tasks.

Fixes #77336
2024-01-23 15:57:05 +01:00
9c5d3060e5 uri: Handle the "force" parameter properly (#82187)
* uri: Two tests that demonstrate missing handling of the "force" parameter

Add unit and integration tests that demonstrate that the uri module is not
handling the "force" parameter.

The unit test demonstrates that when "force" is present in the module parameters,
it is not being passed through to fetch_url().

The integration test demonstrates that "force" does not disable caching as
documented, and calls with a "dest" parameter that points to an existing file
can result in a "304 Not Modified" response.

* uri: Handle the "force" parameter properly

The uri module documents a "force" parameter that can be used to disable caching.
The module accepted the parameter but didn't pass it through to the fetch_url() method
which implements the logic to handle setting the appropriate headers for disabling
caching. This change passes the "force" parameter through as expected, allowing caching
to be disabled when requested by the module caller.
2024-01-23 08:54:18 -05:00
aa40167f40 find - add encoding option to use in conjunction with contains (#82284)
*  when doing a 'contains' search, determine the encoding of the files to be searched

* set default encoding to None for backwards compatibility

* changelog, error handling, tests added

* add sanity ignore.txt for non-utf-8 test
2024-01-22 08:53:37 -05:00
b01f1f207c Support action_plugin in plugin_routing_schema (#82562)
now validation schema matches reality

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
2024-01-19 16:21:10 +00:00
853423c270 test_encrypt: remove unreachable assertion (#82570)
We explicitly skip tests in environments where passlib is not available.
2024-01-19 14:37:25 +01:00
a3e5546e43 🔥 Exterminate __builtin__ import from tests (#82569)
This patch removes an import fallback that was only executed under
Python 2. Now that we don't run tests against that runtime, it
generates an uncovered line. Dropping it will slightly increase the
coverage metric as a side effect.
2024-01-19 14:33:25 +01:00
6935c8e303 Ensure ANSIBLE_NO_LOG is respected (CVE-2024-0690) (#82565) 2024-01-18 15:37:39 -06:00
48bed1e15a Fix ansible.builtin.include_vars - depth (#80995)
* Changes as suggested by sivel

* Add changelog fragment and tests

Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
2024-01-18 11:56:54 -05:00
3f74bc08ce Remove crypt support from ansible.utils.encrypt (#81721)
Fixes #81717

Co-authored-by: Matt Clay <matt@mystile.com>
2024-01-18 08:23:01 +01:00
71d81e4a60 Add no-unwanted-characters sanity test for core (#82557) 2024-01-17 11:19:37 -08:00
30169c76de Replace Unicode no-break spaces with ASCII spaces 2024-01-17 10:26:30 -08:00
4aa109897f default svn URL to 127.0.0.1 for subversion integration tests (#82551)
* default svn URL to 127.0.0.1 for subversion integration tests

* svn client gives up before trying IPv4 addresses when localhost->(::1,127.0.0.1) in dual-stack envs (eg podman, most real hosts)
* svn client also requires legacy CN match on cert
* IPv6 works, but setup playbook would need a bunch more templating exceptions to conditionally manage `[::1]`

* explain IPv4 defaults
2024-01-17 09:49:47 -08:00
d9709c5ae9 module_utils/basic.py: remove PY2 compat (#81989) 2024-01-17 15:35:57 +01:00
975cf1655a modules: remove PY2 compat (#81990) 2024-01-17 09:24:35 +01:00
4a2de764ec Fix issues with ansible-playbook-callbacks test (#82407)
The timing of the async tasks was a little unpredictable, meaning that
sometimes we would get an unexpected number of v2_runner_on_async_poll
callbacks, and fail the test. This change fixes the issue by increasing
the poll interval to 2 seconds and the sleep duration to 3 seconds, such
that on a reasonably responsive system we will poll twice per task, with
the sleep ending in the middle of the two polls.

The include_me.yml file does not exist in this integration test. It has
been added.

The remote_tmp_dir.path expression is invalid - the setup_remote_tmp_dir
role uses set_fact to set remote_tmp_dir to remote_tmp_dir.path.

The integration tests run with ANSIBLE_HOST_PATTERN_MISMATCH=error,
meaning that the final play was never reached. Set
ANSIBLE_HOST_PATTERN_MISMATCH=warning to continue past the play and
trigger the v2_playbook_on_no_hosts_matched callback.
2024-01-17 09:22:40 +01:00
5f1b3898e8 Avoid delattr in test callback plugin (#82550)
This prevents the test plugin from tampering with the base callback plugin,
which causes issues with all other callback plugins running in the test.
2024-01-16 22:57:34 +00:00
b8c7ed39e4 Reboot timeout fix (#82526)
reboot now uses fallback as some plugins or older versions on ssh one use 'timeout' instead of 'connect_timeout'
2024-01-16 17:17:14 -05:00
0429520790 expect docs - improve responses description (#82544)
* consolidate notes describing the structure of `responses` with the option description

* include a link to Python regex syntax
2024-01-16 15:03:38 -05:00
6b9f49b6c5 Update attribute description for check_mode (#82536)
Fixes #82509
2024-01-16 16:10:11 +01:00
bf9509bf33 validate_argument_spec: fixed example syntax (#82534) 2024-01-13 08:17:21 -08:00
21247c828e ansible-test - Bypass PEP 668 checks
When ansible-test installs requirements, it now instructs pip to allow installs on externally managed environments as defined by PEP 668.

This only occurs in ephemeral environments managed by ansible-test, such as containers,
or when the `--requirements` option is used.
2024-01-11 14:10:31 -08:00
da9edd7760 expect - fix argument spec error with timeout=null (#82522)
* Fix using timeout=null to wait indefinitely

* fix error message
2024-01-12 05:21:29 +10:00
d7be3824fe [ansible-galaxy] Remove role name conversion when the repo startswith 'ansible-role' (#82508)
* Remove role name conversion based on whether the repo name starts with
ansible-role

This was added in 2.3 to match the Galaxy ui behavior of truncating the
'ansible-role-' prefix automatically, but the new backend requires an
alternate name to be provided or defined in the ``galaxy_info``
metadata.

Roles that were imported using the ansible-role-$name convention will
need to use ``--role-name`` or add ``role_name`` to the ``galaxy_info``
dictionary in ``meta/main.yml``.

changelog

* Update changelogs/fragments/fix-default-ansible-galaxy-role-import-name.yml

* Update changelogs/fragments/fix-default-ansible-galaxy-role-import-name.yml

Co-authored-by: flowerysong <junk+github@flowerysong.com>

---------

Co-authored-by: flowerysong <junk+github@flowerysong.com>
2024-01-12 05:11:56 +10:00
d2812aeb6f Update example in apt module docs (#82504)
All examples should use fully qualified collection names to avoid confusion.
2024-01-12 05:10:07 +10:00
a69fab86bc ansible-test - remove Fedora 38 container and remote support
Fixes: #82022

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-01-10 11:05:57 -08:00
78c9090986 Don't hard-code Alpine version in container test 2024-01-10 10:09:51 -08:00
4760dae989 document apt auto-installed dep (#82503) 2024-01-09 19:49:13 -05:00
596c75c2bc uri action plugin check_mode support update (#82484)
Also updated base action messages to be more specific
2024-01-09 12:14:00 -05:00
6c2895fd88 ansible-config dedupe ini plugin entries (#82498)
added test for ini file integrity, also ensuring no dupes
2024-01-09 12:07:03 -05:00
623e0eee42 Add Alp-Dolomite to Suse family list (#82496) 2024-01-09 10:49:49 -05:00
53ddc1648e deb822_repository: handle idempotency (#82483)
* deb822_repository: handle idempotency

Sort the parameters in order to handle idempotency

Fixes: #82454

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-01-09 10:34:18 -05:00
57a59e7194 Misc fix (#82482)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-01-09 10:33:29 -05:00
ceaf68a02c Deprecate required param in get_bin_path (#82466)
* Deprecate `required` param in get_bin_path

* The parameter `required` in process.get_bin_path API
  is deprecated. Will be removed in 2.21

Fixes: #82464


Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2024-01-09 10:25:01 -05:00
6c647aa263 Interpret double newlines as paragraph breaks in documentation strings. (#82465) 2024-01-09 10:23:08 -05:00
0a45dad884 Add VMware virt detection for hardware version of ESXi 8.0. (#82455)
* Add VMware virt detection for hardware version of ESXi 8.0.

* Add changelog for PR#82455
2024-01-09 10:10:35 -05:00
caa86cc4df Add the task info for tombstoned module/action plugins (#82451)
* Add the task info for tombstoned plugins

* Fix deprecation for 'include' by removing it from BUILTIN_TASKS which skip the plugin loader lookup

* changelog

remove obsolete unit test using 'include'

* Update changelogs/fragments/improve-tombstone-error.yml
2024-01-08 04:12:39 +00:00
b5649f9686 Remove more Python 2 handling from tests (#82449) 2024-01-08 04:00:10 +00:00
71a5212586 Add skips for encrypt unit tests for Python 3.13 2024-01-05 12:17:42 -08:00
6e4a5acfbd lineinfile, remove incorrect/unused 'others' option (#82436)
* move incorrect, unused 'others' option

 this was to document 'file' options are usable .. but we already
 import the file fragment to document those options.

* removed now bad ignore
2024-01-04 11:29:04 -08:00
8762d9e7e6 Adds details to the password_hash documentation (#82419)
fix for issue 82415

-

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2024-01-04 09:42:13 -05:00
c75624fbdc ansible-test - Enable shellcheck SC2164 2024-01-03 17:52:29 -08:00
3c432fea43 ansible-test - Update base/default test containers 2024-01-03 17:17:00 -08:00
a1958eefed Fix plugin_loader integration test error handling 2024-01-03 17:14:56 -08:00
630e5dda25 Clean up shellcheck issues in tests 2024-01-03 16:23:25 -08:00
e1bcb8a534 Remove unused unit test code 2024-01-03 14:34:20 -08:00
29b2405b84 Revert "Fix older external connection plugins without _sub_plugin declaration (#79372)" (#82473)
This reverts commit ef1e01aa8b.

broken tests
2024-01-03 17:35:03 +00:00
ef1e01aa8b Fix older external connection plugins without _sub_plugin declaration (#79372)
fixes https://github.com/ansible/ansible/issues/79371

* Check for sub=={} too
* Add a test case for older plugins that do not define '_sub_plugin'
* Add test for legacy plugins
2024-01-03 11:18:31 -05:00
55065c0042 Role fixes (#82339)
* Various fixes to roles

  - static property is now properly set
  - role_names and other magic vars now have full list
  - role public/private var loading is now done when adding to play.roles instead of on each var query
  - added tests

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-22 09:52:12 -05:00
fa92228b50 Replace unwelcoming words (#82413)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-12-18 12:05:15 -05:00
4479c9df13 Fix plugin set option (#82300)
* plugin config, ensure set_option correctly casts

  until now we relied on plugin author getting the right type, now
  the config system itself will process as it would for set_options
2023-12-14 09:41:48 -05:00
5346009d2c ansible-test - Allow multiple documents in the YAML stream for EXAMPLES (#82355)
* Allow multiple documents in the YAML stream for EXAMPLES.

* Add integration test

* linting
2023-12-14 06:18:35 +10:00
8328153121 Run all handlers with the same listen topic when notified from another handler (#82364)
Fixes #82363
2023-12-13 10:56:52 +01:00
fe81164fe5 ansible-galaxy - fix exit code for failed role import (#82193) 2023-12-12 13:59:19 -05:00
7f2ad7eea6 assemble: fixed missing parameter error (#82360)
* content is an optional parameter for _get_diff_data API

Fixes: #82359

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-12-12 11:22:23 -05:00
a9919dd7f6 lookups, make file searching use better is_role (#82290)
* lookups, make file searching use better is_role

 The dwim function will internally try by detecting tasks/main['','.yml','.yaml]
 but this is far from optimial, the existince of role path in vars is much better
 indicator that we can use to pass a hint


* updated test to avoid main.yml
2023-12-08 11:05:40 -05:00
5573d4cde9 Scripts inventory plugin, add examples (#82361)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-08 09:51:37 -05:00
8af920c892 Add helptext to ansible-inventory's positional arg (#82332)
* Add helptext to ansible-inventory's positional arg

This explanation is already present in the documentation and
should make the usage more clear when looking at the --help output

* fix indentation

* change description of positional arg

It has no effect on --list and the docs now reflect that
2023-12-08 05:12:52 +10:00
9b002d2e63 check if there attributes to set (#78707)
Fixes: #76727
2023-12-06 09:02:51 -08:00
dd0138ba21 🧪 Replace GitHub SVN integration test with local TLS (#82334)
* Run svn integration test locally with TLS

This patch uses a `trustme` to make an ephemeral CA, and server, and
client TLS artifacts for testing. These are integrated into the Apache
web server via it's `mod_ssl`.

Resolves #82207

* Replace GitHub SVN HTTPS URL w/ localhost over TLS

This change gets rid of the need to use GitHub, which is just about to
drop support for SVN [[1]]. Moreover, it eliminates the need to use
external network for any SVN commands in the test.

[1]: https://github.blog/2023-01-20-sunsetting-subversion-support/
2023-12-06 17:10:56 +01:00
6ebefaceb6 Better errors for delegate_to (#82319)
Handle empty result of templating
  Also skip work when we omit
2023-12-04 10:19:12 -05:00
3a42a00368 Targeted fix for installing roles with symlinks containing '..' (#82165)
Set the tarfile attribute to a normalized value from unfrackpath instead
of validating path parts and omiting potentially invald parts

Allow tarfile paths/links containing '..', '$', '~' as long as the
normalized realpath is in the tarfile's role directory
2023-11-30 18:05:48 -05:00
b405958f79 fixes typo in cli/ansible-pull arguments (#82316) 2023-11-30 14:13:39 -05:00
1dd0d6fad7 remote log info (#81711)
Both posix and powershell avenues updated to allow for customized string logging on remote

Co-authored-by: Jordan Borean <jborean93@gmail.com>
2023-11-30 13:12:55 -05:00
4208bdbbcd ansible-test - Update nios-test-container to 3.0.0 2023-11-30 09:59:49 -08:00
ee86dafc6e Amend doc of name= parameter to indicate a list of packages can be used (#82309)
* Amend doc of name= parameter to indicate a list of packages can be used

One of the examples here shows package installing a list of packages, but the name= parameter did not reflect this possibility.

* add dependency to underlying package manager
2023-11-30 11:09:35 -05:00
e80507af32 fact_gathering improve linux thread counts (#82261)
don't use `//` aka `floor()` as some architectures show counts of 1.9 threads per CPU and market as 2 per CPU, `round()` will be closer to that.
2023-11-28 10:49:52 -05:00
fd2d0ecfb7 Remove unneeded Task.is_static assignment (#82288)
Added in b38f746 but there is/was no Task.is_static so this just creates
a new attribute dynamically that is/was never used.
2023-11-28 10:35:31 -05:00
322eb0f884 changed the salt type from int to string (#82274) 2023-11-28 10:23:39 -05:00
265f5e724c apt_repository: Do not convert symlink repo to a normal file (#82271)
* apt_repository: Do not convert symlink repo to a normal file

* module manually writes to repo files. If the file is a symlink
  module used to re-write and convert a symlink to a normal file.
  This fix tracks the symlink and keeps the changes intact.

Fixes: #49809

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-28 10:20:57 -05:00
e6e19e37f7 validate-modules: Check for correct values in choice (#82266)
* validate-modules: Check for correct values in choice

* validate-modules test now checks the length of choices and
  correct option values inside the choice.

Fixes: #82179

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

* Fix sanity tests

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

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-28 10:09:29 -05:00
0806da55b1 Add DCO and update CONTRIBUTING.md (#82105) 2023-11-27 10:19:37 -08:00
479949aad2 Fix broken docs RST reference. (#82286) 2023-11-27 10:02:20 -05:00
afd45aca6a ansible-test - remove rhel 9.2 test remote (#82211)
Fixes #82024
2023-11-27 10:03:42 +01:00
e0bf76e3db Issue #80267: Remove user not found warning (#80291)
Co-authored-by: Sebi94nbg <sebastian.kraetzig@4g-server.eu>
2023-11-23 15:25:35 +01:00
d664f13b4a Allow include_tasks handlers for searching role subdirs (#82248)
Fixes #82241
2023-11-22 17:42:51 +01:00
a4b00793be Update known_hosts module to better handle @cert-authority keys (#70340)
Signed-off-by: Chris Francy <zoredache@gmail.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-21 16:55:01 -08:00
7dde4901d4 unarchive: support 8 character permission strings (#81705) 2023-11-21 16:48:31 -08:00
ce9d268ab8 unarchive: force unarchive if the symlink target changes (#82253)
Fixes: #30420

Original PR from nrwahl2 (https://github.com/ansible/ansible/pull/30463)

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-21 09:11:23 -08:00
d6a8df3218 csvfile - add a keycol parameter to specify in which column to search. (#82242) 2023-11-21 10:40:31 -05:00
0a6779f6b7 docs: improve readability & scope of docs for ansible.builtin.assert (#82256)
Co-authored-by: Jonathan Biegert <jonathan.biegert@sva.de>
2023-11-21 10:24:07 -05:00
c35e0e8fd8 Re-enable "group removal" integration test for dnf5 (#82250)
Fixed in https://github.com/rpm-software-management/dnf5/pull/1013
2023-11-21 10:19:28 -05:00
fbdb666411 ansible-test: Added Fedora 39 (#82218)
* Fedora 39 remote
* Fedora 39 container

Fixes: #82018

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-17 02:30:13 +00:00
8fd1aa0d2e syslog: Handle ValueError raised while sending logs to syslog (#82225)
* ValueError exception is raised when Null Character is sent
  to syslog.syslog with Python 3.12.
* Handle this error gracefully instead of stacktrace

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-16 21:15:08 +00:00
1a759659fe Enable vendored copy of distutils in entry_point test (#82232)
* Enable use of vendored copy of distutils by removing
  the environment variable SETUPTOOLS_USE_DISTUTILS

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-16 12:21:19 -08:00
8b102dca4a wait_for, fallback to read for non mmapable files (#82064)
* also handle oserror, added debug jic
2023-11-16 15:20:52 -05:00
f6d7dd0840 displaly. log, handle when caplevel is already taken care of (#82227)
reneables ansible logging
2023-11-16 19:49:40 +00:00
f8cdec6324 ansible-test: Downgrade containerd for Fedora 39 (#82231)
* containerd 1.6.23 on Fedora 39 causes issue. Downgrading
  to containered to 1.6.19-2 works.
* See: https://bugzilla.redhat.com/show_bug.cgi?id=2237396

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-16 19:18:18 +00:00
a45dc10b8f ansible-test: Skip modularity test for Fedora 39 and up (#82230)
* Modularity is deprecated in Fedora 39 and onwards,
  Skip modularity tests

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-16 19:14:07 +00:00
6e448edc63 no_log avoid masking booleans (#82217)
* no_log avoid masking booleans

* clog

* fix issues
2023-11-17 05:04:34 +10:00
f42984eeb3 Fix ManifestControl dataclass to work with future annotations (#82215)
* Fix ManifestControl dataclass to work with future annotations

* Add tests
2023-11-17 05:02:58 +10:00
3d9e5c8b9d fix pc misuse (#82157)
use the more up to date 'task' as play_context only has the 'initial' values.
2023-11-16 09:30:18 -05:00
e2d108db2b log verbosity (#81692)
Allow users to adjust verbosity to logs at same or higher level than to callback/screen

Co-authored-by: Matt Clay <matt@mystile.com>
2023-11-15 20:57:59 -05:00
dbddabce9e Create prefix of file using ansible.builtin.tempfile (#82209)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-15 10:43:10 -08:00
8825e60add ansible-pull: expand destinantion directoy to avoid purgin in / (#82030)
* expand destinantion directoy to avoid purgin in /

  bad things could happen and help alone is not enough
2023-11-15 10:09:04 -05:00
05259aa6ce Restart a Service with Sleep Between Stop and Start (#82210)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-14 19:40:48 -08:00
0bab08ee33 ansible-test - Add RHEL 9.3 support (#82178)
Fixes #82020
2023-11-14 08:23:44 +01:00
2277d470b3 fix typo (#82202) 2023-11-13 14:59:07 -05:00
4a84a9b3db copy keep suffix on temp file for validation (#82158)
Also updated test to require suffix

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2023-11-13 10:03:58 -05:00
a8b6ef7e7c flush_handlers: handle a failure in a nested block with force_handlers (#81572)
Fixes #81532

ci_complete
2023-11-13 09:57:43 +01:00
9c09ed7392 Fix typo in validation.py (#82195)
covert -> convert
2023-11-12 06:54:53 -08:00
667526c22f Fix two misspellings of occurred (#82159) 2023-11-08 13:50:08 -08:00
f2b5c33349 fixed typos in the documentation (#82077) 2023-11-08 11:54:48 -08:00
fd009a073a Remove sefcontext support plugin
It was only used by the subversion test, but is no longer required.
2023-11-07 17:45:13 -08:00
0e6942a4d7 Remove unused unit test code (#82168) 2023-11-07 15:59:08 -08:00
c5b68ef16d Update Python3
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-07 15:43:31 -08:00
98407fc00e Remove unused validate-modules unit test code 2023-11-07 13:43:11 -08:00
dae4e2f07f Remove unused/unreachable unit test code (#82160) 2023-11-07 12:41:42 -08:00
0be33551d7 Remove unit tests dependent on systemd bindings (#82161)
These do no not run as part of our test suite.
2023-11-07 12:41:16 -08:00
78c16d983e Remove type_regex testcase
This is leftover testcase for type checker regex removed in
https://github.com/ansible/ansible/pull/82153

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-07 12:39:08 -08:00
9dd3eafa14 ansible-test - Use pylint unidiomatic-typecheck
This replaces the regex based check previously used within the validate-modules sanity test.

NOTE: The pylint check overlaps with a similar check for pep8.
      Both are used, since the pep8 based check is more nuanced than the one in pylint.
      For example, allowing `is` checks, but not `==` comparisons.
      If the pylint check is ignored, the pep8 check would still be relevant.
2023-11-07 11:04:22 -08:00
78546382b3 setup.cfg: add Programming Language :: Python :: 3.12 classifier (#82151)
ansible-core 2.16+ supports Python 3.12. This corrects missing metadata.
2023-11-07 09:23:47 -06:00
d46b042a94 Reword note on default determination on other OSes (#82147) 2023-11-07 09:20:46 -06:00
40baf5eace iptables - set jump to DSCP when set_dscp_mark or set_dscp_mark_class is set (#82145)
set_dscp_mark and set_dscp_mark_class is only valid when jump is set to
DSCP.

Fixes: #77077

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-07 09:19:25 -06:00
567c78f9a1 Update playbook responses for specific prompts (#82137)
Example is added for multiple questions with responses
2023-11-07 09:14:22 -06:00
7538668731 Check strict before failing to respect skip_broken (#80795)
Fixes #80590
2023-11-07 07:56:12 +01:00
916a20fccd Ignore coverage of test code that does not run 2023-11-06 13:17:30 -08:00
90203b841a Use functools.update_wrapper instead of a copy 2023-11-06 12:01:18 -08:00
dec9eeb2e5 Remove create_new_password parameter in CLI.build_vault_ids (#82066)
* Remove unused argument in call to build_vault_ids

* Remove obsolete build_vault_ids tests

* Change tests to account for argument removal

* Remove redundant test
2023-11-06 09:30:13 -05:00
20a54eb236 restore role param precedence (#82106)
* add test for setfact/param override
2023-11-06 09:18:35 -05:00
5ac62473b0 dnf: properly set gpg options on repos (#80777)
Fixes #80110
2023-11-06 10:22:35 +01:00
51d691bfa9 remove the obsolete TODO comments (#73116)
Co-authored-by: Zhipeng.Gao <zhipeng.gao@monash.edu>
2023-11-06 04:40:03 +00:00
ac3ae94ae1 Ignore coverage on code intended never to execute (#82128)
* Ignore coverage on code intended never to execute

* Fail collection loader test if wrong code runs

* Update boilerplate test to accommodate nocover
2023-11-02 15:28:06 -07:00
8ecc1d485b Fix the strategy plugin description in keywords (#82113)
Fixes: https://github.com/ansible/ansible-documentation/issues/762

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-02 17:17:46 -04:00
1df791cd90 Ignore code which coverage can't analyze (#82125)
* Ignore code which coverage can't analyze

Our own tracing function can't be traced.

* Use `nocover` instead of `no cover` for consistency
2023-11-02 14:14:51 -07:00
f8a9fd4758 Remove duplicate winrm test (#82124) 2023-11-03 07:08:15 +10:00
36d6860d80 ansible-test - Remove no-main-display sanity test 2023-11-02 13:34:20 -07:00
6e15fb0ebf ansible-test - Removed no-basestring sanity test 2023-11-02 12:32:01 -07:00
c349b91af3 ansible-test - Removed no-dict-* sanity tests 2023-11-02 11:55:14 -07:00
9765bb46f9 ansible-test - Remove no-unicode-literals test 2023-11-02 11:42:02 -07:00
172a010dd7 Remove unused test support plugins 2023-11-02 11:40:34 -07:00
5b1b0ce762 Remove Python 2 compat (via six) from unit tests 2023-11-01 17:05:36 -07:00
18e8401edd Remove Python 2.x compat from unit tests (#82109) 2023-11-01 16:37:08 -07:00
bea459654a pip - Add module in venv example 2023-10-31 09:14:51 -07:00
89cda0bcae pip - Add break_system_packages option (#82097) 2023-10-30 17:04:03 -07:00
3ea5304a57 add pep668 note to pip module docs (#82096) 2023-10-30 23:38:36 +00:00
f8de6caeec Reboot - delete useless parameter async, not supported (#80017)
Co-authored-by: baptch <b.jean.ch@gmail.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2023-10-28 04:14:15 +00:00
2908a2c32a corrected become same user config docs (#82059)
fixes #82057
2023-10-27 00:21:30 -07:00
b34f4a559f Add support for TLS 1.3 Post Handshake Auth (#82063)
TLS 1.3 adds a different method it can use to request a client
certificate after the handshake but Python does not allow this by
default. This commit sets the attribute needed to enable this scenario
when using client certificates on Python 3.8+, 3.7.1+.
2023-10-27 12:00:34 +10:00
f5a0c0dfc8 Ignore testing data for gitleaks (#82083) 2023-10-27 05:49:41 +10:00
9b78316687 docs(template): use unambiguous syntax for mode (#82079) 2023-10-27 05:21:25 +10:00
664fe45be9 Create a User with a Home Directory (#82078) 2023-10-27 05:20:50 +10:00
f5d7dc1a97 Legacy.psm1 - Add note telling people not to use function (#82076) 2023-10-27 05:16:05 +10:00
fb8ede22e1 don't warn about using a yescrypt hash as user password (#82071)
* dont warn about using a yescrypt hash as password

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* add changelog

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* add yescrypt test

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

---------

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2023-10-27 05:03:49 +10:00
e8ef6b7d7c Consolidate systemd detection logic (#81809)
* Add logic to consider the canary location for systemd files

Fixes: #80975

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-10-25 19:09:46 -07:00
bf29458726 Address nuance in key checking docs (#82058)
* Address nuance in key checking docs

  and add note to ssh plugin to let users know 'final authoritative source'.

* Update lib/ansible/plugins/connection/ssh.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-10-25 12:02:29 -04:00
b4920c83ad Fix locale related parsing error in git.py
* Fix locale related parsing error in git.py

This fixes the issue found at https://github.com/ansible/ansible/issues/77213 which got introduced by changing over to "best parseable locale" approach, but missing out the requirement of locales other than `L` having to have `LANGUAGE` specified as well. For further details, check this post within the issue discussion: https://github.com/ansible/ansible/issues/77213#issuecomment-1446919617

* Add changelog

Create 81931-locale-related-parsing-error-git.yml
2023-10-25 15:47:55 +02:00
fe94a99aa2 any_errors_fatal fixes (#78680)
Fixes #31543
Fixes #36308
Fixes #73246
Fixes #80981
Fixes #81533

ci_complete
2023-10-25 09:42:13 +02:00
c827dc0dab Remove obsolete requirements from prepare_http_tests 2023-10-24 09:19:58 -07:00
0bfc5bcf82 Fix contains example (#82067)
* Added missing round bracket

Fixes: https://github.com/ansible/ansible-documentation/issues/555

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-10-24 17:30:11 +02:00
99e0d25857 ansible-pull now handles all secret files CLI options (#82009)
* ansible-pull added missing pasthrough for secrets

 Both become and connection password file options were missing.
 Also added test
2023-10-24 09:20:25 -04:00
9ee603d1c5 Clarify some points in config lookup documentation (#81951)
Also update tests to support the format on modules/plugins

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-24 09:17:32 -04:00
b815b15362 Fix additional spelling errors in builtin modules (#82012) 2023-10-23 21:22:35 -07:00
0b7387d46c Improve filter_encryption test
- Update `data2_vaulted_string_with_id` to match the documented plaintext.
- Add a comment explaining how `data2_vaulted_string_with_id` was derived.
- Add assertions for unvaulted values to ensure they match their plaintext.
- Add round-trip tests for vault+unvault when no salt is used.
2023-10-23 15:46:00 -07:00
2d2211e4e1 Simplify filter_encryption test (#82062) 2023-10-23 19:11:31 +00:00
40263992df remove args passthru on role runme tests that use grep (#82060)
* varying verbosity was masking some first-pass test failures
2023-10-23 17:37:50 +00:00
b4566c18b3 Fix Jinja plugin deduplication (#82002)
for j2 plugins dedupe on path and  not basename
for j2 this is a container file , for other plugins file name == plugin name
2023-10-20 19:00:41 -04:00
e933d9d8a6 ansible-test - Fix parsing of cgroup entries 2023-10-19 15:30:32 -07:00
09d943445c 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
2023-10-19 13:49:00 -07:00
598a9307d7 var names not matching in example. (#82001)
Update to var name as example is not correct.
2023-10-19 12:41:51 -07:00
2e4f5d5ca0 Replace launchpad.net/api with api.launchpad.net @ apt_repository module
This patch is a refactoring change. It replaces one Launchpad endpoint URL with another on a subdomain. There is no functional effect to this whatsoever.

PR #81978

Refs:
* https://github.com/ansible/ansible/pull/81978#issuecomment-1767062178
* https://bugs.launchpad.net/launchpad/+bug/2039251/comments/12
2023-10-19 01:33:11 +02:00
37cee8bdfc ansible-test - Remove special cryptography install (#82008)
Python 3.10 is the minimum version on the controller, and it requires openssl 1.1.1 or later.

As a result, there's no need to check the openssl version any longer.
2023-10-18 10:52:18 -07:00
74f6e6a134 Update apt.py (#81975)
updating documentation
2023-10-17 11:58:04 -04:00
22568305d6 Add ignore invalid options override for mod wrapper (#81899)
Adds an option that can have an action plugin tell the module to ignore
options that do not fit its arg spec. This is to enable support for core
running modules that exist outside of the collection that may not be new
enough to support some of the options supplied to it.
2023-10-17 11:05:21 -04:00
5812cabaf5 Fix typos in builtin modules (#81969) 2023-10-13 20:37:58 -07:00
4f04df75cc Fix outdated S3 URLs (#81964)
We should always use the CloudFront backed endpoint (ci-files) not the direct S3 bucket reference (ansible-ci-files).
2023-10-12 19:28:40 -07:00
f5c742cdfd ansible-test - Clean up old Python 2 compat code (#81962)
* Update generated code __future__ import

* Remove Python 2.x compat from compile sanity test

* Remove __metaclass__ from pylint good names list

* Remove Python 2.x compat from ansible-test injector

* Remove Python 2.x compat from ansible-test importer

* Remove Python 2.x compat from ansible-test units

* Remove Python 2.x compat from validate-modules

* Remove Python 2.x compat from pylint plugins

* Remove more Python 2.x compat from ansible-test

* Remove Python 2.x openssl detection in ansible-test

* Remove obsolete Python 2.x comment

* Remove obsolete ansible-test Python 2.x support

* Remove unused bootstrap script functions

* Keep mypy happy

* Remove unused imports

* Keep pylint happy
2023-10-11 19:04:30 -07:00
3ae8541133 Update boilerplate in galaxy network templates (#81959) 2023-10-11 18:32:57 -07:00
3f607359de Remove obsolete compat code from integration tests (#81961)
Also fix up boilerplate for non .py extension files that contain Python code.
2023-10-11 18:22:33 -07:00
40e4c69724 Cleanup the hacking directory a bit (#81960)
* Clean up hacking/ansible-profile script

Also rename the script so it has a `.py` extension.

* Remove test-module symlink

Use the test-module.py script instead.
2023-10-11 17:44:42 -07:00
9295bb5b5d Unit test cleanup (#81958)
Remove obsolete Python 2.7 and 3.6 support code and fix up existing tests.
2023-10-11 17:31:04 -07:00
fd0f48e99d ansible-test - Update base/default containers (#81957) 2023-10-11 17:17:11 -07:00
d8484f0af7 Update default test container Python to 3.12 and support for PyLint 3.0.1 (#81953)
* temporary PyLint plugin to mask 3.12 finalizer noise

* ansible-test - Default to Python 3.12 for base/default

* ansible-test - Update pylint requirements

* ansible-test - Remove obsoleted changelog entry

* Add changelog fragment for pylint work-around
2023-10-11 13:04:22 -07:00
d2ba76c117 Remove Python < 3.5 selectors fallbacks (#81872) 2023-10-11 08:36:20 -07:00
46623b0a96 Deprecate pycompat24 (#81896) 2023-10-10 12:00:05 -04:00
350a394185 Remove Python 2 importlib.import_module compat (#81879) 2023-10-10 11:52:47 -04:00
92d2c66db2 Remove py2 support from urls.py (#81880) 2023-10-09 11:35:50 -05:00
858a3dbaad Fix example in strftime filter plugin help (#81696)
* Move the timestamp example to to_datetime.yml and be more verbose in its description
2023-10-09 08:55:06 -07:00
8a5ccc9d63 ansible-galaxy - fix traceback error for invalid req file (#81917)
Provide a better error message when encountering a YAML requirements file that is not a dictionary or list.

Fixes: #81901
2023-10-05 12:03:01 -07:00
976067c15f Add more winrm coverage (#81923) 2023-10-06 04:55:47 +10:00
282908c57e Add test coverage for winrm (#81910) 2023-10-06 01:28:12 +10:00
16b23d6779 Rename boilerplate sanity test (#81903)
The test covers more than just future boilerplate, so the shorter name is more appropriate.
2023-10-04 15:33:12 -07:00
9f899f9492 Require from __future__ import annotations (#81902) 2023-10-04 22:11:17 +00:00
921efce43a ansible-test - Remove more Python 2.7 / 3.6 support (#81898) 2023-10-04 11:32:31 -07:00
dfc62589f6 win_fetch - improve test time by not scanning Win dir (#81884) 2023-10-05 00:57:39 +10:00
c0eefa955a docs: update error message (#81554)
* Reword the error message when the module fails to parse parameters
  in JSON format
* misc typo fixes

Fixes: #81188

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-10-04 14:49:03 +00:00
d67d8bd823 Misc typo fixes in connection plugin (#81883) 2023-10-04 06:54:50 -07:00
b94ee1cefd Drop Python 2.7 and Python 3.6 support (#81866)
* Drop Python 2.7 and Python 3.6 support

* Remove obsolete _json_compat
2023-10-03 21:52:38 +00:00
c1343cc304 switch available_hosts to frozenset from list in ansible-inventory (#81870)
* major speedup large inventories, since it's consulted iteratively
2023-10-03 17:20:14 -04:00
debf2be913 optimize host_group_vars and vars plugin loading (#79945)
* Improve host_group_vars efficiency:

* normalize the basedir with `os.path.realpath()` once and cache it
* cache missing paths/files
* reduce the calls to `isinstance`

Add a couple more general improvements in vars/plugins.py get_vars_from_path():

* call `PluginLoader.all()` once for vars plugins and reload specific
  plugins subsequently
* don't reload legacy/builtin vars plugins that are not enabled

Add a test for host_group_vars and legacy plugin loading

Co-authored-by: Matt Davis <mrd@redhat.com>

* changelog

* Add a new is_stateless attribute to the vars plugin baseclass

update integration tests to be quieter and use the same test pattern

Fix deprecation and adjust test that didn't catch the issue (deprecation only occured when the value was False)

move realpath cache to host_group_vars (do not smuggle call state as instance data)

refactor under a single 'if cache:' statement

Call os.path.isdir instead of always calling os.path.exists first. Just call os.path.exists to differentiate between missing and non-directory.

remove call to super(VarsModule, self).get_vars()

use the entity name as the cache key instead of variable location

Remove isinstance checks and use a class attribute just in case any plugins are subclassing Host/Group

Replace startswith by checking index 0 of the name instead, since host/group names are required

* rename is_stateless to cache_instance to make it more clear what it does

* add plugin instance cache using the path to plugin loader

reduce loading stage option if a new instance isn't created

don't require a known subdir on PluginLoader instantiation for backwards
compatibility

rename attribute again

contain reading from/initializing cached instances to a plugin loader method

* Deprecate v2 vars plugins

* Refactor to use the cache in existing plugin loader methods

Rename the attribute again

Refactor host_group_vars with requested changes

Make changelog a bugfixes fragment

Add a deprecation fragment for v2 vars plugins.

Add type hints

* unbreak group_vars

* Apply suggestions from code review

* misc tweaks

* always cache instance by both requested and resolved FQ name
* add lru_cache to stage calculation to avoid repeated config consultation

* handle KeyError from missing stage option

---------

Co-authored-by: Matt Davis <mrd@redhat.com>
2023-10-03 16:24:06 -04:00
9b3ed5ec68 Properly template tags in parent blocks (#81624)
When templating tags (which happens outside of standard `post_validate`) we
need to template each object in the inheritance chain and set the templated
values on those objects individually. That way when `task.tags` is called the
`extend` functionality properly picks up the templated values of all
parents into one flatten list.

Fixes #81053
2023-10-03 15:07:26 -04:00
304e63d76e Add family fallback for Amzn to register as RedHat (#81755)
* Add family fallback for Amzn to register as RedHat

Fixes: #80882

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-10-03 18:54:14 +00:00
2d5861c185 run_once: unnotify hosts on handlers that are not run (#81667)
Fixes #81666
2023-10-03 14:43:46 -04:00
000cf1dd46 Update the test containers to include Python3.12.0 final (#81858) 2023-10-03 10:46:58 -07:00
b3408ab80b Fix dnf module crash for non-existent url (#81801)
* ci_complete ci_coverage
2023-10-03 12:37:34 -04:00
116766ac3e Add intentional tests for dnf group remove (#81739)
* Add intentional tests for dnf group remove

* Copy tests from yum
2023-10-03 12:34:07 -04:00
b7903669b4 ansible-test - Update distro containers (#81851)
* ansible-test - Update distro containers

* Update the alpine3 container to Python 3.11

* Update changelog
2023-10-03 16:33:37 +00:00
20f17687da ansible-test - Invoke container sleep through env (#81853) 2023-10-03 08:27:55 -07:00
d8f791d88c Bump sanity test requirements for 3.12 (#81846) 2023-10-03 06:38:49 -07:00
ce3954ba74 Bump sanity test requirements for 3.12 (#81843) 2023-10-03 06:18:32 -07:00
ec265ec08a Bump coverage.py to v7.3.2 in ansible-test (#81844) 2023-10-02 20:45:57 +00:00
f31c287348 ansible-test - Improve compatibility with pylint 3 (#81841) 2023-10-02 13:05:39 -07:00
e756e359e0 Remove deprecated JINJA2_NATIVE_WARNING env var (#81720)
Fixes #81714
2023-10-02 15:57:17 -04:00
ab6a544e86 Import role public (#81772)
revert to previous behavior to push vars to play at compile time
add `public` parameter to allow per import control of exporting (vs just the global config)

Co-authored-by: tchernomax <maxime.deroucy@gmail.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2023-10-02 15:42:00 -04:00
e78cc1e602 Install upgraded crun from edge (#81833) 2023-10-02 14:30:31 -04:00
7fab552563 Fix reporting role as not found when remote_data is None (#81829) 2023-10-02 09:11:12 -07:00
a82dc06116 Update winrm.py (#81817)
fixes some of the issues in #81808
2023-10-02 09:33:11 -04:00
8bf1a41d58 Fixed typos in winrm.py file (#81825)
bewteen ==> between
alligns ==> aligns
2023-10-02 06:32:13 -07:00
7109d392fd fixes spelling errors (#81814) 2023-10-02 09:27:47 -04:00
4d4c50f856 Provide more info about plugin in deprecation message (#81719)
Provide more information about plugin usage which needs to be
used instead of the deprecated plugin in the deprecation message.

Fixes: #80561

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-29 18:19:16 +00:00
27bbff7c22 Add count and mandatory_count parameters in regex_replace filter (#81775) 2023-09-29 10:33:13 -04:00
01d190f3d2 Add intentional tests for module_utils/yumdnf.py (#81776) 2023-09-29 07:48:25 +02:00
d6a356d7cd ansible-test - Update sanity test requirements (#81810) 2023-09-28 14:28:35 -07:00
55f27a579e systemd_service: add a note about module rename (#81803)
* The module systemd is renamed to systemd_service to maintain
  the scope of the module. Mention this in the module description.
* Misc typo fixes.

Fixes: #80917

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-29 05:20:15 +10:00
cb8cb8936a Update ansible-test containers
* Include Python 3.12rc3 and PowerShell 7.3.7
2023-09-28 10:24:03 -04:00
f22231de20 winrm - make command input more resiliant (#81538)
* winrm - make command input more resiliant

* Expand warning message
2023-09-26 22:46:48 +00:00
60c9660952 Add intentional tests for dnf install rpm when higher version is installed (#81740)
* Add intentional tests for dnf install rpm when higher version is installed

* ci_complete ci_coverage
2023-09-26 15:49:14 -04:00
68ab02a504 Test heuristic_log_sanitize (#81730)
* Test heuristic_log_sanitize. See #81689

* Add note about what this test is doing

* grammar

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

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2023-09-26 14:23:15 -05:00
f951c64ee9 Fix typo in finished.yml (#81784)
aysnc -> async
2023-09-26 12:19:10 -07:00
4071f3b803 file: add a note about follow=false (#81788)
While creating a symlink, we apply fs attributes changes
to the destination. But in case of a non-existent destination, we warn
the user. This warning message can be suppressed by setting follow=false.
Add a note of this behavior in the `follow` parameter.

Fixes: #50543

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-26 17:14:37 +00:00
ddf0311c63 Prevent roles from using symlinks to overwrite files outside of the installation directory (#81780)
* Sanitize linkname during role installs

* Add tests

* add clog frag
2023-09-26 11:32:19 -05:00
989ea7a9f0 Misc. fixes in base.yml (#81771)
* Convert Latin short forms to English wording
* Typo fixes
* Sentence rewording

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-26 11:15:14 -04:00
51f2ddd445 Extend mount info (#81768) 2023-09-26 11:12:03 -04:00
230f956e25 Add lineinfile integration test for removing a line that has already been removed (#81762)
ci_complete ci_coverage
2023-09-26 11:07:53 -04:00
7d9889fcb3 Fix typo in action_core.py (#81763)
Fixes typo 'obeys' vs 'objeys' in doc_fragments/action_core.py
2023-09-22 09:48:10 -07:00
85adaa76f1 Add integration test for copy with force=false when dest exists (#81756)
ci_complete ci_coverage
2023-09-22 09:53:24 -04:00
Val
91f94fb59d Daemonize follow-up fixes (#81584)
* Ensure binary data transmission in daemonize

* Add changelog fragment
2023-09-22 09:41:30 -04:00
3794612832 ansible-test - Skip pylint test on Python 3.12 (#81706) 2023-09-21 21:01:58 -07:00
2aef0406d4 ansible-galaxy fix scm dependency error (#81599)
* ansible-galaxy fix scm dependency error

  also changed usage of 'virtual colleciton' to actual type
  avoid error by filtering out virtual collections that dont have
expected properties

simplified as per webknjaz

* Update lib/ansible/galaxy/collection/__init__.py
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2023-09-21 15:49:30 -04:00
7c7385521e Harden the ansiballz and respawn python templates (#81753)
Harden our python templates for respawn and ansiballz around str literal quoting
2023-09-21 12:48:48 -07:00
9edf64eaeb Deprecating paramiko options in base config (#81593)
* Deprecating paramiko options in base config

 they exist in the plugin itself since 2.14

* clog
2023-09-21 15:47:53 -04:00
1e7f7875c6 Allow for searching handler subdir for included task via include_role (#81733)
Fixes #81722
2023-09-21 12:12:04 -07:00
86fd7026a8 Handle exceptions in interpreter discovery (#81745)
* Handle exceptions like AnsibleError, AnsibleConnectionFailure
  raise while interpreter discovery.

Fixes: #78264

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-21 11:13:40 -07:00
62c10199d1 Add intentional tests for dnf list (#81738)
ci_complete ci_coverage
2023-09-21 19:52:43 +02:00
9244b2bff8 Make sure paths are treated correctly when building collection files manifest (#81619)
* Make sure paths are correct when building collection files manifest

This commit makes sure the path of the files part of
the collection build manifest are correct.

This commit uses os.path.commonprefix instead of
dealing with strings.

Signed-off-by: Carlos Camacho <ccamacho@redhat.com>

Bugfix Pull Request
Fixes: #81618

* Revert the change note type to `minor_changes`

* Clarify the change note with user-oriented details

---------

Signed-off-by: Carlos Camacho <ccamacho@redhat.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2023-09-20 20:18:37 +02:00
e4b9f9c6ae tests: update CloudStack test container to version 1.7.0. (#81732) 2023-09-20 08:34:02 -07:00
7662a05085 Always allow "no-other-choice" pre-release dependencies when resolving collection dependency tree
PR #81606.

Prior to this patch, when `--pre` CLI flag was not passed, the
dependency resolver would treat concrete collection dependency
candidates (Git repositories, subdirs, tarball URLs, or local dirs or
files etc) as not meeting the requirements.

This patch makes it so pre-releases in any concrete artifact
references, and the ones being specifically pinned dependencies or
user requests, met anywhere in the dependency tree, are allowed
unconditionally.

This is achieved by moving the pre-release check from
`is_satisfied_by()` to the `find_matches()` hook, following the
Pip's example.

As a bonus, this change also fixes the situation when a collection
pre-releases weren't considered if it didn't have any stable releases.
This now works even if `--pre` wasn't requested explicitly.

Finally, this patch partially reverts commit
6f4b4c345b, except for the tests. And it
also improves the `--pre` hint warning to explain that it mostly
affects Galaxy/Automation Hub-hosted collection releases.

Ref #73416
Ref #79112
Fixes #79168
Fixes #80048
Resolves #81605

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2023-09-20 16:35:54 +02:00
4b7705b07a Remove deprecated APIs from ansible-doc (#81729)
* Removed add_collection_plugins
* Removed find_plugins

Fixes: #81716

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-19 16:48:33 -07:00
3ec7a6e0db Fix ansible-test issues with detecting docker host and forwarding ports (#81726)
* Properly detect docker host using ssh

* Disable ControlPath when creating SSH port forwards

* typo fix

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

* Add clog frag

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2023-09-19 12:10:52 -05:00
710c0a264e Typo in documentation then -> than (#81724) 2023-09-19 17:16:32 +02:00
0ea40e09d1 vars: handle exception in combine_vars (#81700)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-19 17:03:58 +02:00
f7234968d2 bump devel to 2.17.0.dev0 (#81712) 2023-09-18 16:24:44 -05:00
a1a6550daf inventory_ini: Handle SyntaxWarning in ini parsing (#81707)
* handle SyntaxWarning ini inventory parsing

Fixes: #81328

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-18 10:50:50 -04:00
2793dfa594 reboot: show last error message in verbose log (#81578)
* The last error message is now presented in a verbose log

Fixes: #81574

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-15 17:50:26 +00:00
81c83c623c Add an example for cleaning up the async job cache, and clarify how that works (#81697) 2023-09-15 05:11:28 +10:00
6f65397871 galaxy: check if the target for symlink exists (#81586)
* Symlinks in the collection might be pointing to non-existent
  targets. Check and report the failure to the user.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-12 16:05:51 -07:00
7f0baabbe0 blockinfile: avoid crash on Python 3 when creating directory fails (#81662)
* Avoid crash on Python 3.

* Add a test for the crash on Python 3
2023-09-12 15:46:44 -04:00
3b608f97b1 sanity: update requirements (#81680)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-12 11:33:08 -04:00
e4468dc944 copy: print correct dest path when content + diff is used (#81678)
* when --diff is used with content parameter, print destination
  path instead of temporary file path.

Fixes: #79749

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-12 11:32:41 -04:00
243197f2d4 env-setup.fish: Correct syntax errors (#81677)
- Single quote regular expression values to avoid shell expansion
- Properly test if the $QUIET variable is set and non-zero
2023-09-12 11:31:19 -04:00
67cdaa49f8 ansible-galaxy-collection - fix config permissions for galaxy-importer (#81679)
* Fix permissions for the galaxy-importer config, previously only root had
read/write

* fix ownership instead
2023-09-12 08:43:46 -05:00
7d3d4572ed Fix set filters to use set operations (#81639)
* Fix set filters to use set operations

* Fix integration tests

* Update filter documentation
2023-09-11 09:32:32 -07:00
b1b029c6b5 ansible-doc: allow to filter by more than one collection (#81450)
Make collection filters more flexible for listing collections.
Co-authored-by: Maxwell G <maxwell@gtmx.me>
2023-09-11 09:31:52 -04:00
8034651cd2 Only mark a role as complete once a task in it executes for the target host (#81565)
* If all tasks in the role are skipped or unreachable, the role is not marked as complete for the host.

* Only mark the role as complete if a task in the role succeeds or fails for the host.
2023-09-08 12:11:48 -04:00
3eb96f2c68 Lazy load Templar for [changed,failed]_when (#81650)
The `handler_templar` in `StrategyBase._process_pending_results` was
used for templating handler names which is no longer the case. Now it is
only used for templating `changed_when`/`failed_when`. To prevent
re-creating templars each time results are processed, just create it
on-demand when whens are processed.
2023-09-08 10:06:58 +02:00
cd0aa35c19 encrypt: deprecate passlib_or_crypt (#81571)
* deprecate passlib_or_crypt in favor of do_encrypt

Fixes: #55839
2023-09-07 14:44:26 -07:00
6177888cf6 ansible-vault: Check if the destination is writable (#81660)
* Before performing shredding the original file, check if the
  destination file location is writable or not. This will
  prevent corruption of original file.

Fixes: #81455

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-07 15:30:05 -04:00
a861b1adba Replace ConfigParser.readfp() with read_file() (#81657)
* Replace ConfigParser.readfp() with read_file()

readfp was removed in Python 3.12.

Fixes #81656

* py2?

* Use PY3 for the python check
2023-09-07 15:24:50 -04:00
a65c331e8e Corrected a typo In options list (#81655)
There was a typo in the word "container", it was spelled "contianer"
2023-09-07 15:23:46 -04:00
45f4fc8389 Update user.py (#81653)
The phrase `Does nothing when used with other platforms.` sometimes appears before the supported platforms. Combine this phrase with the supported platform line.
2023-09-07 15:23:26 -04:00
dedc48bda4 Improve ansible-pull documentation (#81646)
* Improve ansible-pull documentation

* chnaged description from local/remote to target
2023-09-07 15:13:23 -04:00
3ec0850df9 Support packaging and importlib.metadata for pip module (#80881) 2023-09-05 16:11:18 -05:00
dd79c49a4d fix various Jinja plugin caching issues (#79781)
* fix various Jinja plugin caching issues

* consolidate the wrapper plugin cache
* remove redundant cache in J2 filter/test interceptor

* intra-template loader bypass

* fix early exits swallowing some exception detail

* misc comment cleanup
2023-09-05 13:32:36 -07:00
4d40988876 Add type hints to ansible.utils.display::Display (#81400)
* Add type hints to ansible.utils.display::Display

Fixes #80841

* Avoid circular import

* Fix sanity

* type hint some of the functions of the module?

* Fix units

* Not sure about this

* Fix some of the issues from reviews

* Add changelog

* ...

* Update lib/ansible/utils/display.py

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

* remove py2 boilerplate

---------

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2023-09-05 12:08:13 -07:00
48d8e067bf changed link ‘Risks of becoming an unprivileged user’ (#81623)
* changes made in become linkœ

* change become link

* Update lib/ansible/plugins/action/__init__.py

---------

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2023-09-05 17:45:57 +02:00
24aac50369 utils/encrypt.py: remove unused private _LOCK (#81614)
Added in #15299, unused since #30160.

Fixes #81613
2023-09-05 17:02:56 +02:00
786a8abee6 yum/dnf/dnf5/zypper documentation - fix grammatical error (#81601) 2023-08-31 15:14:27 -04:00
0f20540e96 Docs: Clarify copy module's purpose; tweak wording (#81592) 2023-08-31 15:03:10 -04:00
1cc5efa77b 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>
2023-08-31 12:02:48 -07:00
5a059b81c8 ansible-test - Fix Python coverage stub generation (#81611)
As of coverage 7.1.0, files without arcs are not generated.

To work around this, an empty (0, 0) arc is used for each file instead.

This is a follow-up to https://github.com/ansible/ansible/pull/81077

ci_coverage
ci_complete
2023-08-31 10:53:10 -07:00
ae69b280ad Add short option for --ask-vault-pass (#80527)
Fixes: #80523
2023-08-31 09:43:26 -07:00
e1e0e2709c ansible-test - Enable thread code coverage (#81604)
ci_complete
ci_coverage
2023-08-30 14:39:47 -07:00
261e5ce381 ansible-test - Update mypy to 1.5.1 (#81602) 2023-08-30 10:39:25 -07:00
c59bcbe627 Bump coverage.py to v7.3.0 in ansible-test (#81077) 2023-08-30 08:58:45 -07:00
65a96daaf4 Fix typos in url lookup plugin options (#81587) 2023-08-29 16:27:09 -05:00
509be19357 Fix nested jinja statements in integration tests (#81591) 2023-08-29 14:33:19 -05:00
5dc3a2ee6d mode is a module option. (#81590) 2023-08-29 18:42:43 +01:00
aeec51ac54 Improve ansible.builtin.copy directory_mode parameter docs (#81127)
* Improve ansible.builtin.copy directory_mode parameter docs
2023-08-29 11:23:41 +01:00
bdaa091b33 Add warnings for illegal file names in role (#81555)
Co-authored-by: Aleksey Tsalolikhin <atsaloli.tech@gmail.com>
2023-08-28 14:54:08 -04:00
4ab5ecbe81 dnf - fix for a package from URI and update_only (#81568)
Fixes #81376
2023-08-28 10:48:45 +02:00
da63f32d59 script: add argument validation (#81469)
partially fixes: #81349

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-08-25 10:27:26 -07:00
37cb44ec37 find: correct typo (#81512) 2023-08-25 10:22:43 -07:00
7865b198d2 PowerShell - Improve error checking (#80984)
Improves the error checking when running PowerShell modules using
Ansible.ModuleUtils.Legacy. It will only return an rc of 1 if both the
PowerShell module runner signalled an error occurred and those error
records were present in the output. This should reduce some false
positive errors when using the older module style.
2023-08-25 05:24:02 +10:00
f3976117fb PowerShell - remove uneeded dotnet code for future compatibility (#81472) 2023-08-25 05:23:48 +10:00
116948cd14 user - set current expiration correctly when no shadow entry exists (#75194) 2023-08-23 11:18:57 -07:00
2e6d849bdb apt: ignore fail_on_autoremove and allow_downgrade when using aptitude (#81445)
* apt: ignore fail_on_autoremove and allow_downgrade when using aptitude

* fail_on_autoremove (--no-remove) and allow_downgrade (--allow-downgrades)
  parameters are only valid for apt-get and not for aptitude. Ignore them when
  aptitude is detected and used.

Fixes: #77868
2023-08-23 08:42:03 -07:00
5deb4ee991 Remove duplicate FILE_ATTRIBUTES definition (#81494)
* Remove duplicated definition of the FILE_ATTRIBUTES constant in basic.py by importing it from the new location.
2023-08-23 09:34:29 -04:00
194f829b0f Fix pause CPU consumption (#81519)
* Sleep for the DEFAULT_INTERNAL_POLL_INTERVAL between polling for user input

Fixes #81516
2023-08-22 15:03:22 -04:00
3e9d374fda fix typo in example human_to_bytes filter (#81559) 2023-08-22 11:25:51 -04:00
aa8a29a9d4 group: remove extraneous warning (#81557)
* remove extraneous warning shown when group does not exist

Fixes: #77049

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-08-22 11:23:10 -04:00
4a96b3d5b4 path_join: update docs and examples for absolute path (#81544)
Document path_join behavior -
    If a path component is an absolute path, then all previous components
    are ignored and joining continues from the absolute path.

Fixes: #81446

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-08-22 11:12:21 -04:00
863e2571db debconf: idempotency for password question (#81484)
* Gather value of password using debconf-get-selections command,
  use this information for idempotency.

Fixes: #47676

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-08-21 18:25:03 -07:00
6627ba9ace Unit test cleanup (#81556)
* Fix cleanup_tmp_file unit tests

* Simplify the problematic wcwidth chars unit test
2023-08-21 15:54:03 -07:00
f28e32c063 ansible-test - Limit deprecated check to core (#81552)
Using `# deprecated:` comment checks in collections would effectively limit those collections to a single version of ansible-core.
2023-08-21 12:58:09 -07:00
c69c83c962 Fix macos defaults (#79999) 2023-08-21 10:02:47 -07:00
390e508d27 ansible-test - Always use managed entry points (#81537) 2023-08-17 19:13:29 -07:00
a48feb4cfc "retries" without "until": retry until success (#81531)
Fixes #20802
2023-08-17 15:17:26 -04:00
98f1627817 include_role: expose vars from parent roles to role's handlers (#81524)
* include_role: expose vars from parent roles to role's handlers

Fixes #80459
2023-08-17 15:14:20 -04:00
a2673cb564 Pre-calculate date early and use it for all zipfile writes (#81521)
* Pre-calculate date early and use it for all zipfile writes

Fixes #80089
Closes #80578
2023-08-17 15:08:53 -04:00
9afaf2216b Remove obsolete text from release.py PR template (#81526) 2023-08-16 10:52:20 -07:00
470f41b275 Deprecate STRING_CONVERSION_ACTION (#78860) 2023-08-16 08:44:35 -07:00
ca08261f08 Add ability to filter find on mode (#81485) 2023-08-15 11:58:19 -05:00
a2d9c4d62f docs: Update examples in systemd_service to use the new name (#81518) 2023-08-15 15:45:31 +00:00
0cba3b7504 Last handler with same name wins for listen too (#81358)
Fixes #49371
Fixes #81013
2023-08-15 15:03:56 +02:00
bd3ffbe109 fix incorrect ansible_managed formatting (#79129)
Ansible breaks configs if file name could be parsed as jinja template
or contains `%` chars.
Especially `%n`[ame%] which is a line break pattern according to [strftime (3)](https://manpages.debian.org/bullseye/manpages-dev/strftime.3.en.html)
2023-08-14 09:59:40 -04:00
01469c558c sanity: Document pep8 known issue with Python 3.12 (#81495)
The ``pep8`` sanity test may detect issues with f-strings on
Python 3.12, such as E201/E202, that are not detected under earlier
Python versions.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2023-08-11 13:23:16 -07:00
6347da9696 Document return values of template module (#75980)
* Document return values of template module

Add documentation for some return values of template module. 

I have not tested this extensively, so it's possible that under special
circumstances this might not be entirely accurate, but briefly looking
at the code as far as I can tell they are correct.

Co-authored-by: mprasil <mprasil@mpT15p>
2023-08-11 14:04:23 -04:00
47ab59753c Clean up release script (#81488)
* 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
2023-08-10 13:39:37 -07:00
5dbcf47e02 Add documentation for systemd reload (#81473)
* Add documentation for systemd reload
2023-08-10 15:04:23 -04:00
b4943e45d0 Update cliconf-> __init__.py -> get_capabilities() (#79097)
Doc string was incorrect. 
The `get_capabilities` method returns a Python Dict data structure not a JSON string as stated.
2023-08-10 10:54:15 -07:00
d0699cb44a Add unit tests for module_utils.compat.datetime (#81483) 2023-08-09 12:24:10 -07:00
580b87252c Remove unreachable code in password lookup test (#81482) 2023-08-09 12:23:58 -07:00
726d9a5fcc Fix constructed inventory plugin unit test (#81481) 2023-08-09 12:23:47 -07:00
553f51e728 Revert logic to use Popen.communicate (#80874)
* Back out use of communicate, add better comments, add bufsize, and align with subprocess._communicate

* tests

* re-order logic slightly

* more comments

* loopty loop

* yet another comment

* Revert "yet another comment"

This reverts commit 96cd8ada5fa0441b92f2298bdaa6cb40594847d2.

* Revert "loopty loop"

This reverts commit 96ea066f6a7d18902c04a14f18dd79b38e56f5e7.

* ci_complete

* Copy in comment too

* Wording updates

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

* Back out bufsize

---------

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2023-08-09 11:09:43 -07:00
85d3305889 Fix f-string whitespace in release script (#81477) 2023-08-09 09:35:38 -07:00
1c765a6afc restore conditional lookup nerfing (#81460)
* a recent optimization lost the unsafe lookup disable behavior when templating conditionals with inline templates that referred to untrusted values
* added regression test to catch this case
2023-08-09 09:25:20 -07:00
fa5fe8a7db Bump test container versions to latest (#81471)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-08-08 19:53:04 -07:00
493c678795 Sanity: Bump version to match Python 3.12 (#81399)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-08-08 09:05:46 -07:00
f3a15a4a95 filters vault/unvault fix vault_id parameter usage (#81422)
* vault/unvault filters, fixed id field to match documented.

fixes #81420

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-08-04 17:50:57 -04:00
a1569ea4ca iptables chain creation does not populate with a rule (#80257)
* iptables chain creation does not populate with a rule

fixes #80256

* Add changelog fragment

* Add rules and flush chain during integration tests

* Check chain rule on comment

* Update test/integration/targets/iptables/tasks/chain_management.yml
2023-08-04 13:59:21 -04:00
f10d11bcdc dpkg_selections: Check if package exists before selection operation (#81406)
* dpkg_selections: Check if the package exists before the selection operation

Fixes: #81404

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-08-03 14:01:20 -07:00
95fdd555b3 galaxy: Cross check the collection type (#81423)
* User-provided collection type might differ from collection
  source. Cross-check the type before proceeding

Fixes: #79463

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-08-03 13:59:59 -07:00
f894ce89b4 Overhaul package-data sanity test (#81427)
The sanity test now only inspects the sdist and wheel instead of trying to install the sdist using setup.py.
2023-08-03 13:24:25 -07:00
c07652f42e yum_repository: deprecate keepcache parameter (#81426)
* keepcache parameter can not be set in repository file
  instead it goes in yum.conf or dnf.conf

Fixes: #78693 

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-08-03 12:33:43 -07:00
cc01a73ef0 service action: improve documenation about service and service (#81405)
* service action: improve documenation about service and service

moudule used as backup and cli that confuses everyone

* Update service.py

---------

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2023-08-03 19:17:07 +00:00
ab9a48d4b1 Fix comment about authorization (#81401)
Move all information about supported platforms to the same bullet point.
2023-08-03 12:06:27 -07:00
f5431321a2 password_hash - fix bcrypt algorithm when passlib is not installed (#81385) 2023-08-03 14:32:42 -04:00
dbb3feddaf Update update-sanity-requirements.py script (#81424)
Frozen requirements can now preserve any explicitly installed package that would normally be omitted, not just setuptools.
2023-08-03 10:58:19 -07:00
2ebeb43d6f ansible-galaxy - improve ignoring multiple signature status codes (#77610)
* ansible-galaxy - improve ignoring multiple signature status codes when using --ignore-signature-status-code

* fix backwards compatibility by adding a new plural option instead, and hide the singular from --help
2023-08-03 13:00:07 +00:00
76aa0bdbd6 Update bot link in the GH templates (#81390)
Also remove "Component Name" section from the PR template as components
are automatically detected by the bot from the list of changed files.
2023-08-03 09:20:32 +02:00
c525514994 ansible-test - Update source layout detection (#81418) 2023-08-02 20:24:13 -07:00
0c03a6bcf6 Add changelog fragment for docs/examples removal (#81410) 2023-08-02 12:27:10 -07:00
d1cd06073f Extend setup_collections timeout to 3 minutes (#81408) 2023-08-02 10:43:21 -07:00
b9daa6891f Remove unused sanity test code (#81398) 2023-08-01 14:08:01 -07:00
11e261b54f CI: remove FreeBSD 12.4 from test matrix (#81315)
Fixes: #80417

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-08-01 13:37:26 -07:00
691c8e8603 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.
2023-08-01 12:48:01 -07:00
6d1f85bbe9 ansible-test: remove alpine 3.17 (#81124) 2023-08-01 11:54:33 -07:00
0b9d83ccdb fixed become page link in PE error message (#81391) 2023-08-01 11:35:06 -04:00
b8db05f13e Update reboot module to include message option (#81374) 2023-08-01 11:24:45 -04:00
2e4a501549 add type hints for DataLoader methods (#81359)
* add type hints for DataLoader methods

* fix list of tuples

* remove mention of pre-2.4 vault method

* Add None return type

Use | instead of typing.Optional or typing.Union
2023-08-01 11:20:20 -04:00
081c60b9d3 Include subcommands in generated man pages (#81378)
Sub commands of `ansible-galaxy role` and `ansible-galaxy collection` are now documented.
2023-07-31 13:04:17 -07:00
32b388b4ca Fix missing command descriptions in manpages/docs (#81366) 2023-07-28 18:01:11 -07:00
f9d674fcfd Fix command doc lookup in man page generation (#81365) 2023-07-28 16:24:04 -07:00
fead654671 Exclude internal options from man pages and docs (#81360) 2023-07-28 14:58:18 -07:00
6db006a5fa fix networking path (#81295)
* now uses class property instead of only relying on network_os variable

---------

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2023-07-27 10:59:55 -04:00
010e542a13 Fix blockinfile code comment (#81351) 2023-07-26 18:19:04 -04:00
d5d1c27bf3 Add option to blockinfile to wrap inserted block with blank lines (#81083)
* Add new blockinfile options 'prepend_newline' and 'append_newline' to wrap inserted block with blank lines
2023-07-26 17:38:07 -04:00
4c41562270 remove deprecated datetime.datetime methods (#81323)
* Remove datetime.datetime.utcfromtimestamp and datetime.datetime.uctnow
  from controller code since they are deprecated in Python 3.12.

* Update target side code to use new utcfromtimestamp and utcnow utils in ansible.module_utils.compat.datetime that return aware datetime objects on Python 2.7 and 3.

Co-authored-by: Matt Clay <matt@mystile.com>
2023-07-26 17:26:33 -04:00
923ede4f72 pep8: fix sanity for 3.12 (#81348)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-07-26 14:17:08 -07:00
a5ccc0124f Fix ansible_pkg_mgr is unknown in Kylin Linux (#81314)
Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
2023-07-25 14:45:30 -07:00
6a8c51bb9c fix redis cache setup (#81329)
* use https repo
* increase default download timeout of 10s for slow/lagged connections
2023-07-25 13:09:40 -07:00
2a19c80b89 Refactor test cases to improve unit test quality (#81334) 2023-07-25 11:35:57 -07:00
cd13812e32 Fix ansible_pkg_mgr incorrect in TencentOS Server Linux (#81336)
Signed-off-by: denisecheng <denisecheng@tencent.com>
Co-authored-by: denisecheng <denisecheng@tencent.com>
2023-07-25 17:18:18 +02:00
c8bc393871 Raise the minimum setuptools version to 66.1.0 (#81341)
* Raise the minimum setuptools version to 66.1.0

This is the first version to support Python 3.12.

While Python 3.10 and 3.11 could use an older version, a consistent minimum is easier to work with and test against.

* Fix PEP 517 integration test
2023-07-24 16:02:05 -07:00
5167618e46 Update ansible-test containers to test Python 3.12 with the test venvs (#81330) 2023-07-21 20:15:07 -07:00
48dfe8e215 add Python 3.12 support to ansible-test (#80834)
* update docker containers versions to use newer ansible-test ref in the pre-built venvs

* Allow invoking ansible-test with Python 3.12

* Add python3.12 to the INTERPRETER_PYTHON_FALLBACK

* changelog

* add Python 3.12 as a non-default Python version for the test containers

* Update mypy ignores for Python 3.12

* Add Python 3.12 to CI matrix for unit tests, generic tests, and galaxy

* Update unit test for using the Python 2 collection loader path with Python 3.

Skip the existing test on Python 3.12, since find_module is removed.

Suppress the pre-existing deprecation warnings using the Python 2
codepath with Python 3.

Add a test for Python >= 3.12, which doesn't call find_module.

* Ignore sanity test errors on systems without libselinux present.
2023-07-21 10:23:14 -07:00
efbc00b6e4 Consider all configured collection paths when installing collections (#81243)
* Only install collections which can't be satisfied by a collection in any of the configured paths.

* Improve warning for unexpected collection install path

Fix warning when path is configured, but is a pip-managed path

Normalize the path before validating to fix warning consistency
2023-07-20 18:30:59 -04:00
c5d18c39d8 Update sanity requirements comments (#81321)
Also remove a redundant indirect dependency.

The requirements file updates are being deferred until other changes are required.
2023-07-20 14:31:25 -07:00
99eeaf7da8 ansible-test: cloudstack: bump test container version (#81319) 2023-07-20 14:26:00 -07:00
26d855c87e update ansible-galaxy testserver to use SSLContext.load_cert_chain (#80961)
* update ansible-galaxy testserver to use SSLContext.load_cert_chain for Python 3.12 compatibility
2023-07-20 16:15:13 -04:00
e34807d010 find, stay simple (#81313)
* find, stay simple

* Apply suggestions from code review

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-07-20 15:02:16 -04:00
d20a0c02cc ansible-test - update module_utils/urls.py unit test to support cryptography >= 41.0.0 (#81296) 2023-07-20 09:47:47 -04:00
79560410bf Update user module documentation to include MacOS password change behavior (#80958) 2023-07-19 17:59:32 -04:00
371b62eab1 Add test for 256-color configuration values (#78613)
* Add test for 256-color configuration values

See #78607.

* color is not restricted to 16 choices

 currently supports up to 256, not listing them all
 TOOD: create examples and point to/list the basic 16

---------

Co-authored-by: Brian Coca <brian.coca+git@gmail.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2023-07-19 15:46:47 -04:00
18cbfc688b Add missing skip entries for selinux module_util (#81305) 2023-07-18 18:27:25 -07:00
e964078a83 ansible-test - Pre-build PyYAML wheels (#81300)
This works around Cython failures when attempting to install PyYAML >= 5.4 <= 6.0.
2023-07-18 18:17:48 -07:00
261a12b8a9 Disable cron integration test on Alpine (#81301)
The tests are now failing due to the lack of `libfaketime` in the Alpine repos.
2023-07-18 17:38:37 -07:00
1e929ada6f filter: fix documentation (#81113)
* Updated urldecode documentation
* Misc typo fixes
* Better formatting
* Corrected some example

Fixes: #81112

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-07-18 15:14:05 -04:00
528e7859d0 smart connection deprecation version fix (#81262) 2023-07-18 17:19:27 +02:00
894c339df8 Fix stealth exceptions and blocking select() in daemonize() (#81064)
* Fix stealth exceptions and blocking select() in daemonize()

* Add changelog entry
2023-07-17 12:47:57 -04:00
b771e59793 The split filter was added in ansible-core 2.11. (#81275)
I thought it was 'hysterical' ...
2023-07-17 10:00:08 -04:00
9d6179780c Update comment to match correct form parameter (#81270)
Updated `refresh_token` to match value in the form payload from line 63.
2023-07-14 17:39:05 -07:00
765b2bd783 ansible-test - Narrow the scope of some sanity tests (#81273)
* ansible-test - Limit scope of replace-urlopen test

Only ansible-core code and plugins in collections can be expected to rely on module_utils.

* ansible-test - Limit scope of use-compat-six test

Only ansible-core code and plugins in collections can be expected to rely on module_utils.

* ansible-test - Limit scope of no-get-exception test

Only ansible-core code and plugins in collections should be checked for usage of outdated module_utils functions.

* Add integration tests
2023-07-14 17:19:33 -07:00
3f7bf0bcd4 ansible-test - Fix sanity traceback with -e opt (#81271)
Also remove redundant warning about missing programs.

Includes integration tests to verify `-e` does not traceback.
2023-07-14 15:50:14 -07:00
39ef570e16 Remove BOTMETA.yml and sanity tests for it (#81198) 2023-07-14 14:03:52 +02:00
26cb1652bc Add docs and examples to obsolete-files test (#81258) 2023-07-13 16:20:37 -07:00
479928c199 Add missing use case with module purge (#81237)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-07-13 15:47:06 -07:00
c5e54be5ea apt: Return calculated diff while running apt clean (#81247)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-07-14 05:27:05 +10:00
c3015c5eb1 replace: handle exception while parsing escape char (#81244)
* replace: handle exception while parsing escape char

* Fail early when bad escape character is provided in replace module

Fixes: #79364

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

* Run tests in Python 3.6 or greater env

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

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-07-14 05:25:08 +10:00
d373ec572b regex_replace: correct Python function in docs (#81253)
regex_replace calls re.sub()
2023-07-13 10:51:06 -07:00
b6ebb9d41a Replace reboot_command integration test with unit tests (#78956)
Co-authored-by: Matt Clay <matt@mystile.com>
2023-07-13 19:26:21 +02:00
ee12bafe48 deprecate 'smart' connection value (#81218)
Co-authored-by: Jordan Borean <jborean93@gmail.com>
2023-07-13 12:57:26 -04:00
59a791ee3b ansible-test - remove Fedora 37 container and remote support (#81093) 2023-07-13 08:50:15 -04:00
effb494db4 Update wait_for_connection to not reference configure script (#81250) 2023-07-13 17:12:19 +10:00
08307de366 ansible-test - Remove obsolete WinRM setup script (#81249)
The WinRM setup is handled internally by ansible-core-ci now.
2023-07-12 19:52:49 -07:00
8edba0bb72 filter: add documentation for msg parameter (#81110)
* mandatory filter provides `msg` parameter. Document the same.

Fixes: #81105

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-07-12 16:02:56 -07:00
b93a628aed Omit hacking directory from MANIFEST.in (#81245)
* Omit `hacking` directory from `MANIFEST.in`

* Update package-data sanity test
2023-07-12 14:43:08 -07:00
3e3fb26b35 Use semantic markup for modules. (#81190) 2023-07-12 10:06:32 -04:00
f2ade88334 Fix yaml syntax in csvfile_lookup example (#81221)
Testing this example gives a parse error.
The correct syntax needs a colon for assignment, not equal sign
2023-07-12 09:57:48 -04:00
1ca03139cc Update regex_* docs (#81016)
* Update regex_* docs
* Remove Python 3 regex link
* Added references to inline regex flags

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-07-11 19:38:36 -07:00
7c6564ad0e Revert "define code owners to support branch-protection rules on docs (#81041)" (#81228)
This reverts commit 9117762358.
2023-07-11 16:27:29 -07:00
2915424541 Update env-setup.fish (#81208)
## Description

This commit includes improvements and optimizations to the script:

- Clarified the purpose of the quiet flag with a comment.
- Adjusted conditions for appending to PYTHONPATH and MANPATH variables.
- Enhanced Python executable check for reliability and cross-platform support.
- Improved comments and function clarity.
- Ensured consistency with the original code.

These changes enhance readability, efficiency, and maintainability of the script.
2023-07-11 16:16:14 -07:00
876be11f8c Add pymarkdown sanity test for core (#81220)
* Clean up markdown

* Add pymarkdown sanity test for core

* Update unit test SHA
2023-07-11 14:40:47 -07:00
72e038e823 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
2023-07-11 12:40:06 -07:00
38e50c9f81 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
2023-07-11 11:42:40 -07:00
dce51f4ff4 Module docs fixes. (#81213) 2023-07-11 12:10:16 -04:00
c7eca0e5c0 first_found lookup, let lookup handle templating errors (#81178)
* first_found lookup, let lookup handle templating errors

Avoids case in which TE was not sending valid and templatable entries to the lookup
The lookup already handles the case TE was attempting to itself, so no need for this code anymore.

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2023-07-11 11:48:33 -04:00
5014a6025e Add space to make linter happy (#81175) 2023-07-11 11:41:27 -04:00
c3f479e378 Add type annotation for connection plugins (#78552)
* Add type annotation for connection plugins

* Use new | syntax instead of Union/Optional

* Fix pep issue

* Use ParamSpec and other minor fixes

* Fix up ParmaSpec args and kwargs type
2023-07-11 11:23:57 +10:00
67b78a17c4 Remove Python 3.9 support for the controller (#80973)
* Remove obsolete Python <=3.9 controller code
* Remove Python 3.9 test controller bootstrapping
* Update test requirements

Co-authored-by: Matt Clay <matt@mystile.com>
2023-07-10 12:01:47 -04:00
73b95db66b fix doc report template (#81202)
* fix doc report template

* Update .github/ISSUE_TEMPLATE/documentation_report.yml

Co-authored-by: Sandra McCann <samccann@redhat.com>

---------

Co-authored-by: Sandra McCann <samccann@redhat.com>
2023-07-10 11:56:44 -04:00
faca205ca1 Add multirepo tip to doc issue report (#81140) 2023-07-10 10:40:47 -04:00
7cf15d0732 Use semantic markup for remaining plugins. (#81189)
also change  `ansible_psrp_protocol` for `protocol`  as what matters is the option itself, not what was used to set it
2023-07-10 09:30:33 -04:00
c3af71a2c8 dnf5: utilize automatic gpg check via transaction.run() (#81144)
https://github.com/rpm-software-management/dnf5/pull/607
2023-07-10 15:19:17 +02:00
eb19692f48 Properly disable modularity tests for dnf5 only (#81195) 2023-07-10 10:51:05 +02:00
7b2647f3b2 Re-introduce RHEL 9 modularity testing in CI (#81160) 2023-07-10 09:54:36 +02:00
f4ff6768f3 ansible-test - Remove old pytest-forked constraint (#81185) 2023-07-07 13:10:42 -07:00
3d2ff64264 ansible-test - Fix import sanity test for targets (#81184) 2023-07-06 22:57:10 -07:00
ca3ffbf4c2 ansible-test - remove test remotes: rhel 8.7/9.1 (#81065)
Fixes #80419
Fixes #80420
2023-07-06 11:25:57 -07:00
ad0e082ac0 script inventory plugin, link to dev script howto docs (#80796) 2023-07-06 10:26:06 -04:00
5cf58f9a15 Use semantic markup for docs fragments (#81152) 2023-07-06 09:41:24 -04:00
73dde45f0f ansible-galaxy - add pre-release hint to dependency resolution error (#81147)
* add pre-release hint to dependency resolution error if --pre wasn't provided

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2023-06-30 10:36:12 -04:00
f1ddcb4ae4 Simplify release name tracking and testing (#81151)
Convert the release names list from YAML to plain text, removing the need for YAML parsing in the sanity test.
2023-06-29 10:18:15 -07:00
8c9f5c9106 Remove unused unit test code (#81150) 2023-06-28 16:26:00 -07:00
bcdb82992a user - add parameter for password expiration warning days (#79884)
* user - add parameter to set number of warning days before password expires

Signed-off-by: Norman Ziegner <norman.ziegner@ufz.de>
2023-06-28 17:36:35 -04:00
b06f7de24a Remove unused strategy plugin unit tests (#81146) 2023-06-28 12:07:25 -07:00
0cc50e0673 dnf5: enable now implemented cacheonly functionality (#81141)
Note that this also fixes a traceback caused by backwards incompatible
change in dnf5 where cacheonly was changed from bool to string:
https://github.com/rpm-software-management/dnf5/pull/665/files#diff-ab65249ff7fccadfb2864b6826f6559f7f16fad43fd3bf2da0b4fe8db790d59aR179
2023-06-28 16:05:59 +02:00
63946eaed6 Remove unreachable code in curses unit test (#81138) 2023-06-27 23:24:42 -07:00
5f58775a1f More unit test code coverage improvements (#81136) 2023-06-27 17:38:35 -07:00
a5a4903b03 edited the documentation for 'groups' in user.py (#81114)
* edited the documentation for 'groups' in user.py

* Update user.py
2023-06-27 11:03:20 -04:00
2f820381ea Inventory Script Plugin: raise execution error (#81104)
It adds exception treatment when execute a inventory based on script with the --host argument

---------

Co-authored-by: Everson Leal <everson.leal@sonda.com>
2023-06-26 17:29:59 -04:00
ed8a404f4a add coverage for Python 3.12 (#81125) 2023-06-26 10:38:22 -07:00
e780b5e56d ansible-galaxy - add config option for the default ansible-galaxy timeout (#81108)
allow configuring the default server timeout via env/ini
2023-06-26 13:10:41 -04:00
e22fe9be56 ansible-test add alpine 3.18 as remote (#81109)
* add crun to avoid runc
2023-06-26 10:41:31 -04:00
e535eb625b Remove long obsolete hacking/get_library.py (#81122) 2023-06-23 18:42:48 -07:00
5b586096b3 Remove hacking/fix_test_syntax.py (#81121)
This script is no longer needed, since using tests as filters was removed in 2.9.
2023-06-23 18:31:42 -07:00
7e2b25beac Revert "Add a custom policy for hackers using ansible-test (#68535)" (#81120)
This reverts commit bd9e31fcb0.
2023-06-23 17:36:36 -07:00
82b5544b09 Improve code coverage of unit tests (#81119)
- Remove unused code
- Remove unnecessary code
- Ignore coverage for unreachable code
- Use previously unused code to increase coverage
2023-06-23 16:08:54 -07:00
da2cd157f1 Fix arg splitting and key/value parsing (#80030)
* Improve readability of unit test output

This drops the trailing `-expectedXXX` suffixes from test names generated by parametrize.

* Add more splitter unit tests

This fills in code coverage gaps in the exising unit tests.

* Bug fixes and code cleanup

- Fix IndexError exceptions caused by parsing a leading newline, space or escaped space.
- Fix an AttributeError exception in `parse_args` when parsing `None`.
- Fix incorrect parsing of multi-line Jinja2 blocks, which resulted in doubling newlines.
- Remove unreachable exception handlers in the `parse_kv` function.
  The unreachable code was verified through analysis of the code as well as use of the `atheris` fuzzer.
- Remove unnecessary code in the `split_args` function.
- Add an optimization to `split_args` for the empty args case.

* Add unit tests for bug fixes

The splitter code is now fully covered by unit tests.

* Add another issue ref in changelog
2023-06-22 16:19:52 -07:00
98d1cf7aa2 Deprecate plural collections_paths option (#81063)
* Deprecate plural collections_paths option

* Fix test assumption
2023-06-23 04:41:59 +10:00
a7d2a4e032 display, also proxy warnings and deprecations (#81060)
Use generic proxy for display  methods with decorator
2023-06-22 13:57:59 -04:00
38067860e2 template escaping: use configured variable start instead of default one (#81001)
this will handle escaping correctly in tempaltes that override the default jinja variable tokens
also fix optimization for single var path when overrides happen
2023-06-22 11:40:25 -04:00
c3926268e2 ansible-test - Avoid using atexit module (#81096) 2023-06-21 14:41:25 -07:00
1f9836fe9a Fix typo in to_yaml filter examples (#81094) 2023-06-21 10:13:07 -04:00
bd5b0b4293 Avoid deprecated importlib.abc.TraversableResources (#81082)
* Avoid usage of deprecated importlib.abc.TraversableResources

This fixes ansible-compat test failures with Python 3.12.

* Add deprecated: marker for compat code

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

* add declarative deprecation comment to < 3.9 case

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

---------

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2023-06-20 11:54:06 -07:00
c69951daca ansible-test: remove Ubuntu 20.04 LTS (#81070) 2023-06-20 11:25:12 -07:00
bc68ae8b97 ansible-test: Added Fedora 38 (#81074) 2023-06-20 11:24:08 -07:00
56b67cccc5 Resolve issues on python pre-3.10.6 with collection dirs longer than 100 characters (#81061) 2023-06-15 16:15:11 -05:00
6fead15334 Pylint deprecated comment checker (#81071)
Co-authored-by: Matt Clay <matt@mystile.com>
2023-06-15 16:14:52 -05:00
534f688a53 remove Freebsd 13.1 from test matrix (#81058)
* remove Freebsd 13.1 from test matrix

fixes #80416


Co-authored-by: Matt Clay <matt@mystile.com>
2023-06-15 14:59:33 -04:00
cde15f3c81 Add test support for Python 3.11 on RHEL 8.8/9.2 (#80990)
Fixes #80412
Fixes #80413
2023-06-14 18:16:28 -07:00
c1bc445aa7 ansible-test - Update openSUSE containers (#81062)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-06-14 17:54:43 -07:00
ecbbd7e5d1 Remove Python 3.5 support (#80972)
* Remove Python 3.5 support

* changelog

* add requested changes

* Update changelogs/fragments/remove-python3.5.yml

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

* remove Python3 < 3.5 error handling

* remove Python3 < 3.5 error handling in TE too

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2023-06-15 00:05:50 +02:00
660f1726c8 Register handlers immediately if currently iterating handlers (#80898)
This fixes the issue where handlers notifying other handlers are
not properly run because the notification is not registered unless
another flush_handlers occurs. Instead, if the current host state
is iterating handlers we immediately register the handler to be
run so the notification is not lost.

Fixes #80880
2023-06-14 17:39:20 +02:00
73e04ef2d6 Don't mutate templar.environment, only overlay on local myenv (#81005) 2023-06-13 11:37:17 -05:00
cf803d6d58 Improved return docs (#81006)
* Improved the return docs for modules `sysvinit`
  and `systemd_service`

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-06-13 08:23:50 -07:00
f13e35cbf9 dnf5 - enable env groups testing in CI (#81032)
Implemented in https://github.com/rpm-software-management/dnf5/pull/585
2023-06-13 11:20:22 -04:00
440b5fd040 Make sure that values that should be strings are actually strings. (#81029) 2023-06-13 11:19:40 -04:00
ce55e0faf5 Update example in apt_key module (#81017)
* Verify checksum of downloaded key

Fixes: #79892

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-06-13 11:17:42 -04:00
9117762358 define code owners to support branch-protection rules on docs (#81041)
* during interim docs/ (and related dirs) split to separate repo, prevent merges that might require a rebase of the target repo
2023-06-12 11:16:40 -07:00
796d41ff18 Bump azure-pipelines-test-container to v4.0.1 @ CI (#80916)
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:23:03 -07:00
42ca0803a1 Bump azure-pipelines-test-container to v4.0.1 @ CI (#80916)
* Bump azure-pipelines-test-container to v4.0.1 @ CI

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:22:35 -07:00
cf4d4577ac Remove hacking dir dependency from build backend (#81021)
* Copy man generation files into build backend

* Use copied files in build backend
2023-06-09 16:56:48 -07:00
a473bb798d modules/find: param contains: Describe matching behavior (#80744) 2023-06-09 13:47:01 -04:00
6ac0ea3567 Use *.md instead of *.rst for test READMEs (#81009) 2023-06-08 23:04:32 -07:00
faa6d55ee6 Fix Source Mage family mapping (#80985)
* Fix Source Mage family mapping

* Update docs too

* Add changelog fragment
2023-06-09 14:03:39 +10:00
ff359fa8e1 Reorganize CI sanity test matrix (#81004) 2023-06-08 13:07:54 -07:00
b3f1290bcd Remove docs dir dependency from man page build (#81003) 2023-06-08 12:41:45 -07:00
30a8ef0277 Roadmap: Update 8.1.0 ETA (#80998) 2023-06-08 11:58:49 -04:00
6e137433ae Ansible 9 roadmap (#80851) 2023-06-08 09:08:52 +01:00
519caca70c Update modules_intro.rst (#80588) 2023-06-07 17:05:41 -04:00
ef56284f9d Revert "update intersphinx links for Ansible 8" (#80960)" (#80993)
This reverts commit 7a01fb221a.
2023-06-07 12:46:14 -07:00
6fcbed0f3f Simplify conditional.py (#80584)
* Simplify conditional.py
2023-06-07 12:14:07 -04:00
25b3d3a6f7 Check if skeleton is /dev/null while creating home folder (#75948)
* Check if skeleton is /dev/null while creating home folder

* Add test for linux

Co-authored-by: Holger Dörner <h.doerner@bitexpert.de>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2023-06-07 12:10:21 -04:00
1ecc62ba06 Document lookups using dwim (#80878) 2023-06-07 12:08:52 -04:00
c511a79172 Add simpleinit_msb fact for service_mgr (#80963)
* Add simpleinit_msb fact for service_mgr
2023-06-07 12:07:08 -04:00
fda66eeee0 Sanity Fixes: (#80953)
* Typo fixes
* arguments-renamed
* pep8:E501
* pylint:use-a-generator
* pep8:E231
* use-argspec-type-path

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-06-07 12:06:30 -04:00
090a5cdfcf add 2.16 to the release and maintenance table (#80974) 2023-06-07 11:54:23 -04:00
e801921b98 update backport instructions to use 2.15 examples (#80959) 2023-06-07 11:52:42 -04:00
7a01fb221a update intersphinx links for Ansible 8" (#80960) 2023-06-07 11:52:09 -04:00
9e14a85fe3 Added link to argument_spec (#80967) 2023-06-07 11:51:26 -04:00
9a87ae4406 Add 2.16 roadmap items (#80971) 2023-06-07 09:30:24 -05:00
92d5ffda82 Update galaxy_ng container for tests (#80721) 2023-06-07 09:09:01 -05:00
af84f7a00e Update other_tools_and_programs.rst (#80895) 2023-06-07 13:06:43 +01:00
6e325d9e4d 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.
2023-06-06 14:48:16 -07:00
08a647214f Indicate which args can be provided multiple times. Fixes #22396 (#80970) 2023-06-06 12:29:54 -05:00
d210260afc Correct syntax error in the example (#80976)
* Update success.yml
* Update reachable.yml
* Update unreachable.yml
2023-06-06 10:20:29 -07:00
ef3b806dd3 Fix remote_tmp tests so that they actually use the remote_tmp (#80969)
* Fix remote_tmp tests so that they actually use the remote_tmp

* Isolate remote_tmp dir during remote_tmp tests. Fixes #80965

* Do everything without become
2023-06-06 11:24:53 -04:00
742d47fa15 replace deprecated ast.value.s with ast.value.value (#80968)
* replace deprecated ast.value.s with ast.value.value

the s attribute is deprecated since Python 3.8 and emits a warning in
3.12 causing some test failures
2023-06-06 11:22:26 -04:00
aa67d544fc Handle unreachable errors in fetch properly. Fixes #27816 (#80952) 2023-06-06 11:03:22 -04:00
5e550b6086 Update COLLECTIONS_8.rst (#80962)
ansible-core 2.15.1 is expected on 2023-06-19, adjusting the dates accordingly

Fix mention of Ansible-9 for when minor releases (of ansible-8) will stop
2023-06-05 10:05:08 -04:00
0982d5fa98 Fix TypeError when installing subdir collections. Fixes #80943 (#80949) 2023-06-01 15:58:06 -05:00
c069cf88de Added an example of mixed format argv in command module (#80933)
Fixes: #80126

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-06-02 05:05:45 +10:00
79677c16f1 add mission survey to docs banner (#80931)
Co-authored-by: Don Naro <dnaro@redhat.com>
2023-05-31 11:57:20 -04:00
e91bf2248f Update manager.py (#80926) 2023-05-31 11:04:15 -04:00
939f2741c6 Docs: Update changelog for Ansible 8 (#80886) 2023-05-30 13:46:24 -04:00
124f33b230 Add Ansible community 8.0.0 porting guide (#80927) 2023-05-30 13:29:22 -04:00
9fb03093b3 set latest version to 8 (#80892) 2023-05-30 17:25:32 +01:00
6011b7c4c1 Update split.yml (#80915)
typo in description
2023-05-30 11:18:48 -04:00
d0686f0f77 fix typo in from_yaml_all.yml (#80911)
mulitple -> multiple
2023-05-30 11:14:24 -04:00
3a1d58bc58 ansible-test - Use raise from to handle exceptions (#80905) 2023-05-26 20:25:17 -07:00
43c31c5dc2 Use isinstance in unit tests for type checks (#80906) 2023-05-26 19:25:26 -07:00
585b82838b Improve code coverage of unit tests (#80904)
* Improve coverage of validate-modules unit tests

* Remove unused galaxy unit test code

* Fix galaxy unit test teardown logic

* Improve coverage of galaxy unit test code

* Improve coverage of galaxy unit tests

* Remove unused code in galaxy API tests

* Remove unused galaxy collection unit test code

* Improve coverage of galaxy collection unit tests

* Remove unused galaxy unit test code
2023-05-26 16:54:11 -07:00
a5bb4c7dee ansible-test - local change detection without --fork-point (#79734) 2023-05-26 14:07:20 -07:00
e88ff32b10 deb822_repository: use http-agent with open_url (#80876)
* Use http-agent in open_url API while getting
  cloudflare content

Fixes: #80809

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-05-25 12:09:53 -07:00
09387eaa24 Update dnf5 module to handle API change for setting the download directory. Fixes #80887 (#80888) 2023-05-25 12:13:38 -04:00
0775e991d5 Documentation tweaks for apt repo key management. Fixes #78063 (#80872) 2023-05-25 10:37:59 -05:00
9f4dfff69b Pylint fixes (#80855)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-05-24 11:58:42 -07:00
56f2e65ee7 Remove unused test files (#80879)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-05-24 10:01:40 -07:00
c9f76f6d49 Remove unused import (#80875)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-05-24 09:02:04 -07:00
09b4cae4fb unarchive - ensure src is an absolute path before picking handler (#80738) 2023-05-24 10:56:37 -05:00
86e7cd57b7 Add Ansible community 8.0.0rc1 porting guide (#80873) 2023-05-23 17:42:08 +01:00
d955fb1590 Removed unused get_md5 parameter from stat (#80871)
* removed unused, undocumented `get_md5` parameter from stat module.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-05-23 11:52:23 -04:00
8652b231f2 Align yum_repository documentation with arguments (#80867) 2023-05-23 11:44:42 -04:00
0c7361d9ac URI Module find json sub type (#80745)
* uri: fixed search for json types to include strings in the format xxx/yyy+json
2023-05-23 09:38:05 -05:00
47539a19ea Add Ansible community 7.6.0 porting guide (#80868) 2023-05-23 12:09:06 +01:00
652ddc4078 Fix pylint disallowed-name errors (#80854)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-05-22 11:11:36 -07:00
a551e8db80 eol 2.12 docs (#80850) 2023-05-22 19:08:47 +01:00
61157f6a9e Switch from multiprocessing.Queue to SimpleQueue (#80838) 2023-05-22 10:02:52 -05:00
202195f5e4 Remove unreachable error for removed include_role.static (#80837) 2023-05-22 09:09:47 -05:00
9526338273 validate-modules and docsite build: bump antsibull-docs(-parser) dependencies to new major versions (#80846)
* Bump antsibull-docs-parser version to 1.0.0.

There are no functional changes that affect the functionality used in validate-modules.

* Bump antsibull-docs to 2.0.0.
2023-05-19 16:18:59 -07:00
f4b2d4d4bb Add pipx instructions to install guide (#80833) 2023-05-19 14:51:34 -04:00
10d91db003 [Docs] update node req table for 2.15 (#80823) 2023-05-19 10:22:19 -04:00
4899d4a4d6 simple skip of connection (#80638)
Avoid 'persistent' connection handling if not needed
removed useless connection passing
added property to action classes as indicator/selector
2023-05-19 09:23:27 -04:00
19b85ff415 have docs explain why we import guard (#80569)
Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Don Naro <dnaro@redhat.com>
2023-05-18 16:38:30 -04:00
be02813d25 fix yes/no to true/false in loop documents etc (#80591) 2023-05-18 16:36:42 -04:00
e4194112a0 Update inconsistency playbooks_checkmode (#80692) 2023-05-18 16:28:21 -04:00
c7e3c91294 Missing space in docs (#80779)
* Missing space between $ and ansible command

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-05-18 16:19:50 -04:00
8db9bd7574 Remove deprecated include (#80752)
* Remove deprecated include

* Add tombstone entry for include

* Use string for date

* Use todays date

* Remove uneeded if statement
2023-05-19 05:49:07 +10:00
2253837453 command - Add option to disable argument var expansion (#80512)
* command - Add option to disable argument var expansion

* Use test char that isn't an escape sequence
2023-05-19 05:36:52 +10:00
dbfb0d3cc4 Fix typo in service_mgr.py (#80824)
faild -> failed
2023-05-18 15:10:23 -04:00
070ce87440 Add test for symbolic to octal when others is omitted (#80822)
* Add test for symbolic to octal when others is omitted

Add case when there should be no permissions for other.
And specific permissions for owner and group.

* Fix permissions test by explicitly setting no permissions for others

* Add additional cases where multiple permissions are specified
2023-05-18 15:09:28 -04:00
0a36cd910e Removed testing support for Server 2012 and 2012 R2 (#80778) 2023-05-18 11:02:58 -07:00
0df794e5a4 urls - remove deprecated client key calls (#80751) 2023-05-17 17:17:25 -05:00
b16041f1a9 ansible-test - Fix traceback when mixing sources (#80801)
* ansible-test - Fix traceback when mixing sources

* ansible-test - Refactor layout error handling
2023-05-17 09:07:04 -07:00
2fd64161c1 Fix hard-coded interpreter in test_async_wrapper (#80816) 2023-05-16 16:55:57 -07:00
e837680f4b Use strings for removal_date in runtime metadata (#80815) 2023-05-16 14:23:46 -07:00
2ba24957dd Use subset checks for some collection loader tests (#80812) 2023-05-16 10:29:46 -07:00
c1f2a9ea6c No core irc meeting (#80811) 2023-05-16 11:03:42 -05:00
bf53a26deb Add Ansible community 8.0.0b1 porting guide (#80807) 2023-05-16 09:14:49 +01:00
1ff5d2bf5c update version switcher for 2.15 (#80556) 2023-05-15 20:09:32 +01:00
0830b69059 config lookup, new option to show origin of value (#80651) 2023-05-11 11:54:41 -04:00
156493eed5 ansible-test - Add RHEL 9.2 support (#80755) 2023-05-11 14:36:36 +02:00
aacab0633a ansible-test - Fix handling of long timeouts (#80769) 2023-05-10 17:08:53 -07:00
4c6aa70662 ansible-test - Fix timeout handling (#80764) 2023-05-10 14:55:57 -07:00
93216e276c [sanity-mypy] Ignore re-import warning (#80763)
* get_origin is already imported warning can be
  ignore safely.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-05-10 14:43:39 -07:00
fd341265d0 ansible-test - Avoid use of deprecated utcnow (#80750)
The timestamps are only used by ansible-test, not the junit callback, so this change only impacts ansible-test.
2023-05-10 11:26:49 -07:00
905131fc76 junit-xml - Remove outdated type ignore hint (#80748) 2023-05-09 17:20:41 -07:00
b576f0cda7 fix error if path had wildcard in it (#74723)
* fix error if path had wildcard in it

* add test

* add changelog fragment
2023-05-10 08:58:22 +10:00
7ef8e0e102 Remove unnecessary test case in vault editor (#80741)
* Remove test_real_path_symlink test case
* Check if we do not get `-` return when some value other `-` is passed

Fixes: #80444

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-05-09 11:22:41 -04:00
4b0d014d58 setup module, retry facter to handle --puppet errors (#80645)
* setup module, retry facter to handle --puppet errors

facter versions have changed how they deal with the --puppet flag
when puppet is not present, most versions will just ignore it and not error,
but initial versions of facter 4 changed the behaviour (later reverted).

fixes #80496
2023-05-08 16:53:53 -04:00
790e0b0983 ansible-test - Update the NIOS test container (#80739) 2023-05-08 13:53:01 -07:00
5a84ff26df first_found fix no terms option (#76550)
also fix bug with multiple items clobbering previous settings

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2023-05-08 14:25:25 -04:00
70e0b1f544 docsite build: upgrade sphinx-ansible-theme and antsibull-core (#80734) 2023-05-08 15:31:53 +01:00
932abc0711 Prevent setting arbitrary attrs on Jinja2 envs via overrides (#80715) 2023-05-05 16:18:35 +02:00
cdeb607b1d ansible-test - Always use unique container names (#80724) 2023-05-04 15:41:14 -07:00
2b6d5536d7 Fix docstrings RST markup in ansible-console CLI module (#80719)
* 📝🐛 Fix RST list @ `ansible-console` manpage

Said CLI entrypoint docstring is used to construct the corresponding
manpage. `docutils` were producing the following warning with the
current RST markup used there, as follows:

  :36: (WARNING/2) Bullet list ends without a blank line; unexpected unindent.

This change puts a portion of the first list entry on a separate line
which allows the RST parser stomach it without any problems and
produce correct output without gibberish in it.

* 🎨📝 Use RST inline code @ ansible-console doc

The single backtick syntax was causing things to be interpreted as
italics text. The inline code needs double backticks.
2023-05-04 11:15:31 -05:00
8cd95a8e66 Account for overlays when interacting with Jinja envs (#80705)
Instead of using Templar.environment in Templar.do_template for
accessing/mutating the environment, myenv local variable should be used
because it is the environment used for actual templating. It can either
point to Templar.environment or newly created environment overlay.

Fixes #80605
2023-05-04 14:55:27 +02:00
7eada15d1e Remove unused code from lib/ansible/collections/ (#80712) 2023-05-03 18:41:25 -07:00
d12aa7f69c Add FreeBSD 13.2 to ansible-test (#80698) 2023-05-03 10:24:53 -07:00
2cd1744be3 Use ansible.module_utils.common.text.converters (#80704)
Replace use of old `ansible.module_utils._text` and add a unit test to maintain backwards compatibility.
2023-05-03 08:58:00 -07:00
eea7137449 Fix os.walk issues in package-data sanity test (#80703) 2023-05-02 16:17:00 -07:00
54576cd794 pep517 backend - Copy symlinks when copying source (#80690) 2023-05-02 14:35:59 -07:00
23e2ca91c2 Improve coverage of role unit tests (#80695) 2023-05-02 10:53:42 -07:00
be6f2f43b6 Wording change (#80664) 2023-05-02 16:53:31 +01:00
40fd86c618 Fix typo in comment filter option (#80672) 2023-05-02 11:08:30 -04:00
dbd3bf27ec Add Ansible community 8.0.0a3 porting guide (#80691) 2023-05-02 12:18:00 +01:00
7f48fa0129 Better parse virtualenv_command option for pip (#80624)
Atthe moment if a users wants to protect  virtualenv_command by using
quotes around 'venv', module will fail out as literal parsing is used
at the moment. In order to imrpove things, argparse is leveraged to
parse out passed value to the virtualenv_command

Closes-Bug: #76372

Signed-off-by: Dmitriy Rabotyagov <noonedeadpunk@gmail.com>
2023-05-02 09:52:11 +02:00
251360314d Fix docs-build test to not mutate source tree (#80689) 2023-05-01 17:04:13 -07:00
884215bd1c Improve unit test code coverage (#80683) 2023-05-01 09:41:43 -07:00
d37678c5ff Release tool improvements (#80641)
* Provide reproducible sdist builds.
* Use reproducible wheel builds.
* Add PyPI artifact checks.
2023-05-01 09:30:19 -07:00
06dcb4ad7a Don't include a default for cli as it overrides config with lesser pr… (#80650)
* Don't include a default for CLI as it overrides config with lesser precedence

  connection plugins should already use the same config entries (and more)
  than DEFAULT_TIMEOUT.
2023-05-01 10:20:08 -04:00
1568f07b22 Removes extraneous parentheses; Fixes 80670 (#80671)
* Added missing parentheses; Fixes 80670

* Removes both parentheses.
2023-04-28 15:33:02 -04:00
9bd698b3a7 service module : remove flag confugration from openbsd enable/disable service (#80628)
fixes #66434


* removed flag setting from enable/disable on openbsd
  service was changing permanent config on openbsd, which is not expected from the this module
* if in check mode, module should not stop at enable/disable
* simplify and clean up opensd service enable/disable
* does break for those that were using service for configuring flags
2023-04-27 16:15:24 -04:00
d5e2e7a0a8 [ansible-galaxy] Fix installing signed collections (#80661)
* 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
2023-04-27 16:11:17 -04:00
71f6e10dae Use assertRaisesRegex in unit test (#80663) 2023-04-27 12:43:35 -07:00
058b722a54 Remove terminal viewing docs (#80655)
* ansible-doc command can not handle terminal plugins since they
  are not documentable and configurable. Removing documentation section
  to list them.

Fixes: #80140

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-04-27 15:14:23 -04:00
d18d4f84ec _symbolic_mode_to_octal- fix raising ValueError for invalid symbolic modes (#80449)
validate the full user and perm strings instead of just first character

fixes unhelpful unarchive error for some invalid modes
2023-04-27 13:19:37 -04:00
ed749cf0a0 Remove deprecated FileLock class (#80438) 2023-04-27 16:04:09 +02:00
8754d8e1e1 ActionBase: remove deprecated _remote_checksum (#80440) 2023-04-27 13:46:13 +02:00
cc5f8c529b Remove deprecated default.fact_caching_prefix ini config option (#80441) 2023-04-27 12:59:41 +02:00
5ac292e12d 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.
2023-04-26 16:23:26 -07:00
0c63b9622e source module compression setting directly from config (#80647)
* source module compression setting directly from config

no need to proxy via play_context, which can fall out of date w/o constant variable updates.
2023-04-26 17:29:35 -04:00
4d25e3d54f Set the minimum setuptools to 45.2.0 (#80649)
Also update the package-data sanity test to use the minimum setuptools version.
2023-04-26 16:01:56 -05:00
ece8da71ea Add TTY check and argument to disable it (#50603) (#68260)
* Add TTY check and argument to disable it (#50603)

* Fix formatting

* add changelog

* rename flag and updated help description

* add tests for tty check

* replace deprecated uses of assertRaisesRegexp to assertRaisesRegex

* fix yaml syntax

* shorten line 79

* Revert "replace deprecated uses of assertRaisesRegexp to assertRaisesRegex"

This reverts commit cea5fe1655.

* change back to assertRaisesRegexp
2023-04-27 05:55:44 +10:00
b2c0095722 Fix gather parallel (#80597)
* fix meaning of parallel in gather_facts
 * Update docs with note about parallel not always being faster
 * add 'smarter' usage of gahter_timeout for parallel tasks
 * restore async when needed, not always
 * added typing
 * parallelism tests
2023-04-26 11:14:39 -04:00
1e8b889b93 Templar: remove deprecated shared_loader_obj param (#80439) 2023-04-26 17:09:05 +02:00
038ff8b3de Add Ansible community 8.0.0a2 porting guide (#80643) 2023-04-26 12:18:44 +01:00
5f6e1b22a7 Add Ansible community 7.5.0 porting guide (#80642) 2023-04-26 08:52:19 +01:00
850a403226 service_facts, get more info for rcctl services (#80630)
uses rcctl get function to get all settables for a service
2023-04-25 23:53:44 -04:00
5e220416a2 ansible-test - Update the default containers (#80635) 2023-04-25 14:54:04 -07:00
372fc99686 ansible-test - Update pylint to 2.17.3 (#80632) 2023-04-25 12:45:26 -07:00
a2be8915de PlayIterator: remove deprecated methods (#80437) 2023-04-25 09:33:17 +02:00
36df60e226 dnf5: use new API to check package signatures (#80609) 2023-04-25 08:26:05 +02:00
abc58c026b ansible-test - Use FreeBSD packaged setuptools (#80615)
This will avoid issues during bootstrapping caused by breaking changes in setuptools.
2023-04-24 12:13:59 -07:00
989a7d6951 Fix calling v2_playbook_on_notify callback (#80585)
Co-authored-by: Matt Martz <matt@sivel.net>
2023-04-24 17:06:07 +02:00
f4615d69ad tests: replace a mock import with unittest.mock (#80589) 2023-04-21 12:34:36 -07:00
734f38b259 Add GALAXY_COLLECTIONS_PATH_WARNINGS option. (#78487)
* Add GALAXY_COLLECTIONS_PATH_WARNING option.

This allows users to disable warnings from `ansible-galaxy collection
install` about `--collections-path` missing from Ansible's configured
collections_paths.
2023-04-21 08:29:10 -04:00
748f534312 Use target of /usr/bin/dnf for dnf version detection (#80550)
Fixes #80376
2023-04-21 08:53:07 +02:00
68e270d4cc Add note guidelines for additional distributions (#80389) 2023-04-20 15:13:34 -04:00
a4fb670e9c Update DOCUMENTATION.yml (#80579) 2023-04-20 15:03:09 -04:00
791510ccba Vars Plugin Documentation Improvement (#80470) 2023-04-20 15:01:22 -04:00
ed9cd39d0f apt key and repository example security patch (#80381) 2023-04-20 14:49:06 -04:00
9ca863501c note in systemd that systemctl can change behaviour due to diff order… (#80570) 2023-04-20 14:44:08 -04:00
f05abd4540 fix become yes/no to true/false (#80515) 2023-04-20 14:40:41 -04:00
449c628f3d uri module, fix example (#80554) 2023-04-20 14:39:17 -04:00
560d5b00d0 Remove docs references to obsolete test plugins (#80576) 2023-04-19 14:40:58 -07:00
7b50571588 ansible-test - Remove deprecated features (#80558) 2023-04-18 17:17:22 -07:00
1fdeff949c ansible-test - Update default containers (#80559) 2023-04-18 17:16:29 -07:00
ba47dd9ef4 ansible-test - Update pylint to 2.17.2 (#80555) 2023-04-18 13:44:27 -07:00
44794e3ebc Update tools and programs page as per community feedback (#80493) 2023-04-18 14:30:54 -04:00
c1d8130df5 redirect old vmware guide (#80553) 2023-04-18 14:29:28 -04:00
8d685b89f2 Update validate_argument_spec.py (#80547)
##### SUMMARY
Fix example with file lookup, filter 'from_yaml' is required.


##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2023-04-18 11:30:53 -04:00
64fb64643d Fix PolicyRcD.__exit__ docstring (#80528) 2023-04-18 11:17:51 -04:00
0ee7cfb128 Implement checks, and backwards compat change, to move forward with UTF-8 only (#80370)
Co-authored-by: Sandra McCann <samccann@redhat.com>
2023-04-17 17:30:08 -05:00
694c11d5bd argspec - fix validating type for required options that are None (#79677)
* Only bypass type validation for null parameters if the default is None. A default is mutually exclusive with required.

* Prevent coercing None to str type. Fail the type check instead.
2023-04-17 15:42:58 -04:00
964e678a7f ansible-galaxy - fix installing dir sources with a trailing path separator (#79110)
* strip trailing path separator from type=dir sources
2023-04-17 15:24:55 -04:00
676b731e6f ansible-test - Replace pytest-forked (#80525)
- Unit tests now report warnings generated during test runs.
- Python 3.12 warnings about `os.fork` usage with threads (due to `pytest-xdist`) are suppressed.
- Added integration tests to verify forked test behavior.
2023-04-14 15:13:58 -07:00
6aac0e2460 Extend OpenBSDStrategy to also update current hostname. (#80521)
Fixes #80520
2023-04-14 10:41:44 -04:00
2e62724a8a feature: add support for symbolic links when passing "dir" (#80460)
* update the include_vars action plugin to always follow symbolic links when traversing directories
2023-04-14 08:07:08 -04:00
bd6feeb6e7 Validate task attributes with first finalized attrs after loop (#80476)
* Validate task attributes `run_once` and `action` with finalized attrs after individual loop results

* Validate task attribute `ignore_unreachable` using individual loop results

Once there's a way to post validate only certain fields, we can use self._task.post_validate() instead

This replaces the fix introduced in https://github.com/ansible/ansible/pull/80051.
2023-04-13 11:18:38 -04:00
d081ed3616 Adds Ansible 8 Porting Guide to Index Page (#80511) 2023-04-12 16:51:28 -04:00
f3774ae7d4 --syntax-check is only applicable to ansible-playbook. Fixes #80506 (#80507) 2023-04-12 15:24:34 -04:00
362c949622 Add Ansible community 8.0.0a1 porting guide (#80498) 2023-04-12 13:59:08 -04:00
43c5cbcaef Fix galaxy CLI unit test assertions (#80504) 2023-04-12 10:32:59 -07:00
3ec828703f Fix unit test asserts (#80500) 2023-04-12 10:04:42 -07:00
e87802cf2c pep517 backend - Use correct import_module import (#80480) 2023-04-12 10:00:09 -07:00
74b102b33c Fix unit tests returning values (#80499) 2023-04-12 09:59:11 -07:00
bd22b849c6 Fix unclosed files in unit tests (#80497) 2023-04-12 09:51:20 -07:00
09dd80b4ec Last handler defined runs, fix for roles (#79558)
Fixes #73643
* clear_notification method and simplify ifs
* Deduplicate code
* Limit number of Templar creations
* Fix sanity
* Preserve handler callbacks order as they were notified
2023-04-12 09:45:43 -04:00
9026bc5d76 Remove obsolete pkg_resources usage (#80489) 2023-04-11 19:33:57 -07:00
0371ea08d6 ansible-test - Add support for argcomplete 3 (#80482) 2023-04-11 12:03:18 -07:00
62211097cb Expand pylint deprecated plugin to catch ansible.module_utils.common.warnings uses (#80462) 2023-04-11 11:45:56 -05:00
d5f3578369 Fixing bit shift, extra comma, reformatting "copy" test. (#80458) 2023-04-11 12:13:36 -04:00
a7d6fdda66 Update ansible_tips_tricks.rst (#80477)
Fix quotation marks in example
2023-04-11 11:38:02 -04:00
bc3cc426bf fetch_url: remove auto disabling decompress when gzip is not available (#80474) 2023-04-11 11:33:04 -04:00
9f0a9cf20d get_action_args_with_defaults: remove deprecated redirected_names arg (#80473) 2023-04-11 11:31:43 -04:00
2a795e5747 Manage basic.selinux completely, instead of mocking potentially missing module (#80448)
* Manage basic.selinux completely, instead of mocking potentially missing module. Fixes #80436

* pep8
2023-04-11 11:02:20 -04:00
5ddd530d1d Templar: do not add dict to globals (#80475)
All required Jinja2 versions (>=3.0) already do this, see
f9d804ead7
2023-04-11 09:49:00 -04:00
4e9d21ec32 installation_distros: update Fedora section (#80453) 2023-04-11 09:37:58 -04:00
243aea45ce Symbolic modes with X or =[ugo] always use original mode (#80132)
* Symbolic modes with X or =[ugo] always use original mode (Fixes #80128)

Here's what's happening, by way of this mode example: u=,u=rX

At the first step in the loop, the "u" bits of are set to 0. On the next
step in the loop, the current stat of the filesystem object is used to
determine X, not the "new_mode" in the previous iteration of the loop. So
while most operations kind of operate left to right, "X" is always going
back to the original file to determine whether to set x bit.

The Linux "chmod" (the only one I've tested) doesn't operate this way. In
it, "X" operates on the current state the loop understands it is in,
based on previous operations (and starting with the file permissions).

This is an issue with "X" and any of the "=[ugo]" settings, because
they are lookups. For example, if a file is 755 and you do "ug=rx,o=u",
file module produces 0557 and chmod produces 0555.

This really becomes a problem when you want to recursively change a
directory of files, and the files are currently 755, but you want to
change the directory to 750 and the files to 640. In chmod you can do
"a=,ug=rX,u+w" (or "a=,u=rwX,g=rX"), and have it apply equally to the
directory and the files. I can't come up with a single way in the ansible
file module to deterministically, recursively, set a directory to 750
and the contents to 640 no matter what the current permissions are,
as the code currently is.

The fix is to pass in "new_mode" to _get_octal_mode_from_symbolic_perms
in lib/ansible/module_utils/basic.py inside _symbolic_mode_to_octal. And
then take "new_mode" as an argument and use it instead of the filesystem
object stat.st_mode value.

* Fixing my new unit test, fixing bug in test comments
2023-04-10 18:29:10 -04:00
f9534fd7b7 ansible-test - Update default containers (#80468) 2023-04-10 14:29:09 -07:00
2ed4396558 Fix typo in playbooks_keywords.rst.j2 (#80461) 2023-04-10 14:33:40 -04:00
5a44acc704 Update P() semantic markup example (#80464) 2023-04-10 14:30:11 -04:00
a84b3a4e72 Fix misrendered sections in manpage generation
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.
2023-04-08 14:04:59 +02:00
babdec80cc Fix the parsing integration tests (#80454)
Most of the bad_parsing tests were no longer running, with several of them no longer being valid.
The invalid tests have been removed and the valid ones rewritten.
2023-04-07 10:03:45 -07:00
bf4e0166a5 Update password.py documentation (#80297)
* Update password.py documentation with new semantic markup
2023-04-06 16:06:41 -04:00
032881e4f1 documents approaches to octal modes better (#80112) 2023-04-06 15:39:25 -04:00
af6d75e313 Add OpenSUSE to the distro's installation guide (#80308)
* Add OpenSUSE to the distro's installation guide

Similar to the rest of the distros, OpenSUSE distributes ansible and it was
missing.

Signed-off-by: ybonatakis <ybonatakis@suse.com>
2023-04-06 15:27:58 -04:00
ec403db1c7 Document how to run all tasks, even the ones with the never tag (#80315)
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2023-04-06 15:20:28 -04:00
a6e0012b8a Update playbooks_templating.rst (#80375) 2023-04-06 15:04:42 -04:00
0460f78081 Documentation changes for #80367 and #80270 (#80391) 2023-04-06 14:55:39 -04:00
db8f1756bc [Docs] communication.rst: Add a hint about adding Matrix shields to READMEs (#80392) 2023-04-06 14:53:17 -04:00
7251938370 ansible.builtin inferred by collection_name == None (#80446) 2023-04-06 13:51:39 -05:00
88a380c8f0 📝 Document macOS user deletion over SSH (#80358)
Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Don Naro <dnaro@redhat.com>
2023-04-06 18:08:24 +01:00
4029da9a9f Semantic markup docs (#80240)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
Co-authored-by: Don Naro <dnaro@redhat.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2023-04-06 16:46:03 +01:00
92c694372b Replace validate-modules's semantic markup parser with antsibull-docs-parser (#80406) 2023-04-05 17:45:44 -07:00
96f7fd5539 Extend ansible-doc test with more classic markup. (#80407) 2023-04-05 16:14:35 -07:00
163f297d7f Extend bulk issue creator (#80423)
It can now be used to create feature requests, not just deprecation bug reports.
2023-04-05 15:24:21 -07:00
fc5c0aadc9 Correct bypass_host_loop attribute for group_by (#80380)
This action originally bypassed the host loop, but it does not
currently.
2023-04-05 16:51:25 -05:00
12ce7d2e4e dnf5: fix module/pkg names in the failed respawn msg (#80402) 2023-04-05 11:18:04 -05:00
8d5c250234 dnf5: use the logs API to determine transaction problems (#80401) 2023-04-05 11:17:50 -05:00
6d1e355639 Only use the selectors code path when we are prompt matching (#79931) 2023-04-04 15:20:26 -05:00
460abe0cef Fetch signatures from galaxy after the dependency resolver runs (#80334)
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>
2023-04-04 14:43:58 -04:00
4f7f7d1c26 Remove old release announcement scripts (#80371)
These have been replaced by `packaging/release.py`
2023-04-04 11:08:44 -07:00
d7e7c2d872 Update URLs in COPYING (#80385) 2023-04-04 10:37:23 -05:00
c1e19e4bdd Fix getting timeout for get mounts facts on Linux (#79847)
* Fix how to get the gather_timeout setting while getting the
mounts facts on Linux.

Issue: #79844
2023-04-04 11:02:41 -04:00
5e131a96c0 bump devel to 2.16.0.dev0 (#80390) 2023-04-03 15:26:32 -07:00
2f647e9617 Implement semantic markup support for Ansible documentation in validate-modules. (#80243) 2023-03-31 14:14:35 -07:00
7fcb9960e6 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.
2023-03-31 12:29:06 -07:00
4b20191c52 list all tags (including never) when listing tags (#80309)
* Ensure we default to show all tags when listing tags

 'never' was being excluded by default,as it is not part of the 'run tags'
 runtime default ('all'). For listing we now add it to the default 'run tags'.
2023-03-31 11:37:17 -04:00
043a0f3ee8 Fix run_once by instantly tiny post_validate (#78492) (#80051)
Signed-off-by: tu1h <lihai.tu@daocloud.io>
2023-03-31 11:36:44 -04:00
0e509ecf25 Support role extension for semantic markup. (#80305) 2023-03-31 10:52:10 -04:00
a81b787a05 Add new dnf5 module (#80272) 2023-03-31 15:51:48 +02:00
666188892e fix using templated values for include/import role FA (#80320)
* fix using templated values for include/import role options 'public', 'allow_duplicates', and 'rolespec_validate'

* pass templated values without changing the instance

* Fix templating by setting always_post_validate to True and calling IncludeRole.post_validate() instead

ci_complete

* add changelog
2023-03-30 17:20:10 -05:00
a45dd2a01c 🐛📝 Undouble trailing colon @ faq.rst (#80359)
It is causing parsing/representation problems of the following
explicit RST code block.
2023-03-30 12:20:38 -07:00
5d64024f1a ansible-test - Fix packaging change classification (#80360) 2023-03-29 17:54:30 -07:00
d8adc081d8 ansible-test - Update base and default container (#80355) 2023-03-29 14:59:44 -07:00
49b5c80c41 ansible-test - Update sanity test requirements (#80354) 2023-03-29 12:15:25 -07:00
6a66761e0e 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.
2023-03-29 10:14:39 -07:00
cf44c84396 Add antsibull-changelog and antsibull-docs to other tools and programs page. (#80340) 2023-03-29 11:06:18 -04:00
55c40d4d45 Remove obsolete MANIFEST.in entries (#80346)
The referenced file and directory no longer exist.
2023-03-28 17:11:47 -07:00
0cfdf0ad59 Use a dedicated version helper for the docs build (#80345)
This removes the dependency on the release version helper in the docs-build sanity test.
2023-03-28 17:00:12 -07:00
46362bbd27 Update package-data sanity test (#80344)
The test no longer relies on the Makefile.
2023-03-28 16:44:36 -07:00
052da3c89e Use skip/macos instead of skip/macos/13.2 (#80343)
The reason for the skip won't be going away with future versions of macOS.
2023-03-28 16:11:56 -07:00
1d6f019ce6 Remove obsolete integration test aliases (#80342)
* Remove obsolete integration test aliases

* Remove obsolete `skip/osx` aliases

* Use `skip/macos` instead of `skip/osx` in docs
2023-03-28 13:45:56 -07:00
d2f6ea4179 New deb822_repository module (#80018)
Fixes #77073
2023-03-28 14:34:15 -05:00
29e0a68af2 Add Ansible community 7.4.0 porting guide (#80338) 2023-03-28 14:56:25 -04:00
2e413b74e4 Add work-around for old AZP jobs (#80339) 2023-03-28 11:50:47 -07:00
9faf94468b Enforce that Display.display requires a str (#80327)
* Enforce that Display.display requires a str

* clog frag

* ci_complete
2023-03-28 17:41:02 +02:00
bf74f390af clog (#80336)
(cherry picked from commit 97c8da7783)
2023-03-28 10:25:54 -04:00
fc9415eeb4 "Ansible Lint" IntelliJ plugin added (#80263) 2023-03-28 12:26:45 +01:00
fb6b90fe42 Improve Ansible.Basic.cs tempdir uniqueness (#80328)
* 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
2023-03-28 12:25:10 +10:00
8600a1b927 Bump antsibull-docs version in docs-build sanity test (#80326)
* Bump antsibull-docs to 1.11.0.

* Update all requirements for the docs-build sanity test.

* Run again with Python 3.9.
2023-03-27 15:23:47 -07:00
086ae42209 Fix URL processing. (#80295) 2023-03-27 13:54:29 -07:00
ba4505f5cb Ansible.Basic - Improve temporary file cleanup process (#80293)
* Ansible.Basic - Improve temporary file cleanup process

* Add comment on struct value used
2023-03-28 05:57:17 +10:00
8ce102f302 ansible-test - Remove macos/12.0 remote (#80319) 2023-03-27 12:56:13 -07:00
a6bfa82bd0 New upstream release tool (#80179) 2023-03-27 12:40:35 -07:00
93beef053e Improve dirname and basename filter doc (#80054) 2023-03-27 14:17:29 -04:00
93d0253292 Use variable instead of container resource in AZP (#80299) 2023-03-27 10:04:36 -07:00
0fd88717c9 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.
2023-03-27 10:22:18 -04:00
016b7f71b1 ansible-galaxy - support resolvelib >= 0.5.3, < 1.1.0 (#80196)
* ansible-galaxy - support `resolvelib >= 0.5.3, < 1.1.0`

<https://pypi.org/project/resolvelib/1.0.1> released on 2023-03-09:

-   <https://github.com/sarugaku/resolvelib/blob/main/CHANGELOG.rst#101-2023-03-09>
-   <https://github.com/sarugaku/resolvelib/releases/tag/1.0.1>

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>

* Trigger CI by pinning resolvelib with latest version

Since resolvelib is pre-installed in our test containers, we should temporarily pin the latest version allowed to force the tests to run with that version. Once the tests have passed that commit can be reverted.

Please make those changes without force pushing, so that we keep the reference to the passing CI run. We can squash the commits when merging the PR so the temporary commits won't be in the final commit merged to the devel branch.

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>

* https://github.com/ansible/ansible/pull/80196#discussion_r1136003637

Also test resolvelib with multiple supported versions.

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>

* Revert "Trigger CI by pinning resolvelib with latest version"

This reverts commit 5518e5dbca.

---------

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
2023-03-27 16:19:23 +02:00
b398613120 Add support for plugin field in seealso. (#80212) 2023-03-23 17:37:09 -07:00
054aa92158 Fix url lookup test to use test container (#80284) 2023-03-23 12:58:57 -07:00
ed4b1afc6c Don't double loop, ensuring that machine formats don't dupe collections onto all paths (#80277)
* Don't double loop, ensuring that machine formats don't dupe collections onto all paths

* Add tests
2023-03-23 12:57:14 -07:00
42355d181a Do not double calculate loops and delegate_to (#80171) 2023-03-23 13:04:09 -05:00
fafb23094e ansible-doc: fix broken seealso links in text output (#80280)
* Fix broken URLs.

* Also remove auto-generated description for modules outside ansible.builtin.
2023-03-23 13:28:05 -04:00
4ea50cef23 validate-modules: check_mode attribute and compare with supports_check_mode parameter (#80090)
Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
2023-03-23 09:59:33 -07:00
5388f6020a validate-modules: support plugin see-also (#80244) 2023-03-23 09:48:22 -07:00
6a6824f570 ansible-test - Update CloudStack test container (#80278) 2023-03-23 09:28:23 -07:00
cf8fa5e75c ansible-test - Update sanity test requirements (#80279) 2023-03-22 17:47:06 -07:00
c2cc4225c2 Remove test related targets from Makefile (#80115)
Invoke `ansible-test` directly instead of wrapping invocations with `make`.
2023-03-22 15:51:00 -07:00
2ae013667e ansible-galaxy collection install retry improvements (#80180)
* 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

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

* Add missing import

---------

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2023-03-22 11:04:56 -05:00
cba3952434 Move Collection requirements to ansible/ansible (#80234) 2023-03-21 16:59:26 -04:00
a2dc5fcc7d Implement semantic markup support for Ansible documentation in ansible-doc. (#80242) 2023-03-21 11:29:45 -04:00
4ca3a29cd2 Bump antsibull-docs version to 1.10.0 to support semantic markup. (#80201) 2023-03-21 10:21:54 -04:00
eebfd71a6d Make PEP 517 mutation tests use pinned old setuptools (#80262)
* Pin setuptools to lowest supported @ PEP 517 test

This allows catching the behavior of builds under old setuptools.

* Stop invoking `setup.py install` in tests

This is not the part we care about since it involves dealing with the
external runtime dependencies rather than building our source
distribution.
2023-03-20 14:53:13 -07:00
7097df3eed 📦 Switch sdist build-system to pure setuptools (#80255)
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 will make sure not to modify the current
source checkout on that first build.

Co-authored-by: Matt Clay <matt@mystile.com>
2023-03-20 12:01:16 -07:00
888abf5d6e Make isolated source changes @ PEP 517 backend (#80253) 2023-03-20 11:26:53 -07:00
1491ec8019 Update special_variables.rst (#80210)
The usage of a glossary on this page will allow linking to a specific special variable, like on the glossary page, e.g.: https://docs.ansible.com/ansible/latest/reference_appendices/glossary.html#term-Idempotency
2023-03-17 09:55:04 -04:00
fc8203168e uri: improve force_basic_auth documentation (#80211)
Add more details about what "true" and "false" mean for the
force_basic_auth setting. Give example scenarios when clients may want
to use this setting.
2023-03-17 09:41:31 -04:00
0937cc4862 Update connection.rst (#80194) 2023-03-16 16:13:01 -04:00
507fd1bd60 Document debugging conditionals (#80239)
##### SUMMARY
Add a section to the docs describing how to debug conditional statements - how to get Ansible to show you whether your `when:` clause evaluates to `true` or `false`.

I ran into trouble with this and couldn't find anything in the docs. Thought I'd add it.


##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2023-03-16 15:47:01 -04:00
0a6333f7d0 corrected class documentation (#80241) 2023-03-16 15:38:02 -04:00
516cb9a52e fix typo in plugin_docs.py (#80195)
lable -> label
2023-03-16 10:34:08 -04:00
bad8843124 ansible-test - Update git diff handling (#80202)
This change allows ansible-test to work with newer versions of git on AZP.
2023-03-13 15:29:09 -07:00
1c156c0d16 Replace deprecated BadZipfile with BadZipFile (#80198)
* Replace deprecated BadZipfile with BadZipFile

* Retain support for Python 2.7
2023-03-13 05:39:30 +10:00
7ce951ff48 Adjust release schedule docs to four weeks (#80166) 2023-03-10 11:41:45 -05:00
6165dfea40 ansible-galaxy role info - fix unhandled AttributeError
* catch GalaxyError instead of its base class to ensure it will have a http_error attribute
2023-03-09 16:47:13 -05:00
cb2180e286 Fixed typo (#80184)
`uvault` should be `unvault`
2023-03-09 11:21:08 -08:00
f3bc0f18ff ansible-test - Update base and default container (#80178) 2023-03-08 14:38:14 -08:00
85b5f31f75 Update mypy to 1.1.1 (#80175) 2023-03-08 13:11:03 -08:00
b7a0e0d792 copy - fix check mode with remote_src=True (#78624)
* Don't create dest directory in check mode

uncomment existing test

Fix checking for file attribute changes in check mode and add a test
2023-03-08 15:40:01 -05:00
c564c6e21e ansible-test - Update pylint requirements (#80172) 2023-03-08 12:15:02 -08:00
31658031ed ansible-test - Remove pointless comparison (#80168) 2023-03-08 11:06:54 -08:00
cfa7acbc19 Raise an error on invalid FA.isa value (#80040)
Avoids bad definitions of playbook classes
2023-03-08 12:48:43 -05:00
701f8852ec Revert "🧪 Switch macOS 13.2 to 12.0 in CI (#80145)" (#80156)
This reverts commit 326e70c02a.
2023-03-07 23:13:42 -08:00
46c08c4467 move test so it runs when the plugin is modified (#80158) 2023-03-07 17:13:02 -05:00
9a03c8f5b3 update paramiko_ssh unit tests load the connection with plugin loader (#80157)
* Load the paramiko_ssh connection plugin properly using plugin loader so it can use config manager when _connect() is called
2023-03-07 16:05:13 -05:00
a1bff416ed paramiko connection now uses the correct source of data (#79704)
* paramiko connection now uses the correct source of data

* keep orig name

* added missing port to docs

* Update changelogs/fragments/paramiko_config.yml

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

* test ansible_host templating

* added missing private_key_file

* removed all play_context fallbacks

* Update lib/ansible/plugins/connection/paramiko_ssh.py

Co-authored-by: Jordan Borean <jborean93@gmail.com>

* Update lib/ansible/plugins/connection/paramiko_ssh.py

Co-authored-by: Jordan Borean <jborean93@gmail.com>

---------

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Jordan Borean <jborean93@gmail.com>
2023-03-07 10:09:14 -06:00
694f12d01b Avoid redundant unsafe wrapping in ansible_eval_concat (#80143)
The wrap_var is done in do_template for all concat functions after their
return.
2023-03-07 16:14:52 +01:00
12c1891ce6 Fix spelling and grammar in subelements filter doc (#80137) 2023-03-07 16:05:02 +01:00
367d45facd ansible-test - Fix error with missing pylint home (#80155) 2023-03-06 19:49:21 -08:00
27287b40c0 ansible-test - Fix pylint error with old home dir (#80151) 2023-03-06 17:58:14 -08:00
7c62cdeecd Fix MANIFEST.in includes (#80147) 2023-03-06 15:28:53 -08:00
326e70c02a 🧪 Switch macOS 13.2 to 12.0 in CI (#80145)
* 🧪 Switch macOS 13.2 to 12.0 in CI

The former revealed unexpected flakiness while the latter is the
previous value that was used to be stable. This is a temporary revert.

* Skip lookup_url integration test under macOS 12.0
2023-03-06 14:55:12 -08:00
ca604513db apt_repository, dont assume only missing apt-key will populate stderr (#79827)
fixes #79825
2023-03-06 16:14:35 -05:00
ff3ee9c4bd ansible-inventory prevent duplicating host entries (#80059)
this happened after implementing limits we introduced a bug that a host would be duplicated if it existed in a group's children
2023-03-06 15:46:54 -05:00
1055803c3a docsite requirements path (#80134) 2023-03-03 10:09:40 -05:00
3216e071c7 docs: automatic always tag in gather_facts (#80052) 2023-03-03 10:08:03 -05:00
8fec2d2a82 Add macOS 13 to CI and ansible-test (#79508)
* ✨ Add macOS 13.2 to `ansible-test`

* 🧪 Replace macOS 12.0 with 13.2 in the CI matrix

* Skip `lookup_url` under macOS 13.2

This is due to https://wefearchange.org/2018/11/forkmacos.rst.html
that manifests itself as follows:

    TASK [lookup_url : Test that retrieving a url works] ***************************
    objc[15394]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
    objc[15394]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in t
    he fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
    ERROR! A worker was found in a dead state

* 📝 Extend ansible-test change note w/ macOS 13.2
2023-03-03 04:30:30 +01:00
c0e0550bce 🐛 Make integration tests compatible w/ modern Git (#80122)
* 🐛 Make integration tests compatible w/ modern Git

This patch makes use of the `init.defaultBranch` setting to unify
the test across new and old Git versions since one defaults to
`master` and the other uses `main` for the default branch.

Where possible, it uses the `HEAD` committish to avoid having to
normalize the branch name.

The change fixes the following integration tests:

  * `ansible-galaxy`

  * `ansible-galaxy-collection-scm` (recursive collection)

  * `git`

* 🐛Replace `git-symbolic-ref` with a repo template

This custom Git repository template emulates the `init.defaultBranch` setting
on Git versions below 2.28. Ref: https://superuser.com/a/1559582.
Other workarounds mentioned there, like invoking
`git symbolic-ref HEAD refs/heads/main` after each `git init` turned
out to have mysterious side effects that break the tests in surprising ways.

* 🎨 Make Git integration test non-destructive

This patch makes use of the `$HOME` environment variable to trick Git
into using a user-global config generated in the temporary directory.
2023-03-03 02:34:29 +01:00
cc8e6d06d0 Update playbooks_conditionals.rst (#80062)
"changed" was missing from the docs
2023-03-02 14:17:50 -05:00
0521184337 clarify playbook tests (#80073) 2023-03-02 14:14:31 -05:00
841b71c94f Fixing typos (#80045) 2023-03-02 14:04:43 -05:00
809727a7c7 improve password lookup syntax in examples (#80092) 2023-03-02 14:03:26 -05:00
012393e2cd fix link for development guidelines (#80055) 2023-03-02 13:54:42 -05:00
02c49ffe60 Encourage true/false for module documentation (#80060)
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-02 13:46:02 -05:00
c8f740cfee Fix typo docs in playbooks_tags.rst (#80117) 2023-03-02 13:32:22 -05:00
352010f9c3 improve doc dependency install steps (#80120) 2023-03-02 13:31:08 -05:00
980ec16422 📦 Drop unnecessary wheel PEP 517 build dependency (#80096)
Code snippets advertising the `wheel` dependency in the
`pyproject.toml`'s `[build-system].requires` setting were a historical
mistake. This has been corrected in
https://github.com/pypa/setuptools/commit/f7d30a95 but many pyprojects
still have `wheel` in their configs.

It is not needed for building sdists and the corresponding setuptools'
PEP 517 hook that provides requirements for building wheels already
esposes this dependency automatically.
2023-03-01 12:07:59 -06:00
292c70368b unarchive - log errors from underlying commands (#75329)
* unarchive - log errors from underlying commands

When a command run by the module fails, log the errors if debugging is enabled.

* Use debug() method
2023-03-01 16:55:14 +01:00
a56428de11 unarchive - properly handle relative path for dest (#75267)
* unarchive - properly handle relative path for dest

* Add integration test

* Return output of underlying commands with increased verbosity

* Revert "Return output of underlying commands with increased verbosity"

This reverts commit a2790c8275cdc5697b65670a0beffdc74b741bf6.

* Warn when a relative destination path was provided
2023-03-01 16:54:00 +01:00
f47bc03599 Relocate the AZP entry point scripts (#80114)
Scripts previously under `test/utils/shippable/` are now under `.azure-pipelines/commands/` instead.
2023-02-28 13:21:11 -08:00
b981a9dfcd add a worker queue to get updates from the main results thread (#79886)
* Create a queue per WorkerProcess to receive intra-task updates
* Update `pause` action to use the worker queue
* Deprecate ConnectionBase()._new_stdin
* Add new `Display`  convenience method `prompt_until` to manage both controller- and worker-sourced prompting without cross-fork stdin sharing, in-worker mechanism to handle request-response over new worker queue.
2023-02-28 12:21:48 -08:00
c2ea56e12e Relocate and refactor ansible-test diff unit tests (#80113)
This provides the same test coverage as the previous tests, without the dependency on git.
It also includes many more specific test cases with assertions, instead of simply relying on the code to not raise an exception.
2023-02-28 11:46:36 -08:00
67bafafbc0 🎨 Convert RST to manpage in-memory @ PEP 517 (#80098)
* Add _convert_rst_in_template_to_manpage arg types

* 📦 Make manpage build dependencies conditional

Previously, said dependencies were declared as unconditionally
required even when manpages not needed to be built. This patch
Makes it so they are only required when needed.

* Correct _generate_rst_in_templates returned type

It was marked as Path before this patch but in fact, it's iterable of
paths.

* 🎨 Convert RST to manpage in-memory @ PEP 517

Previously, the automation was writing a temporary templated RST on
disk and calling a helper CLI script on that. But with this change, it
happens with less unnecessary I/O.

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

* 📦Expose sdist manpage build deps unconditionally

Due to a bug in pypa/build, the `get_requires_for_build_sdist()` hook
is always invoked with `config_settings=None`. This means that we
cannot conditionally extend build requirements in said hook.

As a workaround, this patch makes hook pretend that `--built-manpages`
is always passed.

Ref: https://github.com/pypa/build/issues/559.

---------

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2023-02-28 16:13:41 +01:00
dbcaab1012 Add Ansible community 7.3.0 porting guide (#80106) 2023-02-28 08:43:53 -05:00
060a27f28f Do not use hardcoded httpbin.org in uri tests (#80101) 2023-02-27 16:59:32 -06:00
f64e79be41 sanity tests - ignore pre-release versions for deprecation comparisons (#79185) 2023-02-27 13:23:40 -08:00
39fd899d83 Clarify combine filter examples (#80078) 2023-02-27 09:15:18 -08:00
a895cae5a1 Relocate validate-modules unit tests (#80087)
This allows the validate-modules unit tests to run as part of the regular unit test suite.
2023-02-23 17:47:02 -08:00
2f62db842d ansible-test - Update base and default container (#80086) 2023-02-23 17:19:14 -08:00
c028006aaf Define all processor facts on s390x (#19755) (#79806)
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2023-02-23 16:40:14 -08:00
f587856beb Remove straight.plugin dependency (#80084) 2023-02-23 15:37:12 -08:00
dc3c88be8b Remove unused integration test support files (#80081)
* Remove unused integration test support files
* Remove obsolete ignores

ci_complete
ci_coverage
2023-02-23 14:39:45 -08:00
086046d478 Remove unused network test support files (#80080)
* Remove unused network test support files

* Remove obsolete ignores
2023-02-23 13:19:19 -08:00
6bfe6b899a ansible-test - Fix vendoring support (#80074)
- Support loading of vendored Python packages.
- Exclude vendored Python packages from payloads.
2023-02-23 12:45:43 -08:00
56036013cd 📦 Integrate manpage builds into PEP 517 build backend
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 the process of building a source distribution.
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.

PR #79606


Co-authored-by: Matt Clay <matt@mystile.com>
2023-02-23 21:37:02 +01:00
563833d124 Docs: Clarify note on tags (#80079)
The current wording could be read as "tasks that are tagged *both* configuration and packages" while in fact it is "tasks that are tagged *either* configuration *or* packages"
2023-02-23 11:40:59 -08:00
3fd0e12571 Introduce Delegatable and Notifiable mixin classes (#80077)
* Introduce Delegatable and Notifiable mixin classes

* fix sanity

* fix sanity
2023-02-23 11:32:22 -08:00
43aa47c2af package_facts requires python-rpm on SUSE systems in ansible 2.12.1 (#80041) 2023-02-23 10:28:52 -05:00
5ad77fc7bb fix: jinja complex type transforms doesn't work as documented (#80067)
jinja complex type transforms: dict(somelist| slice(2)) doesn't work as documented. Changed the example to use zip_longest
2023-02-23 10:27:17 -05:00
940fdf5dba consistent booleans for page text and code blocks (#80036)
* consistent booleans for page text and code blocks

* Update check_mode from n to false
2023-02-23 10:24:26 -05:00
ce5471fc9f Update collection_integration_updating.rst (#80037) 2023-02-23 10:21:39 -05:00
998b5c1a06 Clarify when plugin settings are being populated (#79710) 2023-02-22 11:41:44 -05:00
6c3d2a4e51 Use FAs with inheritance only when applicable (#80026)
... and set default value of an attribute on an object
only in NonInheritableFA.

Fixes #79777

ci_complete
2023-02-22 17:18:10 +01:00
ed879954f9 Update playbooks_tests.rst (#79788) 2023-02-22 10:32:26 -05:00
5f6ebebce9 Update ansible-test openshift plugin tests (#80064)
Update ansible-test openshift plugin tests to use config to get server endpoint.

Also update the comment explaining why the tests are disabled.
2023-02-21 14:56:25 -08:00
1108c0f331 Fix markdown in changelog fragment (#80065) 2023-02-21 14:54:32 -08:00
9f02e505d9 add wheel to docsite pre-reqs #79513 (#80061) 2023-02-21 17:03:22 -05:00
bca55d945b ansible-test - Adjust vcenter test plugin behavior (#80063)
The previous change to the default mode of operation for the plugin is now limited to collections.

This enables easier testing of the plugin in core, so the previously removed tests have been restored.
2023-02-21 13:50:32 -08:00
39a5b08ca6 ansible-test - Update base and default container (#80058) 2023-02-21 12:24:29 -08:00
c05d813661 Fix #80020 typos confusing pylint for pytest (#80056) 2023-02-21 08:43:24 -08:00
ecf66c6f82 ansible-test - Update mypy and pylint requirements (#80049) 2023-02-20 20:39:54 -08:00
5e3db6e441 ansible-test - Show Python version before install (#80022)
Always indicate the Python version being used before installing requirements.
2023-02-20 17:55:04 -08:00
e6cffce0eb 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.
2023-02-20 17:54:34 -08:00
fe2732b91e ansible-test - Support pylint assertion rewriting (#80020)
Add support for `pylint` assertion rewriting when running unit tests on Python 3.5 and later.
2023-02-20 17:54:20 -08:00
2f8f7fba4c Update lookup to use positional only arg for name to avoid conflicts (#79839) 2023-02-20 13:45:03 -06:00
122de95d85 Add Steampunk Spotter to Other tools list (#80006) 2023-02-20 12:43:18 -05:00
b7ef2c1589 ansible-playbook -K breaks when passwords have quotes (#79837)
Now only 'unquote' when ini config file is the source
2023-02-20 11:58:21 -05:00
72c59cfd98 Avoid trailing spaces in unit test (#80033) 2023-02-17 18:02:20 -08:00
21fc699b77 Remove trailing spaces from lines in YAML (#80032) 2023-02-17 17:00:41 -08:00
a4248a63aa Add missing newlines to YAML files (#80031) 2023-02-17 16:34:49 -08:00
967a88963f Update docs requirements to latest package versions (#79930)
Co-authored-by: Matt Clay <matt@mystile.com>
2023-02-17 13:32:21 -05:00
f841c2803a update banner' (#79971) 2023-02-15 16:02:13 -05:00
54ff9afa10 Data tagging delayed to 2.16 (#80011) 2023-02-15 14:47:12 -06:00
1e6b8249e7 Add condition that causes a when to skip a task to output msg (#78918)
* Add condition that causes a when to skip a task

* Fix up tests

* Use false_condition instead of failed_condition

* Remove formatting accidentially added

* Fix sanity
2023-02-15 08:49:30 +10:00
bd329dc543 Make using blocks as handlers a parser error (#79993)
Fixes #79968
2023-02-14 15:00:01 -06:00
117cf0a44b ansible-test - Disable the pep8 E203 rule (#79966)
The `E203` rule in `pycodestyle` is not fully PEP 8 compliant.
Disabling it provides compatibility with the output of the `black` code formatter.
2023-02-14 12:39:04 -08:00
67d49734f7 ansible-test - Support Podman 4.4.0+ 2023-02-14 12:17:42 -08:00
930c2137d3 Revert "Disable F37 podman tests for ansible-test (#79998)"
This reverts commit 875a4ec242.
2023-02-14 12:17:42 -08:00
d67b436eba ansible-test - Improve pylint backwards compat (#79997) 2023-02-14 11:34:39 -08:00
875a4ec242 Disable F37 podman tests for ansible-test (#79998)
The recent update from podman 4.3.1 to 4.4.1 has broken container management.
Removing the tests from the CI matrix until the issue is resolved.
2023-02-14 09:54:08 -08:00
75274021d3 fixes typo in Ansible 7 roadmap (#79996)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2023-02-14 11:54:23 -05:00
0946ee2f14 adds roadmap for Ansible 8 (#79598) 2023-02-14 11:19:19 -05:00
556dadba6d user - fix comparing existing group names to group IDs (#79981) 2023-02-14 16:08:02 +01:00
715ab99462 ansible-test - Improve code formatting (#79983)
* ansible-test - Add blank lines after docstrings

* ansible-test - Preserve formatting of arg pairs

* ansible-test - Remove unused string

* ansible-test - Remove pointless dict() usage

* ansible-test - Clean up initial func arg indenting

* ansible-test - Clean up constructor arg indenting

* ansible-test - Clean up func arg wrapping

* ansible-test - Clean up comma and paren placement
2023-02-13 10:49:58 -08:00
43487c6581 ansible-test - Enable unused-import pylint rule (#79912)
This was previously enabled for core. This change enables it for collections.
2023-02-13 10:09:05 -08:00
10bc8af5a2 ansible-test - Remove auto format pylint rule (#79985) 2023-02-13 09:21:11 -08:00
e2f147bcec ansible-inventory, add --limit option (#79596)
* ansible-inventory, add --limit option

* also graph

* optimize the when not providing limit

* added tests and clog

* avoid empty groups, fix tests

* i swear there as an ignore_errors there already!!?!?!?

* Fix stdout test fallback

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

* simpler approach using subset against inventory directly

* tyupose

* renamed funciton to what it actuall does
got yaml in line with others about removing empty groups

* have graph ignore limts, also note same for --host

* fixed typo long line

* better test

* cause hosvars are not a thing

---------

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2023-02-13 11:07:10 -06:00
58d84933fc ansible-test - Clean up indentation and spaces (#79980) 2023-02-10 14:53:36 -08:00
71f2e777ed Update mypy to version 1.0.0 (#79963) 2023-02-09 16:52:31 -08:00
d47a848219 fix core devel doc output (#79902) 2023-02-09 14:22:15 -05:00
ceafb5411a Add an integration test to ensure that defaults don't count towards mutually exclusive (#79949) 2023-02-09 14:18:27 -05:00
b5ff981369 Change yes to true in uri-module (#79934) 2023-02-09 14:15:07 -05:00
d43d8274b1 Remove unneeded fallback code for nested defined/undefined tests (#79960)
* Remove unneeded fallback code for nested defined/undefined tests

The code used to handle defined/undefined tests on objects containing
nested undefined variables. Due to changes in lazy evalution of Jinja2
expressions it is no longer needed, see #56116.
2023-02-09 10:35:46 -06:00
243d1b5e3d Replace deprecated stacked @classmethod and @property (#79952) 2023-02-09 08:51:18 -06:00
09e0fb3516 Change ansible_job_id format (#79951)
* Change ansible_job_id format

...to be something that does not resemble float or other type which
value could be changed by literal_eval that jinja2_native uses.

Specifically the format of '%d.%d' is converted from str to float and
then back to float which may result in truncating the number resulting
in the job not being found because the job id does not exist.
2023-02-09 08:49:07 -06:00
e1d298ed61 don't ignore templated _raw_params that k=v parser failed to parse (#79913)
fixes #79862
2023-02-08 17:54:46 -06:00
2525d0a136 basic.py - Perform Python version check earlier (#79954) 2023-02-08 17:19:40 -06:00
e6900f5cad pycompat24 - Remove support for Python <= 2.5 (#79953) 2023-02-08 15:44:59 -06:00
fcdd7493ae improve password_hash warning for unsupported algorithms (#79872)
* password_hash - give a warning for unsupported algorithms (that raise a TypeError)

* add suggested changes, a test and changelog
2023-02-08 11:46:07 -08:00
9d65e122ff Fix detection of available hashlib algorithms (#79946)
* Fix detection of available hashlib algorithms

Detection of hashlib algorithms now works on Python 3.x.
The new implementation works on Python 2.7 and later.

Test coverage is provided by both integration and unit tests.

* Add additional details about hashlib in docs
2023-02-08 09:27:59 -08:00
dc99005820 Rst fixes (#79939)
* fix rstcheck errors for 6.1.1
* spell shell correctly
2023-02-08 08:02:38 -08:00
0793833847 ansible-test - Fix collection delegation (#79947) 2023-02-08 00:24:20 -08:00
497d296ed6 Enable pylint rules to detect pointless statements (#79944)
Also instruct `git blame` to ignore the commit used to convert pointless strings to comments.
2023-02-07 21:11:51 -08:00
716631189c Fix "pointless" strings detected by pylint (#79943)
Convert these strings to comments, since they are not valid docstrings.
2023-02-07 16:36:29 -08:00
02f6e40534 Clean up pointless statements (#79941)
* Add ignores for intentional pointless statements

* Remove redundant docstring

* Fix function docstring placement
2023-02-07 14:46:33 -08:00
1ba100a3b4 Fix pointless statements in unit tests (#79940) 2023-02-07 14:00:38 -08:00
fa1564c548 include_vars - document hash_behaviour + dir (#79790)
* document that hash_behaviour does not apply to individual files of variables when using the dir option

* add tests
2023-02-07 16:31:08 -05:00
c8c1402ff6 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
2023-02-07 12:18:20 -08:00
c7c991e79d quiet default ansible-doc integration test output (#79921)
* quiet default ansible-doc integration test output 

* typical non-verbose output was exceeding 27k lines per fun
* disables `set -x` unless `-v` is passed to the script (eg when ansible-test is called with `-v` or `--retry-on-error` adds it on the second try
* added simple progress echoes
* suppress some grep output

* only enable `set -x` for >= `-vvv`

* fix shellcheck default complaint
2023-02-07 16:20:57 +01:00
5f947f867c make this a warning, not a comment (#79928)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2023-02-06 16:12:11 -05:00
24519f3bd1 Update example to always init ANOTHER_LIBRARY_IMPORT_ERROR (#79927) 2023-02-06 13:44:10 -06:00
32672c6326 Improving the RETURN and its docs on the apt_repository module (#79658)
* Improving the documentation on how we generate the default value of the filename parameter

* fix pep8

* removing unnecessary documentation and improving the module's return

* making the RETURN docs

* pep8

* version_added and changelog

* module._diff

* module._diff fix

* add rudimentary tests for new outputs

---------

Co-authored-by: Matt Davis <mrd@redhat.com>
2023-02-06 10:56:21 -08:00
402ae0aa5d ansible-test - Remove old containers and remotes (#79929) 2023-02-06 10:49:56 -08:00
ce6e53e1f6 Remove another unwanted comma from pause action (#79926) 2023-02-06 11:00:20 -05:00
379058e10f Update collections.abc imports (#79911)
* Update `collections.abc` imports

- Use `six.moves` for modules and module_utils
- Use `collections.abc` for controller code

This avoids using `ansible.module_utils.common._collections_compat`,
which was added before the vendored `six` was updated to provide these
imports.

* Update _collections_compat to use six.moves

Also update the custom pylint rule to reflect this change.
2023-02-03 16:22:40 -08:00
e658995760 ansible-test - Enable pylint unused-import for core (#79910) 2023-02-03 15:42:09 -08:00
4706af58ab ansible-test - Enable trailing-comma-tuple pylint rule (#79909) 2023-02-03 15:19:35 -08:00
3b4f3c066a Ignore necessary unused imports in module_utils (#79904) 2023-02-03 14:50:39 -08:00
9e2aad6e51 Remove unwanted comma from pause action (#79908) 2023-02-03 14:41:32 -08:00
51fadd0aac Clean up unused imports in plugins (#79899) 2023-02-03 14:40:55 -08:00
833909ac19 Clean up unused imports in core (#79900)
* Clean up unused imports in core

* Add changelog fragment
2023-02-03 14:35:09 -08:00
b3307f1aa7 Remove unused stdlib imports from module_utils (#79905) 2023-02-03 14:22:57 -08:00
639e3e30d7 Remove unused internal imports from module_utils (#79906) 2023-02-03 14:20:44 -08:00
2fa8ee503c Clean up unused imports in modules (#79898) 2023-02-03 14:16:06 -08:00
0cf9db6fc2 Clean up unused imports in ansible-test unit tests (#79897) 2023-02-02 16:38:34 -08:00
ca54b7b26d Clean up unused imports in sanity tests (#79896) 2023-02-02 16:24:31 -08:00
7495070b83 Clean up unused imports in integration tests (#79895) 2023-02-02 16:15:03 -08:00
e69ef1b249 Clean up unused imports in hacking directory (#79894) 2023-02-02 16:00:50 -08:00
25d859f8fb Clean up unused imports in unit tests (#79893) 2023-02-02 15:52:38 -08:00
d637e87a9e user - Remove invalid return docs (#79891) 2023-02-02 12:55:27 -08:00
0a00263a53 Use arg validation in debug action (#79866)
* Use arg validation in debug action. Fixes #79862

* Add clog frag

* Move the msg default into the argspec
2023-02-02 11:21:59 -08:00
1c01eab3fb Remove irrelevant line (#79865)
Remove irrelevant comment line form example code
2023-02-02 11:19:15 -08:00
0ab53aefc9 Update dnf.py (#79679) 2023-02-02 14:18:08 -05:00
913e4863af Description for changing User ID to match user value (#79470) 2023-02-02 14:17:18 -05:00
d8dc76e134 Mentions 'meta: flush_handlers' task (#79542) 2023-02-02 13:19:08 -05:00
07f1a1b7dc docsite: bump antsibull-docs, reference collection env var index (#79666) 2023-02-02 13:17:32 -05:00
1fd0265e22 ansible-test - Update default containers (#79887) 2023-02-02 09:31:30 -08:00
d48d1c23df ansible-test - Specify config path in plugin error (#79881) 2023-02-02 00:21:38 -08:00
91807695c3 Remove unused unit test code (#79879)
* Remove unused test fixtures

* Removed unused _old_dump_load_cycle method

* Remove Python 2.x compat

* Remove unused code

* Remove unused context manager

* Fix cowsay test

- The test no longer depends on another test to initialize config.
- Also remove unreachable code.

* Remove Python 2.x compat
2023-02-01 16:00:57 -08:00
0a53309f47 ansible-test - Update pylint to 2.16.0 (#79878) 2023-02-01 12:40:36 -08:00
58461bc204 Remove outdated note on relative imports in docs (#79873) 2023-02-01 12:23:59 -05:00
fa382670dc maintainers_guidelines.rst: add a link to collection release guidelines (#79859) 2023-02-01 09:08:37 +00:00
9d42447fa5 Add Ansible community 7.2.0 porting guide (#79867) 2023-01-31 17:00:31 -05:00
652a74e087 AddType - Support compiling with /unsafe C# code (#79853)
* AddType - Support compiling with /unsafe C# code

* Update Ansible version in docstring
2023-01-31 10:23:12 +10:00
d16ec2455d Add tests to cover win_reboot incidental paths (#79856)
* Add tests to cover win_reboot incidental paths

* Fix sanity issues
2023-01-31 10:10:30 +10:00
c33c8cf086 Remove unused and unreachable unit test code (#79854) 2023-01-30 15:29:17 -08:00
1dce45c42d ansible-test - Update base and default containers (#79846) 2023-01-30 12:32:47 -08:00
83fe75db07 Ansible.Basic.cs - Fix compile error on PS 7.3.x (#79848) 2023-01-31 06:09:43 +10:00
10f0e5f6d4 Remove dev_guide stubs (#79795)
* Remove dev_guide stubs

* Remove Cisco ACI Dev Guide
2023-01-30 13:46:14 -05:00
58f0950638 [Docs] add doc links to documentation_contributions.rst (#79840) 2023-01-30 11:34:36 -05:00
722fc05c31 [Docs] add easyfix/good first issue/docs links (#79830) 2023-01-30 11:18:52 -05:00
44dcfde9b8 Improve documentation on requirements.yml (#76140)
Makes it clear that user can use range identifiers with collection
versions inside requirements.yml files.
2023-01-26 17:08:59 -05:00
65eb5c0a9f Update dev_guide.rst (#79625) 2023-01-26 16:50:15 -05:00
6cd1a1404a docs: Extend password entry of ansible.builtin.user (#79694)
* docs: Extend password entry of ansible.builtin.user

Clarify that `password` sets the password hash.
Not the actual password.
Fixes part of  #79684
2023-01-26 16:30:48 -05:00
2164d5699c Expand docs for the import sanity test. (#79768)
* Expand docs for the import sanity test.

* Remove note about Python 2.7 compat.

It should not be needed since there is a sanity test to enforce use of `__metaclass__ = type`.

* Improve introductory paragraph.

* Fix link typo.
2023-01-26 12:38:26 -08:00
321848e98d fix installing collections from git repos that contain MANIFEST.json (#79808)
* add null 'manifest' key to metadata for git repo collections containing MANIFEST.json

changelog

* set to Sentinel instead of None

* Test installing a collection in a git repo that contains a MANIFEST.json

* fix test

* Update changelogs/fragments/ansible-galaxy-install-git-src-manifest.yml
2023-01-26 11:15:18 -08:00
52d3d39ffc ansible-test - Deprecate the foreman test plugin (#79821) 2023-01-25 16:51:43 -08:00
7e53ec3c01 ansible-test - Update the NIOS test container (#79820) 2023-01-25 16:31:31 -08:00
739bc8bb6c ansible-test - Update sanity test requirements (#79819)
Also update core sanity test requirements, except mypy (already updated) and docs-build (update separately).
2023-01-25 16:05:25 -08:00
27cd5e77d8 Update mypy and its dependencies. (#79812)
* Update mypy and its dependencies.

* Fix requirements.

* Remove unnecessary matching constraints.
2023-01-25 12:46:09 -08:00
f4a38a787b Drop requirement for matching sanity constraints
Each sanity test uses its own virtual environment, so there is no risk of conflicting requirements between tests.

It may still be a good idea to make an effort to keep frozen requirements in sync between tests.

Making it a hard requirement unnecessarily complicates updating individual tests and increases the risk of incorrect manual changes.
2023-01-25 11:31:02 -08:00
281474e809 strategy fix invalid variables being registered (#79706)
also added tests for normal and bad cases
2023-01-25 14:28:18 -05:00
7329ec6936 ansible-test - Update CloudStack plugin container (#79813) 2023-01-25 11:22:28 -08:00
Jo
48e6bf8d27 Fix: documentation for per-task timeout (#79715) 2023-01-25 19:21:02 +00:00
d7a4152851 doc fix for platform content #79794 (#79801) 2023-01-25 19:20:03 +00:00
5fb8bc3ddb Bump acme test container. (#79783) 2023-01-25 08:53:23 -08:00
330af433f3 Use raise ... from instead of six.raise_from 2023-01-25 16:21:27 +01:00
6cb6d655b3 [Docs] maintainers_guidelines: add WG and real-time chat request info (#79750) 2023-01-25 14:50:18 +00:00
7ab3de7ee8 correct examples to use removed_from_collection not collection_name (#79803) 2023-01-25 09:36:03 +00:00
a3b7863098 validate-modules - Remove __future__ limits (#79800)
* validate-modules - Remove `__future__` limits

Limits on specific `__future__` imports are handled by other sanity tests.

* Add integration test for module/plugin imports.
2023-01-24 13:25:32 -08:00
10eda5801a Fix conditionally notified include handlers (#79804)
Fixes #79776

ci_complete
2023-01-24 16:26:25 +01:00
c9f20aedc0 ansible-test - Fix various type hinting issues. (#79798)
* ansible-test - Add missing type hints.

* ansible-test - Remove redundant type hints.

* ansible-test - Fix return type annotations.

* ansible-test - Add assert, casts to assist mypy.

* ansible-test - Fix incorrect type hints.

* ansible-test - Remove no-op code.

* ansible-test - Fix incorrect types.

* ansible-test - Fix method signature mismatch.
2023-01-23 16:56:07 -08:00
5f58015527 ansible-test - Remove obsolete DirectoryTarget.
This code has been unused since at least the 2.9 release.
2023-01-23 16:08:58 -08:00
29b20f68e6 ansible-test - Deprecate the govcsim container.
Also remove the integration tests for the `vcenter` test plugin, since the tests relied on using the simulator.
2023-01-23 15:48:12 -08:00
f2707d1fbc fix filename for sidecar docs (#79779) 2023-01-23 10:42:55 -05:00
4f5ed24972 Fix traceback in template action with ANSIBLE_DEBUG=1 (#79764)
Fixes #79763
2023-01-20 09:39:18 +01:00
868d721d8c Flush output in sanity requirements update script. (#79774)
This keeps the subprocess output under the correct heading.
2023-01-19 21:49:04 -08:00
8e80b03b33 document where to save cloud config files (#79412) 2023-01-19 15:25:16 -08:00
5d71ace583 Fix broken docs links. (#79769) 2023-01-19 12:47:10 -08:00
11a27eefa2 communication.rst: improve (#79751) 2023-01-19 15:04:21 -05:00
97993eeb10 Fix broken link for inventory script examples (#79762)
These scripts were removed from community.general in https://github.com/ansible-collections/community.general/pull/2696 and moved to ansible-community/contrib-scripts per https://github.com/ansible-community/community-topics/issues/16#issuecomment-853317111
2023-01-19 15:03:14 -05:00
8a7185c224 Argument spec alias handling: actually report deprecated aliases in suboptions, and fix warning message in suboptions when two aliases of the same option are used (#79740)
* Normalize deprecation records.

* Fix alias deprecations in suboptions.

* Report in which option an alias warning happened for suboptions.

* Add deprecation tests for suboptions.

* Also test deprecation in list of dicts.

* Adjust unit tests for toplevel alias deprecation field name change.
2023-01-19 11:58:02 -05:00
b5b7f9bce2 complex_data_manipulation.rst: fix typo (#79758) 2023-01-19 16:54:52 +00:00
6c0559bffe Show filename additionally if missing secrets prevents decryption (#79732)
Fixes #79723
2023-01-18 09:37:33 +01:00
cf50d8131f Fix regex filter docs (#79736)
* Fix notes in regex_replace doc

The documentation says that this maps to 'regex.replace' when it should say 're.replace'. The distinction is important because of the third-party 'regex' module that has more features than the built-in 're' module. https://pypi.org/project/regex/

* Fix notes in re.search docs

The documentation says that this maps to 'regex.search' when it should say 're.search'. The distinction is important because of the third-party 'regex' module that has more features than the built-in 're' module. https://pypi.org/project/regex/
2023-01-17 16:14:02 +01:00
b756a08d89 Truthy value should be one of false or true (#79730)
Otherwise ansible-lint complains: https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.truthy
2023-01-17 16:04:44 +01:00
40dd762e68 add task for testing to remove gpg key using key id (#79729) 2023-01-17 16:03:30 +01:00
1852f9fab4 Support test and filter plugins in ansible-doc sanity test (#77737)
* Support test and filter plugins in ansible-doc sanity test.

* Move integration target non-filter file check_pylint.py from filter/ to plugin_utils/.
2023-01-16 14:15:55 -05:00
1a47a21b65 Fix reporting of deprecated arguments for modules. (#79681) 2023-01-13 16:55:48 -05:00
e38b3e64fd Correctly count rescued tasks in play stats (#79724)
Fixes #79711

ci_complete
2023-01-13 05:18:41 +10:00
74cdffe30d Better json content type detection for uri (#79719)
* Better json content type detection for uri

* typo
2023-01-13 05:11:31 +10:00
2143bcd6b1 Ensure we are passing ciphers to all url_get calls (#79718)
* Ensure we are passing ciphers to all url_get calls. Fixes #79717

* Add clog frag

* Fix tests
2023-01-13 05:10:09 +10:00
8b032150a4 document adjacent docs (sidecar) (#79056)
* Update docs/docsite/rst/dev_guide/developing_locally.rst
Co-authored-by: Don Naro <dnaro@redhat.com>
2023-01-12 11:47:07 -05:00
61d5586c7c Use uri in uri test instead of get_url. 2023-01-11 11:30:36 -08:00
fb32e92b1a communication.rst: remove Tesing WG info 2023-01-11 10:14:41 -08:00
50a673f9e7 normal action plugin: remove superfluous code (#79690)
* Remove obsolete 'if'

The result dict returned by super.run() will never have a 'skipped' entry.
Without the if, it is more clear that wrap_async is actually defined at the end of the function.

* Remove more dead code.

The result dict will also not contain invocation.

* Remove notes.
2023-01-11 15:07:00 +01:00
ee33be9484 ansible-test - fix ps argspec check inside cmdlet (#79699)
* ansible-test - fix ps argspec check inside cmdlet

* Added error condition test

* Fix sanity problem
2023-01-11 08:05:50 +10:00
602824db1d Fix broken reference to FAQ (#79621) 2023-01-10 19:33:27 +00:00
56d142350d Add support for importlib.resources (#78915)
* Add support for importlib.resources

* Remove the importlib.resources imports

* return the correct data

* Some code comments, and re-order for consistency

* Disallow traversing packages below an individual collection

* Add a traversable class for namespaces

* Re-use variable

* Utilize itertools.chain.from_iterable

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

* Simplify logic to check for packages from ansible loaders

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

* Just a generator expression, instead of a generator

* docstrings

* Add comment about find_spec for our namespaces

* Add some initial unit tests for importlib.resources

* normalize

* Utilize importlib.resources for listing collections

* collections_path is already in config, just use config

* install uses a different default for collections_path

* Remove unused import

* Remove duplicate __truediv__

* Bring back TraversableResources

* Apply some small suggestions from code review

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>

* Remove cross contamination between plugin loader code and CLI code

* Remove unused import

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2023-01-10 11:09:57 -06:00
e41d2874a6 Fix undef() example to a valid Jinja template (#79701) 2023-01-10 12:58:46 +00:00
55f9d7f71f Docsite: remove dead Lockdown Working Group from Communication guide (#79693) 2023-01-10 12:44:39 +00:00
65efa4b97f Docsite: add Security Automation Working Group to Communication guide (#79692) 2023-01-10 12:43:36 +00:00
fe7d488a1b contributor_path: fix typos (#79678) 2023-01-10 12:41:48 +00:00
0fc932fda0 switched reference from katacoda to instruqt (#79698) 2023-01-09 16:30:26 -05:00
b5b239fd71 fix role argument spec error for invalid suboptions (#76578)
fixes https://github.com/ansible/ansible/issues/75536
2023-01-09 11:54:45 -05:00
acbf4cc60e ansible-galaxy - fix turning off the ConcreteArtifactManager's validate certs at the global level (#79561)
Fix ignoring certs when downloading tarballs

Fix ignoring certs when downloading a collection from a specific source that isn't in the configured servers list
2023-01-09 11:42:07 -05:00
fd325c00bd ansible-galaxy collection|role init - fix preserving symlinks (#79134)
* Preserve symlinks in custom role/collection skeletons

* changelog
2023-01-09 10:59:05 -05:00
32c5793de5 systemd: ignore errors in daemon_reload and daemon_reexec when running in a chroot or with $SYSTEMD_OFFLINE==1 (#79643)
Signed-off-by: Olaf Klischat <olaf.klischat@gmail.com>
2023-01-09 09:43:13 -05:00
1375861ec2 ansible-test - Update available platforms. 2023-01-06 17:13:20 -08:00
6a73a5a480 Fixes for uri integration test. (#79688)
* Fix HTTP methods used in URI test.

* Fix urllib2 redirect tests on Python 3.11.

* Fix uri cookie testing on Python 3.11.
2023-01-06 15:44:46 -08:00
a7111c4dbb validate-modules: don't fail on invalid YAML (#79682)
* validate-modules: don't fail on invalid YAML

When validate-modules encounters invalid YAML (e.g. in the EXAMPLES
section), it tries to reformat the exception to include the line number
in the Python file instead of the line number of the embedded YAML
document. However, PyYAML doesn't allow modification of the Mark object
(anymore) which leads to a new exception being raised, instead of
reporting the original exception.

As the original exception is not needed in other places anymore, we
don't have to modify it at all and can just compute the right line
number when reporting the error via ansible-test.

Fixes: #75837

* Add test for invalid module doc YAML syntax.

Co-authored-by: Matt Clay <matt@mystile.com>
2023-01-06 11:34:35 -08:00
6f8c1da0c8 correct the mistake of example repeat_original (#79659)
there is a little mistake 


##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2023-01-05 12:22:34 -08:00
4a29591b98 Fix a typo in the warning message (#79635) 2023-01-05 17:03:48 +00:00
eae02bf5b8 Fix link in compile sanity test docs. 2023-01-04 18:34:12 -08:00
1243d2ace0 Fix EPEL setup for integration tests on RHEL 7 2023-01-04 15:40:32 -08:00
8e7cc371be Fix typo (#79641) 2023-01-04 14:31:03 +00:00
e7af7532bd Update authentication.rst (#79623) 2023-01-04 14:23:15 +00:00
51bddd862b Document callback types in documentation (#79651) 2023-01-03 14:32:37 -05:00
38cedc7f1a Fixed incorrect spelling of the word overridden. (#79620) 2023-01-03 10:48:06 -05:00
45df14a2e0 Fix spelling of "triple" in Issue Templates (#79628) 2022-12-27 02:22:32 +01:00
754c54d3d6 Clean up setup_paramiko test target.
- Remove obsolete install/uninstall files.
- Use OS packages on Alpine 3.
2022-12-16 17:33:11 -08:00
04fc98c794 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.
2022-12-15 19:42:58 -08:00
69c874f478 Typo in playbooks_blocks.rst (#79603) 2022-12-15 13:30:21 -05:00
b7e948e623 filter/test plugin listing, fix bug on file sorting (#79591)
* filter/test plugin listing, fix bug on file sorting

avoid legacy/builtin special casing for 'all'
2022-12-15 10:06:13 -05:00
f6c0e22f98 Add more retries to ansible-test-container test. 2022-12-14 14:50:59 -08:00
75b60b17ee ansible-test - Support RSA SHA-1 for SSH clients. 2022-12-14 09:19:33 -08:00
aa268b8db2 Add example of yaml file with --extra-vars (#79521) 2022-12-13 17:12:14 -05:00
b3a1eabb7d Add big support table (#79221)
Co-authored-by: samccann <samccann@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2022-12-13 15:08:45 -05:00
0f01c69f1e Update split.yml (#79570)
typo fix
2022-12-13 16:09:07 +01:00
da3b1d3f50 ansible-test - Fix --prime-containers and --explain (#79581)
* Remove unused code.
* Fix explain errors.
* Fix `--prime-containers` with docker on cgroup v2.
2022-12-12 12:12:16 -08:00
dcc08eec35 ansible-test - Fix target PyPI proxy config. 2022-12-12 09:51:02 -08:00
04209d328b 2.15.0 will release 2023-05-15 (#79567)
* 2.15.0 will release 2023-05-15

* Eliminate 1 week freeze, shift dates 1 week

* oops

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2022-12-12 09:26:53 -06:00
60f76436c1 Simplify AnsibleJ2Vars by using ChainMap for vars (#78713)
Co-authored-by: Matt Martz <matt@sivel.net>
2022-12-09 13:33:13 +01:00
245d516911 Fix :ref: usage in testing docs. (#79566) 2022-12-09 11:27:01 +00:00
6a7fb7d2ab fix: broken link (#79461) 2022-12-08 16:24:21 -05:00
0f4afd7e6d Remove obsolete legacy integration test docs. (#79563) 2022-12-08 16:22:22 -05:00
932a32153a Update docs for the compile sanity test. (#79562) 2022-12-08 16:05:44 -05:00
0a12d8a5bc ansible-test - fix warning to include image name (#79560) 2022-12-09 05:21:00 +10:00
bc13099e56 fixed misleading setup example (#79495) 2022-12-08 14:06:37 -05:00
11e43e9d6e Set locale for python apt (#79546)
* set locale to get_best_parsable_locale for the python-apt API

* add a test case

* add changelog

* remove test that tests nothing
2022-12-09 05:06:08 +10:00
527abba860 Update windows_faq.rst (#79552)
`python-pip` changes to `python3-pip` for the Ubuntu 20.04 WSL distro
2022-12-08 12:05:30 -05:00
b1caba8b53 Add Ansible community 7.1.0 porting guide (#79553) 2022-12-07 15:31:33 -05:00
3fd519de57 Fix hardcoded python call (#79520)
Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
2022-12-06 16:43:43 -05:00
3cdf589ca7 Add Ansible community 6.7.0 porting guide (#79544) 2022-12-06 11:12:38 -05:00
1424484be0 Prevent stdio deadlock in forked children (#79522)
* background threads writing to stdout/stderr can cause children to deadlock if a thread in the parent holds the internal lock on the BufferedWriter wrapper
* prevent writes to std handles during fork by monkeypatching stdout/stderr during display startup to require a mutex lock with fork(); this ensures no background threads can hold the lock during a fork operation
* add integration test that fails reliably on Linux without this fix
2022-12-05 20:46:15 -08:00
80d2f8da02 ansible-test - Fix container detection. (#79530) 2022-12-05 13:33:14 -08:00
31f95e201a Handle line wraps in jinja_plugins test. 2022-12-05 12:47:06 -08:00
79dfe14adf More integration tests for import sanity test. (#79532) 2022-12-05 12:28:01 -08:00
31f9d60b8d Don't use color in jinja_plugins test.
This should prevent color codes from interfering with string matches.
2022-12-05 11:45:53 -08:00
9acca5b3b9 Allow test to run on system with selinux enabled. Fixes #77564 (#79510) 2022-12-01 11:23:08 -08:00
042a55fbe0 Docs: Update intersphinx links for Ansible 7 (#79485) 2022-12-01 14:01:23 -05:00
5b51b560d0 Removed sorting to preserve original order (#74839)
updated tests to reflect new order
2022-11-30 09:25:34 -05:00
1998521e2d Always create new role (#78661)
Don't use role cache for determining whether to create a new instance of role
2022-11-29 15:56:41 -06:00
f9715f436c ansible-test - Avoid direct use of errno.
Error handling on Python 3.x no longer requires the use of `errno` to identify specific errors.
2022-11-29 13:40:04 -08:00
cda16cc5e9 ansible-test - Improve container management. (#78550)
See changelogs/fragments/ansible-test-container-management.yml for details.
2022-11-29 13:35:53 -08:00
3bda4eae6f Fix repr(Task) to check action when testing for a meta task (#79464)
Fixes #79459
2022-11-29 16:43:14 +01:00
01ff57bdff add ansible-galaxy cli documentation for parallel execution (#79433)
* add ansible-galaxy cli documentation for parallel execution

Co-authored-by: saranti <tsarantis@proton.me>

* Update lib/ansible/cli/galaxy.py

* Update lib/ansible/cli/galaxy.py

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

Co-authored-by: saranti <tsarantis@proton.me>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2022-11-29 16:27:08 +01:00
c33a782a9c Fix password lookup rewrites file when using encrypt (#79431)
* Remove unused mock from test_password_already_created_encrypt

The _get_paths mock is never used in the
test_password_already_created_encrypt test case.

* Add test to assert the password file is not rewritten

If the password file already contains the salt and the hasing algorithm
does not use the ident parameter, the password lookup should not write
to the password file.

* Fix "changed" if using "encrypt" in password lookup

When using the "encrypt" parameter to the password lookup without the
ident parameter, the password file was always marked as "changed". This
caused the file to be rewritten with the same content. This is fixed by
only marking the file as changed, if an "ident" value needs to be added
to the file.

Fixes #79430.

Add changelog entry
2022-11-29 16:26:30 +01:00
3936b5c471 Fix file touch check mode result (#79360) (#79422)
Fixes #79360
2022-11-29 16:17:38 +01:00
ab76916b14 galaxy: Add license_file to manifest directives (#79420)
* galaxy: Add license_file to manifest directives

* ag collection build: Test license handling

This adds tests to ensure that
    - REUSE licensing files: .reuse/dep5, LICENSES/*, anyfile.license
    - galaxy.yml license_file
are always included in the manifest.
2022-11-29 16:12:47 +01:00
5f3a6b78db local connection: avoid tb when running in container with invalid user (#79414)
* local connection: avoid tb when running in container with invalid user

* clog

* cannot use uid, leave empty and ~/ will resolve itself

* get back to what it did
2022-11-29 16:08:32 +01:00
38fe34244c ansible-test - Fix completion error in Python 3.11. 2022-11-28 19:41:47 -08:00
3723c426d2 Fix lists styling (#79481) 2022-11-28 11:04:37 -05:00
3a6b6370ad Add comma (#79480) 2022-11-28 11:03:02 -05:00
80551633c7 Set explicit meta long_description_content_type (#79468)
This is necessary for `twine check --strict` to pass.
2022-11-28 16:16:46 +01:00
f79a54ae22 Update vendored distro (#79227)
Commit bb35d41 in branch python2.7-support from 2022-10-10:
https://github.com/python-distro/distro/commit/bb35d41
2022-11-23 14:44:15 -05:00
505b29b2a9 more strftime docs (#79417)
* more strftime docs

fixes #79397
Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: Don Naro <dnaro@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2022-11-23 12:27:09 -05:00
b148fd8dd7 ansible-galaxy - support `resolvelib >= 0.5.3, < 0.10.0` (#79399)
* Upgrade `resolvelib >= 0.5.3, < 0.10.0`

https://pypi.org/project/resolvelib/0.9.0/ released on 2022-11-17:

  * https://github.com/sarugaku/resolvelib/blob/master/CHANGELOG.rst#090-2022-11-17
  * https://github.com/sarugaku/resolvelib/releases/tag/0.9.0

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
2022-11-23 08:57:24 -05:00
6ea058315f Add Ansible community 7.0.0 porting guide (#79448) 2022-11-22 17:04:36 -05:00
e5399c95d5 issue #79378 html context in sphinx conf (#79401) 2022-11-22 16:17:15 -05:00
32c90080e4 Docs: Updating the Ansible community changelogs (#79400) 2022-11-22 16:12:45 -05:00
3cc95d1f12 docs - make the existence of 'trivial' changelog entries easier to find (#79440) 2022-11-22 14:54:19 -05:00
493ef4a559 WinRM - Add doc entry for cert auth over TLS 1.3 (#79434) 2022-11-22 06:46:48 +10:00
1bda6750f5 fix reject list (#79391) 2022-11-18 14:26:35 -05:00
942bcf6e7a Add manifest includes for reuse licenses (#79403)
* Add includes for reuse licenses

* Add additional exludes to follow REJECT_EXTS

* clog frag
2022-11-17 17:13:01 -06:00
a954918b60 consolidate duplicated test files (#79380) 2022-11-17 16:20:20 -05:00
d925ece764 Allow pip like version syntax for installing collections (#79405) 2022-11-17 15:17:48 -06:00
6cec31574f Update fileglob.py (#78887)
Improve documentation for relative file paths
2022-11-17 15:48:50 -05:00
f089aae5ee Clarify that b64decode does not work with binary output (#79294) 2022-11-17 14:17:47 -05:00
3ae2f97d4a iss#55935: Documents missing internal parameters and polishes 'Intern… (#79118)
Co-authored-by: Jaroslav Klech <jklech@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2022-11-17 14:05:38 -05:00
7d35f70caf Add tests to validate vars_files first found behavior (#79386) 2022-11-17 14:05:02 -05:00
ec3f6ed9b9 update antsibull-docs to 1.7.3 (#79395)
* update antsibull-docs to 1.7.3

* remove extraneous changes
2022-11-17 13:48:58 -05:00
0a2b96f402 typos (#79377) 2022-11-17 12:02:24 -05:00
b7ea661807 Update pull.py (#79387) 2022-11-17 12:00:25 -05:00
6059116a64 Replace _valid_attrs with fattributes (#79376)
It was missed in one place it seems.
2022-11-15 10:25:57 -05:00
5c0b4a3798 Add Ansible community 7.0.0rc1 porting guide (#79382) 2022-11-15 10:15:59 -05:00
6baf25a048 [DOCS] collection_release_with_branches.rst: update major releases section (#79335)
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Don Naro <dnaro@redhat.com>
2022-11-15 15:09:02 +00:00
1705ec98cd ansible-doc and validate-modules: remove underscore deprecation handling for collections (#79362)
* Remove underscore deprecation handling for collections.

* Also consider ansible.legacy.
2022-11-15 10:03:47 -05:00
66cc952b49 communication.rst: Add IRC channel to Storage WG info (#79374) 2022-11-15 13:14:34 +00:00
3448fcabc5 file lookup now works with general lookup error framework (#79339)
* file lookup now works with general lookup error framework
2022-11-14 11:45:34 -05:00
35db7df9ce communication.rst: add AAP Config As Code WG (#79365) 2022-11-11 09:02:46 +00:00
d02f96b78c Add note to command_line_tools.rst (#79351)
Documentation fix for #69390
2022-11-10 13:40:49 -05:00
f9451dfaf8 docfix for ssh_args FAQ (#79308) 2022-11-10 10:35:02 +00:00
183c34db65 update backport instructions to 2.14 (#79354) 2022-11-10 10:03:19 +00:00
284e642cb9 communication.rst: add Storage WG info (#79359) 2022-11-10 10:02:04 +00:00
e7730f5d6c Fix up incorrectly quoted doc example (#79356) 2022-11-10 07:03:50 +10:00
d72326b6af Allow force deletion of group (#78172)
* Allow force deletion of group

* Update version_added

Co-authored-by: Jordan Borean <jborean93@gmail.com>
2022-11-10 06:52:27 +10:00
a3531ac422 Refactor structure of group module integration tests (#78652)
This to match the structure with the tests for the user module. When having the tests available as stand-alone tests, it will be easier to add more integration tests in the future.
2022-11-10 06:29:24 +10:00
196084773b Japanese version switcher (#79276)
* update japanese version switcher for 2.14

* update latest version
2022-11-08 13:20:09 -05:00
d5e90e1737 Add Ansible community 6.6.0 porting guide (#79340) 2022-11-08 12:23:49 -05:00
ef053bbebb Add Ansible community 7.0.0b1 porting guide (#79341) 2022-11-08 12:23:09 -05:00
eae42ec57e openbsd factgs, use physmem instead of usermem for total mem (#79316)
Signed-off-by: darshanip <darshancoding@gmail.com>
2022-11-08 10:30:12 -05:00
4759590467 Move collection playbook output from "warning" to "-v" (#79320)
* lib/ansible/executor/playbook_executor.py: fix minor typo in comment

* lib/ansible/executor/playbook_executor.py: move 'running playbook inside collection' from warning to -v debugging output
2022-11-08 10:17:53 -05:00
e0118d9d03 The attribute was renamed to 'action' and the extra data was not used anymore. (#79317) 2022-11-08 10:16:52 -05:00
0ae963a311 Add missing type to the reference option of the documentation of the git module (#79305)
* Add missing type to the `reference` option of the `git` module

* No more doc-missing-type error in validate-modules
2022-11-08 10:06:22 -05:00
d0b6ce7473 update version switcher to include 2.14 (#79273) 2022-11-07 10:43:56 -05:00
657acfb7af update release table with 2.14 details (#79272) 2022-11-07 10:37:29 -05:00
2a03c8028e Fix typo 'Ansbile'. (#79318) 2022-11-07 09:06:10 +00:00
852e2d7550 Update Ansible 7 roadmap (#79307) 2022-11-04 12:29:33 -04:00
f3be331c9c Delete a bad PR #79263 change note (#79295) 2022-11-03 12:20:31 -07:00
f700047e69 blockinfile - document multiline marker behavior (#79292) 2022-11-03 12:10:45 -07:00
a12a9b409f Add more documentation for InventoryData methods (#79288)
* Add more documentation for InventoryData methods

Reword some constructed documention and mention fetch_hostvars

* describe use cases for default strict behavior

Co-Authored-By: Brian Coca <bcoca@users.noreply.github.com>

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2022-11-03 12:05:33 -07:00
938c0fa944 ansible-test - Fix and update documentation links. 2022-11-03 11:04:31 -07:00
e2450d4886 added --allow-change-held-packages for apt remove (#78203)
* added --allow-change-held-packages for apt remove

* add tests for apt remove (allow_change_held_packages=yes)

* add changelog for apt remove (allow-change-held-packages=yes)

* update tests for apt remove (allow_change_held_packages=yes)
2022-11-02 12:02:04 -04:00
26a4775611 [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.
2022-11-02 16:52:46 +01:00
bb7ad0f0d8 Enable the reboot integration test in CI
Co-Authored-By: Matt Clay <matt@mystile.com>
2022-11-02 02:56:54 +01:00
698da30c1e ansible-test - Update test container to 7.4.0 (#79281) 2022-11-02 10:39:33 +10:00
f0d61245e3 Added ignore revs file for tracking commits with bulk sanity changes (#79280) 2022-11-02 08:52:28 +10:00
6def4a3180 Fix up sanity problems 2022-11-02 08:18:38 +10:00
4ad02dc6e3 ansible-test - Update PSScriptAnalyzer to 1.21.0 2022-11-02 08:18:38 +10:00
bfcb557777 replace yes/no with true/false in docstrings (#79274)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2022-11-01 15:50:11 -04:00
1c80209422 communication.rst: add Ansible MySQL WG information (#79269) 2022-11-01 11:13:41 -04:00
6e379e5d65 validate-modules: do not treat falsy non-False defaults as None (#79267)
* Do not treat falsy non-False defaults as None.

* Fix various instances of this in modules.

* Add changelog fragment.
2022-11-01 11:12:59 -04:00
6674c43edd 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
2022-11-01 11:10:05 -04:00
6d9e2bc5e9 De-duplicate initialisation of ConnectionBase._connected (#79256)
The same value is unconditionally set 4 lines down.
2022-11-01 11:08:13 -04:00
65e725f08f #59449: Removes translatable words from code blocks (#79193)
Co-authored-by: Jaroslav Klech <jklech@redhat.com>
2022-11-01 10:44:45 -04:00
44f7ca4645 add ansible 7 porting guide to index page (#79254) 2022-10-28 15:13:36 -04:00
0f18ddca9f mention acl in permissions errors (#79209)
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
2022-10-27 19:37:19 -04:00
aaab0791d9 File lookup handle missing file more gracefully (#79230)
previously it would have a 2nd tb due to bad error raising
 also remove superfluous warning
2022-10-27 15:28:32 -04:00
0bacea70c4 plugins/lookup/pipe: docs typo fixes (#79222) 2022-10-27 14:31:08 -04:00
6ee089bc80 collection roles dont support plugins (#79243) 2022-10-27 14:30:38 -04:00
bc83da9a1b Communication docs: note that editing Matrix messages causes IRC spam (#79238) 2022-10-27 11:02:56 +01:00
fa8dc6b73d Docs: Typos and edits in collections reviews (#79217) 2022-10-27 09:17:38 +01:00
d55423f5a4 ansible-test - Update default container. 2022-10-26 18:12:04 -07:00
9545f2e0de stable docs build: do not use YAML parsing/serialization for .deps files (#79233)
* Do not use YAML parsing/serialization for .deps files.

* Prevent crash.
2022-10-26 14:54:00 -07:00
74b80c3193 Bump antsibull-docs version from 1.6.1 to 1.7.0. (#79071) 2022-10-26 15:26:34 -04:00
656d01dd24 fix url for fest VoD banner (#79229) 2022-10-26 19:35:34 +01:00
74f55db5c6 Docs: Typos and edits in collections integration (#79228) 2022-10-26 16:04:55 +01:00
04957715cc contributor_path: misc doc fixes (#79224) 2022-10-26 13:13:08 +01:00
f02b8fb6f0 Add Ansible community 7.0.0a2 porting guide (#79219) 2022-10-25 16:36:12 -04:00
4fb5240af2 ansible-test - Update base and default containers. 2022-10-25 10:15:51 -07:00
4202acb41b 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
2022-10-25 09:48:26 -07:00
da3a7618ba give a warning when no roles match the search instead of returning rc 1 (#79195)
* give a warning when no roles match the search instead of returning rc 1

* porting guide note

* Update docs/docsite/rst/porting_guides/porting_guide_core_2.15.rst

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2022-10-25 12:00:56 -04:00
f3f7d44238 Added link to the Ansible meetup page (#79207) 2022-10-25 11:41:20 -04:00
060f114d8c add link to fest videos (#79196) 2022-10-25 09:46:01 +01:00
645b6b8581 ansible-test - Fix pylint support on Python 3.11. 2022-10-24 15:29:20 -07:00
a76bbb18a5 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>
2022-10-24 14:57:54 -07:00
757efa4a45 managed node requirement amend (#79189) 2022-10-24 16:53:43 -04:00
465480f755 documentation fix for file module 78988 (#79182) 2022-10-24 13:13:52 +01:00
bcdc2286e8 Revert "Fix yum exclude example to align to parameter doc (#79128)" (#79179)
This reverts commit 062315ecaa.
2022-10-20 15:57:36 -04:00
551f5a3753 Change occurance yes/no to true/false (#79035) 2022-10-20 15:06:15 -04:00
ae38628404 docs: cgroupsv1 is required for ansible-test with docker (#79066) 2022-10-20 14:38:02 -04:00
1182059d46 Setting indentation correctly in the Example section (#79072) 2022-10-20 14:34:05 -04:00
cc3abae532 minor changes in documentation (#79114) 2022-10-20 14:30:55 -04:00
062315ecaa Fix yum exclude example to align to parameter doc (#79128) 2022-10-20 14:20:56 -04:00
b7eb067090 Added the emphasize changelog (#79160)
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2022-10-20 14:19:43 -04:00
89af4e6e31 Update overview_architecture.rst (#79161)
Add missing right parenthesis
2022-10-20 14:09:43 -04:00
64d5c6cc3a Update contributor_path.rst (#79170)
grammar fixes
2022-10-20 14:05:25 -04:00
1a6cfa8203 Update communication.rst (#79172)
grammar fixes
2022-10-20 13:58:39 -04:00
d6c268378f Made changes to notes on #L9 and #L21 (#79173) 2022-10-20 13:55:41 -04:00
d82d232d07 update alpha to next week (#79166) 2022-10-19 15:23:51 -04:00
89d682464b 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.
2022-10-18 08:25:39 -04:00
5b04dff7bd remove AnsibleFest banner (#79156) 2022-10-17 20:45:38 +01:00
f66016df0e copy, avoid moving non temp remote 'non' files (#79102)
* copy, avoid moving non temp remote files that are not dirs/files
fix tests
2022-10-17 13:07:04 -04:00
cb2e434dd2 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
2022-10-14 09:14:35 -04:00
808f5a0c03 contributor_path: add doc link (#79138) 2022-10-14 11:18:12 +01:00
58f051a941 contributor_path: fix refs (#79136) 2022-10-14 09:15:09 +01:00
8d94a95ccf Docs: file parameter import_tasks and include_tasks (#79077)
* issue #79022 file parameter import_tasks and include_tasks

* adding details back

* Update lib/ansible/modules/import_tasks.py

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

* Update lib/ansible/modules/include_tasks.py

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

* use pipe as in original version

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-10-13 17:39:27 -07:00
3a6eca6670 Fix test for jinja2_native preserve quotes (#79131)
Fixes https://github.com/ansible/ansible/pull/79119#discussion_r993752129
2022-10-13 12:21:02 -07:00
f53dbf90ea Don't assume column index for netmask and broadcast (#79121)
* Don't assume column index for netmask and broadcast. Fixes #79117

* fix typo
2022-10-13 12:16:13 -07:00
c4d6629bce fix password unit tests (#79113) 2022-10-13 09:47:47 -05:00
7e060c148a Add Ansible community 6.5.0 porting guide (#79122) 2022-10-12 16:11:25 -04:00
d34b578685 jinja2_native: preserve quotes in strings (#79119)
Fixes #79083
2022-10-12 12:16:06 -05:00
f9cb679675 compile role with all parents in the dep chain (#79079)
fix inheriting from parents when role depth exceeds 3

Fixes #47023
2022-10-12 09:44:22 -04:00
cc2e7501db Disable IP address lookups in iptables -module when listing (#78828)
* add --numeric to list

Co-authored-by: Mikko Toivola <mikko.toivola@insta.fi>
2022-10-11 16:59:35 -04:00
5d253a1380 fix password lookup's use of f=v settings (#76551)
update tests
2022-10-11 15:09:00 -04:00
14e7f05318 ansible-test - Update pylint to 2.15.4. 2022-10-11 10:37:50 -07:00
58637702b4 Cache field attributes list on the playbook classes (#79091)
* Cache field attributes list on the playbook classes
2022-10-11 11:16:57 -04:00
1286b7d42e Apply minor formatting changes to "playbooks directory" section (#79092) 2022-10-11 08:36:37 +05:30
dfef3260a5 Add code-block wrappers to code examples in playbooks_filters.rst (#79093)
Fixes #79029
2022-10-10 14:59:23 -07:00
a48c442275 Misc Typo fixes (#79088) 2022-10-10 14:41:20 +01:00
ad1eba9876 community_steering_committee: add a new member (#79089) 2022-10-10 13:50:09 +01:00
7d6984618d Docs: syntax error in Parsing semi-structured text with Ansible (#79085) 2022-10-10 09:34:31 +05:30
8ecfb7c6d8 Added code-block wrappers in implicit_localhost.rst (#79086)
Fixes #79031
2022-10-10 09:33:03 +05:30
ad5d9843d6 docs: fix typos (#79082) 2022-10-09 19:51:43 +05:30
eecc4046e8 Fix empty str defaults in config/base.yml (#77733)
* fix empty str default for config/base.yml config options by rendering '' instead of ``''``

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2022-10-07 15:27:17 -04:00
e208fe5932 copy module - fix copying directories recursively with remote_src=True (#76997)
* copy module - fix copying directories containing modified subdirs with remote_src=True. Previously, the first changed subdir would prevent recursively checking for changes for in subdirs at the same level.

* Fix reporting changed for copying empty directories with remote_src=True. If a directory is created on the remote but nothing else, changed is True.
2022-10-07 14:24:46 -04:00
27ab589ee8 ansible-config, only subvalues should use yaml shorthand (#79073)
* ensure we only use shorthand for assigned values

* fix ansible-config std display

* split baby

* killed offending whitespace

* moved to func instead

* the revenge of whitespace
2022-10-07 12:45:40 -04:00
fcea07bbef Custom salt for ansible-vault encrypt (#79063)
* Custom salt for ansible-vault encrypt

  add VAULT_ENCRYPT_SALT config
  add salt testing


Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Piotr Stawarski <p@stawarski.pl>
2022-10-07 10:05:46 -04:00
8cf7a0d3f0 Fix collection install from source respects symlinks (#78983)
* Fix installation from source transforms symlinks of dirs to empty dirs

* Add test to check symlinks to dirs are respected when installing from source

* Add changelog for collection install from source symlink to dirs issue
2022-10-06 13:53:23 -04:00
420564c5bc Ensure that we do not squash keywords in validate (#79049)
* Ensure that we do not squash keywords in validate. Fixes #79021

* become_user: nobody should only apply to the test tasks, not the setup_test_user role

* Update how become_user is specified

* Add test to ensure keyword inheritance is working for become

* Add clog frag

* Cache fattributes to prevent re-calculation

* ci_complete

* Remove unnecessary getattr
2022-10-06 08:55:56 -05:00
11c1777d56 facts: List all local (scope host) IP address ranges (#79018)
After changes:
```
        "ansible_locally_reachable_ips": {
            "ipv4": [
                "127.0.0.0/8",
                "127.0.0.1",
                "192.168.0.1",
                "192.168.1.0/24"
            ],
            "ipv6": [
                "::1",
                "fe80::2eea:7fff:feca:fe68",
                ...
            ]
        },
```

192.168.1.0/24 is a local prefix, where any IP address inside this range
is reachable locally (or outside this host if this prefix is announced via
EGP/IGP).

Signed-off-by: Donatas Abraitis <donatas.abraitis@hostinger.com>
2022-10-06 09:30:57 -04:00
e1daaae42a Fix using FQCN for flush_handlers (#79057)
Fixes #79023
2022-10-06 09:26:49 -04:00
f8f1c6a6b5 Add password_hash filter and fix some nits (#78743)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2022-10-06 17:11:06 +05:30
44581289e8 Use python re to parse service output instead of grep (#79015)
* 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
2022-10-05 12:19:40 -05:00
680bf029b1 Docs: Add code-block wrappers in lookup.rst & strategy.rst (#79032, #79033) (#79048) 2022-10-05 09:55:41 -07:00
35700f57cc Docs: Add code-block wrappers in faq.rst (#79047) 2022-10-05 09:46:14 -07:00
25a770de37 Docs: fixed configs docs to properly display code blocks (#79040)
* fixed some docs to properly display code blocks
Co-authored-by: Shade Alabsa <shadealabsa@microsoft.com>
2022-10-05 09:28:53 -07:00
3fc3371463 Cleaned up test_strategies doc (#79045)
Authored-by: Shade Alabsa <shadealabsa@microsoft.com>
2022-10-05 08:51:43 -07:00
3a788314a2 Docs: Adding code blocks wrapper (#79042)
* Adding code blocks wrapper
2022-10-05 08:41:34 -07:00
63b5fc4b8d Docs: Add code-block wrappers to code examples (#79037)
* Docs: Add code-block wrappers to code examples
2022-10-05 05:39:06 -07:00
57f22529cb Add code-block wrappers in network_debug_troubleshooting.rst 2022-10-05 17:16:08 +05:30
ff6e4da36a fixes to FA inheritance (#78990)
finalized applies to all field attributes
fix getting parent value
also remove unused/needed extend/prepend signature
moar testing
2022-10-04 11:47:32 -04:00
b5db71e318 ansible-vault: add newline to the output of the 'encrypt_string' command (#79017)
* ansible-vault: add newline to the output of the 'encrypt_string' command

* Add comment with issue description and improve string joining

* Add changelog fragment

* Update changelogs/fragments/79017-ansible-vault-string-encryption-ending-with-newline.yml

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

* Fixed some typos in changelog fragment

* Improve comment regarding newline character at the end of file

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

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2022-10-04 08:05:37 -07:00
56285b1d2b Docs: true/false with boolean values (#78980)
* Adding FQCN community.postgresql. to postgresql modules
2022-10-04 10:29:26 -04:00
6d0aeac1e1 Do not crash templating when filter/test name is not a valid Ansible plugin name (#78913)
* Do not crash templating when filter/test name is not a valid Ansible plugin name.
* Store and re-raise KeyError if there was one.

Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
2022-10-04 09:44:00 -04:00
367cdae3b2 docs: replace latin terms with english in the scenario_guides (#79008) 2022-10-04 10:35:45 +01:00
4d3c12ae9e docs: replace latin terms with english in the reference_appendices (#79010) 2022-10-04 10:33:40 +01:00
8f4133b514 Docs: Replace Latin in the porting guides (#79011) 2022-10-04 10:30:57 +01:00
ea04d05a1e Docs: Typo in Alibaba Cloud Compute Services Guide (#78984) 2022-10-04 10:19:13 +01:00
8d665a1a8e docs: replace latin terms with english in network (#79013)
fixes #78999 by removing Latin usage in network docs
2022-10-04 09:47:24 +01:00
f0cc70f9e1 No latin terms (#79009)
Fixes #79006
2022-10-04 08:05:15 +05:30
173ddde126 Docs: true/false with boolean values in docsite/rst/playbook_guide (#78958) 2022-10-03 16:55:00 -04:00
4f4ad453c4 Fixed Latin words, replaced all via with either through or by (#79004) 2022-10-03 16:54:03 -04:00
55925958ea docs: replace latin terms with english in the os_guide directory (#79007)
Fixes #79003
2022-10-03 16:51:44 -04:00
78c9fb4159 replace with boolean true/false (#78950) 2022-10-03 16:49:43 -04:00
fbd98cd824 Docs: Replace Latin terms in the dev_guide #78997 (#79005) 2022-10-03 16:42:37 -04:00
5b333c9665 scenario guide doc changes (#78934) 2022-10-03 16:40:12 -04:00
5137cb16e9 Update porting_guide_5.rst (#78954) 2022-10-03 16:35:06 -04:00
ba32642538 Update porting_guide_4.rst (#78953) 2022-10-03 16:34:47 -04:00
919c449256 Update porting_guide_3.rst (#78952)
Fixes #78914
2022-10-03 16:34:16 -04:00
dc2d15fca4 Update porting_guide_2.0.rst (#78951)
Replaced http link with rst version - issue https://github.com/ansible/ansible/issues/78914
2022-10-03 16:33:57 -04:00
f7c01bc866 Docs: Provide descriptive labels for http references (#78959) 2022-10-03 15:01:27 -04:00
fb8c2daf46 Docs: true/false with boolean values in docsite/rst/os_guide (#78957) 2022-10-03 14:39:09 -04:00
56c48d1c45 docs - Use code-block to format examples in Windows module development walkthrough (#78985) 2022-10-03 01:51:14 -07:00
1b922b42dd Adds code-block in collection documentation (#78977)
* fix issue #78976
2022-10-03 01:45:44 -07:00
9afb37eda6 #78965 Adding the code-block to prevent the translation (#78979)
* Adding the code-block to prevent the translation
2022-10-01 11:40:28 -07:00
93c2cb2b8e #78971 Update module_lifecycle.rst (#78974)
* Update module_lifecycle.rst
2022-10-01 08:37:57 -07:00
3dc0c2135e Docs: Add code-block wrappers to code examples in style_guide (#78970)
* Docs: Add code-block wrappers to code examples in style_guide
List of changed files:
- docs/docsite/rst/dev-guide/style_guide/index.rst
- docs/docsite/rst/dev-guide/style_guide/basic_rules.rst
2022-10-01 08:11:07 -07:00
446406a0c8 added code-blocks according to #78963 (#78969)
* added code-blocks according to  #78963
* Update testing.rst, added newlines
2022-10-01 07:59:43 -07:00
1db75a41bf Adding code-block wrappers to code examples (#78968) 2022-10-01 07:51:02 -07:00
01484cdc68 added code-blocks according to #78962 (#78972) 2022-10-01 07:37:40 -07:00
538b99781f Docs: Add code-block wrappers to code examples: testing_documentation.rst (#78966)
* Docs: Add code-block wrappers to code examples: testing_documentation.rst
List of changed files:
- docs/docsite/rst/dev_guide/testing_documentation.rst
* Fix: match whitespace convention of other occurences
2022-10-01 06:37:42 -07:00
5b239acb77 ansible-test - Update distro containers to 4.8.0.
The updated containers include coverage 6.5.0.
2022-09-30 10:31:42 -07:00
9650ddb11c omit keyword should reset to context (#78917)
* omit keyword should reset to context

  ensure we use context/inheritance when calculating value,
  using default only when context is unavailable.

  fixes #75692
2022-09-30 13:07:24 -04:00
20c1252212 ansible-test - Update coverage to version 6.5.0.
ci_complete
ci_coverage
2022-09-30 08:57:21 -07:00
cee9872605 apt_key, fix example indentation
Co-authored-by: Matt Clay <matt@mystile.com>
2022-09-30 11:06:41 -04:00
ba6da65a0f Fix connection/become task loop settings (#78565)
* Fix connection/become task loop settings

* Remove old code
2022-09-30 09:06:10 +10:00
be4807b712 ansible-test validate-module - support sidecar docs (#78904) 2022-09-30 08:22:42 +10:00
c3fc8db41c Deprecate using a list of dicts for vars. See #78920 (#78927) 2022-09-29 12:45:55 -07:00
d93883645c Upgrade antsibull-docs to 1.6.1 (#78872)
* Bump antsibull-docs version to 1.6.0 to fully support filter docs.

* known_good_reqs.txt no longer exists.

* Bump version to 1.6.1.
2022-09-29 11:54:00 -04:00
0343ae46d2 Add message about viewing chat history when on IRC (#78834) 2022-09-29 11:19:34 -04:00
ae66d9a1f4 Fixed spelling (#78911) 2022-09-29 11:01:46 -04:00
0884a7cf0e Add Ansible community 7.x porting guide (#78916) 2022-09-29 09:15:01 -04:00
0b678d5036 avoid roles exporting vars: (#69040)
- correct 'vars:' precedence to allow phasing out of include_params
 - actually merge vars and always include role_vars
 - avoided dupe deps from giving wrong vars
 - use 'first' instance of dep as others are from previous instances/invocations
   and can have diff values for vars
 - ensured deps only provide exportable vars themselves
 - added COMMENTS
 - added tests
 - apply export restrictions setting to defaults
 - use 'public' as cutoff

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

ci_complete
2022-09-28 15:54:48 -04:00
3423a6609f Fix docs for new commonpath and normpath filters (#78897) 2022-09-28 14:41:01 -04:00
4b0697ee03 make pager and editor configurable, specifically for ansible (#78816)
* make pager and editor configurable, specifically for ansilbe

  fallback on common ways to configure
2022-09-28 10:09:46 -04:00
c7cde2645d apt_repository, handle both new/old gpgp stds (#78735)
* apt_repository, handle both new/old gpgp stds
2022-09-28 10:08:00 -04:00
7acd4f75c0 apt module, prevent tb from invalid type for pkg (#78666)
* apt module, prevent tb from invalid type for pkg

 see #78663
2022-09-28 09:58:03 -04:00
95236c5569 slight var loading optimization (#78835)
Avoid having to recalculate these values since they don't change from first access
2022-09-28 09:13:05 -04:00
3515b3c5fc winrm - fix reducing 'Read timed out' error (#78869)
* winrm - fix reducing 'Read timed out' error

This fix reduces the exceptiopn 'Read timed out. (read timeout=nnn)' occurring seemingly randomly and
unpredictable on some networks (which have long latency and/or many hops or other problems). The fix
ensures that the involved timeout is set to a value so this issue is reduced.

* Add changelog fragment

Co-authored-by: Jordan Borean <jborean93@gmail.com>
2022-09-28 09:00:57 +10:00
bc274f57f7 ansible-test - Improve pylint command consistency. (#78896)
* ansible-test - Improve pylint command consistency.

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2022-09-27 11:39:25 -07:00
6e949d8f5d Added normpath filter (#78894)
Signed-off-by: Shivam Durgbuns <sdurgbun@redhat.com>
2022-09-27 13:21:38 -04:00
7c4d5f5099 documented windows filters (#78876)
* documented windows filters

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Sandra McCann <samccann@redhat.com>
2022-09-27 12:14:14 -04:00
8444d47b11 Adding two new os.path filters and its docs (#78794)
* Adding two new os.path filters and its docs

Signed-off-by: Shivam Durgbuns <sdurgbun@redhat.com>
2022-09-27 11:46:44 -04:00
4115ddd135 plugin loader fix existing config testing (#78859)
create specific function to find config entry to avoid repopulating constantly
2022-09-27 11:34:59 -04:00
71adb02142 Fixes typo in rst format (#78884)
.. hint:: requires a blank line above and below.
2022-09-27 11:11:32 -04:00
9aa9b4eac0 Improve filter docs (#78839) 2022-09-26 14:28:37 -04:00
de4ff281ab 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>
2022-09-26 09:27:20 -04:00
50dae8087e runtime-metadata sanity test: ensure redirects are FQCRs (#78802)
* Ensure that meta/runtime.yml redirects are FQCRs.

* Avoid crash when YAML errors without context mark happen, for example if file starts with 'foo---' instead of '---'.
2022-09-26 07:35:43 -04:00
964e2bc6fe iss#72389: Adds note and polishes docs/docsite/rst/tips_tricks/sample_setup.rst (#78858)
Co-authored-by: Jaroslav Klech <jklech@redhat.com>
2022-09-23 10:19:21 -04:00
d3d7785472 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).
2022-09-22 12:28:54 -07:00
f8f76c5886 Update yum.py (#78829)
##### SUMMARY
The entire yum command should be highlighted, not only its options.


##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2022-09-22 12:09:27 -07:00
16cde1104f ansible-test - Update base and default containers. (#78846) 2022-09-21 15:49:33 -07:00
4c26022171 Don't request repo updates when only testing modes (#78843) (#78850)
(cherry picked from commit 254204856f)
2022-09-21 15:24:19 -07:00
228d25a321 Remove deprecated ANSIBLE_COW_WHITELIST/cow_whitelist (#78831)
Fixes #78819
Fixes #78820
2022-09-21 15:09:05 -05:00
d514aeb2a1 Remove deprecated ANSIBLE_CALLBACK_WHITELIST/callback_whitelist (#78830)
Fixes #78821
Fixes #78822
2022-09-21 15:08:53 -05:00
76b746655a Add use_rsa_sha2_algorithms option for paramiko (#78789)
Fixes #76737
Fixes #77673

Co-authored-by: Matt Clay <matt@mystile.com>
2022-09-21 12:14:55 -05:00
4d25233ece ansible-test - Update Python 3.11 support. (#78840)
- Update sanity test requirements to fully support Python 3.11.
- Make Python 3.11 the default in the base and default test containers.
2022-09-21 10:09:11 -07:00
163819efa2 tests: Fix test_ansible_version() when run within a git checkout (#78636)
When running the unit tests locally, in a git clone, `ansible --test`
prints additional information about the git revision, e.g.

```
~/src/ansible$ ansible --version
ansible 2.10.8
...
~/src/ansible$ source hacking/env-setup
...

Setting up Ansible to run out of checkout...
...
~/src/ansible$ ansible --version
[WARNING]: You are running the development version of Ansible. You
should only run Ansible from "devel" if you are modifying the Ansible
engine, or trying out features under development. This is a rapidly
changing source of code and can become unstable at any point.
ansible [core 2.14.0.dev0] (test_ansible_version-devel df497ea13b) last
updated 2022/08/25 10:37:07 (GMT +100)
...
```

which causes `test_ansible_version()` to fail.

Also removed an unused argument from previous parameterisation.

Co-authored-by: Alex Willmer <alex.willmer@cgi.com>
2022-09-21 09:34:53 -07:00
1b47def5ed Add ssh_args and friends back, add var for proxy_command (#78826)
Fixes #78750
2022-09-21 10:58:00 -05:00
161e2631f2 Remove missed clog frags (#78825) 2022-09-20 18:31:19 -05:00
f8e8326437 Bump devel to 2.15.0.dev0 (#78817) 2022-09-20 14:04:29 -05:00
3b937123d2 final docs for filters (#78800)
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-09-20 11:38:26 -04:00
24a42bb25e fix network_connection_options text (#78813) 2022-09-20 10:04:24 -04:00
b1ff0f4ebc vault secrets file, keep context when symlink (#78734)
* vault secrets file, keep context when symlink

	fixes #18319

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2022-09-20 09:07:21 -04:00
e5e87a3927 ansible-test - Update pylint to 2.15.3. (#78811) 2022-09-19 15:34:41 -07:00
ab8a291824 Add sudo for writing bash completion to a global (#78712) 2022-09-19 16:45:39 -04:00
a02e22e902 Add --offline option to 'ansible-galaxy collection install' (#78678)
* Add --offline option to 'ansible-galaxy collection install' to prevent querying distribution servers

This allows installing/upgrading individual tarfiles to have dependency resolution.
Previously needed to be done manually with --no-deps or else all collections and dependencies needed to be included in the requirements.

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2022-09-19 14:10:36 -04:00
813c25eed1 plugin docs: look at all potential sidecar docs extensions before giving up (#78788)
* Look at all potential sidecar docs extensions before giving up.

* Do not process Python files twice.
2022-09-19 11:50:27 -04:00
1d410ca700 Fix local facts unreadable (#76095)
* Catch exceptions during stat calls

If such an exception is not caught it causes the complete
local facts gathering to fail.
2022-09-19 10:57:02 -04:00
9b8e60c36d While the Python function is called ismount, the filter has the names mount and is_mount. (#78792) 2022-09-19 10:50:31 -04:00
616ad883ad Add OSMC to Debian OS_FAMILY_MAP (#78778)
* Add OSMC to Debian OS_FAMILY_MAP

 - os_family fact of the Debian-based OSMC distribution was not detected correctly

* tweak changelog

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2022-09-16 10:44:04 -07:00
2df2261cd4 Doc: Community Steering Committee policy: add topics triage workflow (#78732) 2022-09-16 09:48:46 -04:00
f26f3325ba apt - fix module short-circuiting when a package is not installed and only_upgrade is True (#78790) 2022-09-15 18:24:39 -04:00
7683c0ae54 ansible-test - Update base and default containers. (#78774) 2022-09-15 12:44:05 -07:00
4b45b4b09d 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
2022-09-15 12:42:34 -07:00
9bc4fa496c Env gitignore (#78766)
* added env to git ign aka the std name for py venv

* added the github def py env ign
2022-09-15 12:16:38 -07:00
86b86398f0 add ansible_name/ansible_aliases attrs to plugin objects (#78700)
*  new _fqcn attribute to plugin objects
* unbreak plugins in subdirs
* Fix inadventent changes to _load_name and use existing vars
* add plugin aliases and name property, and replace plugin._load_name where incorrect
* Fix listing plugin names

Fix listing legacy and builtin together
test deprecated plugin documentation
fix doc extensions
remove sometimes inaccurate _load_name handling from plugin.name

* Add tests for REJECT_EXTS and doc extensions

Fix unpredictable collection redirects so non-fqcns in the redirect list are guaranteed to be legacy (instead of determined by the collections keyword)

Move aliases and name properties to _update_object so all plugin types, including doc fragments, can use them

* make legacy plugin names internally consistent
* rename attributes to ansible_name and ansible_aliases
2022-09-15 14:15:42 -04:00
a55afcc39a Added warning (#78785) 2022-09-15 14:13:01 -04:00
cbffb77f57 Document some more filters (#78548) 2022-09-15 14:00:52 -04:00
e276770ee9 Removed repeated introduction paragraph (#78691) 2022-09-15 11:46:57 -04:00
c7b4a25f9d Fix typo and wrong syntax in intro_patterns.rst (#78702) 2022-09-15 11:37:03 -04:00
db33ca8e1a faq legacy vs builtin (#78769) 2022-09-15 11:12:48 -04:00
f50ff1c2db Fix Issue #78564 (#78741) 2022-09-15 11:06:31 -04:00
952ee88f33 Documented connection parameters required to enable scp (OpenSSH >=9.0) (#78745) 2022-09-15 11:03:09 -04:00
d4407ca688 Ansible 6.4.0: Porting Guide (#78775) 2022-09-15 10:34:05 -04:00
4c720036e4 Update docs-build and rstcheck sanity tests. (#78773) 2022-09-14 15:45:05 -07:00
9f16bdbdda Ensure syntax check errors include filenames (#77679)
This fixes bug which prevents identification of broken playbook when
passing multiple playbooks as arguments, something that is common
especially with `--syntax-check`.

Affects: ansible-lint
2022-09-14 12:50:50 -07:00
df6a564abd add galaxy docs back to core' (#78764) 2022-09-14 20:18:44 +01:00
695c48957d Fix test docs (#78756) 2022-09-14 13:32:28 -04:00
8090ee3e78 post_validate LoopControl (#75715)
avoid having to template/post_validate each part of the object
2022-09-14 10:15:23 -04:00
540442db2e issue #78760 missing indexes (#78763) 2022-09-13 14:43:21 -04:00
563f3ecc11 Error for context-dependent redirects (#78755) 2022-09-13 09:31:38 -05:00
86ab63f281 Recover unix load average into an ansible_loadavg fact (#75319)
* Recover unix load average into an ansible_loadavg fact

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

* Add an integration test
2022-09-13 10:09:06 -04:00
a6d4c3ff7c Print skip reason for skipped meta tasks instead of an empty msg in -vv (#78681)
Fixes #77315
2022-09-13 09:50:10 +02:00
a26c325bd8 uri: added use_netrc argument to allow ignoring netrc (#74397) (#78569) 2022-09-12 09:38:22 -05:00
79f67ed561 ansible-test - Fix container error handling. (#78739) 2022-09-09 10:40:21 -07:00
2e5e8026cc Improve split integration test. (#78738)
* Omit redundant fact gathering.

* Add connection type to split test.

* Add user info to split integration test.
2022-09-08 15:26:22 -07:00
62221a3be2 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.
2022-09-08 14:30:59 -07:00
b8025ac160 Allow selection of TLS/SSL ciphers (#78650)
* Allow selection of TLS/SSL ciphers. Fixes #78633
* Never pass None as the password. Fixes #53373
2022-09-08 15:11:13 -05:00
fa093d8adf ansible-doc: remove manual formatting (#78668)
* remove manual formatting and make the output align closer with the original YAML

Co-authored-by: Brian Coca <brian.coca+git@gmail.com>
2022-09-08 16:02:58 -04:00
eb17ab8c27 ansible-doc consistent version info ignore (#78725) 2022-09-08 12:19:45 -07:00
8a7b89c2f4 ansible-test - Update distro containers. (#78729) 2022-09-07 19:32:45 -07:00
b3854161a0 ansible-test - Update coverage to version 6.4.4. (#78728) 2022-09-07 18:47:19 -07:00
c56b35598f ansible-test - Upgrade pylint. (#78727)
This version of pylint now supports Python 3.11.
2022-09-07 14:22:38 -07:00
fbd828673d Fix distro fact handling for Flatcar (#77635)
* Fix distro fact handling for Flatcar

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

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

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

Signed-off-by: Johanan Liebermann <jliebermann@microsoft.com>
2022-09-07 13:14:12 -04:00
77ba025a13 document tests (#78685)
Document the builtin test plugins

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-09-07 09:49:23 -04:00
fcfdca8e7d Overriding AnsibleContext.resolve is not needed/allowed (#78714)
https://github.com/pallets/jinja/pull/1393
https://github.com/pallets/jinja/pull/1544

ci_complete
2022-09-07 15:20:24 +02:00
41b62f7db4 Limit Galaxy API calls during ansible-galaxy dependency resolution (#77468)
* Limit Galaxy API calls during ansible-galaxy collection dependency resolution when possible

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

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2022-09-06 17:07:04 -04:00
dc2a79f1c3 ansilbe-doc fixes for filters/test listing (#78696)
* split filters
* listing fixes
* return to no docs being exception
2022-09-06 16:13:18 -04:00
38a82a5cc4 ansible-test - Remove Fedora 35 support. (#78720) 2022-09-06 13:00:52 -07:00
8ebca4a6a3 fetch_file - properly split files with multi-part file extensions (#75257) 2022-09-06 14:30:04 -05:00
fd19ff2310 Propagate ansible_failed_task to an outer rescue (#78676)
Fixes #43191
Fixes #72638
Fixes #78042

Co-authored-by: Sandra McCann <samccann@redhat.com>
2022-09-06 17:11:49 +02:00
848143640b issue 78082 move content and orphan user guide (#78711) 2022-09-06 05:20:46 -07:00
223e05e012 issue 78082 create collections users guide (#78708) 2022-09-05 08:06:13 -07:00
75975a691e issue 78082 modules plugins collections (#78699) 2022-09-02 12:52:06 -04:00
a66a6c2f84 issue 78082 create separate vault guide (#78697) 2022-09-02 12:19:58 -04:00
72783837c5 fix issue with legacy pugins and no docs (#78686)
* fix issue with legacy pugins and no docs
2022-09-01 17:48:04 -04:00
077e1bfe17 Added section about boolean variables (#78653)
Co-authored-by: William Njuguna <william@coralogix.com>
2022-09-01 14:28:03 -04:00
5f2bb2ba93 Add the rest of the runtime keys to the example in the default collection skeleton (#78573) 2022-09-01 14:24:49 -04:00
b8abcd17a8 new: documentation update for galaxy usr guide (#78649) 2022-09-01 14:20:45 -04:00
4260b71cc7 refactor and fixes for doc parsing (#77719)
* refactor and remove redundant code in documentation

  allow location and building api to be more accessible
  fix issues with displaying ansible.legacy and ansible.builtin
  ensure we don't x2 process tokens (some modules reference them also) fixes #77764
  move to constants vs hardcoded
  more informative errors and comments
  now have actual filter/test plugins, which expose the filter/test functions
  moved filter/test loading/finding logic into jinja2pluginloader, removed dupe implementations
  added tests for case in which we unique by basename when listing

Update lib/ansible/utils/plugin_docs.py
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2022-09-01 14:16:05 -04:00
2464e1e91c Fix vars plugin code and documentation mismatch (#78562)
* Add a warning for collections that are attempting to be autoloaded to no effect
* Deprecate REQUIRES_WHITELIST and add support for REQUIRES_ENABLED so the docs are accurate
* Fix documentation
* add more vars plugin tests
* Simplify code and add a FIXME for another bug
* fix precedence
* Make setting the class attr at all a warning, even if it's True
* Add fun parsing for _load_name
* include _load_name in messages
2022-08-31 12:15:58 -04:00
f8e24e4a65 Guard urllib3 imports against all exceptions. Fixes #78648 (#78667) 2022-08-30 14:22:56 -05:00
19e7c5b0c1 _get_next_task_from_state should not mutate anyting outside of state (#78657)
Fixes #78612
2022-08-30 17:16:21 +02:00
38c3b5e8f1 Fix typos in stat module examples (#78651) 2022-08-30 17:05:27 +02:00
0c57734819 until is also implicit (#78632)
The until keyword templating is also implicit, this will now reflect in the docs
2022-08-29 11:21:37 -04:00
d8cb9117ac Skip test if no there are no problematic chars for wcswidth (#78645) 2022-08-29 09:06:37 -05:00
ebcf1654c4 Note that become_user is required for runas (#78603) 2022-08-25 15:54:41 -04:00
87ba1e29d3 doc: Correct mixed up commentary and task name (#78610)
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2022-08-25 15:17:23 -04:00
484a671c5e Fixes broken links. For the github links this was where references to in the URL are stale due to the default branch in the linked repository now being . While github does have the functionality of dropping you on the default branch (via an HTTP 302 redirect) when it does not recognize the branch you are trying to reach, the fact that most of these links work is more of a coincidence than reliance on a github feature. Also removes unnecessary whitespace where found. (#78638) 2022-08-25 15:14:05 -04:00
81813b7f23 Fixes parameter name in expect module examples (#78635) 2022-08-25 12:10:25 -07:00
49fdf59d1f Fixes typo on docsite playbook_reuse_roles page (#78630) 2022-08-25 12:06:50 -07:00
12cec69545 Fix validate-modules version_added test (#78554) 2022-08-25 10:47:06 -04:00
843405077e prep intro inventory page to be subdivided (#78634) 2022-08-24 16:53:42 -04:00
df497ea13b Add Porting Guide for ansible-community v6 (#78625) 2022-08-24 09:36:42 -04:00
3b9f1871e5 Docs: fix issue-76133-apt-repository (#78586) 2022-08-23 11:06:11 -04:00
f1c56e988d Fail fast in stuck ansible-galaxy-collection
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.
2022-08-23 16:57:19 +02:00
38db9cf417 ansible-test - Update test containers. (#78615)
The test containers no longer use the `VOLUME` instruction.
2022-08-22 14:22:29 -07:00
4187707f03 ansible-test - Use --tmpfs to run containers. (#78605) 2022-08-22 12:24:23 -07:00
2e536c0afb Fix file integration test chattr/lsattr check. (#78614)
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.
2022-08-22 11:18:17 -07:00
ece85abbc4 ansible-test - Verify executables are executable. (#78606) 2022-08-19 19:45:51 -07:00
5ac40b358d fix adhoc dev example (#78593) 2022-08-19 15:06:03 -04:00
beb70daf14 Fix pytest collection during test_host partial run
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
2022-08-19 20:11:57 +02:00
045f30371f fix Ansible 2.14 reference (#78589) 2022-08-19 09:15:52 -07:00
42d8a9daa8 Prevent double failing hosts for includes in loops (#76928)
Fixes #23161
2022-08-19 14:19:31 +02:00
3d6a60b481 Address inactive but legacy print calls found with code checking. (#78581)
* Address inactive but legacy print calls found with code checking.

* Per bcoca remove the inactive legacy print statements
2022-08-18 19:23:39 -04:00
4c8b8a06be Fix exit codes for role search and delete. Fixes #78516 (#78578) 2022-08-18 15:15:51 -04:00
1e6730aec4 docs: Update managed node requirements (#78468) 2022-08-18 14:48:51 -04:00
e0eb45e753 Docs: Issue 78082 Create command line guide (#78567) 2022-08-18 14:46:36 -04:00
9e287d9002 issue 78082 move bsd hosts content (#78568) 2022-08-18 14:31:18 -04:00
deb54e4c5b Relax minimal config to enable manifest functionality (#78574)
* Revert "Fix incorrect docs about how to enable manifest functionality (#78572)"

This reverts commit ac1ca40fb3.
2022-08-17 18:01:46 -05:00
ac1ca40fb3 Fix incorrect docs about how to enable manifest functionality (#78572) 2022-08-17 15:10:00 -05:00
d2f8099118 Use MANIFEST.in style directives to build collections (#78422) 2022-08-17 14:22:39 -05:00
f9a450551d add required file to collection skeleton (#77418)
* add required file to collection skeleton

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

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

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

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

Also updates relevant test and adds a changelog fragment
2022-08-17 14:42:47 -04:00
8dc097989b add note to use package_facts module (#78484) 2022-08-17 18:59:55 +01:00
2e8082ebb0 yum_repository: Do not set default value for async (#76750)
* yum_repository: Do not set default value for async

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

```ini
async = 1
```

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

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

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

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

Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
2022-08-17 13:56:24 -04:00
bf1ef5a1f3 Replace get_persistent_connection_options in task_executor with get_options (#74446)
Replace get_persistent_connection_options with get_options
Remove special case for network sub_plugin in _set_plugin_options
Try to avoid mock connection pretending to be persistent
Rename variables->options to reflect what they actually are
Gather options for ssh_type_conn on network_cli
Drop reliance on sub_plugin["type"]
2022-08-17 12:12:08 -04:00
2fdaee143a update link for RH customers in docs banner (#78563) 2022-08-17 16:56:49 +01:00
33ee5d4c1b update FAQ with not about libyaml (#78483) 2022-08-16 16:06:25 -04:00
7ae1eabaa4 clarify collection signature not available from Community Galaxy (#78386) 2022-08-16 16:05:06 -04:00
ccf1a63158 issue #78082 separate inventory user guide (#78555) 2022-08-16 15:02:39 -04:00
811093f022 Move handler processing into new PlayIterator state (#77955)
Fixes #46447
Fixes #52561
Fixes #54991
Fixes #64611
Fixes #64999
Fixes #65067
Fixes #72725
Fixes #72781
Fixes #77616
2022-08-16 18:37:14 +02:00
254de2a434 Templar: deprecate shared_loader_obj option (#78540) 2022-08-16 17:17:10 +02:00
d683c5bd21 ansible-test - Fix Ubuntu 20.04 bootstrapping. (#78551) 2022-08-15 17:00:19 -07:00
660aceaa77 Fix version switcher for Japanese docs (#78432) 2022-08-15 14:05:03 -04:00
b6f42547f4 Targeting a small typo correction (#78531) 2022-08-15 10:44:58 -04:00
4604ea38dd Supply some descriptions for settings used in ansible.cfg (#78536) 2022-08-15 10:43:45 -04:00
8e96c27888 ansible-test - Update base and default containers. (#78532) 2022-08-11 16:03:15 -07:00
69ceb31600 ansible-test - Update sanity test requirements. (#78528) 2022-08-11 14:44:50 -07:00
09d0df1d87 Fix variable use before definition. (#78500)
* Fix variable use before definition.

* Include mkstemp in exception handler.

Also remove two pointless variable assignments.
2022-08-11 13:58:52 -07:00
7f69629fa7 Fix ansible-docs: shipping ansible in wheel format #78485 (#78524) 2022-08-11 16:54:21 -04:00
135f95fb2f Split up ansible-test integration tests. (#78520)
* Relocate venv-pythons.py script.

* Split out unsupported-directory test.

* Split out sanity-import test.

* Split out sanity-validate-modules test.

* Split out units test.

* Split out integration test.

* Split out units-constraints test.

* Split out integration-constraints test.

* Split out coverage test.

* Split out sanity test.

* Split out git test.

* Update test groups.
2022-08-11 13:40:36 -07:00
0de4480467 allow multiple types for null representation (#78451)
* allow multiple types for null representation

  '' is not Nonetype
  fixes #76493
2022-08-11 16:07:57 -04:00
3a59cb25f4 add info about plugin name when ignoring abstract errors (#78465)
* add info about plugin name when ignoring abstract

  related to #78464

* added error to narrow down method
2022-08-11 16:07:28 -04:00
99016653a2 ansible-test - Fix self-test change handling. (#78521) 2022-08-11 12:35:23 -07:00
86298b7a47 Fix --role-file arg detection (#78475)
* Fix --role-file arg detection. Fixes #78204

* Do not traceback, give better error

* Add coverage for compound shortopts to match -r. Fixes #78491
2022-08-11 14:30:00 -05:00
740864869e ansible-config init fixes (#78453)
* ansible-config init fixes

  now handles --disabled correctly for 'vars' format
  also does not display internal config entries anymore

  fixes #78438

note plugins have _prefixed settings that are public, this should change
2022-08-11 15:20:59 -04:00
2729088f2a PlayIterator: deprecate cache_block_tasks and get_original_task (#78514) 2022-08-11 15:14:17 -04:00
cb0215bcdd adding .PHONY for 3 rules (#78510)
rules: docs, version, install_manpages
2022-08-11 15:11:32 -04:00
3add5e9321 Fix apt making changes in check mode (#78496)
* 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
2022-08-11 15:08:50 -04:00
c35a36083d ansible-console - Fix arg name to match base class. (#78502) 2022-08-11 10:56:39 -07:00
0d3523df8f docs: misc fixes in The Ansible Development Cycle (#78513) 2022-08-11 13:56:19 -04:00
2b63fdd1b8 ansible-test - Fix ansible-doc sanity test FQCN. (#78518) 2022-08-11 10:53:23 -07:00
9eb3d6811b find - Use getattr instead of __getattribute__ (#78503) 2022-08-11 09:51:35 -07:00
3a666a131f Remove unused code. (#78499) 2022-08-11 09:50:32 -07:00
2d2839b234 module_utils - Fix changing value while iterating. (#78501) 2022-08-11 09:32:08 -07:00
0a199a07ed remove old network link (#78495) 2022-08-11 15:39:02 +01:00
2fedde6356 ansible-test - Update distro test containers. (#78506) 2022-08-10 20:48:02 -07:00
8367af9cdd ansible-test - No locale warning with delegation. (#78505)
The locale warning for the origin host is not relevant when delegation is used.
It is also not relevant when non-test commands are in use.
2022-08-10 18:53:19 -07:00
47804fcdf5 ansible-test - Update coverage to 6.4.3. (#78504) 2022-08-10 17:05:12 -07:00
9ee183c4b9 Clean up unit tests. (#78498) 2022-08-10 14:41:52 -07:00
89862fda3b ansible-test - Sanity test code cleanup. (#78497) 2022-08-10 14:41:37 -07:00
3f1838bf91 Update attributes of files that are links without specifying link target (#76167)
* update attributes of files that are symlinks

* update attributes of files that are hard links

* fix default state in documentation

* remove unnecessary suppression

* add to changelog
2022-08-11 06:01:31 +10:00
69c7e3f4a3 update the documentation for the _collection init_ command (#78404) 2022-08-09 15:13:42 -04:00
98a5820da6 Python 3.9 Controller minimum (#78466) 2022-08-09 10:24:25 -04:00
82246df5b7 fix configuration name in porting guide 2.12 (#78472) 2022-08-09 10:22:47 -04:00
650befed37 Add missing space after keywords. (#78480)
Also remove unnecessary parenthesis.
2022-08-08 13:18:28 -07:00
04e8927579 apt: include apt preferences (e.g. pinning) when selecting packages (#78327)
Fixes #77969
2022-08-05 17:05:07 +02:00
85acf4d1e5 ansible-test - Avoid use of deprecated type hints. (#78456)
* ansible-test - Avoid use of deprecated type hints.

PEP 585 deprecated many container types in the `typing` module in favor of the actual types, which support subscripting as of Python 3.9.

Conversion of `t.Type` was skipped since PyCharm does not currently recognize it.

* ansible-test - Fix `t` and `c` imports/shadowing.
2022-08-04 22:29:38 -07:00
5bee66fc5d ansible-test - More type hint updates. (#78455)
* Simple regex replace of multi-line function arg annotations on the first line.

* Manually fix up ArgumentParser type annotations.

* Manual type hint conversions.

* Manual conversion of function type hints.

* Remove unnecessary type hints on for statements.
2022-08-04 15:51:11 -07:00
b993b5cd49 ansible-test - Convert more type hints. (#78449)
* Simple regex replace of multi-line function arg annotations.

* Simple regex replace of multi-line function arg annotations with default values.

* Simple regex replace of multi-line function arg return annotations.

* Simple regex replace of assignment annotations.
2022-08-04 12:15:46 -07:00
2218b63aef Fix typo: missing 'install'. (#78448) 2022-08-04 14:26:32 -04:00
02e98810a9 Re-organize CI test groups for POSIX tests. (#77420)
* `context/target` tests must be in groups 1 - 2.
* `context/controller` tests must be in groups 3 - 5.

This makes it easier to efficiently organize groups and balance test runtimes.
2022-08-04 09:31:14 -07:00
7e634f54c3 Module/plugin docs: (#78380) 2022-08-04 12:30:38 -04:00
d92f6da592 Update galaxy_server_list (#78398) 2022-08-04 12:29:19 -04:00
733a767948 Add basic docs on how to create a collection docsite with antsibull-docs. (#78387) 2022-08-04 12:28:48 -04:00
ddd8b8bfd9 Improve grammar (#78391) 2022-08-04 12:26:25 -04:00
f5cac6bc5d docs: Fix control node reference links (#78424) 2022-08-04 12:22:05 -04:00
51f94570a6 Fix default value documentation for pipelining. (#78441) 2022-08-04 12:19:24 -04:00
eb462edb16 add example to import a playbook from collection (#78443) 2022-08-04 12:17:57 -04:00
eb46ab1399 fix broken link (#78434) 2022-08-04 03:16:10 -07:00
0591efd5e6 remove Templar caching (#78419)
* source of templating bugs (and at least one CVE), only applies to single-var values anyway
2022-08-03 15:26:37 -07:00
3eb0485dd9 ansible-test - Use more native type hints. (#78435)
* ansible-test - Use more native type hints.

Simple search and replace to switch from comments to native type hints for return types of functions with no arguments.

* ansible-test - Use more native type hints.

Conversion of simple single-line function annotation type comments to native type hints.

* ansible-test - Use more native type hints.

Conversion of single-line function annotation type comments with default values to native type hints.

* ansible-test - Use more native type hints.

Manual conversion of type annotation comments for functions which have pylint directives.
2022-08-03 15:08:55 -07:00
f2abfc4b3d ansible-test - Parse content config only once. (#78418) 2022-08-02 22:20:21 -07:00
ad79c1e0d0 Add support for json in adhoc -a (#78114)
Co-authored-by: Sandra McCann <samccann@redhat.com>
2022-08-03 11:24:12 +10:00
d8fefba20e ansible-test - Update locale logic to match core. (#78389)
Now that core requires UTF-8 filesystem encoding, ansible-test does as well.

Additionally, the `en_US.UTF-8` or `C.UTF-8` encoding must be available.
Previously the `en_US.UTF-8` encoding was requested, but its availability was never verified.
The fallback to `C.UTF-8` maintains UTF-8 encoding while allowing more flexibility in the running environment.
2022-08-02 16:59:14 -07:00
27ce607a14 Ansible 6.2.0: porting_guide changes (#78408) 2022-08-02 14:32:26 -04:00
9af282debe Slip data tagging to 2.15 (#78414) 2022-08-02 12:31:15 -05:00
05608b20e8 Fix listing collections that are missing the metadata required by build (#76596)
* 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>
2022-08-02 11:46:47 -04:00
9b79d6ba35 config error origin (#78407) 2022-08-02 11:26:54 -04:00
a2174fc6d9 Fix removing existing dir/files with ansible-galaxy collection init --force (#78403)
* Remove collection contents when re-initializing with --force


Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2022-08-02 11:25:49 -04:00
ce6c9befb8 Do not allow handlers from dynamic includes to be notified (#78399)
* Do not allow handlers from dynamic includes to be notified
2022-08-02 11:21:21 -04:00
f6d2b18322 Correctly get the filename from a url in fetch_file. Fixes #29680 (#78383) 2022-08-02 11:03:31 -04:00
5979f215a6 [WIP] Ansible 7 Roadmap (#78125) 2022-08-01 14:39:16 -04:00
e4890afc4e Pause module, return actual echo value (#78378) 2022-07-29 09:11:20 -04:00
b0b58fa7c2 ansible-test - Update base and default containers. (#78377) 2022-07-28 16:50:28 -07:00
234938cd76 Change the language used in the unarchive test. (#78382)
The current language pack fails to install on Ubuntu 22.04.
However, since the langauge only needs to be non-English, changing it preserves the test functionality.
2022-07-28 14:52:33 -07:00
9bf5da8f75 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.
2022-07-28 12:27:51 -07:00
b6ec06ab25 add note about permission change (#78128) 2022-07-28 14:45:50 -04:00
85bc2bcfcd Update information on the Intro_patterns.rst (#78192) 2022-07-28 14:27:22 -04:00
cc5c706681 Update unit test controller requirements. (#78376) 2022-07-28 10:27:05 -07:00
f5c01a8b6e Remove unit test Python 2.6 compat. (#78369) 2022-07-28 10:14:30 -07:00
3ba6348e4d Galaxy metadata docs update (PR 78280) (#78374)
Co-authored-by: Root <edroot@s1068319.srn.sandia.gov>
Co-authored-by: Emmanuel Ugwu <32464178+ugwutotheeshoes@users.noreply.github.com>
2022-07-28 12:00:17 -04:00
cb9b20311c Update playbooks_variables.rst (#78359) 2022-07-28 10:09:05 -04:00
27b4b74e52 Fix typo and style (#78365) 2022-07-28 10:05:05 -04:00
b86a18bd27 Remove unit test pytz requirement. (#78368) 2022-07-27 19:28:19 -07:00
1368bfa348 PluginLoader now installs module-to-be-imported in sys.modules before exec (as Python import does). (#78364) 2022-07-27 14:55:50 -07:00
0ef1376966 Make distro.id() report newer versions of OpenSuSE (at least >=15) also report as opensuse (#76121)
* Report OpenSuSE >= 15 as opensuse

Make distro.id() report newer versions of OpenSuSE (at least >=15) also report
as opensuse. They report themselves as opensuse-leap.

* Add a test
2022-07-28 06:21:18 +10:00
eba15885cf update Fest url per marketing (#78361) 2022-07-27 13:40:58 -04:00
0f688f07af update the out-of-date ansible-test sanity ignores (#78342) 2022-07-27 09:33:35 -07:00
a3c90dd0bc ansible-test - Fix TTY and output handling. (#78350) 2022-07-26 11:43:48 -07:00
e4087baa83 Add missing colon to a snippet in complex data doc (#78349) 2022-07-26 17:19:15 +02:00
c135a47f44 chmod aix errors with 255 is not unreachable (#78249)
* chmod aix errors with 255 is not unreachable

  fixes #78210

* added another 'aix chmod msg'
check stderr also
2022-07-26 11:13:56 -04:00
5728d72cda Fix KeyError for ansible-galaxy when caching paginated responses from v3 (#78325)
* 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>
2022-07-22 07:18:07 +10:00
1429672213 Add pep440 version_type for version test (#78308) 2022-07-21 15:56:14 -05:00
9d4ced1237 wait_for - Read file and perform comparisons using bytes to avoid decode errors (#78317)
* 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
2022-07-21 15:03:52 -05:00
0012263c7a ansible-test - Fix handling of args after -- (#78328) 2022-07-21 13:00:36 -07:00
399e34ddd6 Add cli docs for interacting with gpg for collection signing (#78321) 2022-07-21 13:47:23 -04:00
fd810e88d6 Fix minor typos (#78294)
Signed-off-by: Hu Shuai <hus.fnst@fujitsu.com>
2022-07-21 13:42:42 -04:00
b0a84cc9ca dnf: clarify comparison operators in docs (#78316)
Fixes #78295
2022-07-21 13:39:17 -04:00
7aada8d499 Docs: Issue 78082 Create playbook guide (#78262) 2022-07-21 11:38:17 -04:00
61af59c808 ansible-test - Update distro containers to 4.4.0. (#78322) 2022-07-20 15:38:07 -07:00
4cd3425dfe ansible-test - Update coverage to 6.4.2 (#78320) 2022-07-20 11:12:12 -07:00
b56b38b3ba Use classproperty to access field attributes of a class (#78180)
* Use classproperty to access field attributes of a class, consolidate into one class
2022-07-20 12:21:20 -04:00
884244f1b2 Python 3.9 min for controller (#77566) 2022-07-20 10:52:32 -05:00
90ef914f77 ansible-test - Drop Python 3.8 controller support. (#78237) 2022-07-19 21:32:23 -07:00
681c32ec65 Fix fetch integration test on macOS. (#78314)
The test can now run split.
2022-07-19 17:43:38 -07:00
61ea6c4a5b Fix expect integration test. (#78315)
The test can now run split on macOS.
2022-07-19 17:27:37 -07:00
27d39be580 Fix become integration test. (#78313)
* Don't set become_flags in become integration test.

Setting the flags in the test overrides the default value in the become plugins, which was not intentional.

* Remove hack for broken implicit tilde support.

It was only broken because the tests were overriding the default become flags for sudo.

* Simplify assertions.
2022-07-19 14:59:36 -07:00
619a1fa7e2 Drop custom repo from libuser install @ Alpine CI (#78305)
`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.

Co-Authored-By: Matt Clay <matt@mystile.com>
2022-07-19 23:18:32 +02:00
de2163b160 Overhaul become integration tests. (#78312) 2022-07-19 14:12:33 -07:00
f3f4ad9332 ansible-test - Use sudo for all remotes. (#78310) 2022-07-19 13:38:34 -07:00
8565deaae3 ansible-test - Install acl on Alpine remotes. (#78303) 2022-07-19 12:39:03 -07:00
8bb20fe06b ansible-test - Enable ACL support on more remotes. (#78299) 2022-07-19 11:49:32 -07:00
9b42f9befe Revert "Re-enable strategy units (#78293)" (#78300)
This reverts commit c6c9d90ca4.
2022-07-19 13:23:58 -05:00
c6c9d90ca4 Re-enable strategy units (#78293) 2022-07-19 17:18:22 +02:00
5e74693215 add AnsibleFest 2022 registration banner (#78291) 2022-07-19 14:41:21 +01:00
691dde645c Update cheetsheet to fix meaning of -k (#78271) 2022-07-18 15:12:48 -04:00
ee4588abca Split integration test fixes. (#78281)
* Add setup_test_user integration target.

This integration target creates a temporary test user and removes
it when the current integration target finishes. This user is
configured with a password so it can be used with become, even
when the current user is unprivileged.

* Fix slurp integration test.

* Fix unarchive integration test.

* Fix module_utils integration test.
2022-07-18 10:19:25 -07:00
b63812bc08 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.
2022-07-15 16:12:39 -07:00
358a8ad7af Updated release_and_maintenance.rst (#78272) 2022-07-15 11:02:30 -04:00
d070b03ad8 Fix templating nested vars with convert_data=False (#78273)
Regression introduced in #78259.
2022-07-15 15:57:34 +02:00
9afdb7fec1 template module/lookup: fix convert_data for macros (#78259)
Fixes #78141
2022-07-14 12:14:25 -07:00
de810d5799 Deprecate use of Python crypt (#78257) 2022-07-14 12:12:23 -07:00
bc3686c784 Adding some troubleshooting detail for Kerberos connections (#78197) 2022-07-14 13:11:18 -04:00
fedd386998 Add note about package managers (#78260) 2022-07-14 13:10:24 -04:00
0590ce065c example showing how to deal with keys w/o apt_key (#78206) 2022-07-13 16:47:43 -04:00
221af7640d stat only returns pw_name/gr_name if those can be looked up (#78183) 2022-07-13 16:47:14 -04:00
c9a341902b Document choice to use Ansible Project in copyright lines (#78164)
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2022-07-13 16:46:04 -04:00
6ddccc1604 Adding applicable licensing requirements (#78162) 2022-07-13 16:45:19 -04:00
d635b871d1 Cleanup write_file method in uri (#76412) 2022-07-13 15:32:18 -05:00
048adac5b7 Migrate vmware.vmware_rest Dev Guide to collection (#78255) 2022-07-13 16:19:52 -04:00
b2cde3a896 Add default value for lvm_facts when lvm or lvm2 is not installed or … (#75989)
* Add default value for lvm_facts when lvm or lvm2 is not installed or there are no lvm facts
2022-07-13 12:30:13 -07:00
d58e69c82d Add support for gzip decoding responses (#41925) 2022-07-13 11:06:52 -05:00
a6e671db25 Fix AIX processor facts and add unit test (#78223)
- `processor_count` was erroneously set to the number of cores
- `processor_cores` was erroneously set to the number of threads per core
- `processor_vcpus` and `processor_threads_per_core` were not set
- `processor` was a string, while it's supposed to be a list

Before:

```
"ansible_processor": "PowerPC_POWER7",
"ansible_processor_cores": 4,
"ansible_processor_count": 12,
```

After:

```
"ansible_processor": [
    "PowerPC_POWER7"
],
"ansible_processor_cores": 12,
"ansible_processor_count": 1,
"ansible_processor_threads_per_core": 4,
"ansible_processor_vcpus": 48,
```

Also add a unit test.

Co-authored-by: Baptiste Jonglez <git@bitsofnetworks.org>
2022-07-13 14:49:36 +02:00
1f59bbf4f3 listify_lookup_plugin_terms deprecate dataloader (#78244)
* listify_lookup_plugin_terms deprecate dataloader

  deprecated useless dataloader pass to function
  also removed from callers in core


Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2022-07-12 16:10:32 -04:00
3658c26ad4 Ansible 6.1.0: Updated porting_guide_6.rst (#78245) 2022-07-12 14:59:10 -04:00
b85bcd7abf Fix module_utils_common.respawn test. (#78248)
The respawn failure can be returned on either stdout or stderr.
2022-07-12 10:04:15 -07:00
be88250a83 Update python_3_support.rst (#78239)
Fix invalid characters warning when using example group names. (Replace dashes in example group name with underscores.)
2022-07-12 17:42:09 +02:00
fff14d7c1d Decode vaulted args before sending over ansible-connection. (#78236)
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.
2022-07-12 17:40:47 +02:00
2e4b0fefbf Added Kylin Linux Advanced Server Support (#78232) 2022-07-12 17:24:51 +02:00
75de4a37bc validate-modules - allow raw module return type (#78231) 2022-07-12 17:23:22 +02:00
2bc2153c01 yum: fix releasever for latest (#78066)
Fixes #78058
2022-07-12 12:38:47 +02:00
630616103e dnf: fix output parsing on non-English LANGUAGE systems (#78233)
Fixes #78193
2022-07-12 09:10:25 +02:00
b1dd2af4ca Preflight utf8 encodings check (#78175) 2022-07-11 09:22:27 -05:00
9950a86f73 Remove unnecessary special case in Role.load_data (#78181)
ci_complete
2022-07-11 09:19:41 +02:00
d26801e994 Fix wording for :ref|term: substitution (#78216)
* 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
2022-07-07 12:25:52 -07:00
f6419a53f6 Ensure atomic writes for cache file (#78208)
* Ensure atomic writes for cache file

 helps avoid errors in highly concurrent environments
2022-07-07 13:50:49 -04:00
e10851d495 documentation: become plugins: correct pluralization in description (#78196)
fixes #78195
2022-07-05 11:19:39 -04:00
7ec8916097 fix ternary problem (#78186) 2022-07-01 11:06:47 -04:00
489b7f1859 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.
2022-07-01 09:33:36 -04:00
a77fc2e822 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.
2022-07-01 01:49:00 -07:00
b56d73796e Clarify that sbin directories are always looked at in get_bin_path (#78171) 2022-06-30 18:24:42 -04:00
1a417e52d6 use 'command -v' instead of 'which' in Makefile (#78170)
'which' is not standardized and can even be considered problematic [1]

[1] https://lwn.net/Articles/874049/
2022-06-30 12:08:16 -07:00
17d52c8d64 Move undefined check from concat to finalize (#78165)
* Move undefined check from concat to finalize

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

* Fix sanity

* ...

* sigh
2022-06-30 12:05:39 -07:00
953a86f5a6 doc: filter: unvault: fix example (#78161)
no filter named to_string
2022-06-30 12:02:28 -07:00
84105e39f4 Update vault.rst (#78140) 2022-06-30 13:55:29 -04:00
7ec84c511f elaborate on import/include conditional example (#78138) 2022-06-30 13:51:50 -04:00
1562672bd1 Make unit test for missing git executable more generic (#78173)
* Make unit test for missing git executable more generic

* use MagicMock side_effect to raise exception instead
2022-06-30 13:19:44 -04:00
6bcb494f83 [dnf] Fix skip_broken, add test coverage (v2) (#78158)
* [dnf] Fix skip_broken, add test coverage

Change:
- skip_broken was set in config but not actually used in calls to
  base.install()
- added a lot of test cases with specialized repo
- got rid of external (docker repo) nobest test cases since the
  specialized repo works well for those too
- Slight cleanup and adding comments in dnf module

Test Plan:
- ci_complete

Tickets:
- Fixes #73072

Original-author: Rick Elrod <rick@elrod.me>

* Use a better test for checking results list

ci_complete

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

Co-authored-by: Rick Elrod <rick@elrod.me>
2022-06-30 12:16:00 -04:00
f70cc2fb7e Refactor ansible-test integration tests. (#78168)
* 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.
2022-06-29 17:34:32 -07:00
bcdc2e167a Support for Python 3.11+ tomllib for inventory (#77435) 2022-06-29 11:12:47 -05:00
5797d06aec Use customized setraw to prevent output issues (#78060) 2022-06-29 10:50:33 -05:00
43153c5831 FieldAttributes as descriptors (#73908) 2022-06-29 14:39:23 +02:00
4c9385dab7 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
2022-06-28 11:25:45 -04:00
58b42abede Update README.md (#78139)
Update Python version requirement to >= 3.8.
2022-06-28 11:03:29 -04:00
a1444f390d Docs: Issue 78082 separate tips and tricks in user guide (3/3) (#78103) 2022-06-28 10:07:29 -04:00
4bd7e50612 fixed hyperlinks to galaxy.ansible for issue #78104 (#78152) 2022-06-27 15:46:44 -04:00
4594c0c609 Fix HTTP tests on FreeBSD when running split. 2022-06-24 16:55:12 -07:00
b9d13d222c ansible-test - Improve pip bootstrap download. 2022-06-24 11:36:11 -07:00
fa35aa4865 Galaxy server config updates (#77106)
* ansible-galaxy configurable timeouts

  - also fixed issues with precedence,
    so --ignore-certs now overrides config
  - made galaxy_timeout generic setting,
    if set, it becomes default for server configs,
    but now specific servers can override
  - updated tests or added notes (some tests ignore/override precedence)

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2022-06-24 13:26:31 -04:00
e481b35e23 Delete core-ci query param from ansible-test (#78136)
Ref: https://github.com/ansible/ansible-core-ci/pull/343
2022-06-23 22:54:27 +02:00
4cfa0b07fc issue #78082 create win user guide (#78099) 2022-06-23 16:31:49 -04:00
08327c698c issue #78082 add concepts to start (#78097) 2022-06-23 16:28:02 -04:00
59f3f1b625 issue #78076 fix diagram (#78077) 2022-06-23 14:30:41 -04:00
3e3f8cb004 Update list for gather_subset (#78133) 2022-06-23 14:25:23 -04:00
ca04dc28a2 ansible-test - Remove deprecated test platforms. 2022-06-23 10:14:38 -07:00
70543402c7 update intersphinx links for Ansible 6 (#78121) 2022-06-23 10:05:10 -04:00
08b438c4ba Updated the document 'src' in URI (#78105) 2022-06-22 13:52:53 -04:00
e8a77626a3 update conf.py for Ansible 6 release (#78049) 2022-06-21 13:58:46 -04:00
34f8168afc ansible-console fixes (#78064)
* list collection task actions too
* dynamically add execute/help functions when module is found
* handle redirection and short names
2022-06-21 13:50:23 -04:00
a9ce358f98 update release page to reflect Ansible 6 release (#78047)
Co-authored-by: Iheanacho Amarachi Sharon  <58210919+Iheanacho-ai@users.noreply.github.com>
2022-06-21 13:39:22 -04:00
1b63e7d3fa docs: Update porting guide for Ansible 6.0.0 (#78101) 2022-06-21 13:34:52 -04:00
cea18bf60a password lookup argument parsing fix (#78080)
fixes #78079
2022-06-21 11:11:02 -04:00
cf9fd2d7da ansible-test - Use shlex.join where appropriate. 2022-06-17 23:01:25 -07:00
24d91f552c ansible-test - Add support for more remotes. 2022-06-17 18:56:06 -07:00
5666c6d6a3 ansible-test - More flexible become support. 2022-06-17 17:37:42 -07:00
717f178870 Add tutorial links to the docs #78073 (#78084) 2022-06-17 14:20:07 -04:00
ea351f0ae2 user - Use -n instead of -N for luseradd on all distros (#75042)
* Use -n instead of -N for luseradd on all distros

Co-authored-by: Chris James <git@etcet.net>
2022-06-17 13:16:42 -04:00
44b5314174 fix missing single quotes in sample code (#78056) 2022-06-17 09:12:53 +05:30
c321e3baad update documentation of 'unarchive' (#77643) 2022-06-16 14:34:04 -04:00
5b90601ca4 Document debconf interaction with dpkg-reconfigure (#74196)
Signed-off-by: David Greaves <david@dgreaves.com>
2022-06-16 13:47:56 -04:00
66c0882314 reword the regex note (#75393)
Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
2022-06-16 13:33:09 -04:00
3cd2c494bd issue #72449 winrm script rm (#77931) 2022-06-16 13:30:31 -04:00
681dc6eab9 Windows - incorrect python-devel package in WinRM docs (#78037)
Co-authored-by: Emanuele Barbato <manu@Giuseppes-MacBook-Air.local>
2022-06-16 13:29:03 -04:00
3a5a61b783 hide distro map since it is not configurable (#78068)
make it a private setting for internal use and avoid
 user confusion by not displaying it with normal configuration options
2022-06-16 13:03:52 -04:00
18992b7947 Add new loop_control.extended_allitems option (#75760)
* Add new `loop_control.extended_allitems` option. Fixes #75216

* Add test for extended_allitems

* docs code block fix
2022-06-16 08:56:13 -05:00
a90f666ab3 Use ctypes to access shadow, instead of spwd which is deprecated (#78050)
* Use ctypes to access shadow, instead of spwd which is deprecated

* Remove sanity ignore

* cast to str to satisfy mypy

* Add typing.cast polyfill

* Appease mypy redefine

* Add clog frag
2022-06-16 08:55:52 -05:00
d81a519f25 Remove .travis.yml files from galaxy init skeletons (#75740)
* Remove .travis.yml files from galaxy init skeletons

These files have existed for many years but in light of the recent
circumstances around Travis, we should not include them by default in
the galaxy init skeletons.

* Add breaking_changes changelog fragment with recommendation to use a custom skeleton if the .travis.yml file is still needed.

Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
2022-06-15 13:23:24 -04:00
46d86a882d Docsite: update links to community docs (#78043) 2022-06-15 10:14:41 -04:00
f4ad1c771e Create reusable role layout snippet for documentation (#78057)
* reuse role structure
* reuse role snippet in role docs
2022-06-15 06:08:27 -07:00
30a923fb5c Fix 'Permission denied' in user module while generating SSH keys (#78040)
* 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>
2022-06-14 11:19:23 -04:00
95df5cb740 Fix invalid-ansiblemodule-schema sanity errors.
The validate-modules sanity test expects a list not a dict_keys iterable.
2022-06-13 14:58:40 -07:00
561cf1956d Docsite: Updated style guide resources (#78048) 2022-06-13 15:06:08 -04:00
3fa377387e shell plugins give out user friendly type error (#77983)
shell plugins give out user friendly type error
# TODO: this should really have been taken care of via config or fieldattribute validation
2022-06-10 12:55:43 -04:00
1321d6ecd5 Update AZP test container to 3.0.0.
ci_coverage
ci_complete
2022-06-09 14:57:15 -07:00
614dc10ef0 With antsibull-changelog >= 0.14.0 and the sidecar docs feature, test and filter plugins are detected if they have version_added (#77871)
Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
2022-06-09 14:18:48 -04:00
556ac89664 Rephrase-community (#77985) 2022-06-09 14:08:05 -04:00
fa840d4c7c mention different results for password_hash depending on library used (#76863) (#77963) 2022-06-09 10:53:04 -04:00
85329beb90 update backport instructions to reflect stable-2.13 (#77958)
Co-authored-by: Divine Odazie <dodazie@gmail.com>
2022-06-09 10:49:44 -04:00
04c7abcbfe corrected version_added for new config option (#78013)
new option, not subs should have version, also it's 2.14
2022-06-09 09:12:27 -04:00
2f0530396b ansible-test - Clean up type hints and comments. 2022-06-08 23:31:58 -07:00
05fc96c927 facts: Add uptime fact for NetBSD (#75431)
* facts: Add uptime fact for NetBSD

This is copied from the current OpenBSD facts code.

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

* Added changelog fragment

Co-authored-by: Baptiste Jonglez <git@bitsofnetworks.org>
Co-authored-by: Jordan Borean <jborean93@gmail.com>
2022-06-09 06:45:39 +10:00
1b1c2c79cf Add configurable option for paramiko banner_ssh timeout (#68184)
* Add configurable option for paramiko banner_ssh timeout

This PR adds a configurable option for paramiko connection
to control the value of banner timeout in paramiko library.
The banner timeout value can be set in ansible.cfg file as
The default value of banner timeout is set to 30 seconds in
paramiko connection plugin.
```
[paramiko_connection]
banner_timeout = 30
```
or using enviornment variable
```
export ANSIBLE_PARAMIKO_BANNER_TIMEOUT=30
```

* Fix CI failure

* Fix review comments

* Fix review comment
2022-06-09 06:01:34 +10:00
570379ef98 Do not crash callbacks if exception is not a string. (#77781) 2022-06-09 05:58:55 +10:00
5f5c4ef2ef Remove incidental_inventory_foreman test. 2022-06-08 12:08:54 -07:00
a4e4413cde ansible-test - Update distro containers to 4.3.0.
The primary change in this update is removal of `/etc/ansible/hosts` from the containers.
2022-06-08 12:08:34 -07:00
5b3557f8ba ansible-test - Allow docstring in docs-only module 2022-06-08 10:41:01 -07:00
6e78425f8d fix pip module resolution (#78000)
* `importlib.util` appears to be lazily imported and is sometimes unavailable as an attribute of `importlib` without an explicit import
2022-06-08 09:56:17 -07:00
db335498d0 ansible-galaxy - ensure variable is defined for any error when getting the ansible-core distribution (#77993) 2022-06-08 12:05:17 -04:00
c2b36ba04d ansible-test - Update base and default containers. 2022-06-07 15:26:57 -07:00
23914d3f0b ansible-test - Adjust unit test mock usage. (#77961) 2022-06-07 14:42:31 -07:00
5a0b230e24 Make fuzzy plugin matching deterministic. 2022-06-07 14:38:25 -07:00
e059dde9fb Add missing inventory cache test (#77990)
Fix intentional coverage to replace incidental_inventory_foreman

ci_complete
ci_coverage
2022-06-07 17:12:04 -04:00
9d6cc7b576 unarchive - fall back to unzip -Z if zipinfo is not available (#76971)
Add a new handler class ZipZArchive to use unzip -Z as an alternative to zipinfo

Run 'unzip -Z' in can_handle_archive so we fall back to the next handler if it's not available (failing in is_unarchived is too late)

* Add a test for unzip -Z when zipinfo is not available

* Update test for missing binary altogether by removing /usr/bin from the PATH
2022-06-07 16:05:07 -04:00
a43112290a fix ansible-galaxy-collection test with revoked key (#77989)
* Remove unnecessary gpg passphrase
2022-06-07 15:39:33 -04:00
ca9be6e27e Fix docs links for the steering committee (#77974) 2022-06-07 15:04:11 -04:00
a30500144e docs: Update porting guide for ansible 6.0.0rc1 (#77991) 2022-06-07 14:37:27 -04:00
e89176caac Pin PyYAML version compatible with Python 3.8+ (#77936)
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2022-06-07 12:26:56 -04:00
f9d4c26143 docs: Update porting guide for ansible 5.9.0 (#77982) 2022-06-07 12:01:40 -04:00
5e369604e1 Forked display via queue (#77056)
* Forked Display via queue

* Docs and simple code cleanup

* Only proxy Display.display

* Remove unused import

* comment

* Update deadlock comment, remove py3 check

* Don't flush display, and don't lock from forks

* clog frag

* ci_complete ci_coverage

* Add units for queue proxying

* Cleanup flush

* ci_complete

* Only lock the write, switch to RLock

* Remove unused import
2022-06-07 08:31:56 -07:00
0fae2383da Add macOS fork issue to FAQ (#77965)
* Add macOS fork issue to FAQ

* Remove colon from error msg
2022-06-07 11:07:59 -04:00
143e7fb45e ansible-galaxy - support resolvelib versions >= 0.5.3, < 0.9.0 (#77649)
* 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
2022-06-07 09:49:43 -04:00
df765c0ecf ansible-test - Update Alpine, openSUSE containers 2022-06-06 19:55:49 -07:00
fe2d8b7066 Skip libuser tests on openSUSE 15.4+
The libuser package is not available.
2022-06-06 16:29:41 -07:00
e31e918e04 Don't install lgroupadd for SUSE tests.
It's not used by the tests and is not available as of openSUSE 15.4.
2022-06-06 15:48:40 -07:00
89c6547892 preserve add_host/group_by on refresh (#77944)
* preserve add_host/group_by on meta: refresh_inventory

Co-authored-by: Jordan Borean <jborean93@gmail.com>
2022-06-06 18:08:43 -04:00
52c8613a04 ansible-test - Skip mypy runs under Python 3.11. 2022-06-06 14:03:33 -07:00
11b6032e73 ansible-test - Ignore vendored code in mypy test. 2022-06-06 13:32:49 -07:00
6c6a7851ed Add inventory cache integration tests (#77895)
* Add intentional coverage for incidental_inventory_foreman coverage cache tests

ci_complete
ci_coverage
2022-06-06 16:03:13 -04:00
5391150b30 Integration tests for invalid group name. 2022-06-06 12:16:47 -07:00
0ff1ba3e12 Move AWS guidelines to collection (#77959) 2022-06-06 14:00:39 -04:00
1706d35fc4 ansible-galaxy-collection - use --pinentry-mode loopback for gpg key revocation (#77967) 2022-06-03 16:50:29 -04:00
39b3581316 Deprecate non lists lookups (#77875) 2022-06-03 12:42:54 +02:00
a01815f3ce added note to omit -t all (#77956) 2022-06-03 05:19:45 +10:00
c908d782fb get_url - permit to have a checksum only file (#77948)
checksum can also accept a checksum only file (no filename beside the checksum).
fixes #54390

Co-authored-by: Baptiste Mille-Mathias <baptiste.millemathias@gmail.com>
2022-06-03 05:19:02 +10:00
e589eba506 Docs: change community collection inclusion process (#77905) 2022-06-02 12:25:08 -04:00
16e0d4a121 fix: update button text to "Load token" (#77925) 2022-06-02 12:23:34 -04:00
15750aec52 ssh retry docs addition (#77930) 2022-06-02 12:21:40 -04:00
f270b4e224 Fix items2dict errors for incorrect list item type and missing keys (#77946)
* Fix items2dict errors for incorrect list item type and missing keys

* keep dict comprehension
2022-06-02 10:49:29 -04:00
89e4fb71e6 Issue #77681 revamp getting started guide (#77897) 2022-06-02 10:28:11 -04:00
058a69e6b0 Properly send a skipped message for empty templated loop (#77945)
Fixes #77934
2022-06-02 10:18:45 -04:00
81351022d8 ansible-test - Prefer unittest.mock for core. 2022-06-01 16:48:00 -07:00
f933314101 ansible-test - Fix shell target options handling. 2022-06-01 12:49:51 -07:00
86779cc903 ansible-test - Code cleanup.
This helps prepare for a future pylint upgrade.
2022-06-01 11:45:41 -07:00
b69eb28ed2 Migrate community.vmware Dev Guide to collection (#77723) 2022-06-01 12:23:10 -04:00
9767cda507 Make ignore_unreachable to count ignored counter
Fixes #77690
2022-06-01 16:10:59 +02:00
e6075109d0 Remove incidental_inventory_aws_ec2 and supporting plugins (#77877)
* Remove aws/2.7 and aws/3.6 from incidental test matrix entries

* Remove aws.sh symlink
2022-05-31 14:30:17 -04:00
bd849b3076 Fix ansible-runner integration tests. 2022-05-31 10:53:11 -07:00
f3c684564c Remove platform dev guides from core docs (#77915) 2022-05-31 13:35:16 -04:00
33beeace10 Fix lusermod using a group name and not id (#61965) (#77914)
* Fix lusermod using a group name and not id (#61965)
2022-05-31 13:07:06 -04:00
9f7956ba30 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.
2022-05-27 12:52:23 -04:00
7c89562580 docs: update porting guide for ansible 6.0.0b1 (#77913) 2022-05-27 11:12:17 -04:00
e259317c3e Remove incidental_inventory_docker_swarm tests. (#77924)
ci_complete
ci_coverage
2022-05-26 17:55:19 -07:00
1214b63f4f Fix 'ansible-config dump --only-changed -t all' verbosity (#77898)
* Fix 'ansible-config dump --only-changed -t all' to only display headers if plugin options are changed

* changelog

* add a test
2022-05-26 12:03:29 -07:00
43d650f924 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>
2022-05-26 11:44:27 -07:00
dbbeea0686 more context on multiple facts modules (#77896) 2022-05-26 14:11:04 -04:00
45d930e9c1 Point to Kerberos as a safer winrm setup method (#77794) 2022-05-26 14:10:26 -04:00
74469bf54a [docs]Mention that global variables are not mapped to hostvars (#77783) 2022-05-26 14:06:25 -04:00
a99623bce1 add anchors for crossreferencing (#77800) 2022-05-26 13:55:34 -04:00
711b51fad6 Remove double spaces in errormessage (#77839) 2022-05-26 13:55:02 -04:00
9010f0fbe3 doc: Clarify stride/increment in inventory intro (#77893) 2022-05-26 13:40:50 -04:00
a2eb472fb6 Remove statement about dependencies and includes. Fixes #75055 (#77912) 2022-05-26 13:38:32 -04:00
289cba333b ansible-test - More multi-arch containers. 2022-05-25 14:55:17 -07:00
74eb8b779d Blockinfile multiline search (#75090) 2022-05-25 15:39:12 -05:00
813afcbbb4 swallow all exceptions in type annotation support shim imports (#77860)
* swallow all exceptions in type annotation support shim imports

* add changelog
2022-05-25 14:41:06 -05:00
e7e1d592a6 Incidental coverage 1 (#77846)
* Add find test to assert patterns with regex

* Add test to assert that nested includes with relative path work

* Add test to assert symmetric_difference supports unhashable types

* ci_complete ci_coverage

* Add test to assert JSON values are converted to Python

* Add test to assert how unexpected module failures behave

* Add test to verify remote_is_local

* ci_complete ci_coverage

* Get real path of local tmp

* ci_complete ci_coverage

* Expanded symmetric_difference tests

* ci_complete ci_coverage

* I don't even know

* ci_complete ci_coverage

* Revert mathstuff changes

* ci_complete ci_coverage
2022-05-25 13:57:31 -05:00
f7d7604454 Add uri, urn and url test plugins (#77423)
and docs!

Co-authored-by: Tabah Baridule <dulemartins07@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-05-25 10:33:49 -04:00
e4c0bbf885 apt: fix virtual package install version detection (#76781)
* 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
2022-05-25 10:26:02 -04:00
6fbc8bd2bc Fix boolean condition so that ansible-galaxy collection install works when a valid resolvelib is installed. (#77906) 2022-05-25 08:37:51 -04:00
82f3a57bee 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>
2022-05-24 15:35:55 -04:00
621e782ed0 Add toggle to fix module_defaults with module-as-redirected-action on a per-module basis (#77265)
* 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
2022-05-24 13:38:46 -04:00
eecbaee7f4 Fix windows connection options (#77844)
* 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
2022-05-24 09:11:35 -04:00
2595b42aca Prefer unittest.mock over mock. (#77886) 2022-05-23 12:00:10 -07:00
3a9a23fb1a Use unittest.mock instead of mock. (#77883)
This can only be done for controller tests.
2022-05-23 11:04:56 -07:00
1eb7f71f0e Replace incidental_inventory_aws_ec2 with intentional coverage (#77743)
* Add intentional test coverage for lib/ansible/plugins/inventory/__init__.py

* Add intentional (integration) test coverage for lib/ansible/module_utils/common/network.py

* Add ansible_release info test from https://github.com/ansible/ansible/pull/74673

ci_complete
ci_coverage

Co-authored-by: Rick Elrod <rick@elrod.me>
2022-05-23 09:40:16 -04:00
0f882d010f Supply 'dev' keyword for linux network facts discovery (#77793)
This avoids incorrect results when the device name conflicts with
another 'ip' keyword. For example, if the device name is 'primary'.

Closes #77792
2022-05-23 08:58:31 +02:00
400475acc0 validate meta/main.yml dependencies and meta/requirements.yml are both lists before concatenating them together (#77821) 2022-05-19 12:04:30 -07:00
e85e8ee00a set theory filter docs (#77801)
Co-authored-by: flowerysong <junk+github@flowerysong.com>
2022-05-19 14:42:15 -04:00
c83419627a apt_repository add falalback to deprecated apt-key usage (#77340)
New path uses gpg directly and the stated directories and keystores to use by debian docs

Co-authored-by: Matt Clay <matt@mystile.com>
2022-05-19 10:21:47 -04:00
a985021286 Switch CI from FreeBSD 13.0 to 13.1. (#77852) 2022-05-18 22:51:20 -07:00
13d03c3c22 ansible-test - Add RHEL 9 / FreeBSD 13.1 remotes. (#77851) 2022-05-18 18:24:18 -07:00
3d2c2e60aa ansible-test - Update distro containers. (#77847)
* ansible-test - Add a Ubuntu 22.04 container.
* ansible-test - Add a Fedora 36 container.
* ansible-test - Update distro containers.
* Fix dnf test on Fedora 36.
* Work around scp test issues.
2022-05-18 14:59:01 -07:00
ef3ea4cdc3 Incidental docker chip away (#77830)
* Add new templating target, test splitter

* Add test for host:port parsing in parse_address via add_host

* Test already notified listening handler

* Add test for gathering bridge network facts

* Add veth to bridge

* ci_complete ci_coverage
2022-05-18 14:34:49 -05:00
76ead1e768 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
2022-05-18 12:19:07 -07:00
a415697d70 Allow result sha to be overriden with local sha (#77832) 2022-05-18 13:19:11 -05:00
66e92a3aff docs: Update porting guide for ansible 6.0.0a3 (#77842) 2022-05-18 14:03:44 -04:00
059204b871 docs: Update porting guide for ansible 5.8.0 (#77843) 2022-05-18 14:03:00 -04:00
185340e667 ansible-test - Update default containers.
These containers include Python 3.11 sanity test environments.
2022-05-18 01:28:26 -07:00
dfde4be444 Add Python 3.11 support.
ci_complete
ci_coverage
2022-05-17 23:52:47 -07:00
8ca28acd0d Fix unit tests for Python 3.11. 2022-05-17 23:32:35 -07:00
5f74350fd5 Avoid deprecated method in unit tests. 2022-05-17 23:02:13 -07:00
9600e3064a ansible-test - Improve requirements handling. (#77825)
The requirements for virtualenv and coverage are now kept in a requirements file for easier container builds.

The test-constraints sanity test has been updated to make sure the requirements file is kept up-to-date.
2022-05-17 11:11:58 -07:00
fecc78b5fb remove extra validate-modules ignore entry (#77826) 2022-05-17 13:45:47 -04:00
201aba3d0f Update PSF-license.txt to version from CPython 3.9.5. (#77805) 2022-05-17 11:46:36 -05:00
4706091a38 rename systemd module to services only (#77644)
* rename systemd module to services only

 disambiguates what it handles since systemd is now much more
 that a service manager, but the module is specific to services
2022-05-17 12:32:11 -04:00
c9ce7d08a2 template/__init__.py - fix KeyError when wantlist=False with non-list 2022-05-17 18:24:53 +02:00
5e50284693 Restrict role loading .. to role ... (#77683)
* Ansible will now error out if you try to use the `*_from` to load files from outside the role being loaded by `{import,include}_role`
2022-05-17 11:41:47 -04:00
290fb5e0ca ansible-test - Upgrade to coverage 6.3.3. (#77817) 2022-05-17 08:31:50 -07:00
e9af6efee6 Raise a proper error when include/import_role is used as a handler (#77807) 2022-05-17 17:25:18 +02:00
f6ac2b4f93 Update config dumping info to include 'all info' (#77802) 2022-05-17 17:19:56 +02:00
1e3cf9f732 ansible-test - Make distro containers multi-arch. (#77814) 2022-05-16 18:21:08 -07:00
cb448097e4 Minor typo fix (#77804) 2022-05-16 17:54:43 +05:30
0d6aa2e87e More information on doc parsing errors (#77685)
* More information on doc parsing errors

  fixes #77675
2022-05-13 12:18:31 -04:00
f5642cea28 update version switcher to include 2.13 (#77786) 2022-05-13 05:01:19 -07:00
f75bb09a8b Update url to quickstart video. (#77779) 2022-05-12 10:34:45 -04:00
654fff05e6 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>
2022-05-12 01:25:14 -07:00
524d30b8b0 distribution: add distribution_minor_version for Debian Distro (#74721)
* Added a fact about minor version details for Debian Distro

Fixes: #74481

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2022-05-11 17:21:47 -04:00
6230244537 core-2.13 - update release table (#77780) 2022-05-11 16:52:31 -04:00
46d2c9a988 document some 'dir' based filters (#77687)
Co-authored-by: flowerysong <junk+github@flowerysong.com>
Co-authored-by: Emmanuel Ugwu <32464178+ugwutotheeshoes@users.noreply.github.com>
2022-05-11 14:51:11 -04:00
449d82a521 ansible-test - Add RHEL 8.6 support. 2022-05-11 11:19:45 -07:00
8e91403412 revamp basic concepts docs (#77748) 2022-05-11 14:12:25 -04:00
836683a082 Stop making core docs build talk of (ansible-)'base' when meaning (ansible-)'core'. (#77728) 2022-05-11 14:04:43 -04:00
235f2598b1 docs: Update ansible-core release date in Ansible roadmap (#77775) 2022-05-11 13:51:36 -04:00
75bc630565 2.13 GA has been bumped up a week to release on May 16 (#77772) 2022-05-10 14:53:18 -05:00
9923e92d97 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>
2022-05-10 11:22:24 -04:00
97e574fe6e Docsite/communication.rst: fix formatting (#77760) 2022-05-09 13:55:30 -04:00
5e22fe21fd stub out ovirt dev guide with pointer to new location (#77751) 2022-05-09 02:38:38 -07:00
42086c14a3 Updated the playbook section in this docs (#77747) 2022-05-06 11:30:42 -04:00
18fe5a8835 Updated text in ini.py (#77746) 2022-05-06 10:00:22 -04:00
d352f2ec21 core branch descriptions (#76152) 2022-05-05 14:49:12 -04:00
0cfc291573 docs: update porting guide for ansible 6.0.0a2 (#77736) 2022-05-05 14:15:14 -04:00
fe349a1ccd 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.
2022-05-05 09:09:57 -07:00
52bd59c481 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
2022-05-05 08:44:57 -07:00
255745b3e6 simplify developing modules (#77647) 2022-05-05 10:35:05 -04:00
dd094a4413 Mention admin requirement for runas become (#77722) 2022-05-05 10:16:37 -04:00
fbc5b3f9c5 fix copy test for split controller/remote 2022-05-04 10:22:36 -07:00
3f4cacd355 Remove MacOSX-specific cleanup for unarchive test 2022-05-04 10:21:39 -07:00
5753fd2d8d docs: announce the PG working group (#77732) 2022-05-04 16:58:42 +01:00
ef2fe6823c 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>
2022-05-04 11:11:10 -04:00
cc5ac88c4c Update mypy test. Fix type hints for Python 3.9.
This also bumps the minimum controller version (for mypy only) to Python 3.9.
2022-05-03 18:55:39 -07:00
7471c036ec shift to ansible_core_version 2022-05-03 10:53:18 -07:00
a1ddb83fc1 Docsite: move a stepped down steering committee member to past members (#77715) 2022-05-03 09:54:36 +01:00
2cc74b04c4 ansible-test - Add multi-arch remote support. 2022-04-29 18:20:14 -07:00
de5d6820f8 ansible-test - Remove obsolete code. 2022-04-29 13:27:37 -07:00
a115a7fce2 Install acl on Ubuntu for copy integration test. 2022-04-29 13:27:18 -07:00
e2200e8dfc ansible-test - Fix remote completion validation. 2022-04-29 13:27:01 -07:00
4ff10fcd31 fix SELinux facts tests
* 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)
2022-04-29 11:36:14 -07:00
6513453310 ansible-test - Add support for remote Ubuntu VMs. 2022-04-29 10:38:38 -07:00
dcda1e7239 Trim message in split integration test. 2022-04-29 10:21:11 -07:00
dbdbfe845a Remove deprecated subclassing DefaultCallback without doc_fragment (#77677) 2022-04-29 09:32:13 +02:00
a12e0a0e87 ansible-config added json/yaml output to list/dump (#77447)
fixes #733644
2022-04-28 19:58:58 -04:00
a3cc6a581e dont rely on path to set config defs for plugins (#77659) 2022-04-28 12:14:33 -07:00
fb2f080b42 document base64 filters (#77657)
* document base64 filters

* Update lib/ansible/plugins/filter/b64decode.yml

Co-authored-by: Sandra McCann <samccann@redhat.com>

* Update lib/ansible/plugins/filter/b64encode.yml

Co-authored-by: Sandra McCann <samccann@redhat.com>

Co-authored-by: Sandra McCann <samccann@redhat.com>
2022-04-28 12:12:29 -07:00
ec00c9c64e Deprecate FACT_PATH/GATHER_SUBSET/GATHER_TIMEOUT defaults (#77656) 2022-04-28 12:09:49 -07:00
ed30fc9a06 Remove deprecated loading cache plugins directly without cache_loader (#77655) 2022-04-28 12:08:20 -07:00
572bc1354a Fix lazy eval version in integration tests 2022-04-28 12:07:22 -07:00
749a105956 ansible-doc stay 3.8 python compatible (#77682)
pathlib with_stem will wait till 3.9
  also add tests by listing filters
2022-04-28 14:57:34 -04:00
c71faec595 typo in doc (#77672) 2022-04-28 14:31:43 -04:00
f633b62cbc clarify latest release (#77577)
* clarify latest release
* fix tables
2022-04-28 06:12:49 -07:00
f7c2b1986c Require blocking IO for ansible CLI. 2022-04-27 16:28:06 -07:00
cc872a57f2 Reduce output from ansible-doc integration test.
This removes about 20K lines of output which are not evaluated as part of the test.
2022-04-27 15:11:18 -07:00
5c2d830dea 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.
2022-04-27 14:07:15 -07:00
f6fb402d1f Update guide_vultr.rst (#77665) 2022-04-27 16:27:03 -04:00
cf5f0690f0 Typo fix (#77648) 2022-04-27 16:24:43 -04:00
b439e41a91 expand ansible-doc coverage (#74963)
* Expand ansible-doc to tests/filters and fix existing issues

  enable filter/test docs if in single file or companion yaml
  add docs for several filters/tests plugins
  allow .yml companion for docs for other plugins, must be colocated
  verify plugins are valid (not modules, cannot)
  fix 'per collection' filtering
  limit old style deprecation (_ prefix) to builtin/legacy
  start move to pathlib for saner path handling
  moved some funcitons, kept backwards compat shims with deprecation notice

  Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
  Co-authored-by: Felix Fontein <felix@fontein.de>
  Co-authored-by: Sandra McCann <samccann@redhat.com>
2022-04-27 09:46:52 -04:00
a65fbfad5b 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
2022-04-27 02:05:05 -07:00
d321fa3f15 remove import_play examples from include module (#77597) 2022-04-26 14:23:24 -04:00
709ae7c050 docs: Update porting guide for ansible 5.7.0 (#77646) 2022-04-26 14:06:26 -04:00
af9f628ab5 Add python path to version output (#77631)
To further disambiguate 'which' python is the correct python
2022-04-26 11:44:29 -04:00
3980eb8c09 Prevent losing unsafe from lookups (#77609)
* 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
2022-04-26 11:16:22 -04:00
6fdec4a6ab Revert "Require blocking IO for ansible CLI. (#77639)"
This reverts commit e2d54d3594.
2022-04-25 15:48:01 -07:00
26fd5a8c3a Revert "ansible-test - Fix subprocess management. (#77638)"
This reverts commit 62d03c8e75.
2022-04-25 15:38:35 -07:00
e2d54d3594 Require blocking IO for ansible CLI. (#77639) 2022-04-25 15:29:56 -07:00
62d03c8e75 ansible-test - Fix subprocess management. (#77638)
* 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.
2022-04-25 12:39:09 -07:00
b8793fa48d Fix use of deprecated antsibull-docs option. 2022-04-25 12:21:09 -07:00
1802684c7b add link to deprecation warning (#77599)
* add link to deprecation warning

(cherry picked from commit f991470dd0)
2022-04-25 11:44:31 -04:00
578a815271 Fix issue probably-meant-fstring found at https://codereview.doctor (#77619) 2022-04-25 09:37:23 -04:00
841bdb74eb Replace antsibull with antsibull-docs (#77504) 2022-04-22 09:33:32 -04:00
d06d99cbb6 git fix docs and wrapper script (#77588)
* 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
2022-04-21 15:44:42 -05:00
1b947eaf92 arg_spec - Return aliases in validation result and update aliases (#77576)
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.
2022-04-21 15:06:31 -04:00
096393a221 add select distro installs to docs (#77567) 2022-04-21 13:58:34 -04:00
494f932773 Deprecate PlayContext.verbosity (#77507)
display.verbosity should be used instead
2022-04-21 10:26:08 -04:00
2c2a204dc6 varaiblemanager, more efficienet vars file reads (#77570) 2022-04-21 08:24:59 -05:00
3cbfee7852 community_steering_committee.rst: add new member (#77589) 2022-04-21 09:22:44 +01:00
b960641759 ansible-test - Support multiple coverage versions.
ci_complete
ci_coverage
2022-04-19 23:15:38 -07:00
4d69c09695 ansible-galaxy collection - ensure dependencies are a dict (#77561)
* fix traceback when installing collection with dependencies set to None
2022-04-19 15:54:45 -04:00
4faa576ee9 Add a test and changelog for non-string host names in yaml inventory files (#77569) 2022-04-19 15:17:36 -04:00
9280396e19 Fix error message for non-str hosts in yaml inventory (#77544) 2022-04-19 11:06:59 -04:00
abdd237de7 Yolo (#77554)
* Revert "Revert "Config, ensure templating happens at functions (#77483)""

This reverts commit 94c9106153.

* removed update configdata, which is unused
* removed test for action we don't perform anymore
* removed unused configdata
2022-04-18 15:57:00 -04:00
191d9a771a ansible-test - Remove more Python 2.7 support. 2022-04-18 11:57:50 -07:00
3b0d74c145 Add contributor path page (#77494)
Co-authored-by: Emmanuel Ugwu <32464178+ugwutotheeshoes@users.noreply.github.com>
2022-04-18 11:36:10 -04:00
0c1cb0e9d4 Fix a broken link and some grammatical errors (#77531) 2022-04-18 11:18:30 -04:00
94c9106153 Revert "Config, ensure templating happens at functions (#77483)"
This reverts commit 6e5f1d781d.
2022-04-14 19:13:49 -07:00
789d29e895 Update docs to recommend the TTY for prompts over stderr (#77533) 2022-04-14 15:29:30 -04:00
762d97f1b8 setup: remove 'any' as seemingly valid option (#77532)
fixes #59783
2022-04-14 15:28:47 -04:00
76273a6b80 Clean up integration tests (#77516) 2022-04-14 15:18:30 -04:00
2ba39fcf8c Update pip example with standard lowercase http[s]_proxy env vars (#77515) 2022-04-14 15:17:40 -04:00
2fc73a9dc3 update python devel docs (#77499)
* update python devel docs

Co-authored-by: Sandra McCann <samccann@redhat.com>
2022-04-14 15:05:03 -04:00
cbe42bff7f Allow for lazy evaluation of Jinja2 expressions (#56116) 2022-04-14 12:32:00 -05:00
f2ab920822 Better info sourcing (#77511)
Task is  authoritative
   also includes latest per loop info
   and fix tests
2022-04-14 13:07:27 -04:00
793bb200ec CLI now issues clearer error when 0 hosts selected (#77517)
fixes #77512
2022-04-14 13:06:34 -04:00
6e5f1d781d Config, ensure templating happens at functions (#77483)
move away from special templating in constants.py
 simplified main get, unified paths to get info

* Let native jinja deal with eval for type
* make constants available for templating defaults
* ensure we use config file
2022-04-14 13:05:30 -04:00
c3a3bc1d0d Allow strftime to display time in UTC (#70351) 2022-04-14 12:35:19 -04:00
a0dede5458 ansible-connection verboistery (#77509)
* ansible-connection verboistery

  for cli, just use normal parser creation
 this also adds --help, but that seems fine
 also some error cleanup

Co-authored-by: Nathaniel Case <this.is@nathanielca.se>
2022-04-14 11:24:33 -04:00
3b9592fcaf Move to display as single source of verbosity (#77498)
* Move to display as single source of verbosity

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2022-04-14 11:23:06 -04:00
553a226da5 Steering Committee: add new member (#77529) 2022-04-13 16:53:39 +01:00
32d67ce998 Exclude Python 2.6 from interpreter discovery. 2022-04-13 08:30:02 -07:00
0d9a580f24 docs: Add porting guide for Ansible 6.0.0a1 (#77526) 2022-04-13 09:50:35 -04:00
fa7c5d9b10 Update reporting_bugs_and_features.rst (#77518) 2022-04-13 09:47:59 -04:00
727387ad76 2.14 Roadmap (#77387)
Co-authored-by: Matt Clay <matt@mystile.com>
2022-04-12 11:12:18 -05:00
460f842ae0 Remove openSUSE Python 2.7 from test matrix. 2022-04-11 18:45:47 -07:00
d7fbde4ea9 Make "~/.ansible" path configurable (#76114)
* replace hardcoded '~/.ansible' to C.ANSIBLE_HOME
* rename previously existing env ANSIBLE_HOME in env-setup script
* modify cache dir monkeypatching in galaxy api unit tests
* update "version_added" to 2.14 for ANSIBLE_HOME
* fix description of collections with proper use of ANSIBLE_HOME

Co-authored-by: htol <github@h-tol.net>
Co-authored-by: stefanwascoding <stefan@syntaxhelden.de>
2022-04-11 14:17:00 -04:00
538a19b748 Update developing_collections_structure.rst (#77496) 2022-04-11 14:11:09 -04:00
94138cf608 template override colon bugfixes (#77495)
* Proper error on missing jinja2 override separator

Properly catch the case when no (or a wrong) separator is used in a
jinja2 override, and return a useful error message to the user.

* Support colons in jinja2 override value

By limiting the split to 1, any colons in the value are preserved and
passed on.
2022-04-11 10:11:57 -04:00
94eff70030 PlayIterator - remove deprecated states (#77444) 2022-04-11 15:13:10 +02:00
477c55b0d2 Get git executable for collections in git repos (#77493)
* Fix traceback installing collections from git repos if git is not installed
2022-04-08 13:41:53 -04:00
eef0a1cef9 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
2022-04-08 10:56:28 -04:00
7126bfc61c Clarifying how handlers are handled (#77372) 2022-04-07 13:46:04 -04:00
d7d2afd203 avoid recursion in example (#77436) 2022-04-07 13:44:05 -04:00
a85261342a template module: document jinja2_native behavior (#77445) 2022-04-07 13:43:15 -04:00
6da4186f6e Update installing_collections_file.rst (#77439) 2022-04-07 13:42:38 -04:00
e8dbc84afe Trivial (#77467)
Co-authored-by: Iheanacho Amarachi Sharon  <58210919+Iheanacho-ai@users.noreply.github.com>
2022-04-07 13:33:02 -04:00
c7e198b907 Ensure correct environment_class is set on Template (#77485) 2022-04-07 16:52:12 +02:00
66c5844978 ansible-test - Don't fail if network cannot be disconnected (#77472)
* Don't fail if network cannot be disconnected

* add clog frag
2022-04-06 15:32:13 -05:00
62fe4718cb Fix ini section for INVENTORY_UNPARSED_WARNING (#77478) 2022-04-06 13:32:35 -04:00
1d9c68d27e honor use_proxy parameter (#77312)
* 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>
2022-04-06 13:21:49 -04:00
5b44035983 Hide "[WARNING]: No inventory was parsed" message (#65499)
* Add config option INVENTORY_UNPARSED_WARNING to hide the warning "No inventory was parsed, only implicit localhost is available"
2022-04-06 12:41:53 -04:00
6216c9fc93 Fix sanity test crash. 2022-04-06 09:36:23 -07:00
36371500b7 docs: Update porting guide for ansible 5.6.0 (#77466) 2022-04-05 16:39:24 -04:00
26631de88c Document how to release a collection (#77391)
Co-authored-by: Divine Odazie <dodazie@gmail.com>
2022-04-05 13:59:45 -04:00
dce30e2577 Remove deprecated Load-CommandUtils and Import-PrivilegeUtil (#77457) 2022-04-05 11:28:23 -04:00
cdf998fa79 cli - deprecated setting verbosity before sub command, cont'd (#77456)
Follow up on #75840
2022-04-05 11:27:40 -04:00
f41636b9b8 Remove deprecated UnsafeProxy (#77455) 2022-04-05 11:25:58 -04:00
3fe5f577e6 make collection warning message clearer (#74859) 2022-04-04 16:40:02 -04:00
82c622a26a community_steering_committee.rst: add chairperson (#77454) 2022-04-04 13:59:08 -04:00
2797dc644a Add test to assert that missing libyaml doesn't result in an error. Fixes #77437 2022-04-01 13:53:19 -07:00
ac56647f4a INI: values with spaces can be single or double quoted (#77369) 2022-04-01 12:10:56 -04:00
9f82fc204b apt_key: remove deprecated key module param (#77409) 2022-04-01 11:01:20 +02:00
f933f9a178 get_url: remove deprecated sha256sum module param (#77408) 2022-04-01 10:26:41 +02:00
21addac5da Docs cheatsheet - skeleton and ansible-playbook (#76655) 2022-03-31 15:19:21 -04:00
6557a60d08 Most Matrix channels are ansible.com and not .im (#77352) 2022-03-31 15:18:01 -04:00
e3aa73cb97 Catch ImportError when pyyaml doesn't have libyaml extension (#77434) 2022-04-01 05:16:47 +10:00
26149c45df import_playbook: remove deprecated free form params (#77431) 2022-04-01 05:13:28 +10:00
eeef3110b2 Switch to gender neutral terms (#77430)
* Switch to gender neutral terms

* Update _selectors2.py

* Update foreman.py

* Update foreman.py

Co-authored-by: inclusive-coding-bot <inclusive-coding-bot@github.com>
2022-04-01 05:13:13 +10:00
d4dd4a82c0 Remove deprecated default.plugin_filters_cfg config option (#77429)
* Remove deprecated default.plugin_filters_cfg config option

Fixes #77398

* Fix tests
2022-04-01 05:11:56 +10:00
a421a38e10 Remove deprecated NETWORK_GROUP_MODULES env var (#77428)
Fixes #77397
2022-04-01 05:11:42 +10:00
f2387537b6 Remove deprecated DISPLAY_SKIPPED_HOSTS env var (#77427)
Fixes #77396
2022-04-01 05:11:31 +10:00
ff8a854e57 Remove deprecated LIBVIRT_LXC_NOSECLABEL env var (#77426)
Fixes #77395
2022-04-01 05:11:20 +10:00
e918cfa588 Fix list formatting (#77354) 2022-03-31 15:09:43 -04:00
87a8fedd94 Fix type for ansible-galaxy server config definitions (#77424)
* Fix type for ansible-galaxy server config definitions

* changelog

* check attr without api call

* pep8
2022-04-01 05:09:10 +10:00
bf8e186c68 Example is a single play, not a playbook 2022-03-31 15:02:48 -04:00
8caa6efaab 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
2022-03-30 13:46:09 -07:00
4b51e61645 ansible-test - Fix origin host target filtering. 2022-03-30 11:16:15 -07:00
6d260ad967 Remove COMMAND_WARNINGS and warn (#77411)
* Remove COMMAND_WARNINGS and warn

Fixes #77394
2022-03-30 09:52:44 -04:00
e080bae766 Remove deprecated ALLOW_WORLD_READABLE_TMPFILES config option (#77410)
Fixes #77393
2022-03-30 09:46:57 -04:00
60b4200bc6 winrm - ensure callers PATH for kinit is set (#77401)
* winrm - ensure callers PATH for kinit is set

* Fix unit test expectations

* Fix type annotation
2022-03-29 17:36:56 -07:00
353511a900 Add script to handle more deprecations. (#77400)
* Add script to handle more deprecations.

This script currently supports deprecations from the following sanity tests:

* deprecated-config
* update-bundled

* Ignore script in package-data test.
2022-03-29 15:24:30 -07:00
f8ec660e62 [ansible-galaxy] Fix listing collections with null namespace/name/version metadata (#77014)
* 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
2022-03-29 15:18:06 -04:00
4ccc4c5aeb Report relative path in deprecated-config test. 2022-03-29 11:20:04 -07:00
87d52e0ce0 Only require a keyring if collections with signatures will be installed (#77355)
Fixes #77349
2022-03-29 17:03:43 +02:00
50d4cf931c Start of 2.14 development cycle. (#77378)
* Delete old changelog fragments.
* Add 2.14 changelog stub.
* Add porting guide.
* Update version and codename.
* Add temporary deprecated version ignores.
2022-03-28 16:07:24 -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
6429 changed files with 203244 additions and 291074 deletions

View File

@ -0,0 +1,231 @@
trigger:
batch: true
branches:
include:
- devel
- stable-*
pr:
autoCancel: true
branches:
include:
- devel
- stable-*
schedules:
- cron: 0 7 * * *
displayName: Nightly
always: true
branches:
include:
- devel
- stable-*
variables:
- name: checkoutPath
value: ansible
- name: coverageBranches
value: devel
- name: entryPoint
value: .azure-pipelines/commands/entry-point.sh
- name: fetchDepth
value: 500
- name: defaultContainer
value: quay.io/ansible/azure-pipelines-test-container:6.0.0
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: 3.8
- test: 3.9
- test: '3.10'
- test: 3.11
- test: 3.12
- test: 3.13
- stage: Windows
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Server {0}
testFormat: windows/{0}/1
targets:
- name: 2016 WinRM HTTP
test: 2016/winrm/http
- name: 2019 WinRM HTTPS
test: 2019/winrm/https
- name: 2022 WinRM HTTPS
test: 2022/winrm/https
- name: 2022 PSRP HTTP
test: 2022/psrp/http
- name: 2022 SSH Key
test: 2022/ssh/key
- name: 2025 PSRP HTTP
test: 2025/psrp/http
- name: 2025 SSH Key
test: 2025/ssh/key
- stage: Remote
dependsOn: []
jobs:
- template: templates/matrix.yml # context/target
parameters:
targets:
- name: macOS 15.3
test: macos/15.3
- name: RHEL 9.5 py39
test: rhel/9.5@3.9
- name: RHEL 9.5 py312
test: rhel/9.5@3.12
- name: FreeBSD 13.5
test: freebsd/13.5
- name: FreeBSD 14.2
test: freebsd/14.2
groups:
- 1
- 2
- template: templates/matrix.yml # context/controller
parameters:
targets:
- name: macOS 15.3
test: macos/15.3
- name: RHEL 9.5
test: rhel/9.5
- name: FreeBSD 13.5
test: freebsd/13.5
- name: FreeBSD 14.2
test: freebsd/14.2
groups:
- 3
- 4
- 5
- template: templates/matrix.yml # context/controller (ansible-test container management)
parameters:
targets:
- name: Alpine 3.21
test: alpine/3.21
- name: Fedora 41
test: fedora/41
- name: RHEL 9.5
test: rhel/9.5
- name: Ubuntu 24.04
test: ubuntu/24.04
groups:
- 6
- stage: Docker
dependsOn: []
jobs:
- template: templates/matrix.yml # context/target
parameters:
testFormat: linux/{0}
targets:
- name: Alpine 3.21
test: alpine321
- name: Fedora 41
test: fedora41
- name: Ubuntu 22.04
test: ubuntu2204
- name: Ubuntu 24.04
test: ubuntu2404
groups:
- 1
- 2
- template: templates/matrix.yml # context/controller
parameters:
testFormat: linux/{0}
targets:
- name: Alpine 3.21
test: alpine321
- name: Fedora 41
test: fedora41
- name: Ubuntu 24.04
test: ubuntu2404
groups:
- 3
- 4
- 5
- stage: Galaxy
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Python {0}
testFormat: galaxy/{0}/1
targets:
- test: 3.11
- test: 3.12
- test: 3.13
- stage: Generic
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Python {0}
testFormat: generic/{0}/1
targets:
- test: 3.11
- test: 3.12
- test: 3.13
- stage: Incidental_Windows
displayName: Incidental Windows
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Server {0}
testFormat: i/windows/{0}
targets:
- name: 2016 WinRM HTTP
test: 2016/winrm/http
- name: 2019 WinRM HTTPS
test: 2019/winrm/https
- name: 2022 WinRM HTTPS
test: 2022/winrm/https
- name: 2022 PSRP HTTP
test: 2022/psrp/http
- name: 2022 SSH Key
test: 2022/ssh/key
- name: 2025 PSRP HTTP
test: 2025/psrp/http
- name: 2025 SSH Key
test: 2025/ssh/key
- stage: Incidental
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: i/{0}/1
targets:
- name: IOS Python
test: ios/csr1000v/
- 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,46 @@
#!/usr/bin/env bash
set -o pipefail -eux
declare -a args
IFS='/:' read -ra args <<< "$1"
version="${args[1]}"
connection="${args[2]}"
connection_setting="${args[3]}"
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=2022
# 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 the version ${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
fi
# shellcheck disable=SC2086
ansible-test windows-integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
--controller "docker:default,python=${python_default}" \
--target "remote:windows/${version},connection=${connection}+${connection_setting},provider=${provider}" \
--remote-terminate always --remote-stage "${stage}"

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,89 @@
#!/usr/bin/env bash
set -o pipefail -eux
declare -a args
IFS='/:' read -ra args <<< "$1"
version="${args[1]}"
connection="${args[2]}"
connection_setting="${args[3]}"
group="${args[4]}"
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=2022
# 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 the version ${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
fi
for py_version in "${python_versions[@]}"; do
changed_all_target="all"
changed_all_mode="default"
if [ "${py_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 [ "${py_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"} \
--changed-all-target "${changed_all_target}" --changed-all-mode "${changed_all_mode}" \
--controller "docker:default,python=${py_version}" \
--target "remote:windows/${version},connection=${connection}+${connection_setting},provider=${provider}" \
--remote-terminate "${terminate}" --remote-stage "${stage}"
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,59 @@
#!/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 annotations
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,102 @@
#!/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.
"""
from __future__ import annotations
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.
# The use of docker is mandatory when Powershell code is present.
ansible-test coverage xml --group-by command --stub --docker --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,24 @@
#!/usr/bin/env python
"""Prepends a relative timestamp to each input line from stdin and writes it to stdout."""
from __future__ import annotations
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)"

6
.git-blame-ignore-revs Normal file
View File

@ -0,0 +1,6 @@
# .git-blame-ignore-revs
# Bulk PowerShell sanity fixes
6def4a3180fe03981ba64c6d8db28fed3bb39c0c
716631189cb5a3f66b3add98f39e64e98bc17bf7
# Bulk update of strings from triple single quotes to triple double quotes
a0495fc31497798a7a833ba7406a9729e1528dd8

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

@ -4,22 +4,75 @@ Hi! Nice to see you here!
## QUESTIONS ?
Please see the [Community Guide](https://docs.ansible.com/ansible/latest/community/index.html) for information on how to ask questions on the [mailing lists](https://docs.ansible.com/ansible/latest/community/communication.html#mailing-list-information) and IRC.
If you have questions about anything related to Ansible, get in touch with us!
See [Communicating with the Ansible community](https://docs.ansible.com/ansible/devel/community/communication.html) to find out how.
The GitHub issue tracker is not the best place for questions for various reasons, but both IRC and the mailing list are very helpful places for those things, as the community page explains best.
The [Community Guide](https://docs.ansible.com/ansible/devel/community/index.html) also explains how to contribute
and interact with the project, including how to submit bug reports and code to Ansible.
Please note that the GitHub issue tracker is not the best place to ask questions for several reasons.
You'll get more helpful, and quicker, responses in the forum.
## CONTRIBUTING ?
By contributing you agree that these contributions are your own (or approved by your employer) and you grant a full, complete, irrevocable copyright license to all users and developers of the project, present and future, pursuant to the license of the project. You can also read the same [CLA](https://docs.ansible.com/ansible/latest/community/contributor_license_agreement.html) on the Ansible docsite.
By contributing to this project you agree to the [Developer Certificate of Origin (DCO)](#developer-certificate-of-origin-dco).
Please review the [Community Guide](https://docs.ansible.com/ansible/latest/community/index.html) for more information on contributing to Ansible.
The Ansible project is licensed under the [GPL-3.0](COPYING) or later. Some portions of the code fall under other licenses as noted in individual files.
The Ansible project accepts contributions through GitHub pull requests.
Please review the [Community Guide](https://docs.ansible.com/ansible/devel/community/index.html) for more information on contributing to Ansible.
## BUG TO REPORT ?
First and foremost, also check the [Community Guide](https://docs.ansible.com/ansible/latest/community/index.html).
First and foremost, also check the [Community Guide](https://docs.ansible.com/ansible/devel/community/index.html).
You can report bugs or make enhancement requests at the [Ansible GitHub issue page](http://github.com/ansible/ansible/issues/new/choose) by filling out the issue template that will be presented.
You can report bugs or make enhancement requests at
the [Ansible GitHub issue page](http://github.com/ansible/ansible/issues/new/choose) by filling out the issue template that will be presented.
Also please make sure you are testing on the latest released version of Ansible or the development branch; see the [Installation Guide](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) for details.
Also please make sure you are testing on the latest released version of Ansible or the development branch.
See the [Installation Guide](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) for details.
Thanks!
## DEVELOPER CERTIFICATE OF ORIGIN (DCO)
This document was created by the Linux Kernel community and is a simple statement that you, as a contributor, have the legal right to make the contribution.
```text
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
```

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

250
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@ -0,0 +1,250 @@
---
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 see
[Communicating with the Ansible community][communication] to
get in touch and ask questions.
[communication]:
https://docs.ansible.com/ansible/devel/community/communication.html
[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: This is a marker for our automatic bot. Do not change it.
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, 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 triple 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 -t all` below, under the prompt line.
(if using a version older than ansible-core 2.12 you should omit the '-t all')
Please don't wrap it with triple backticks — your
whole input will be turned into a code snippet automatically.
render: console
value: |
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
placeholder: |
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
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 triple 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/ansibotmini#ansibotmini
- type: checkboxes
attributes:
label: Code of Conduct
description: |
Read the [Ansible Code of Conduct][CoC] first.
[CoC]: https://docs.ansible.com/ansible/devel/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,8 +1,8 @@
# 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
url: https://docs.ansible.com/ansible/devel/community/reporting_bugs_and_features.html?utm_medium=github&utm_source=issue_template_chooser
about: |
Please learn how to report security vulnerabilities here.
@ -11,16 +11,16 @@ contact_links:
a prompt response.
For more information, see
https://docs.ansible.com/ansible/latest/community/reporting_bugs_and_features.html
https://docs.ansible.com/ansible/devel/community/reporting_bugs_and_features.html
- name: 📝 Ansible Code of Conduct
url: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_template_chooser
url: https://docs.ansible.com/ansible/devel/community/code_of_conduct.html?utm_medium=github&utm_source=issue_template_chooser
about: ❤ Be nice to other members of the community. ☮ Behave.
- name: 💬 Talks to the community
url: https://docs.ansible.com/ansible/latest/community/communication.html?utm_medium=github&utm_source=issue_template_chooser#mailing-list-information
- name: 💬 Talk to the community
url: https://docs.ansible.com/ansible/devel/community/communication.html?utm_medium=github&utm_source=issue_template_chooser#forum
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!
url: https://forum.ansible.com/g?utm_medium=github&utm_source=issue_template_chooser
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,201 @@
---
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 see
[Communicating with the Ansible community][communication] to
get in touch and ask questions.
[communication]:
https://docs.ansible.com/ansible/devel/community/communication.html
[issue search]: ../search?q=is%3Aissue&type=issues
[submit a pull request]:
https://docs.ansible.com/ansible-core/devel/community/documentation_contributions.html
- type: markdown
attributes:
value: >
**Check the repository for your issue.**
Source files for Ansible community documentation are
hosted in different repositories. Please make sure to file an
issue in the correct project.
Documentation for modules/plugins/etc that are officially
supported by the Ansible Core Engineering team is available
in this (`ansible/ansible`) repository.
The Installation Guide, Playbook Guide, Developer Guide,
and other documentation is available in the
[ansible/ansible-documentation] repository.
Documentation for other modules/plugins/etc is likely to be
available in one of the [Ansible Collections][collections index].
If available in the collection documentation, select the
**Issue Tracker** button to go directly to the GitHub issues.
[ansible/ansible-documentation]: /ansible/ansible-documentation
[collections index]:
https://docs.ansible.com/ansible/latest/collections/index.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: This is a marker for our automatic bot. Do not change it.
options:
- Documentation Report
validations:
required: true
- type: input
attributes:
label: Component Name
description: >
Write the short name of the rst file, module, plugin, task or
feature below, *use your best guess if unsure*.
placeholder: lib/ansible/modules/copy.py
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 triple 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 -t all` below, under the prompt line.
(if using a version older than ansible-core 2.12 you should omit the '-t all')
Please don't wrap it with triple backticks — your
whole input will be turned into a code snippet automatically.
render: console
value: |
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
placeholder: |
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
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/ansibotmini#ansibotmini
- type: checkboxes
attributes:
label: Code of Conduct
description: |
Read the [Ansible Code of Conduct][CoC] first.
[CoC]: https://docs.ansible.com/ansible/devel/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,176 @@
---
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 in the [Ansible forum][forum].
<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 see
[Communicating with the Ansible community][communication] to
get in touch and ask questions.
[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
[communication]:
https://docs.ansible.com/ansible/devel/community/communication.html
[issue search]: ../search?q=is%3Aissue&type=issues
[forum help]:
https://forum.ansible.com/c/help/6
[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: This is a marker for our automatic bot. Do not change it.
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, 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/ansibotmini#ansibotmini
- type: checkboxes
attributes:
label: Code of Conduct
description: |
Read the [Ansible Code of Conduct][CoC] first.
[CoC]: https://docs.ansible.com/ansible/devel/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

@ -0,0 +1,10 @@
---
name: Internal Issue
about: Free-form issue creation for core maintainer use only.
title: ''
labels: [core-internal]
assignees: ''
---
@ansibot bot_skip

42
.github/ISSUE_TEMPLATE/pre_release.yml vendored Normal file
View File

@ -0,0 +1,42 @@
name: Pre-Release Bug Report
description: File a bug report against a pre-release version
labels:
- bug
- pre_release
assignees:
- nitzmahone
- mattclay
body:
- type: markdown
attributes:
value: |
## Bug Report
- type: textarea
attributes:
label: Ansible Version
description: Paste the full output from `ansible --version` below.
render: console
placeholder: $ ansible --version
validations:
required: true
- type: textarea
attributes:
label: Summary
description: Describe the issue with any relevant steps to reproduce.
validations:
required: true
- type: dropdown
attributes:
label: <!-- Bot instructions (ignore this) -->
options:
- |
<!--
### Component Name
bin/ansible
### Issue Type
Bug Report
### Configuration
### OS / Environment
-->
validations:
required: true

View File

@ -1,23 +0,0 @@
##### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
##### ISSUE TYPE
<!--- Pick one below and delete the rest -->
- Bugfix Pull Request
- Docs Pull Request
- Feature Pull Request
- New Module Pull Request
##### COMPONENT NAME
<!--- Write the short name of the module, plugin, task or feature below -->
##### ADDITIONAL INFORMATION
<!--- Include additional information to help people understand the change here -->
<!--- A step-by-step reproduction of the problem is helpful if there is no related issue -->
<!--- Paste verbatim command output below, e.g. before and after your change -->
```paste below
```

1
.github/PULL_REQUEST_TEMPLATE.md vendored Symbolic link
View File

@ -0,0 +1 @@
PULL_REQUEST_TEMPLATE/Unclear purpose or motivation.md

View File

@ -0,0 +1,9 @@
##### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
<!--- Add "Fixes #1234" or steps to reproduce the problem if there is no corresponding issue -->
##### ISSUE TYPE
- Bugfix Pull Request

View File

@ -0,0 +1,9 @@
##### SUMMARY
<!--- Describe the change below, including rationale -->
<!--- Add "Fixes #1234" if there is a corresponding issue -->
##### ISSUE TYPE
- Docs Pull Request

View File

@ -0,0 +1,9 @@
##### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
<!--- Add "Fixes #1234" if there is a corresponding issue -->
##### ISSUE TYPE
- Feature Pull Request

View File

@ -0,0 +1 @@
Unclear purpose or motivation.md

View File

@ -0,0 +1,9 @@
##### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
<!--- Add "Fixes #1234" if there is a corresponding issue -->
##### ISSUE TYPE
- Test Pull Request

View File

@ -0,0 +1,14 @@
##### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
<!--- Add "Fixes #1234" or steps to reproduce the problem if there is no corresponding issue -->
##### ISSUE TYPE
<!--- Pick one below and delete the rest -->
- Bugfix Pull Request
- Docs Pull Request
- Feature Pull Request
- Test Pull Request

20
.github/RELEASE_NAMES.txt vendored Normal file
View File

@ -0,0 +1,20 @@
2.19.0 What Is and What Should Never Be
2.18.0 Fool in the Rain
2.17.0 Gallows Pole
2.16.0 All My Love
2.15.0 Ten Years Gone
2.14.0 C'mon Everybody
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
2.7.0 In the Light
2.6.0 Heartbreaker
2.5.0 Kashmir
2.4.0 Dancing Days
2.3.0 Ramble On
2.2.0 The Battle of Evermore
2.1.0 The Song Remains the Same
2.0.0 Over the Hills and Far Away

View File

@ -1,12 +0,0 @@
---
- 2.10.0 When the Levee Breaks
- 2.9.0 Immigrant Song
- 2.8.0 How Many More Times
- 2.7.0 In the Light
- 2.6.0 Heartbreaker
- 2.5.0 Kashmir
- 2.4.0 Dancing Days
- 2.3.0 Ramble On
- 2.2.0 The Battle of Evermore
- 2.1.0 The Song Remains the Same
- 2.0.0 Over the Hills and Far Away

30
.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
@ -69,7 +73,16 @@ coverage.xml
/test/cache/*
# Development
/test/develop
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
venv
env
Vagrantfile
.vagrant
# Backwards compatibility with `stable-2.9` and earlier branches.
@ -77,12 +90,17 @@ 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/
# First used in the `devel` branch during Ansible 2.18 development.
/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
/hacking/tests/selinux/*.mod
/hacking/tests/selinux/*.pp
# Release directory
packaging/release/ansible_release
/.cache/

View File

@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
@ -664,12 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@ -1,36 +1,10 @@
include README.rst
include COPYING
include SYMLINK_CACHE.json
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 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/units *
include Makefile
include MANIFEST.in
include changelogs/CHANGELOG*.rst
recursive-include hacking/build_library *.py
include hacking/build-ansible.py
include changelogs/changelog.yaml
include licenses/*.txt
include requirements.txt
recursive-include packaging *.py *.j2
recursive-include test/integration *
recursive-include test/sanity *.in *.json *.py *.txt *.ini
recursive-include test/support *.py *.ps1 *.psm1 *.cs *.md
recursive-include test/units *

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)

101
README.md Normal file
View File

@ -0,0 +1,101 @@
[![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/devel/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/devel/community/code_of_conduct.html)
[![Ansible mailing lists](https://img.shields.io/badge/mailing%20lists-Ansible-orange.svg)](https://docs.ansible.com/ansible/devel/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.
## Communication
Join the Ansible forum to ask questions, get help, and interact with the
community.
* [Get Help](https://forum.ansible.com/c/help/6): Find help or share your Ansible knowledge to help others.
Use tags to filter and subscribe to posts, such as the following:
* Posts tagged with [ansible](https://forum.ansible.com/tag/ansible)
* Posts tagged with [ansible-core](https://forum.ansible.com/tag/ansible-core)
* Posts tagged with [playbook](https://forum.ansible.com/tag/playbook)
* [Social Spaces](https://forum.ansible.com/c/chat/4): Meet and interact with fellow enthusiasts.
* [News & Announcements](https://forum.ansible.com/c/news/5): Track project-wide announcements including social events.
* [Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn): Get release announcements and important changes.
For more ways to get in touch, see [Communicating with the Ansible community](https://docs.ansible.com/ansible/devel/community/communication.html).
## Contribute to Ansible
* Check out the [Contributor's Guide](./.github/CONTRIBUTING.md).
* Read [Community Information](https://docs.ansible.com/ansible/devel/community) for all
kinds of ways to contribute to and interact with the project,
including how to submit bug reports and code to Ansible.
* 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.
## 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/devel/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 +0,0 @@
../lib/ansible/cli/scripts/ansible_connection_cli_stub.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,350 @@
==================================================================
ansible-core 2.19 "What Is and What Should Never Be" Release Notes
==================================================================
.. contents:: Topics
v2.19.0b2
=========
Release Summary
---------------
| Release Date: 2025-04-24
| `Porting Guide <https://docs.ansible.com/ansible-core/2.19/porting_guides/porting_guide_core_2.19.html>`__
Minor Changes
-------------
- comment filter - Improve the error message shown when an invalid ``style`` argument is provided.
Bugfixes
--------
- Remove use of `required` parameter in `get_bin_path` which has been deprecated.
- ansible-doc - fix indentation for first line of descriptions of suboptions and sub-return values (https://github.com/ansible/ansible/pull/84690).
- ansible-doc - fix line wrapping for first line of description of options and return values (https://github.com/ansible/ansible/pull/84690).
v2.19.0b1
=========
Release Summary
---------------
| Release Date: 2025-04-14
| `Porting Guide <https://docs.ansible.com/ansible-core/2.19/porting_guides/porting_guide_core_2.19.html>`__
Major Changes
-------------
- Jinja plugins - Jinja builtin filter and test plugins are now accessible via their fully-qualified names ``ansible.builtin.{name}``.
- Task Execution / Forks - Forks no longer inherit stdio from the parent ``ansible-playbook`` process. ``stdout``, ``stderr``, and ``stdin`` within a worker are detached from the terminal, and non-functional. All needs to access stdio from a fork for controller side plugins requires use of ``Display``.
- ansible-test - Packages beneath ``module_utils`` can now contain ``__init__.py`` files.
- variables - The type system underlying Ansible's variable storage has been significantly overhauled and formalized. Attempts to store unsupported Python object types in variables will now result in an error.
- variables - To support new Ansible features, many variable objects are now represented by subclasses of their respective native Python types. In most cases, they behave indistinguishably from their original types, but some Python libraries do not handle builtin object subclasses properly. Custom plugins that interact with such libraries may require changes to convert and pass the native types.
Minor Changes
-------------
- Added a -vvvvv log message indicating when a host fails to produce output within the timeout period.
- AnsibleModule.uri - Add option ``multipart_encoding`` for ``form-multipart`` files in body to change default base64 encoding for files
- INVENTORY_IGNORE_EXTS config, removed ``ini`` from the default list, inventory scripts using a corresponding .ini configuration are rare now and inventory.ini files are more common. Those that need to ignore the ini files for inventory scripts can still add it to configuration.
- Jinja plugins - Plugins can declare support for undefined values.
- Jinja2 version 3.1.0 or later is now required on the controller.
- Move ``follow_redirects`` parameter to module_utils so external modules can reuse it.
- PlayIterator - do not return tasks from already executed roles so specific strategy plugins do not have to do the filtering of such tasks themselves
- SSH Escalation-related -vvv log messages now include the associated host information.
- Windows - Add support for Windows Server 2025 to Ansible and as an ``ansible-test`` remote target - https://github.com/ansible/ansible/issues/84229
- Windows - refactor the async implementation to better handle errors during bootstrapping and avoid WMI when possible.
- ``ansible-galaxy collection install`` — the collection dependency resolver now prints out conflicts it hits during dependency resolution when it's taking too long and it ends up backtracking a lot. It also displays suggestions on how to help it compute the result more quickly.
- ansible, ansible-console, ansible-pull - add --flush-cache option (https://github.com/ansible/ansible/issues/83749).
- ansible-galaxy - Add support for Keycloak service accounts
- ansible-galaxy - support ``resolvelib >= 0.5.3, < 2.0.0`` (https://github.com/ansible/ansible/issues/84217).
- ansible-test - Added a macOS 15.3 remote VM, replacing 14.3.
- ansible-test - Automatically retry HTTP GET/PUT/DELETE requests on exceptions.
- ansible-test - Default to Python 3.13 in the ``base`` and ``default`` containers.
- ansible-test - Disable the ``deprecated-`` prefixed ``pylint`` rules as their results vary by Python version.
- ansible-test - Disable the ``pep8`` sanity test rules ``E701`` and ``E704`` to improve compatibility with ``black``.
- ansible-test - Improve container runtime probe error handling. When unexpected probe output is encountered, an error with more useful debugging information is provided.
- ansible-test - Replace container Alpine 3.20 with 3.21.
- ansible-test - Replace container Fedora 40 with 41.
- ansible-test - Replace remote Alpine 3.20 with 3.21.
- ansible-test - Replace remote Fedora 40 with 41.
- ansible-test - Replace remote FreeBSD 13.3 with 13.5.
- ansible-test - Replace remote FreeBSD 14.1 with 14.2.
- ansible-test - Replace remote RHEL 9.4 with 9.5.
- ansible-test - Show a more user-friendly error message when a ``runme.sh`` script is not executable.
- ansible-test - The ``yamllint`` sanity test now enforces string values for the ``!vault`` tag.
- ansible-test - Update ``nios-test-container`` to version 7.0.0.
- ansible-test - Update ``pylint`` sanity test to use version 3.3.1.
- ansible-test - Update distro containers to remove unnecessary pakages (apache2, subversion, ruby).
- ansible-test - Update sanity test requirements to latest available versions.
- ansible-test - Update the HTTP test container.
- ansible-test - Update the PyPI test container.
- ansible-test - Update the ``base`` and ``default`` containers.
- ansible-test - Update the utility container.
- ansible-test - Use Python's ``urllib`` instead of ``curl`` for HTTP requests.
- ansible-test - When detection of the current container network fails, a warning is now issued and execution continues. This simplifies usage in cases where the current container cannot be inspected, such as when running in GitHub Codespaces.
- ansible-test acme test container - bump `version to 2.3.0 <https://github.com/ansible/acme-test-container/releases/tag/2.3.0>`__ to include newer versions of Pebble, dependencies, and runtimes. This adds support for ACME profiles, ``dns-account-01`` support, and some smaller improvements (https://github.com/ansible/ansible/pull/84547).
- apt_key module - add notes to docs and errors to point at the CLI tool deprecation by Debian and alternatives
- apt_repository module - add notes to errors to point at the CLI tool deprecation by Debian and alternatives
- become plugins get new property 'pipelining' to show support or lack there of for the feature.
- callback plugins - add has_option() to CallbackBase to match other functions overloaded from AnsiblePlugin
- callback plugins - fix get_options() for CallbackBase
- copy - fix sanity test failures (https://github.com/ansible/ansible/pull/83643).
- copy - parameter ``local_follow`` was incorrectly documented as having default value ``True`` (https://github.com/ansible/ansible/pull/83643).
- cron - Provide additional error information while writing cron file (https://github.com/ansible/ansible/issues/83223).
- csvfile - let the config system do the typecasting (https://github.com/ansible/ansible/pull/82263).
- display - Deduplication of warning and error messages considers the full content of the message (including source and traceback contexts, if enabled). This may result in fewer messages being omitted.
- display - The ``collection_name`` arg to ``Display.deprecated`` no longer has any effect. Information about the calling plugin is automatically captured by the display infrastructure, included in the displayed messages, and made available to callbacks.
- distribution - Added openSUSE MicroOS to Suse OS family (#84685).
- dnf5, apt - add ``auto_install_module_deps`` option (https://github.com/ansible/ansible/issues/84206)
- docs - add collection name in message from which the module is being deprecated (https://github.com/ansible/ansible/issues/84116).
- env lookup - The error message generated for a missing environment variable when ``default`` is an undefined value (e.g. ``undef('something')``) will contain the hint from that undefined value, except when the undefined value is the default of ``undef()`` with no arguments. Previously, any existing undefined hint would be ignored.
- file - enable file module to disable diff_mode (https://github.com/ansible/ansible/issues/80817).
- file - make code more readable and simple.
- filter - add support for URL-safe encoding and decoding in b64encode and b64decode (https://github.com/ansible/ansible/issues/84147).
- find - add a checksum_algorithm parameter to specify which type of checksum the module will return
- from_json filter - The filter accepts a ``profile`` argument, which defaults to ``tagless``.
- handlers - Templated handler names with syntax errors, or that resolve to ``omit`` are now skipped like handlers with undefined variables in their name.
- improved error message for yaml parsing errors in plugin documentation
- local connection plugin - A new ``become_strip_preamble`` config option (default True) was added; disable to preserve diagnostic ``become`` output in task results.
- local connection plugin - A new ``become_success_timeout`` operation-wide timeout config (default 10s) was added for ``become``.
- local connection plugin - When a ``become`` plugin's ``prompt`` value is a non-string after the ``check_password_prompt`` callback has completed, no prompt stripping will occur on stderr.
- lookup_template - add an option to trim blocks while templating (https://github.com/ansible/ansible/issues/75962).
- module - set ipv4 and ipv6 rules simultaneously in iptables module (https://github.com/ansible/ansible/issues/84404).
- module_utils - Add ``NoReturn`` type annotations to functions which never return.
- modules - PowerShell modules can now receive ``datetime.date``, ``datetime.time`` and ``datetime.datetime`` values as ISO 8601 strings.
- modules - PowerShell modules can now receive strings sourced from inline vault-encrypted strings.
- modules - The ``collection_name`` arg to Python module-side ``deprecate`` methods no longer has any effect. Information about the calling module is automatically captured by the warning infrastructure and included in the module result.
- modules - Unhandled exceptions during Python module execution are now returned as structured data from the target. This allows the new traceback handling to be applied to exceptions raised on targets.
- pipelining logic has mostly moved to connection plugins so they can decide/override settings.
- plugin error handling - When raising exceptions in an exception handler, be sure to use ``raise ... from`` as appropriate. This supersedes the use of the ``AnsibleError`` arg ``orig_exc`` to represent the cause. Specifying ``orig_exc`` as the cause is still permitted. Failure to use ``raise ... from`` when ``orig_exc`` is set will result in a warning. Additionally, if the two cause exceptions do not match, a warning will be issued.
- removed harcoding of su plugin as it now works with pipelining.
- runtime-metadata sanity test - improve validation of ``action_groups`` (https://github.com/ansible/ansible/pull/83965).
- service_facts module got freebsd support added.
- ssh connection plugin - Support ``SSH_ASKPASS`` mechanism to provide passwords, making it the default, but still offering an explicit choice to use ``sshpass`` (https://github.com/ansible/ansible/pull/83936)
- ssh connection plugin now overrides pipelining when a tty is requested.
- ssh-agent - ``ansible``, ``ansible-playbook`` and ``ansible-console`` are capable of spawning or reusing an ssh-agent, allowing plugins to interact with the ssh-agent. Additionally a pure python ssh-agent client has been added, enabling easy interaction with the agent. The ssh connection plugin contains new functionality via ``ansible_ssh_private_key`` and ``ansible_ssh_private_key_passphrase``, for loading an SSH private key into the agent from a variable.
- templating - Access to an undefined variable from inside a lookup, filter, or test (which raises MarkerError) no longer ends processing of the current template. The triggering undefined value is returned as the result of the offending plugin invocation, and the template continues to execute.
- templating - Embedding ``range()`` values in containers such as lists will result in an error on use. Previously the value would be converted to a string representing the range parameters, such as ``range(0, 3)``.
- templating - Handling of omitted values is now a first-class feature of the template engine, and is usable in all Ansible Jinja template contexts. Any template that resolves to ``omit`` is automatically removed from its parent container during templating.
- templating - Template evaluation is lazier than in previous versions. Template expressions which resolve only portions of a data structure no longer result in the entire structure being templated.
- templating - Templating errors now provide more information about both the location and context of the error, especially for deeply-nested and/or indirected templating scenarios.
- templating - Unified ``omit`` behavior now requires that plugins calling ``Templar.template()`` handle cases where the entire template result is omitted, by catching the ``AnsibleValueOmittedError`` that is raised. Previously, this condition caused a randomly-generated string marker to appear in the template result.
- templating - Variables of type ``set`` and ``tuple`` are now converted to ``list`` when exiting the final pass of templating.
- to_json / to_nice_json filters - The filters accept a ``profile`` argument, which defaults to ``tagless``.
- troubleshooting - Tracebacks can be collected and displayed for most errors, warnings, and deprecation warnings (including those generated by modules). Tracebacks are no longer enabled with ``-vvv``; the behavior is directly configurable via the ``DISPLAY_TRACEBACK`` config option. Module tracebacks passed to ``fail_json`` via the ``exception`` kwarg will not be included in the task result unless error tracebacks are configured.
- undef jinja function - The ``undef`` jinja function now raises an error if a non-string hint is given. Attempting to use an undefined hint also results in an error, ensuring incorrect use of the function can be distinguished from the function's normal behavior.
- validate-modules sanity test - make sure that ``module`` and ``plugin`` ``seealso`` entries use FQCNs (https://github.com/ansible/ansible/pull/84325).
- vault - improved vault filter documentation by adding missing example content for dump_template_data.j2, refining examples for clarity, and ensuring variable consistency (https://github.com/ansible/ansible/issues/83583).
- warnings - All warnings (including deprecation warnings) issued during a task's execution are now accessible via the ``warnings`` and ``deprecations`` keys on the task result.
- when the ``dict`` lookup is given a non-dict argument, show the value of the argument and its type in the error message.
- windows - add hard minimum limit for PowerShell to 5.1. Ansible dropped support for older versions of PowerShell in the 2.16 release but this reqirement is now enforced at runtime.
- windows - refactor windows exec runner to improve efficiency and add better error reporting on failures.
- winrm - Remove need for pexpect on macOS hosts when using ``kinit`` to retrieve the Kerberos TGT. By default the code will now only use the builtin ``subprocess`` library which should handle issues with select and a high fd count and also simplify the code.
Breaking Changes / Porting Guide
--------------------------------
- Support for the ``toml`` library has been removed from TOML inventory parsing and dumping. Use ``tomli`` for parsing on Python 3.10. Python 3.11 and later have built-in support for parsing. Use ``tomli-w`` to support outputting inventory in TOML format.
- assert - The ``quiet`` argument must be a commonly-accepted boolean value. Previously, unrecognized values were silently treated as False.
- callback plugins - The structure of the ``exception``, ``warnings`` and ``deprecations`` values visible to callbacks has changed. Callbacks that inspect or serialize these values may require special handling.
- conditionals - Conditional expressions that result in non-boolean values are now an error by default. Such results often indicate unintentional use of templates where they are not supported, resulting in a conditional that is always true. When this option is enabled, conditional expressions which are a literal ``None`` or empty string will evaluate as true, for backwards compatibility. The error can be temporarily changed to a deprecation warning by enabling the ``ALLOW_BROKEN_CONDITIONALS`` config option.
- first_found lookup - When specifying ``files`` or ``paths`` as a templated list containing undefined values, the undefined list elements will be discarded with a warning. Previously, the entire list would be discarded without any warning.
- internals - The ``AnsibleLoader`` and ``AnsibleDumper`` classes for working with YAML are now factory functions and cannot be extended.
- internals - The ``ansible.utils.native_jinja`` Python module has been removed.
- inventory - Invalid variable names provided by inventories result in an inventory parse failure. This behavior is now consistent with other variable name usages throughout Ansible.
- lookup plugins - Lookup plugins called as `with_(lookup)` will no longer have the `_subdir` attribute set.
- lookup plugins - ``terms`` will always be passed to ``run`` as the first positional arg, where previously it was sometimes passed as a keyword arg when using ``with_`` syntax.
- loops - Omit placeholders no longer leak between loop item templating and task templating. Previously, ``omit`` placeholders could remain embedded in loop items after templating and be used as an ``omit`` for task templating. Now, values resolving to ``omit`` are dropped immediately when loop items are templated. To turn missing values into an ``omit`` for task templating, use ``| default(omit)``. This solution is backwards compatible with previous versions of ansible-core.
- modules - Ansible modules using ``sys.excepthook`` must use a standard ``try/except`` instead.
- plugins - Any plugin that sources or creates templates must properly tag them as trusted.
- plugins - Custom Jinja plugins that accept undefined top-level arguments must opt in to receiving them.
- plugins - Custom Jinja plugins that use ``environment.getitem`` to retrieve undefined values will now trigger a ``MarkerError`` exception. This exception must be handled to allow the plugin to return a ``Marker``, or the plugin must opt-in to accepting ``Marker`` values.
- public API - The ``ansible.vars.fact_cache.FactCache`` wrapper has been removed.
- serialization of ``omit`` sentinel - Serialization of variables containing ``omit`` sentinels (e.g., by the ``to_json`` and ``to_yaml`` filters or ``ansible-inventory``) will fail if the variable has not completed templating. Previously, serialization succeeded with placeholder strings emitted in the serialized output.
- set_fact - The string values "yes", "no", "true" and "false" were previously converted (ignoring case) to boolean values when not using Jinja2 native mode. Since Jinja2 native mode is always used, this conversion no longer occurs. When boolean values are required, native boolean syntax should be used where variables are defined, such as in YAML. When native boolean syntax is not an option, the ``bool`` filter can be used to parse string values into booleans.
- template lookup - The ``convert_data`` option is deprecated and no longer has any effect. Use the ``from_json`` filter on the lookup result instead.
- templating - Access to ``_`` prefixed attributes and methods, and methods with known side effects, is no longer permitted. In cases where a matching mapping key is present, the associated value will be returned instead of an error. This increases template environment isolation and ensures more consistent behavior between the ``.`` and ``[]`` operators.
- templating - Conditionals and lookups which use embedded inline templates in Jinja string constants now display a warning. These templates should be converted to their expression equivalent.
- templating - Many Jinja plugins (filters, lookups, tests) and methods previously silently ignored undefined inputs, which often masked subtle errors. Passing an undefined argument to a Jinja plugin or method that does not declare undefined support now results in an undefined value.
- templating - Templates are always rendered in Jinja2 native mode. As a result, non-string values are no longer automatically converted to strings.
- templating - Templates resulting in ``None`` are no longer automatically converted to an empty string.
- templating - Templates with embedded inline templates that were not contained within a Jinja string constant now result in an error, as support for multi-pass templating was removed for security reasons. In most cases, such templates can be easily rewritten to avoid the use of embedded inline templates.
- templating - The ``allow_unsafe_lookups`` option no longer has any effect. Lookup plugins are responsible for tagging strings containing templates to allow evaluation as a template.
- templating - The result of the ``range()`` global function cannot be returned from a template- it should always be passed to a filter (e.g., ``random``). Previously, range objects returned from an intermediate template were always converted to a list, which is inconsistent with inline consumption of range objects.
- templating - ``#jinja2:`` overrides in templates with invalid override names or types are now templating errors.
Deprecated Features
-------------------
- CLI - The ``--inventory-file`` option alias is deprecated. Use the ``-i`` or ``--inventory`` option instead.
- Stategy Plugins - Use of strategy plugins not provided in ``ansible.builtin`` are deprecated and do not carry any backwards compatibility guarantees going forward. A future release will remove the ability to use external strategy plugins. No alternative for third party strategy plugins is currently planned.
- ``ansible.module_utils.compat.datetime`` - The datetime compatibility shims are now deprecated. They are scheduled to be removed in ``ansible-core`` v2.21. This includes ``UTC``, ``utcfromtimestamp()`` and ``utcnow`` importable from said module (https://github.com/ansible/ansible/pull/81874).
- bool filter - Support for coercing unrecognized input values (including None) has been deprecated. Consult the filter documentation for acceptable values, or consider use of the ``truthy`` and ``falsy`` tests.
- cache plugins - The `ansible.plugins.cache.base` Python module is deprecated. Use `ansible.plugins.cache` instead.
- callback plugins - The `v2_on_any` callback method is deprecated. Use specific callback methods instead.
- callback plugins - The v1 callback API (callback methods not prefixed with `v2_`) is deprecated. Use `v2_` prefixed methods instead.
- conditionals - Conditionals using Jinja templating delimiters (e.g., ``{{``, ``{%``) should be rewritten as expressions without delimiters, unless the entire conditional value is a single template that resolves to a trusted string expression. This is useful for dynamic indirection of conditional expressions, but is limited to trusted literal string expressions.
- config - The ``ACTION_WARNINGS`` config has no effect. It previously disabled command warnings, which have since been removed.
- config - The ``DEFAULT_JINJA2_NATIVE`` option has no effect. Jinja2 native mode is now the default and only option.
- config - The ``DEFAULT_NULL_REPRESENTATION`` option has no effect. Null values are no longer automatically converted to another value during templating of single variable references.
- display - The ``Display.get_deprecation_message`` method has been deprecated. Call ``Display.deprecated`` to display a deprecation message, or call it with ``removed=True`` to raise an ``AnsibleError``.
- file loading - Loading text files with ``DataLoader`` containing data that cannot be decoded under the expected encoding is deprecated. In most cases the encoding must be UTF-8, although some plugins allow choosing a different encoding. Previously, invalid data was silently wrapped in Unicode surrogate escape sequences, often resulting in later errors or other data corruption.
- first_found lookup - Splitting of file paths on ``,;:`` is deprecated. Pass a list of paths instead. The ``split`` method on strings can be used to split variables into a list as needed.
- interpreter discovery - The ``auto_legacy`` and ``auto_legacy_silent`` options for ``INTERPRETER_PYTHON`` are deprecated. Use ``auto`` or ``auto_silent`` options instead, as they have the same effect.
- oneline callback - The ``oneline`` callback and its associated ad-hoc CLI args (``-o``, ``--one-line``) are deprecated.
- paramiko - The paramiko connection plugin has been deprecated with planned removal in 2.21.
- playbook variables - The ``play_hosts`` variable has been deprecated, use ``ansible_play_batch`` instead.
- plugin error handling - The ``AnsibleError`` constructor arg ``suppress_extended_error`` is deprecated. Using ``suppress_extended_error=True`` has the same effect as ``show_content=False``.
- plugins - The ``listify_lookup_plugin_terms`` function is obsolete and in most cases no longer needed.
- template lookup - The jinja2_native option is no longer used in the Ansible Core code base. Jinja2 native mode is now the default and only option.
- templating - Support for enabling Jinja2 extensions (not plugins) has been deprecated.
- templating - The ``ansible_managed`` variable available for certain templating scenarios, such as the ``template`` action and ``template`` lookup has been deprecated. Define and use a custom variable instead of relying on ``ansible_managed``.
- templating - The ``disable_lookups`` option has no effect, since plugins must be updated to apply trust before any templating can be performed.
- to_yaml/to_nice_yaml filters - Implicit YAML dumping of vaulted value ciphertext is deprecated. Set `dump_vault_tags` to explicitly specify the desired behavior.
- tree callback - The ``tree`` callback and its associated ad-hoc CLI args (``-t``, ``--tree``) are deprecated.
Removed Features (previously deprecated)
----------------------------------------
- Remove deprecated plural form of collection path (https://github.com/ansible/ansible/pull/84156).
- Removed deprecated STRING_CONVERSION_ACTION (https://github.com/ansible/ansible/issues/84220).
- encrypt - passing unsupported passlib hashtype now raises AnsibleFilterError.
- manager - remove deprecated include_delegate_to parameter from get_vars API.
- modules - Modules returning non-UTF8 strings now result in an error. The ``MODULE_STRICT_UTF8_RESPONSE`` setting can be used to disable this check.
- removed deprecated pycompat24 and compat.importlib.
- selector - remove deprecated compat.selector related files (https://github.com/ansible/ansible/pull/84155).
- windows - removed common module functions ``ConvertFrom-AnsibleJson``, ``Format-AnsibleException`` from Windows modules as they are not used and add uneeded complexity to the code.
Security Fixes
--------------
- include_vars action - Ensure that result masking is correctly requested when vault-encrypted files are read. (CVE-2024-8775)
- task result processing - Ensure that action-sourced result masking (``_ansible_no_log=True``) is preserved. (CVE-2024-8775)
- templating - Ansible's template engine no longer processes Jinja templates in strings unless they are marked as coming from a trusted source. Untrusted strings containing Jinja template markers are ignored with a warning. Examples of trusted sources include playbooks, vars files, and many inventory sources. Examples of untrusted sources include module results and facts. Plugins which have not been updated to preserve trust while manipulating strings may inadvertently cause them to lose their trusted status.
- templating - Changes to conditional expression handling removed numerous instances of insecure multi-pass templating (which could result in execution of untrusted template expressions).
- user action won't allow ssh-keygen, chown and chmod to run on existing ssh public key file, avoiding traversal on existing symlinks (CVE-2024-9902).
Bugfixes
--------
- Ansible will now also warn when reserved keywords are set via a module (set_fact, include_vars, etc).
- Ansible.Basic - Fix ``required_if`` check when the option value to check is unset or set to null.
- Correctly return ``False`` when using the ``filter`` and ``test`` Jinja tests on plugin names which are not filters or tests, respectively. (resolves issue https://github.com/ansible/ansible/issues/82084)
- Do not run implicit ``flush_handlers`` meta tasks when the whole play is excluded from the run due to tags specified.
- Errors now preserve stacked error messages even when YAML is involved.
- Fix a display.debug statement with the wrong param in _get_diff_data() method
- Fix disabling SSL verification when installing collections and roles from git repositories. If ``--ignore-certs`` isn't provided, the value for the ``GALAXY_IGNORE_CERTS`` configuration option will be used (https://github.com/ansible/ansible/issues/83326).
- Fix ipv6 pattern bug in lib/ansible/parsing/utils/addresses.py (https://github.com/ansible/ansible/issues/84237)
- Fix returning 'unreachable' for the overall task result. This prevents false positives when a looped task has unignored unreachable items (https://github.com/ansible/ansible/issues/84019).
- Implicit ``meta: flush_handlers`` tasks now have a parent block to prevent potential tracebacks when calling methods like ``get_play()`` on them internally.
- Improve performance on large inventories by reducing the number of implicit meta tasks.
- Jinja plugins - Errors raised will always be derived from ``AnsibleTemplatePluginError``.
- Optimize the way tasks from within ``include_tasks``/``include_role`` are inserted into the play.
- Time out waiting on become is an unreachable error (https://github.com/ansible/ansible/issues/84468)
- Use consistent multiprocessing context for action write locks
- Use the requested error message in the ansible.module_utils.facts.timeout timeout function instead of hardcoding one.
- Windows - add support for running on system where WDAC is in audit mode with ``Dynamic Code Security`` enabled.
- YAML parsing - The `!unsafe` tag no longer coerces non-string scalars to strings.
- ``ansible-galaxy`` — the collection dependency resolver now treats version specifiers starting with ``!=`` as unpinned.
- ``package``/``dnf`` action plugins - provide the reason behind the failure to gather the ``ansible_pkg_mgr`` fact to identify the package backend
- action plugins - Action plugins that raise unhandled exceptions no longer terminate playbook loops. Previously, exceptions raised by an action plugin caused abnormal loop termination and loss of loop iteration results.
- ansible-config - format galaxy server configs while dumping in JSON format (https://github.com/ansible/ansible/issues/84840).
- ansible-doc - If none of the files in files exists, path will be undefined and a direct reference will throw an UnboundLocalError (https://github.com/ansible/ansible/pull/84464).
- ansible-galaxy - Small adjustments to URL building for ``download_url`` and relative redirects.
- ansible-pull change detection will now work independently of callback or result format settings.
- ansible-test - Enable the ``sys.unraisablehook`` work-around for the ``pylint`` sanity test on Python 3.11. Previously the work-around was only enabled for Python 3.12 and later. However, the same issue has been discovered on Python 3.11.
- ansible-test - Ensure CA certificates are installed on managed FreeBSD instances.
- ansible-test - Fix support for PowerShell module_util imports with the ``-Optional`` flag.
- ansible-test - Fix support for detecting PowerShell modules importing module utils with the newer ``#AnsibleRequires`` format.
- ansible-test - Fix traceback that occurs after an interactive command fails.
- ansible-test - Fix up coverage reporting to properly translate the temporary path of integration test modules to the expected static test module path.
- ansible-test - Fixed traceback when handling certain YAML errors in the ``yamllint`` sanity test.
- ansible-test - Managed macOS instances now use the ``sudo_chdir`` option for the ``sudo`` become plugin to avoid permission errors when dropping privileges.
- ansible-vault will now correctly handle `--prompt`, previously it would issue an error about stdin if no 2nd argument was passed
- ansible_uptime_second - added ansible_uptime_seconds fact support for AIX (https://github.com/ansible/ansible/pull/84321).
- apt_key module - prevent tests from running when apt-key was removed
- base.yml - deprecated libvirt_lxc_noseclabel config.
- build - Pin ``wheel`` in ``pyproject.toml`` to ensure compatibility with supported ``setuptools`` versions.
- config - various fixes to config lookup plugin (https://github.com/ansible/ansible/pull/84398).
- copy - refactor copy module for simplicity.
- copy action now prevents user from setting internal options.
- debconf - set empty password values (https://github.com/ansible/ansible/issues/83214).
- debug - hide loop vars in debug var display (https://github.com/ansible/ansible/issues/65856).
- default callback - Error context is now shown for failing tasks that use the ``debug`` action.
- display - The ``Display.deprecated`` method once again properly handles the ``removed=True`` argument (https://github.com/ansible/ansible/issues/82358).
- distro - add support for Linux Mint Debian Edition (LMDE) (https://github.com/ansible/ansible/issues/84934).
- distro - detect Debian as os_family for LMDE 6 (https://github.com/ansible/ansible/issues/84934).
- dnf5 - Handle forwarded exceptions from dnf5-5.2.13 where a generic ``RuntimeError`` was previously raised
- dnf5 - fix ``is_installed`` check for packages that are not installed but listed as provided by an installed package (https://github.com/ansible/ansible/issues/84578)
- dnf5 - fix installing a package using ``state=latest`` when a binary of the same name as the package is already installed (https://github.com/ansible/ansible/issues/84259)
- dnf5 - fix traceback when ``enable_plugins``/``disable_plugins`` is used on ``python3-libdnf5`` versions that do not support this functionality
- dnf5 - libdnf5 - use ``conf.pkg_gpgcheck`` instead of deprecated ``conf.gpgcheck`` which is used only as a fallback
- dnf5 - matching on a binary can be achieved only by specifying a full path (https://github.com/ansible/ansible/issues/84334)
- facts - gather pagesize and calculate respective values depending upon architecture (https://github.com/ansible/ansible/issues/84773).
- facts - skip if distribution file path is directory, instead of raising error (https://github.com/ansible/ansible/issues/84006).
- find - skip ENOENT error code while recursively enumerating files. find module will now be tolerant to race conditions that remove files or directories from the target it is currently inspecting. (https://github.com/ansible/ansible/issues/84873).
- first_found lookup - Corrected return value documentation to reflect None (not empty string) for no files found.
- gather_facts action now defaults to `ansible.legacy.setup` if `smart` was set, no network OS was found and no other alias for `setup` was present.
- gather_facts action will now issues errors and warnings as appropriate if a network OS is detected but no facts modules are defined for it.
- gather_facts action, will now add setup when 'smart' appears with other modules in the FACTS_MODULES setting (#84750).
- get_url - add support for BSD-style checksum digest file (https://github.com/ansible/ansible/issues/84476).
- get_url - fix honoring ``filename`` from the ``content-disposition`` header even when the type is ``inline`` (https://github.com/ansible/ansible/issues/83690)
- host_group_vars - fixed defining the 'key' variable if the get_vars method is called with cache=False (https://github.com/ansible/ansible/issues/84384)
- include_vars - fix including previously undefined hash variables with hash_behaviour merge (https://github.com/ansible/ansible/issues/84295).
- iptables - Allows the wait paramater to be used with iptables chain creation (https://github.com/ansible/ansible/issues/84490)
- linear strategy - fix executing ``end_role`` meta tasks for each host, instead of handling these as implicit run_once tasks (https://github.com/ansible/ansible/issues/84660).
- local connection plugin - Become timeout errors now include all received data. Previously, the most recently-received data was discarded.
- local connection plugin - Ensure ``become`` success validation always occurs, even when an active plugin does not set ``prompt``.
- local connection plugin - Fixed cases where the internal ``BECOME-SUCCESS`` message appeared in task output.
- local connection plugin - Fixed hang or spurious failure when data arrived concurrently on stdout and stderr during a successful ``become`` operation validation.
- local connection plugin - Fixed hang when a become plugin expects a prompt but a password was not provided.
- local connection plugin - Fixed hang when an active become plugin incorrectly signals lack of prompt.
- local connection plugin - Fixed hang when an internal become read timeout expired before the password prompt was written.
- local connection plugin - Fixed hang when only one of stdout or stderr was closed by the ``become_exe`` subprocess.
- local connection plugin - Fixed long timeout/hang for ``become`` plugins that repeat their prompt on failure (e.g., ``sudo``, some ``su`` implementations).
- local connection plugin - Fixed silent ignore of ``become`` failures and loss of task output when data arrived concurrently on stdout and stderr during ``become`` operation validation.
- local connection plugin - Fixed task output header truncation when post-become data arrived before ``become`` operation validation had completed.
- lookup plugins - The ``terms`` arg to the ``run`` method is now always a list. Previously, there were cases where a non-list could be received.
- module arg templating - When using a templated raw task arg and a templated ``args`` keyword, args are now merged. Previously use of templated raw task args silently ignored all values from the templated ``args`` keyword.
- module defaults - Module defaults are no longer templated unless they are used by a task that does not override them. Previously, all module defaults for all modules were templated for every task.
- module respawn - limit to supported Python versions
- omitting task args - Use of omit for task args now properly falls back to args of lower precedence, such as module defaults. Previously an omitted value would obliterate values of lower precedence.
- package_facts module when using 'auto' will return the first package manager found that provides an output, instead of just the first one, as this can be foreign and not have any packages.
- psrp - Improve stderr parsing when running raw commands that emit error records or stderr lines.
- regex_search filter - Corrected return value documentation to reflect None (not empty string) for no match.
- respawn - use copy of env variables to update existing PYTHONPATH value (https://github.com/ansible/ansible/issues/84954).
- runas become - Fix up become logic to still get the SYSTEM token with the most privileges when running as SYSTEM.
- sequence lookup - sequence query/lookups without positional arguments now return a valid list if their kwargs comprise a valid sequence expression (https://github.com/ansible/ansible/issues/82921).
- service_facts - skip lines which does not contain service names in openrc output (https://github.com/ansible/ansible/issues/84512).
- ssh - Improve the logic for parsing CLIXML data in stderr when working with Windows host. This fixes issues when the raw stderr contains invalid UTF-8 byte sequences and improves embedded CLIXML sequences.
- ssh - Raise exception when sshpass returns error code (https://github.com/ansible/ansible/issues/58133).
- ssh - connection options were incorrectly templated during ``reset_connection`` tasks (https://github.com/ansible/ansible/pull/84238).
- stability - Fixed silent process failure on unhandled IOError/OSError under ``linear`` strategy.
- su become plugin - Ensure generated regex from ``prompt_l10n`` config values is properly escaped.
- su become plugin - Ensure that password prompts are correctly detected in the presence of leading output. Previously, this case resulted in a timeout or hang.
- su become plugin - Ensure that trailing colon is expected on all ``prompt_l10n`` config values.
- sudo become plugin - The `sudo_chdir` config option allows the current directory to be set to the specified value before executing sudo to avoid permission errors when dropping privileges.
- sunos - remove hard coding of virtinfo command in facts gathering code (https://github.com/ansible/ansible/pull/84357).
- to_yaml/to_nice_yaml filters - Eliminated possibility of keyword arg collisions with internally-set defaults.
- unarchive - Clamp timestamps from beyond y2038 to representible values when unpacking zip files on platforms that use 32-bit time_t (e.g. Debian i386).
- uri - Form location correctly when the server returns a relative redirect (https://github.com/ansible/ansible/issues/84540)
- uri - Handle HTTP exceptions raised while reading the content (https://github.com/ansible/ansible/issues/83794).
- uri - mark ``url`` as required (https://github.com/ansible/ansible/pull/83642).
- user - Create Buildroot subclass as alias to Busybox (https://github.com/ansible/ansible/issues/83665).
- user - Set timeout for passphrase interaction.
- user - Update prompt for SSH key passphrase (https://github.com/ansible/ansible/issues/84484).
- user - Use higher precedence HOME_MODE as UMASK for path provided (https://github.com/ansible/ansible/pull/84482).
- user action will now require O(force) to overwrite the public part of an ssh key when generating ssh keys, as was already the case for the private part.
- user module now avoids changing ownership of files symlinked in provided home dir skeleton
- vars lookup - The ``default`` substitution only applies when trying to look up a variable which is not defined. If the variable is defined, but templates to an undefined value, the ``default`` substitution will not apply. Use the ``default`` filter to coerce those values instead.
- wait_for_connection - a warning was displayed if any hosts used a local connection (https://github.com/ansible/ansible/issues/84419)
Known Issues
------------
- templating - Any string value starting with ``#jinja2:`` which is templated will always be interpreted as Jinja2 configuration overrides. To include this literal value at the start of a string, a space or other character must precede it.
- variables - Tagged values cannot be used for dictionary keys in many circumstances.
- variables - The values ``None``, ``True`` and ``False`` cannot be tagged because they are singletons. Attempts to apply tags to these values will be silently ignored.

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.

View File

@ -1,5 +1,810 @@
# Ancestor is the first release after stable-2.9 was branched
# Technically this should be 2.9.0b1, but that is not a valid
# semantic version and the semver parser will complain.
ancestor: 2.9.0
releases: {}
ancestor: 2.18.0
releases:
2.19.0b1:
changes:
breaking_changes:
- Support for the ``toml`` library has been removed from TOML inventory parsing
and dumping. Use ``tomli`` for parsing on Python 3.10. Python 3.11 and later
have built-in support for parsing. Use ``tomli-w`` to support outputting inventory
in TOML format.
- assert - The ``quiet`` argument must be a commonly-accepted boolean value.
Previously, unrecognized values were silently treated as False.
- callback plugins - The structure of the ``exception``, ``warnings`` and ``deprecations``
values visible to callbacks has changed. Callbacks that inspect or serialize
these values may require special handling.
- conditionals - Conditional expressions that result in non-boolean values are
now an error by default. Such results often indicate unintentional use of
templates where they are not supported, resulting in a conditional that is
always true. When this option is enabled, conditional expressions which are
a literal ``None`` or empty string will evaluate as true, for backwards compatibility.
The error can be temporarily changed to a deprecation warning by enabling
the ``ALLOW_BROKEN_CONDITIONALS`` config option.
- first_found lookup - When specifying ``files`` or ``paths`` as a templated
list containing undefined values, the undefined list elements will be discarded
with a warning. Previously, the entire list would be discarded without any
warning.
- internals - The ``AnsibleLoader`` and ``AnsibleDumper`` classes for working
with YAML are now factory functions and cannot be extended.
- internals - The ``ansible.utils.native_jinja`` Python module has been removed.
- inventory - Invalid variable names provided by inventories result in an inventory
parse failure. This behavior is now consistent with other variable name usages
throughout Ansible.
- lookup plugins - Lookup plugins called as `with_(lookup)` will no longer have
the `_subdir` attribute set.
- lookup plugins - ``terms`` will always be passed to ``run`` as the first positional
arg, where previously it was sometimes passed as a keyword arg when using
``with_`` syntax.
- loops - Omit placeholders no longer leak between loop item templating and
task templating. Previously, ``omit`` placeholders could remain embedded in
loop items after templating and be used as an ``omit`` for task templating.
Now, values resolving to ``omit`` are dropped immediately when loop items
are templated. To turn missing values into an ``omit`` for task templating,
use ``| default(omit)``. This solution is backwards compatible with previous
versions of ansible-core.
- modules - Ansible modules using ``sys.excepthook`` must use a standard ``try/except``
instead.
- plugins - Any plugin that sources or creates templates must properly tag them
as trusted.
- plugins - Custom Jinja plugins that accept undefined top-level arguments must
opt in to receiving them.
- plugins - Custom Jinja plugins that use ``environment.getitem`` to retrieve
undefined values will now trigger a ``MarkerError`` exception. This exception
must be handled to allow the plugin to return a ``Marker``, or the plugin
must opt-in to accepting ``Marker`` values.
- public API - The ``ansible.vars.fact_cache.FactCache`` wrapper has been removed.
- serialization of ``omit`` sentinel - Serialization of variables containing
``omit`` sentinels (e.g., by the ``to_json`` and ``to_yaml`` filters or ``ansible-inventory``)
will fail if the variable has not completed templating. Previously, serialization
succeeded with placeholder strings emitted in the serialized output.
- set_fact - The string values "yes", "no", "true" and "false" were previously
converted (ignoring case) to boolean values when not using Jinja2 native mode.
Since Jinja2 native mode is always used, this conversion no longer occurs.
When boolean values are required, native boolean syntax should be used where
variables are defined, such as in YAML. When native boolean syntax is not
an option, the ``bool`` filter can be used to parse string values into booleans.
- template lookup - The ``convert_data`` option is deprecated and no longer
has any effect. Use the ``from_json`` filter on the lookup result instead.
- templating - Access to ``_`` prefixed attributes and methods, and methods
with known side effects, is no longer permitted. In cases where a matching
mapping key is present, the associated value will be returned instead of an
error. This increases template environment isolation and ensures more consistent
behavior between the ``.`` and ``[]`` operators.
- templating - Conditionals and lookups which use embedded inline templates
in Jinja string constants now display a warning. These templates should be
converted to their expression equivalent.
- templating - Many Jinja plugins (filters, lookups, tests) and methods previously
silently ignored undefined inputs, which often masked subtle errors. Passing
an undefined argument to a Jinja plugin or method that does not declare undefined
support now results in an undefined value.
- templating - Templates are always rendered in Jinja2 native mode. As a result,
non-string values are no longer automatically converted to strings.
- templating - Templates resulting in ``None`` are no longer automatically converted
to an empty string.
- templating - Templates with embedded inline templates that were not contained
within a Jinja string constant now result in an error, as support for multi-pass
templating was removed for security reasons. In most cases, such templates
can be easily rewritten to avoid the use of embedded inline templates.
- templating - The ``allow_unsafe_lookups`` option no longer has any effect.
Lookup plugins are responsible for tagging strings containing templates to
allow evaluation as a template.
- templating - The result of the ``range()`` global function cannot be returned
from a template- it should always be passed to a filter (e.g., ``random``).
Previously, range objects returned from an intermediate template were always
converted to a list, which is inconsistent with inline consumption of range
objects.
- templating - ``#jinja2:`` overrides in templates with invalid override names
or types are now templating errors.
bugfixes:
- Ansible will now also warn when reserved keywords are set via a module (set_fact,
include_vars, etc).
- Ansible.Basic - Fix ``required_if`` check when the option value to check is
unset or set to null.
- Correctly return ``False`` when using the ``filter`` and ``test`` Jinja tests
on plugin names which are not filters or tests, respectively. (resolves issue
https://github.com/ansible/ansible/issues/82084)
- Do not run implicit ``flush_handlers`` meta tasks when the whole play is excluded
from the run due to tags specified.
- Errors now preserve stacked error messages even when YAML is involved.
- Fix a display.debug statement with the wrong param in _get_diff_data() method
- Fix disabling SSL verification when installing collections and roles from
git repositories. If ``--ignore-certs`` isn't provided, the value for the
``GALAXY_IGNORE_CERTS`` configuration option will be used (https://github.com/ansible/ansible/issues/83326).
- Fix ipv6 pattern bug in lib/ansible/parsing/utils/addresses.py (https://github.com/ansible/ansible/issues/84237)
- Fix returning 'unreachable' for the overall task result. This prevents false
positives when a looped task has unignored unreachable items (https://github.com/ansible/ansible/issues/84019).
- 'Implicit ``meta: flush_handlers`` tasks now have a parent block to prevent
potential tracebacks when calling methods like ``get_play()`` on them internally.'
- Improve performance on large inventories by reducing the number of implicit
meta tasks.
- Jinja plugins - Errors raised will always be derived from ``AnsibleTemplatePluginError``.
- Optimize the way tasks from within ``include_tasks``/``include_role`` are
inserted into the play.
- Time out waiting on become is an unreachable error (https://github.com/ansible/ansible/issues/84468)
- Use consistent multiprocessing context for action write locks
- Use the requested error message in the ansible.module_utils.facts.timeout
timeout function instead of hardcoding one.
- Windows - add support for running on system where WDAC is in audit mode with
``Dynamic Code Security`` enabled.
- YAML parsing - The `!unsafe` tag no longer coerces non-string scalars to strings.
- "``ansible-galaxy`` \u2014 the collection dependency resolver now treats version
specifiers starting with ``!=`` as unpinned."
- '``package``/``dnf`` action plugins - provide the reason behind the failure
to gather the ``ansible_pkg_mgr`` fact to identify the package backend'
- action plugins - Action plugins that raise unhandled exceptions no longer
terminate playbook loops. Previously, exceptions raised by an action plugin
caused abnormal loop termination and loss of loop iteration results.
- ansible-config - format galaxy server configs while dumping in JSON format
(https://github.com/ansible/ansible/issues/84840).
- ansible-doc - If none of the files in files exists, path will be undefined
and a direct reference will throw an UnboundLocalError (https://github.com/ansible/ansible/pull/84464).
- ansible-galaxy - Small adjustments to URL building for ``download_url`` and
relative redirects.
- ansible-pull change detection will now work independently of callback or result
format settings.
- ansible-test - Enable the ``sys.unraisablehook`` work-around for the ``pylint``
sanity test on Python 3.11. Previously the work-around was only enabled for
Python 3.12 and later. However, the same issue has been discovered on Python
3.11.
- ansible-test - Ensure CA certificates are installed on managed FreeBSD instances.
- ansible-test - Fix support for PowerShell module_util imports with the ``-Optional``
flag.
- ansible-test - Fix support for detecting PowerShell modules importing module
utils with the newer ``#AnsibleRequires`` format.
- ansible-test - Fix traceback that occurs after an interactive command fails.
- ansible-test - Fix up coverage reporting to properly translate the temporary
path of integration test modules to the expected static test module path.
- ansible-test - Fixed traceback when handling certain YAML errors in the ``yamllint``
sanity test.
- ansible-test - Managed macOS instances now use the ``sudo_chdir`` option for
the ``sudo`` become plugin to avoid permission errors when dropping privileges.
- ansible-vault will now correctly handle `--prompt`, previously it would issue
an error about stdin if no 2nd argument was passed
- ansible_uptime_second - added ansible_uptime_seconds fact support for AIX
(https://github.com/ansible/ansible/pull/84321).
- apt_key module - prevent tests from running when apt-key was removed
- base.yml - deprecated libvirt_lxc_noseclabel config.
- build - Pin ``wheel`` in ``pyproject.toml`` to ensure compatibility with supported
``setuptools`` versions.
- config - various fixes to config lookup plugin (https://github.com/ansible/ansible/pull/84398).
- copy - refactor copy module for simplicity.
- copy action now prevents user from setting internal options.
- debconf - set empty password values (https://github.com/ansible/ansible/issues/83214).
- debug - hide loop vars in debug var display (https://github.com/ansible/ansible/issues/65856).
- default callback - Error context is now shown for failing tasks that use the
``debug`` action.
- display - The ``Display.deprecated`` method once again properly handles the
``removed=True`` argument (https://github.com/ansible/ansible/issues/82358).
- distro - add support for Linux Mint Debian Edition (LMDE) (https://github.com/ansible/ansible/issues/84934).
- distro - detect Debian as os_family for LMDE 6 (https://github.com/ansible/ansible/issues/84934).
- dnf5 - Handle forwarded exceptions from dnf5-5.2.13 where a generic ``RuntimeError``
was previously raised
- dnf5 - fix ``is_installed`` check for packages that are not installed but
listed as provided by an installed package (https://github.com/ansible/ansible/issues/84578)
- dnf5 - fix installing a package using ``state=latest`` when a binary of the
same name as the package is already installed (https://github.com/ansible/ansible/issues/84259)
- dnf5 - fix traceback when ``enable_plugins``/``disable_plugins`` is used on
``python3-libdnf5`` versions that do not support this functionality
- dnf5 - libdnf5 - use ``conf.pkg_gpgcheck`` instead of deprecated ``conf.gpgcheck``
which is used only as a fallback
- dnf5 - matching on a binary can be achieved only by specifying a full path
(https://github.com/ansible/ansible/issues/84334)
- facts - gather pagesize and calculate respective values depending upon architecture
(https://github.com/ansible/ansible/issues/84773).
- facts - skip if distribution file path is directory, instead of raising error
(https://github.com/ansible/ansible/issues/84006).
- find - skip ENOENT error code while recursively enumerating files. find module
will now be tolerant to race conditions that remove files or directories from
the target it is currently inspecting. (https://github.com/ansible/ansible/issues/84873).
- first_found lookup - Corrected return value documentation to reflect None
(not empty string) for no files found.
- gather_facts action now defaults to `ansible.legacy.setup` if `smart` was
set, no network OS was found and no other alias for `setup` was present.
- gather_facts action will now issues errors and warnings as appropriate if
a network OS is detected but no facts modules are defined for it.
- gather_facts action, will now add setup when 'smart' appears with other modules
in the FACTS_MODULES setting (#84750).
- get_url - add support for BSD-style checksum digest file (https://github.com/ansible/ansible/issues/84476).
- get_url - fix honoring ``filename`` from the ``content-disposition`` header
even when the type is ``inline`` (https://github.com/ansible/ansible/issues/83690)
- host_group_vars - fixed defining the 'key' variable if the get_vars method
is called with cache=False (https://github.com/ansible/ansible/issues/84384)
- include_vars - fix including previously undefined hash variables with hash_behaviour
merge (https://github.com/ansible/ansible/issues/84295).
- iptables - Allows the wait paramater to be used with iptables chain creation
(https://github.com/ansible/ansible/issues/84490)
- linear strategy - fix executing ``end_role`` meta tasks for each host, instead
of handling these as implicit run_once tasks (https://github.com/ansible/ansible/issues/84660).
- local connection plugin - Become timeout errors now include all received data.
Previously, the most recently-received data was discarded.
- local connection plugin - Ensure ``become`` success validation always occurs,
even when an active plugin does not set ``prompt``.
- local connection plugin - Fixed cases where the internal ``BECOME-SUCCESS``
message appeared in task output.
- local connection plugin - Fixed hang or spurious failure when data arrived
concurrently on stdout and stderr during a successful ``become`` operation
validation.
- local connection plugin - Fixed hang when a become plugin expects a prompt
but a password was not provided.
- local connection plugin - Fixed hang when an active become plugin incorrectly
signals lack of prompt.
- local connection plugin - Fixed hang when an internal become read timeout
expired before the password prompt was written.
- local connection plugin - Fixed hang when only one of stdout or stderr was
closed by the ``become_exe`` subprocess.
- local connection plugin - Fixed long timeout/hang for ``become`` plugins that
repeat their prompt on failure (e.g., ``sudo``, some ``su`` implementations).
- local connection plugin - Fixed silent ignore of ``become`` failures and loss
of task output when data arrived concurrently on stdout and stderr during
``become`` operation validation.
- local connection plugin - Fixed task output header truncation when post-become
data arrived before ``become`` operation validation had completed.
- lookup plugins - The ``terms`` arg to the ``run`` method is now always a list.
Previously, there were cases where a non-list could be received.
- module arg templating - When using a templated raw task arg and a templated
``args`` keyword, args are now merged. Previously use of templated raw task
args silently ignored all values from the templated ``args`` keyword.
- module defaults - Module defaults are no longer templated unless they are
used by a task that does not override them. Previously, all module defaults
for all modules were templated for every task.
- module respawn - limit to supported Python versions
- omitting task args - Use of omit for task args now properly falls back to
args of lower precedence, such as module defaults. Previously an omitted value
would obliterate values of lower precedence.
- package_facts module when using 'auto' will return the first package manager
found that provides an output, instead of just the first one, as this can
be foreign and not have any packages.
- psrp - Improve stderr parsing when running raw commands that emit error records
or stderr lines.
- regex_search filter - Corrected return value documentation to reflect None
(not empty string) for no match.
- respawn - use copy of env variables to update existing PYTHONPATH value (https://github.com/ansible/ansible/issues/84954).
- runas become - Fix up become logic to still get the SYSTEM token with the
most privileges when running as SYSTEM.
- sequence lookup - sequence query/lookups without positional arguments now
return a valid list if their kwargs comprise a valid sequence expression (https://github.com/ansible/ansible/issues/82921).
- service_facts - skip lines which does not contain service names in openrc
output (https://github.com/ansible/ansible/issues/84512).
- ssh - Improve the logic for parsing CLIXML data in stderr when working with
Windows host. This fixes issues when the raw stderr contains invalid UTF-8
byte sequences and improves embedded CLIXML sequences.
- ssh - Raise exception when sshpass returns error code (https://github.com/ansible/ansible/issues/58133).
- ssh - connection options were incorrectly templated during ``reset_connection``
tasks (https://github.com/ansible/ansible/pull/84238).
- stability - Fixed silent process failure on unhandled IOError/OSError under
``linear`` strategy.
- su become plugin - Ensure generated regex from ``prompt_l10n`` config values
is properly escaped.
- su become plugin - Ensure that password prompts are correctly detected in
the presence of leading output. Previously, this case resulted in a timeout
or hang.
- su become plugin - Ensure that trailing colon is expected on all ``prompt_l10n``
config values.
- sudo become plugin - The `sudo_chdir` config option allows the current directory
to be set to the specified value before executing sudo to avoid permission
errors when dropping privileges.
- sunos - remove hard coding of virtinfo command in facts gathering code (https://github.com/ansible/ansible/pull/84357).
- to_yaml/to_nice_yaml filters - Eliminated possibility of keyword arg collisions
with internally-set defaults.
- unarchive - Clamp timestamps from beyond y2038 to representible values when
unpacking zip files on platforms that use 32-bit time_t (e.g. Debian i386).
- uri - Form location correctly when the server returns a relative redirect
(https://github.com/ansible/ansible/issues/84540)
- uri - Handle HTTP exceptions raised while reading the content (https://github.com/ansible/ansible/issues/83794).
- uri - mark ``url`` as required (https://github.com/ansible/ansible/pull/83642).
- user - Create Buildroot subclass as alias to Busybox (https://github.com/ansible/ansible/issues/83665).
- user - Set timeout for passphrase interaction.
- user - Update prompt for SSH key passphrase (https://github.com/ansible/ansible/issues/84484).
- user - Use higher precedence HOME_MODE as UMASK for path provided (https://github.com/ansible/ansible/pull/84482).
- user action will now require O(force) to overwrite the public part of an ssh
key when generating ssh keys, as was already the case for the private part.
- user module now avoids changing ownership of files symlinked in provided home
dir skeleton
- vars lookup - The ``default`` substitution only applies when trying to look
up a variable which is not defined. If the variable is defined, but templates
to an undefined value, the ``default`` substitution will not apply. Use the
``default`` filter to coerce those values instead.
- wait_for_connection - a warning was displayed if any hosts used a local connection
(https://github.com/ansible/ansible/issues/84419)
deprecated_features:
- CLI - The ``--inventory-file`` option alias is deprecated. Use the ``-i``
or ``--inventory`` option instead.
- Stategy Plugins - Use of strategy plugins not provided in ``ansible.builtin``
are deprecated and do not carry any backwards compatibility guarantees going
forward. A future release will remove the ability to use external strategy
plugins. No alternative for third party strategy plugins is currently planned.
- '``ansible.module_utils.compat.datetime`` - The datetime compatibility shims
are now deprecated. They are scheduled to be removed in ``ansible-core`` v2.21.
This includes ``UTC``, ``utcfromtimestamp()`` and ``utcnow`` importable from
said module (https://github.com/ansible/ansible/pull/81874).'
- bool filter - Support for coercing unrecognized input values (including None)
has been deprecated. Consult the filter documentation for acceptable values,
or consider use of the ``truthy`` and ``falsy`` tests.
- cache plugins - The `ansible.plugins.cache.base` Python module is deprecated.
Use `ansible.plugins.cache` instead.
- callback plugins - The `v2_on_any` callback method is deprecated. Use specific
callback methods instead.
- callback plugins - The v1 callback API (callback methods not prefixed with
`v2_`) is deprecated. Use `v2_` prefixed methods instead.
- conditionals - Conditionals using Jinja templating delimiters (e.g., ``{{``,
``{%``) should be rewritten as expressions without delimiters, unless the
entire conditional value is a single template that resolves to a trusted string
expression. This is useful for dynamic indirection of conditional expressions,
but is limited to trusted literal string expressions.
- config - The ``ACTION_WARNINGS`` config has no effect. It previously disabled
command warnings, which have since been removed.
- config - The ``DEFAULT_JINJA2_NATIVE`` option has no effect. Jinja2 native
mode is now the default and only option.
- config - The ``DEFAULT_NULL_REPRESENTATION`` option has no effect. Null values
are no longer automatically converted to another value during templating of
single variable references.
- display - The ``Display.get_deprecation_message`` method has been deprecated.
Call ``Display.deprecated`` to display a deprecation message, or call it with
``removed=True`` to raise an ``AnsibleError``.
- file loading - Loading text files with ``DataLoader`` containing data that
cannot be decoded under the expected encoding is deprecated. In most cases
the encoding must be UTF-8, although some plugins allow choosing a different
encoding. Previously, invalid data was silently wrapped in Unicode surrogate
escape sequences, often resulting in later errors or other data corruption.
- first_found lookup - Splitting of file paths on ``,;:`` is deprecated. Pass
a list of paths instead. The ``split`` method on strings can be used to split
variables into a list as needed.
- interpreter discovery - The ``auto_legacy`` and ``auto_legacy_silent`` options
for ``INTERPRETER_PYTHON`` are deprecated. Use ``auto`` or ``auto_silent``
options instead, as they have the same effect.
- oneline callback - The ``oneline`` callback and its associated ad-hoc CLI
args (``-o``, ``--one-line``) are deprecated.
- paramiko - The paramiko connection plugin has been deprecated with planned
removal in 2.21.
- playbook variables - The ``play_hosts`` variable has been deprecated, use
``ansible_play_batch`` instead.
- plugin error handling - The ``AnsibleError`` constructor arg ``suppress_extended_error``
is deprecated. Using ``suppress_extended_error=True`` has the same effect
as ``show_content=False``.
- plugins - The ``listify_lookup_plugin_terms`` function is obsolete and in
most cases no longer needed.
- template lookup - The jinja2_native option is no longer used in the Ansible
Core code base. Jinja2 native mode is now the default and only option.
- templating - Support for enabling Jinja2 extensions (not plugins) has been
deprecated.
- templating - The ``ansible_managed`` variable available for certain templating
scenarios, such as the ``template`` action and ``template`` lookup has been
deprecated. Define and use a custom variable instead of relying on ``ansible_managed``.
- templating - The ``disable_lookups`` option has no effect, since plugins must
be updated to apply trust before any templating can be performed.
- to_yaml/to_nice_yaml filters - Implicit YAML dumping of vaulted value ciphertext
is deprecated. Set `dump_vault_tags` to explicitly specify the desired behavior.
- tree callback - The ``tree`` callback and its associated ad-hoc CLI args (``-t``,
``--tree``) are deprecated.
known_issues:
- templating - Any string value starting with ``#jinja2:`` which is templated
will always be interpreted as Jinja2 configuration overrides. To include this
literal value at the start of a string, a space or other character must precede
it.
- variables - Tagged values cannot be used for dictionary keys in many circumstances.
- variables - The values ``None``, ``True`` and ``False`` cannot be tagged because
they are singletons. Attempts to apply tags to these values will be silently
ignored.
major_changes:
- Jinja plugins - Jinja builtin filter and test plugins are now accessible via
their fully-qualified names ``ansible.builtin.{name}``.
- Task Execution / Forks - Forks no longer inherit stdio from the parent ``ansible-playbook``
process. ``stdout``, ``stderr``, and ``stdin`` within a worker are detached
from the terminal, and non-functional. All needs to access stdio from a fork
for controller side plugins requires use of ``Display``.
- ansible-test - Packages beneath ``module_utils`` can now contain ``__init__.py``
files.
- variables - The type system underlying Ansible's variable storage has been
significantly overhauled and formalized. Attempts to store unsupported Python
object types in variables will now result in an error.
- variables - To support new Ansible features, many variable objects are now
represented by subclasses of their respective native Python types. In most
cases, they behave indistinguishably from their original types, but some Python
libraries do not handle builtin object subclasses properly. Custom plugins
that interact with such libraries may require changes to convert and pass
the native types.
minor_changes:
- Added a -vvvvv log message indicating when a host fails to produce output
within the timeout period.
- AnsibleModule.uri - Add option ``multipart_encoding`` for ``form-multipart``
files in body to change default base64 encoding for files
- INVENTORY_IGNORE_EXTS config, removed ``ini`` from the default list, inventory
scripts using a corresponding .ini configuration are rare now and inventory.ini
files are more common. Those that need to ignore the ini files for inventory
scripts can still add it to configuration.
- Jinja plugins - Plugins can declare support for undefined values.
- Jinja2 version 3.1.0 or later is now required on the controller.
- Move ``follow_redirects`` parameter to module_utils so external modules can
reuse it.
- PlayIterator - do not return tasks from already executed roles so specific
strategy plugins do not have to do the filtering of such tasks themselves
- SSH Escalation-related -vvv log messages now include the associated host information.
- Windows - Add support for Windows Server 2025 to Ansible and as an ``ansible-test``
remote target - https://github.com/ansible/ansible/issues/84229
- Windows - refactor the async implementation to better handle errors during
bootstrapping and avoid WMI when possible.
- "``ansible-galaxy collection install`` \u2014 the collection dependency resolver
now prints out conflicts it hits during dependency resolution when it's taking
too long and it ends up backtracking a lot. It also displays suggestions on
how to help it compute the result more quickly."
- 'ansible, ansible-console, ansible-pull - add --flush-cache option (https://github.com/ansible/ansible/issues/83749).
'
- ansible-galaxy - Add support for Keycloak service accounts
- ansible-galaxy - support ``resolvelib >= 0.5.3, < 2.0.0`` (https://github.com/ansible/ansible/issues/84217).
- ansible-test - Added a macOS 15.3 remote VM, replacing 14.3.
- ansible-test - Automatically retry HTTP GET/PUT/DELETE requests on exceptions.
- ansible-test - Default to Python 3.13 in the ``base`` and ``default`` containers.
- ansible-test - Disable the ``deprecated-`` prefixed ``pylint`` rules as their
results vary by Python version.
- ansible-test - Disable the ``pep8`` sanity test rules ``E701`` and ``E704``
to improve compatibility with ``black``.
- ansible-test - Improve container runtime probe error handling. When unexpected
probe output is encountered, an error with more useful debugging information
is provided.
- ansible-test - Replace container Alpine 3.20 with 3.21.
- ansible-test - Replace container Fedora 40 with 41.
- ansible-test - Replace remote Alpine 3.20 with 3.21.
- ansible-test - Replace remote Fedora 40 with 41.
- ansible-test - Replace remote FreeBSD 13.3 with 13.5.
- ansible-test - Replace remote FreeBSD 14.1 with 14.2.
- ansible-test - Replace remote RHEL 9.4 with 9.5.
- ansible-test - Show a more user-friendly error message when a ``runme.sh``
script is not executable.
- ansible-test - The ``yamllint`` sanity test now enforces string values for
the ``!vault`` tag.
- ansible-test - Update ``nios-test-container`` to version 7.0.0.
- ansible-test - Update ``pylint`` sanity test to use version 3.3.1.
- ansible-test - Update distro containers to remove unnecessary pakages (apache2,
subversion, ruby).
- ansible-test - Update sanity test requirements to latest available versions.
- ansible-test - Update the HTTP test container.
- ansible-test - Update the PyPI test container.
- ansible-test - Update the ``base`` and ``default`` containers.
- ansible-test - Update the utility container.
- ansible-test - Use Python's ``urllib`` instead of ``curl`` for HTTP requests.
- ansible-test - When detection of the current container network fails, a warning
is now issued and execution continues. This simplifies usage in cases where
the current container cannot be inspected, such as when running in GitHub
Codespaces.
- ansible-test acme test container - bump `version to 2.3.0 <https://github.com/ansible/acme-test-container/releases/tag/2.3.0>`__
to include newer versions of Pebble, dependencies, and runtimes. This adds
support for ACME profiles, ``dns-account-01`` support, and some smaller improvements
(https://github.com/ansible/ansible/pull/84547).
- apt_key module - add notes to docs and errors to point at the CLI tool deprecation
by Debian and alternatives
- apt_repository module - add notes to errors to point at the CLI tool deprecation
by Debian and alternatives
- become plugins get new property 'pipelining' to show support or lack there
of for the feature.
- callback plugins - add has_option() to CallbackBase to match other functions
overloaded from AnsiblePlugin
- callback plugins - fix get_options() for CallbackBase
- copy - fix sanity test failures (https://github.com/ansible/ansible/pull/83643).
- copy - parameter ``local_follow`` was incorrectly documented as having default
value ``True`` (https://github.com/ansible/ansible/pull/83643).
- cron - Provide additional error information while writing cron file (https://github.com/ansible/ansible/issues/83223).
- csvfile - let the config system do the typecasting (https://github.com/ansible/ansible/pull/82263).
- display - Deduplication of warning and error messages considers the full content
of the message (including source and traceback contexts, if enabled). This
may result in fewer messages being omitted.
- display - The ``collection_name`` arg to ``Display.deprecated`` no longer
has any effect. Information about the calling plugin is automatically captured
by the display infrastructure, included in the displayed messages, and made
available to callbacks.
- distribution - Added openSUSE MicroOS to Suse OS family (#84685).
- dnf5, apt - add ``auto_install_module_deps`` option (https://github.com/ansible/ansible/issues/84206)
- docs - add collection name in message from which the module is being deprecated
(https://github.com/ansible/ansible/issues/84116).
- env lookup - The error message generated for a missing environment variable
when ``default`` is an undefined value (e.g. ``undef('something')``) will
contain the hint from that undefined value, except when the undefined value
is the default of ``undef()`` with no arguments. Previously, any existing
undefined hint would be ignored.
- file - enable file module to disable diff_mode (https://github.com/ansible/ansible/issues/80817).
- file - make code more readable and simple.
- filter - add support for URL-safe encoding and decoding in b64encode and b64decode
(https://github.com/ansible/ansible/issues/84147).
- find - add a checksum_algorithm parameter to specify which type of checksum
the module will return
- from_json filter - The filter accepts a ``profile`` argument, which defaults
to ``tagless``.
- handlers - Templated handler names with syntax errors, or that resolve to
``omit`` are now skipped like handlers with undefined variables in their name.
- improved error message for yaml parsing errors in plugin documentation
- local connection plugin - A new ``become_strip_preamble`` config option (default
True) was added; disable to preserve diagnostic ``become`` output in task
results.
- local connection plugin - A new ``become_success_timeout`` operation-wide
timeout config (default 10s) was added for ``become``.
- local connection plugin - When a ``become`` plugin's ``prompt`` value is a
non-string after the ``check_password_prompt`` callback has completed, no
prompt stripping will occur on stderr.
- lookup_template - add an option to trim blocks while templating (https://github.com/ansible/ansible/issues/75962).
- module - set ipv4 and ipv6 rules simultaneously in iptables module (https://github.com/ansible/ansible/issues/84404).
- module_utils - Add ``NoReturn`` type annotations to functions which never
return.
- modules - PowerShell modules can now receive ``datetime.date``, ``datetime.time``
and ``datetime.datetime`` values as ISO 8601 strings.
- modules - PowerShell modules can now receive strings sourced from inline vault-encrypted
strings.
- modules - The ``collection_name`` arg to Python module-side ``deprecate``
methods no longer has any effect. Information about the calling module is
automatically captured by the warning infrastructure and included in the module
result.
- modules - Unhandled exceptions during Python module execution are now returned
as structured data from the target. This allows the new traceback handling
to be applied to exceptions raised on targets.
- pipelining logic has mostly moved to connection plugins so they can decide/override
settings.
- plugin error handling - When raising exceptions in an exception handler, be
sure to use ``raise ... from`` as appropriate. This supersedes the use of
the ``AnsibleError`` arg ``orig_exc`` to represent the cause. Specifying ``orig_exc``
as the cause is still permitted. Failure to use ``raise ... from`` when ``orig_exc``
is set will result in a warning. Additionally, if the two cause exceptions
do not match, a warning will be issued.
- removed harcoding of su plugin as it now works with pipelining.
- runtime-metadata sanity test - improve validation of ``action_groups`` (https://github.com/ansible/ansible/pull/83965).
- service_facts module got freebsd support added.
- ssh connection plugin - Support ``SSH_ASKPASS`` mechanism to provide passwords,
making it the default, but still offering an explicit choice to use ``sshpass``
(https://github.com/ansible/ansible/pull/83936)
- ssh connection plugin now overrides pipelining when a tty is requested.
- ssh-agent - ``ansible``, ``ansible-playbook`` and ``ansible-console`` are
capable of spawning or reusing an ssh-agent, allowing plugins to interact
with the ssh-agent. Additionally a pure python ssh-agent client has been added,
enabling easy interaction with the agent. The ssh connection plugin contains
new functionality via ``ansible_ssh_private_key`` and ``ansible_ssh_private_key_passphrase``,
for loading an SSH private key into the agent from a variable.
- templating - Access to an undefined variable from inside a lookup, filter,
or test (which raises MarkerError) no longer ends processing of the current
template. The triggering undefined value is returned as the result of the
offending plugin invocation, and the template continues to execute.
- templating - Embedding ``range()`` values in containers such as lists will
result in an error on use. Previously the value would be converted to a string
representing the range parameters, such as ``range(0, 3)``.
- templating - Handling of omitted values is now a first-class feature of the
template engine, and is usable in all Ansible Jinja template contexts. Any
template that resolves to ``omit`` is automatically removed from its parent
container during templating.
- templating - Template evaluation is lazier than in previous versions. Template
expressions which resolve only portions of a data structure no longer result
in the entire structure being templated.
- templating - Templating errors now provide more information about both the
location and context of the error, especially for deeply-nested and/or indirected
templating scenarios.
- templating - Unified ``omit`` behavior now requires that plugins calling ``Templar.template()``
handle cases where the entire template result is omitted, by catching the
``AnsibleValueOmittedError`` that is raised. Previously, this condition caused
a randomly-generated string marker to appear in the template result.
- templating - Variables of type ``set`` and ``tuple`` are now converted to
``list`` when exiting the final pass of templating.
- to_json / to_nice_json filters - The filters accept a ``profile`` argument,
which defaults to ``tagless``.
- troubleshooting - Tracebacks can be collected and displayed for most errors,
warnings, and deprecation warnings (including those generated by modules).
Tracebacks are no longer enabled with ``-vvv``; the behavior is directly configurable
via the ``DISPLAY_TRACEBACK`` config option. Module tracebacks passed to ``fail_json``
via the ``exception`` kwarg will not be included in the task result unless
error tracebacks are configured.
- undef jinja function - The ``undef`` jinja function now raises an error if
a non-string hint is given. Attempting to use an undefined hint also results
in an error, ensuring incorrect use of the function can be distinguished from
the function's normal behavior.
- validate-modules sanity test - make sure that ``module`` and ``plugin`` ``seealso``
entries use FQCNs (https://github.com/ansible/ansible/pull/84325).
- vault - improved vault filter documentation by adding missing example content
for dump_template_data.j2, refining examples for clarity, and ensuring variable
consistency (https://github.com/ansible/ansible/issues/83583).
- warnings - All warnings (including deprecation warnings) issued during a task's
execution are now accessible via the ``warnings`` and ``deprecations`` keys
on the task result.
- when the ``dict`` lookup is given a non-dict argument, show the value of the
argument and its type in the error message.
- windows - add hard minimum limit for PowerShell to 5.1. Ansible dropped support
for older versions of PowerShell in the 2.16 release but this reqirement is
now enforced at runtime.
- windows - refactor windows exec runner to improve efficiency and add better
error reporting on failures.
- winrm - Remove need for pexpect on macOS hosts when using ``kinit`` to retrieve
the Kerberos TGT. By default the code will now only use the builtin ``subprocess``
library which should handle issues with select and a high fd count and also
simplify the code.
release_summary: '| Release Date: 2025-04-14
| `Porting Guide <https://docs.ansible.com/ansible-core/2.19/porting_guides/porting_guide_core_2.19.html>`__
'
removed_features:
- Remove deprecated plural form of collection path (https://github.com/ansible/ansible/pull/84156).
- Removed deprecated STRING_CONVERSION_ACTION (https://github.com/ansible/ansible/issues/84220).
- encrypt - passing unsupported passlib hashtype now raises AnsibleFilterError.
- manager - remove deprecated include_delegate_to parameter from get_vars API.
- modules - Modules returning non-UTF8 strings now result in an error. The ``MODULE_STRICT_UTF8_RESPONSE``
setting can be used to disable this check.
- removed deprecated pycompat24 and compat.importlib.
- selector - remove deprecated compat.selector related files (https://github.com/ansible/ansible/pull/84155).
- windows - removed common module functions ``ConvertFrom-AnsibleJson``, ``Format-AnsibleException``
from Windows modules as they are not used and add uneeded complexity to the
code.
security_fixes:
- include_vars action - Ensure that result masking is correctly requested when
vault-encrypted files are read. (CVE-2024-8775)
- task result processing - Ensure that action-sourced result masking (``_ansible_no_log=True``)
is preserved. (CVE-2024-8775)
- templating - Ansible's template engine no longer processes Jinja templates
in strings unless they are marked as coming from a trusted source. Untrusted
strings containing Jinja template markers are ignored with a warning. Examples
of trusted sources include playbooks, vars files, and many inventory sources.
Examples of untrusted sources include module results and facts. Plugins which
have not been updated to preserve trust while manipulating strings may inadvertently
cause them to lose their trusted status.
- templating - Changes to conditional expression handling removed numerous instances
of insecure multi-pass templating (which could result in execution of untrusted
template expressions).
- user action won't allow ssh-keygen, chown and chmod to run on existing ssh
public key file, avoiding traversal on existing symlinks (CVE-2024-9902).
codename: What Is and What Should Never Be
fragments:
- 2.19.0b1_summary.yaml
- 81709-ansible-galaxy-slow-resolution-hints.yml
- 81812-ansible-galaxy-negative-spec-is-pinned.yml
- 81874-deprecate-datetime-compat.yml
- 83642-fix-sanity-ignore-for-uri.yml
- 83643-fix-sanity-ignore-for-copy.yml
- 83690-get_url-content-disposition-filename.yml
- 83700-enable-file-disable-diff.yml
- 83757-deprecate-paramiko.yml
- 83936-ssh-askpass.yml
- 83965-action-groups-schema.yml
- 84008-additional-logging.yml
- 84019-ignore_unreachable-loop.yml
- 84149-add-flush-cache-for-adhoc-commands.yml
- 84206-dnf5-apt-auto-install-module-deps.yml
- 84213-ansible-galaxy-url-building.yml
- 84229-windows-server-2025.yml
- 84238-fix-reset_connection-ssh_executable-templated.yml
- 84259-dnf5-latest-fix.yml
- 84321-added-ansible_uptime_seconds_aix.yml
- 84325-validate-modules-seealso-fqcn.yml
- 84334-dnf5-consolidate-settings.yml
- 84384-fix-undefined-key-host-group-vars.yml
- 84419-fix-wait_for_connection-warning.yml
- 84468-timeout_become_unreachable.yml
- 84473-dict-lookup-type-error-message.yml
- 84490-allow-iptables-chain-creation-with-wait.yml
- 84496-CallbackBase-get_options.yml
- 84540-uri-relative-redirect.yml
- 84547-acme-test-container.yml
- 84578-dnf5-is_installed-provides.yml
- 84660-fix-meta-end_role-linear-strategy.yml
- 84685-add-opensuse-microos.yml
- 84705-error-message-malformed-plugin-documentation.yml
- 84725-deprecate-strategy-plugins.yml
- Ansible.Basic-required_if-null.yml
- ansible-galaxy-keycloak-service-accounts.yml
- ansible-test-added-macos-15.3.yml
- ansible-test-containers.yml
- ansible-test-coverage-test-files.yml
- ansible-test-curl.yml
- ansible-test-fix-command-traceback.yml
- ansible-test-freebsd-nss.yml
- ansible-test-network-detection.yml
- ansible-test-nios-container.yml
- ansible-test-no-exec-script.yml
- ansible-test-probe-error-handling.yml
- ansible-test-pylint-fix.yml
- ansible-test-remotes.yml
- ansible-test-update.yml
- apt_key_bye.yml
- become-runas-system-deux.yml
- buildroot.yml
- compat_removal.yml
- config.yml
- config_dump.yml
- copy_validate_input.yml
- cron_err.yml
- csvfile-col.yml
- cve-2024-8775.yml
- darwin_pagesize.yml
- debconf_empty_password.yml
- deprecated.yml
- distro_LMDE_6.yml
- dnf5-exception-forwarding.yml
- dnf5-plugins-compat.yml
- dnf5-remove-usage-deprecated-option.yml
- feature-uri-add-option-multipart-encoding.yml
- file_simplify.yml
- find-checksum.yml
- find_enoent.yml
- fix-ansible-galaxy-ignore-certs.yml
- fix-cli-doc-path_undefined.yaml
- fix-display-bug-in-action-plugin.yml
- fix-include_vars-merge-hash.yml
- fix-ipv6-pattern.yml
- fix-is-filter-is-test.yml
- fix-lookup-sequence-keyword-args-only.yml
- fix-module-utils-facts-timeout.yml
- fix_errors.yml
- follow_redirects_url.yml
- gather_facts_netos_fixes.yml
- gather_facts_smart_fix.yml
- get_url_bsd_style_digest.yml
- hide-loop-vars-debug-vars.yml
- implicit_flush_handlers_parents.yml
- include_delegate_to.yml
- interpreter-discovery-auto-legacy.yml
- jinja-version.yml
- libvirt_lxc.yml
- local-become-fixes.yml
- lookup_config.yml
- macos-correct-lock.yml
- no-inherit-stdio.yml
- no-return.yml
- openrc-status.yml
- os_family.yml
- package-dnf-action-plugins-facts-fail-msg.yml
- package_facts_fix.yml
- passlib.yml
- pin-wheel.yml
- pipelining_refactor.yml
- playiterator-add_tasks-optimize.yml
- ps-import-sanity.yml
- pull_changed_fix.yml
- remove_ini_ignored_dir.yml
- reserved_module_chekc.yml
- respawn-min-python.yml
- respawn_os_env.yml
- selector_removal.yml
- service_facts_fbsd.yml
- set_ipv4_and_ipv6_simultaneously.yml
- simplify-copy-module.yml
- skip-handlers-tagged-play.yml
- skip-implicit-flush_handlers-no-notify.yml
- skip-role-task-iterator.yml
- ssh-agent.yml
- ssh-clixml.yml
- ssh_raise_exception.yml
- string_conversion.yml
- sunos_virtinfo.yml
- templates_types_datatagging.yml
- toml-library-support-dropped.yml
- trim_blocks.yml
- unarchive_timestamp_t32.yaml
- update-resolvelib-lt-2_0_0.yml
- uri_httpexception.yml
- url_safe_b64_encode_decode.yml
- user_action_fix.yml
- user_module.yml
- user_passphrase.yml
- user_ssh_fix.yml
- v2.19.0-initial-commit.yaml
- vault_cli_fix.yml
- vault_docs_fix.yaml
- win-async-refactor.yml
- win-wdac-audit.yml
- windows-exec.yml
- winrm-kinit-pexpect.yml
release_date: '2025-04-14'
2.19.0b2:
changes:
bugfixes:
- Remove use of `required` parameter in `get_bin_path` which has been deprecated.
- ansible-doc - fix indentation for first line of descriptions of suboptions
and sub-return values (https://github.com/ansible/ansible/pull/84690).
- ansible-doc - fix line wrapping for first line of description of options and
return values (https://github.com/ansible/ansible/pull/84690).
minor_changes:
- comment filter - Improve the error message shown when an invalid ``style``
argument is provided.
release_summary: '| Release Date: 2025-04-24
| `Porting Guide <https://docs.ansible.com/ansible-core/2.19/porting_guides/porting_guide_core_2.19.html>`__
'
codename: What Is and What Should Never Be
fragments:
- 2.19.0b2_summary.yaml
- 84690-ansible-doc-indent-wrapping.yml
- comment_fail.yml
- get_bin_path-remove-use-of-deprecated-param.yml
release_date: '2025-04-23'

View File

@ -1,11 +1,12 @@
---
title: Ansible Base
title: ansible-core
release_tag_re: '(v(?:[\d.ab\-]|rc)+)'
pre_release_tag_re: '(?P<pre_release>(?:[ab]|rc)+\d*)$'
changes_file: changelog.yaml
changes_format: combined
keep_fragments: true
always_refresh: true
ignore_other_fragment_extensions: true
mention_ancestor: false
notesdir: fragments
prelude_section_name: release_summary

View File

@ -0,0 +1,3 @@
release_summary: |
| Release Date: 2025-04-14
| `Porting Guide <https://docs.ansible.com/ansible-core/2.19/porting_guides/porting_guide_core_2.19.html>`__

View File

@ -0,0 +1,3 @@
release_summary: |
| Release Date: 2025-04-24
| `Porting Guide <https://docs.ansible.com/ansible-core/2.19/porting_guides/porting_guide_core_2.19.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

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

@ -1,5 +0,0 @@
bugfixes:
- "ansible-test - during module validation, improve alias handling."
- "ansible-test - during module validation, handle add_file_common_args only for top-level arguments."
minor_changes:
- "ansible-test - extend alias validation."

View File

@ -1,2 +0,0 @@
bugfixes:
- Use hostnamectl command to get current hostname for host while using systemd strategy (https://github.com/ansible/ansible/issues/59438).

View File

@ -1,2 +0,0 @@
bugfixes:
- CLI - the `ANSIBLE_PLAYBOOK_DIR` envvar or `playbook_dir` config can now substitute for the --playbook-dir arg on CLIs that support it (https://github.com/ansible/ansible/issues/59464)

View File

@ -1,2 +0,0 @@
bugfixes:
- cron and cronvar - use get_bin_path utility to locate the default crontab executable instead of the hardcoded /usr/bin/crontab. (https://github.com/ansible/ansible/pull/59765)

View File

@ -1,5 +0,0 @@
bugfixes:
- >
group - The group module was not correctly detecting whether a local
group is existing or not with local set to yes if the same group
exists in a non local group repository e.g. LDAP. (https://github.com/ansible/ansible/issues/58619)

View File

@ -1,4 +0,0 @@
bugfixes:
- template lookup - ensure changes to the templar in the lookup, do not
affect the templar context outside of the lookup
(https://github.com/ansible/ansible/issues/60106)

View File

@ -1,2 +0,0 @@
minor_changes:
- apt - Implemented an exponential backoff behaviour when retrying to update the cache with new params ``update_cache_retry_max_delay`` and ``update_cache_retries`` to control the behavior.

View File

@ -1,2 +0,0 @@
bugfixes:
- Handle exception encountered while parsing the argument description in module when invoked via ansible-doc command (https://github.com/ansible/ansible/issues/60587).

View File

@ -1,2 +0,0 @@
minor_changes:
- Add an additional check for importing journal from systemd-python module (https://github.com/ansible/ansible/issues/60595).

View File

@ -1,6 +0,0 @@
---
minor_changes:
- vars plugins - Support vars plugins in collections by adding the ability to whitelist plugins.
- host_group_vars plugin - Require whitelisting and whitelist by default.
- Add a global toggle to control when vars plugins are executed (per task by default for backward compatibility or after importing inventory).
- Add a per-plugin stage option to override the global toggle to control the execution of individual vars plugins (per task, after inventory, or both).

View File

@ -1,4 +0,0 @@
bugfixes:
- ansible-inventory - Properly hide arguments that should not be shown
(https://github.com/ansible/ansible/issues/61604)
- ansible-inventory - Restore functionality to allow ``--graph`` to be limited by a host pattern

View File

@ -1,2 +0,0 @@
bugfixes:
- ansible-galaxy - Fix url building to not truncate the URL (https://github.com/ansible/ansible/issues/61624)

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